Amamrnaf commited on
Commit
1324e6f
·
1 Parent(s): 3d60950
Files changed (2) hide show
  1. app.py +2 -2
  2. dataSchema.py +9 -1
app.py CHANGED
@@ -22,8 +22,8 @@ def Noc_timeSheet_pdf_to_img(pdf_path, output_path, dpi: int = 300, quality: int
22
  start_y_total_table = int(height * 0.42)
23
  end_y_first_table = int(height * 0.30)
24
 
25
- croped1 = image.crop((0, 0, width // 2, end_y_first_table))
26
- croped2 = image.crop((0, start_y_total_table, width // 2, height))
27
  upper_width, upper_height = croped1.size
28
  lower_width, lower_height = croped2.size
29
  combined_image = Image.new('RGB', (upper_width, upper_height + lower_height))
 
22
  start_y_total_table = int(height * 0.42)
23
  end_y_first_table = int(height * 0.30)
24
 
25
+ croped1 = image.crop((0, 0, 0, end_y_first_table))
26
+ croped2 = image.crop((0, start_y_total_table, 0, height))
27
  upper_width, upper_height = croped1.size
28
  lower_width, lower_height = croped2.size
29
  combined_image = Image.new('RGB', (upper_width, upper_height + lower_height))
dataSchema.py CHANGED
@@ -22,6 +22,10 @@ class Noc_Residential_TimeSheetInformation(BaseModel):
22
  per_diem_days: int = Field(0, description="Number of Per Diem days for onshore/offshore rotational personnel.")
23
  training_days: int = Field(0, description="Number of training days.")
24
  travel_days: int = Field(0, description="Number of travel days.")
 
 
 
 
25
 
26
  class Noc_Rotational_TimeSheetInformation(BaseModel):
27
  """Details of a timesheet entry."""
@@ -43,7 +47,11 @@ class Noc_Rotational_TimeSheetInformation(BaseModel):
43
  overtime_Hourly_Rate_OFFSHORE:int = Field(0,description="number of over time hours offshore (Over 12 hours) ")
44
  per_diem_days: int = Field(0, description="Number of Per Diem days for onshore/offshore rotational personnel.")
45
  training_days: int = Field(0, description="Number of training days.")
46
- travel_days: int = Field(0, description="Number of travel days.")
 
 
 
 
47
 
48
  class Noc_Item_Information(BaseModel):
49
  """Details of each item in the document."""
 
22
  per_diem_days: int = Field(0, description="Number of Per Diem days for onshore/offshore rotational personnel.")
23
  training_days: int = Field(0, description="Number of training days.")
24
  travel_days: int = Field(0, description="Number of travel days.")
25
+
26
+ approval_status: str = Field("not approved",description="Noc respresentative's signature being filled")
27
+ approved_on : str = Field(...,description="DD/MM/YY of the stamp")
28
+ approved_by : str = Field(...,description="Name of the person who approved the document")
29
 
30
  class Noc_Rotational_TimeSheetInformation(BaseModel):
31
  """Details of a timesheet entry."""
 
47
  overtime_Hourly_Rate_OFFSHORE:int = Field(0,description="number of over time hours offshore (Over 12 hours) ")
48
  per_diem_days: int = Field(0, description="Number of Per Diem days for onshore/offshore rotational personnel.")
49
  training_days: int = Field(0, description="Number of training days.")
50
+ travel_days: int = Field(0, description="Number of travel days.")
51
+
52
+ approval_status: str = Field("not approved",description="Noc respresentative's signature being filled")
53
+ approved_on : str = Field(...,description="DD/MM/YY of the stamp")
54
+ approved_by : str = Field(...,description="Name of the person who approved the document")
55
 
56
  class Noc_Item_Information(BaseModel):
57
  """Details of each item in the document."""