Commit 22f237d7 by Cam Hayes

Adding and Editting Cutting Die Orders is now functional.

Also fixed bug where Order Date wasnt being properly set in database with web plateeeeee.
parent fccbb29f
...@@ -188,19 +188,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -188,19 +188,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
DataField = 'staff_fields_job_name' DataField = 'staff_fields_job_name'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
object edtQuickBooksItem: TWebDBEdit
Left = 26
Top = 514
Width = 121
Height = 23
AutoSize = True
ChildOrder = 79
ElementID = 'edtquickbooksitem'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_quickbooks_item'
DataSource = WebDataSource1
end
object edtSpecialInstructions: TWebDBEdit object edtSpecialInstructions: TWebDBEdit
Left = 835 Left = 835
Top = 185 Top = 185
...@@ -247,7 +234,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -247,7 +234,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ChildOrder = 5 ChildOrder = 5
ElementPosition = epRelative ElementPosition = epRelative
Role = 'alert' Role = 'alert'
TabOrder = 16 TabOrder = 15
object lblMessage: TWebLabel object lblMessage: TWebLabel
Left = 28 Left = 28
Top = 9 Top = 9
...@@ -287,6 +274,20 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -287,6 +274,20 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
DataField = 'NAME' DataField = 'NAME'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
object wcbQBItem: TWebDBComboBox
Left = 26
Top = 515
Width = 145
Height = 23
ElementID = 'wcbqbitem'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
DataField = 'staff_fields_quickbooks_item'
DataSource = WebDataSource1
ListField = 'name'
ListSource = wdsQBItem
end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1 DataSet = XDataWebDataSet1
Left = 22 Left = 22
...@@ -344,12 +345,18 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -344,12 +345,18 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
object XDataWebDataSet1staff_fields_ship_date: TStringField object XDataWebDataSet1staff_fields_ship_date: TStringField
FieldName = 'staff_fields_ship_date' FieldName = 'staff_fields_ship_date'
end end
object XDataWebDataSet1ORDER_ID: TStringField
FieldName = 'ORDER_ID'
end
object XDataWebDataSet1NAME: TStringField object XDataWebDataSet1NAME: TStringField
FieldName = 'NAME' FieldName = 'NAME'
end end
object XDataWebDataSet1staff_fields_quickbooks_item: TStringField
FieldName = 'staff_fields_quickbooks_item'
end
object XDataWebDataSet1general_special_instructions: TStringField
FieldName = 'general_special_instructions'
end
object XDataWebDataSet1staff_fields_quantity: TStringField
FieldName = 'staff_fields_quantity'
end
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
...@@ -368,10 +375,22 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -368,10 +375,22 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Top = 436 Top = 436
end end
object xdwdsShipTo: TXDataWebDataSet object xdwdsShipTo: TXDataWebDataSet
Left = 192 Left = 270
Top = 486 Top = 436
object xdwdsShipToADDRESS: TStringField object xdwdsShipToADDRESS: TStringField
FieldName = 'ADDRESS' FieldName = 'ADDRESS'
end end
end end
object wdsQBItem: TWebDataSource
DataSet = xdwdsQBItem
Left = 230
Top = 554
end
object xdwdsQBItem: TXDataWebDataSet
Left = 190
Top = 548
object xdwdsQBItemname: TStringField
FieldName = 'name'
end
end
end end
...@@ -67,8 +67,8 @@ ...@@ -67,8 +67,8 @@
<input id="edtjobname" class="form-control input-sm" width='50%'/> <input id="edtjobname" class="form-control input-sm" width='50%'/>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<label for="wdbe_first_name" style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QuickBooks Item:</label> <label style="font-weight: 700; font-size: 15px;" class="form-label mt-2">QuickBooks Item:</label>
<input id="edtquickbooksitem" class="form-control input-sm" width='50%'/> <select id="wcbqbitem" class='form-select'></select>
</div> </div>
</div> </div>
<h4 class="custom-h4 mt-3">General</h4> <h4 class="custom-h4 mt-3">General</h4>
......
...@@ -45,7 +45,6 @@ type ...@@ -45,7 +45,6 @@ type
wdbcbShipTo: TWebDBComboBox; wdbcbShipTo: TWebDBComboBox;
edtPONumber: TWebDBEdit; edtPONumber: TWebDBEdit;
edtJobName: TWebDBEdit; edtJobName: TWebDBEdit;
edtQuickBooksItem: TWebDBEdit;
wdsShipTo: TWebDataSource; wdsShipTo: TWebDataSource;
xdwdsShipTo: TXDataWebDataSet; xdwdsShipTo: TXDataWebDataSet;
xdwdsShipToADDRESS: TStringField; xdwdsShipToADDRESS: TStringField;
...@@ -57,8 +56,14 @@ type ...@@ -57,8 +56,14 @@ type
lblMessage: TWebLabel; lblMessage: TWebLabel;
btnCloseNotification: TWebButton; btnCloseNotification: TWebButton;
edtCompanyName: TWebDBEdit; edtCompanyName: TWebDBEdit;
XDataWebDataSet1ORDER_ID: TStringField;
XDataWebDataSet1NAME: TStringField; XDataWebDataSet1NAME: TStringField;
XDataWebDataSet1staff_fields_quickbooks_item: TStringField;
XDataWebDataSet1general_special_instructions: TStringField;
XDataWebDataSet1staff_fields_quantity: TStringField;
wdsQBItem: TWebDataSource;
xdwdsQBItem: TXDataWebDataSet;
xdwdsQBItemname: TStringField;
wcbQBItem: TWebDBComboBox;
procedure btnConfirmClick(Sender: TObject); procedure btnConfirmClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
...@@ -137,6 +142,8 @@ begin ...@@ -137,6 +142,8 @@ begin
orderJSON.AddPair('mode', mode); orderJSON.AddPair('mode', mode);
if mode = 'EDIT' then if mode = 'EDIT' then
orderJSON.AddPair('ORDER_ID', orderID); orderJSON.AddPair('ORDER_ID', orderID);
console.log(orderJSON.GetValue('ORDER_ID'));
console.log(orderJSON);
AddCuttingDieOrder(orderJSON); AddCuttingDieOrder(orderJSON);
FViewMain.ViewOrders('Success'); FViewMain.ViewOrders('Success');
end; end;
...@@ -191,9 +198,9 @@ var ...@@ -191,9 +198,9 @@ var
orderList : TJSObject; orderList : TJSObject;
i: integer; i: integer;
data: TJSArray; data: TJSArray;
order: TJSObject; order, items: TJSObject;
begin begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetOrder', xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCuttingDieOrder',
[Order_ID])); [Order_ID]));
order := TJSObject(xdcResponse.Result); order := TJSObject(xdcResponse.Result);
data := TJSArray(order['data']); data := TJSArray(order['data']);
...@@ -222,6 +229,19 @@ begin ...@@ -222,6 +229,19 @@ begin
CustomerID := XDataWebDataSet1COMPANY_ID.AsString; CustomerID := XDataWebDataSet1COMPANY_ID.AsString;
console.log(CustomerID); console.log(CustomerID);
if mode = 'EDIT' then
begin
CustomerID := XDataWebDataSet1COMPANY_ID.AsString;
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(order['ADDRESS_LIST']);
xdwdsShipTo.Open;
end;
xdwdsQBItem.Close;
items := TJSObject(order['ITEMS']);
xdwdsQBItem.SetJsonData(items['data']);
xdwdsQBITEM.Open;
end; end;
procedure TFOrderEntryCuttingDie.getCustomer(customerID: string); procedure TFOrderEntryCuttingDie.getCustomer(customerID: string);
......
...@@ -93,8 +93,8 @@ object FSetStatus: TFSetStatus ...@@ -93,8 +93,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel6: TWebLabel object WebLabel6: TWebLabel
Left = 326 Left = 324
Top = 140 Top = 200
Width = 62 Width = 62
Height = 14 Height = 14
Caption = 'Mount Due:' Caption = 'Mount Due:'
...@@ -108,8 +108,8 @@ object FSetStatus: TFSetStatus ...@@ -108,8 +108,8 @@ object FSetStatus: TFSetStatus
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object WebLabel7: TWebLabel object WebLabel7: TWebLabel
Left = 484 Left = 482
Top = 140 Top = 200
Width = 78 Width = 78
Height = 14 Height = 14
Caption = 'New Due Date:' Caption = 'New Due Date:'
...@@ -154,7 +154,7 @@ object FSetStatus: TFSetStatus ...@@ -154,7 +154,7 @@ object FSetStatus: TFSetStatus
end end
object WebLabel10: TWebLabel object WebLabel10: TWebLabel
Left = 324 Left = 324
Top = 200 Top = 142
Width = 44 Width = 44
Height = 14 Height = 14
Caption = 'Art Due:' Caption = 'Art Due:'
...@@ -169,7 +169,7 @@ object FSetStatus: TFSetStatus ...@@ -169,7 +169,7 @@ object FSetStatus: TFSetStatus
end end
object WebLabel11: TWebLabel object WebLabel11: TWebLabel
Left = 482 Left = 482
Top = 200 Top = 142
Width = 78 Width = 78
Height = 14 Height = 14
Caption = 'New Due Date:' Caption = 'New Due Date:'
...@@ -226,8 +226,8 @@ object FSetStatus: TFSetStatus ...@@ -226,8 +226,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object btnConfirm: TWebButton object btnConfirm: TWebButton
Left = 11 Left = 25
Top = 271 Top = 323
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Confirm' Caption = 'Confirm'
...@@ -242,8 +242,8 @@ object FSetStatus: TFSetStatus ...@@ -242,8 +242,8 @@ object FSetStatus: TFSetStatus
OnClick = btnConfirmClick OnClick = btnConfirmClick
end end
object btnCancel: TWebButton object btnCancel: TWebButton
Left = 133 Left = 147
Top = 271 Top = 323
Width = 96 Width = 96
Height = 25 Height = 25
Caption = 'Cancel' Caption = 'Cancel'
...@@ -349,8 +349,8 @@ object FSetStatus: TFSetStatus ...@@ -349,8 +349,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpMountDue: TWebDateTimePicker object dtpMountDue: TWebDateTimePicker
Left = 326 Left = 324
Top = 160 Top = 220
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -362,8 +362,8 @@ object FSetStatus: TFSetStatus ...@@ -362,8 +362,8 @@ object FSetStatus: TFSetStatus
Text = '' Text = ''
end end
object dtpNewMountDue: TWebDateTimePicker object dtpNewMountDue: TWebDateTimePicker
Left = 484 Left = 482
Top = 160 Top = 220
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -400,7 +400,7 @@ object FSetStatus: TFSetStatus ...@@ -400,7 +400,7 @@ object FSetStatus: TFSetStatus
end end
object dtpArtDue: TWebDateTimePicker object dtpArtDue: TWebDateTimePicker
Left = 324 Left = 324
Top = 220 Top = 162
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -413,7 +413,7 @@ object FSetStatus: TFSetStatus ...@@ -413,7 +413,7 @@ object FSetStatus: TFSetStatus
end end
object dtpNewArtDue: TWebDateTimePicker object dtpNewArtDue: TWebDateTimePicker
Left = 482 Left = 482
Top = 220 Top = 162
Width = 145 Width = 145
Height = 22 Height = 22
BorderStyle = bsSingle BorderStyle = bsSingle
......
...@@ -43,6 +43,8 @@ object FData: TFData ...@@ -43,6 +43,8 @@ object FData: TFData
Lines.Strings = ( Lines.Strings = (
'Memo1') 'Memo1')
TabOrder = 1 TabOrder = 1
ExplicitLeft = -2
ExplicitTop = 435
end end
object DBAdvGrid1: TDBAdvGrid object DBAdvGrid1: TDBAdvGrid
Left = 6 Left = 6
...@@ -1504,6 +1506,15 @@ object FData: TFData ...@@ -1504,6 +1506,15 @@ object FData: TFData
TabOrder = 11 TabOrder = 11
OnClick = btnPDFClick OnClick = btnPDFClick
end end
object Button1: TButton
Left = 872
Top = 168
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 12
OnClick = Button1Click
end
object dsUsers: TDataSource object dsUsers: TDataSource
DataSet = uqUsers DataSet = uqUsers
Left = 482 Left = 482
...@@ -1527,4 +1538,345 @@ object FData: TFData ...@@ -1527,4 +1538,345 @@ object FData: TFData
Left = 348 Left = 348
Top = 369 Top = 369
end end
object uqWeb: TUniQuery
Connection = ucKG
SQL.Strings = (
'select * from web_plate_orders')
Left = 745
Top = 464
object uqWebORDER_ID: TIntegerField
FieldName = 'ORDER_ID'
Required = True
end
object uqWebCOMPANY_ID: TIntegerField
FieldName = 'COMPANY_ID'
Required = True
end
object uqWebUSER_ID: TIntegerField
FieldName = 'USER_ID'
Required = True
end
object uqWebORDER_DATE: TDateTimeField
FieldName = 'ORDER_DATE'
end
object uqWebSTART_DATE: TDateField
FieldName = 'START_DATE'
end
object uqWebEND_DATE: TDateField
FieldName = 'END_DATE'
end
object uqWebORDER_STATUS: TStringField
FieldName = 'ORDER_STATUS'
Size = 10
end
object uqWebSCHED_JSON: TStringField
FieldName = 'SCHED_JSON'
Size = 4096
end
object uqWebstaff_fields_order_date: TDateField
FieldName = 'staff_fields_order_date'
end
object uqWebstaff_fields_proof_date: TDateField
FieldName = 'staff_fields_proof_date'
end
object uqWebstaff_fields_ship_date: TDateField
FieldName = 'staff_fields_ship_date'
end
object uqWebstaff_fields_ship_via: TStringField
FieldName = 'staff_fields_ship_via'
Size = 45
end
object uqWebstaff_fields_price: TStringField
FieldName = 'staff_fields_price'
Size = 10
end
object uqWebstaff_fields_invoice_to: TStringField
FieldName = 'staff_fields_invoice_to'
Size = 128
end
object uqWebstaff_fields_invoice_attention: TStringField
FieldName = 'staff_fields_invoice_attention'
Size = 256
end
object uqWebstaff_fields_ship_to: TStringField
FieldName = 'staff_fields_ship_to'
Size = 128
end
object uqWebstaff_fields_ship_attention: TStringField
FieldName = 'staff_fields_ship_attention'
Size = 256
end
object uqWebstaff_fields_po_number: TStringField
FieldName = 'staff_fields_po_number'
Size = 16
end
object uqWebstaff_fields_job_name: TStringField
FieldName = 'staff_fields_job_name'
Size = 45
end
object uqWebstaff_fields_art_due: TDateField
FieldName = 'staff_fields_art_due'
end
object uqWebstaff_fields_plate_due: TDateField
FieldName = 'staff_fields_plate_due'
end
object uqWebplates_job_number: TStringField
FieldName = 'plates_job_number'
Size = 16
end
object uqWebsupplied_by_customer_b_w_or_co: TStringField
FieldName = 'supplied_by_customer_b_w_or_co'
Size = 4
end
object uqWebsupplied_by_customer_plates: TStringField
FieldName = 'supplied_by_customer_plates'
Size = 4
end
object uqWebsupplied_by_customer_sample: TStringField
FieldName = 'supplied_by_customer_sample'
Size = 45
end
object uqWebsupplied_by_customer_dimension: TStringField
FieldName = 'supplied_by_customer_dimension'
Size = 4
end
object uqWebsupplied_by_customer_other: TStringField
FieldName = 'supplied_by_customer_other'
Size = 45
end
object uqWebsupplied_by_customer_disk: TStringField
FieldName = 'supplied_by_customer_disk'
Size = 4
end
object uqWebsupplied_by_customer_e_mail: TStringField
FieldName = 'supplied_by_customer_e_mail'
Size = 128
end
object uqWebsupplied_by_customer_ftp: TStringField
FieldName = 'supplied_by_customer_ftp'
Size = 128
end
object uqWebplates_plate_material: TStringField
FieldName = 'plates_plate_material'
Size = 16
end
object uqWebplates_thickness: TStringField
FieldName = 'plates_thickness'
Size = 5
end
object uqWebsupplied_by_customer_total_inc: TStringField
FieldName = 'supplied_by_customer_total_inc'
Size = 32
end
object uqWebsupplied_by_customer_sheets_us: TStringField
FieldName = 'supplied_by_customer_sheets_us'
Size = 32
end
object uqWebsupplied_by_customer_initials: TStringField
FieldName = 'supplied_by_customer_initials'
Size = 16
end
object uqWebproofing_pdf: TStringField
FieldName = 'proofing_pdf'
Size = 1
end
object uqWebproofing_pdf_to: TStringField
FieldName = 'proofing_pdf_to'
Size = 256
end
object uqWebproofing_pdf_date_1: TDateField
FieldName = 'proofing_pdf_date_1'
end
object uqWebproofing_pdf_date_2: TDateField
FieldName = 'proofing_pdf_date_2'
end
object uqWebproofing_pdf_date_3: TDateField
FieldName = 'proofing_pdf_date_3'
end
object uqWebproofing_full_size_ink_jet_for: TStringField
FieldName = 'proofing_full_size_ink_jet_for'
Size = 1
end
object uqWebproofing_ink_jet_to: TStringField
FieldName = 'proofing_ink_jet_to'
Size = 256
end
object uqWebproofing_ink_jet_to_2: TStringField
FieldName = 'proofing_ink_jet_to_2'
Size = 256
end
object uqWebproofing_ink_jet_date_1: TDateField
FieldName = 'proofing_ink_jet_date_1'
end
object uqWebproofing_ink_jet_date_2: TDateField
FieldName = 'proofing_ink_jet_date_2'
end
object uqWebproofing_ink_jet_date_3: TDateField
FieldName = 'proofing_ink_jet_date_3'
end
object uqWebproofing_color_contract: TStringField
FieldName = 'proofing_color_contract'
Size = 17
end
object uqWebproofing_color_contrac_to: TStringField
FieldName = 'proofing_color_contrac_to'
Size = 256
end
object uqWebproofing_color_contrac_date_1: TDateField
FieldName = 'proofing_color_contrac_date_1'
end
object uqWebproofing_color_contrac_date_2: TDateField
FieldName = 'proofing_color_contrac_date_2'
end
object uqWebproofing_digital_color_key: TStringField
FieldName = 'proofing_digital_color_key'
Size = 10
end
object uqWebproofing_digital_color_to: TStringField
FieldName = 'proofing_digital_color_to'
Size = 256
end
object uqWebproofing_digital_color_date_1: TDateField
FieldName = 'proofing_digital_color_date_1'
end
object uqWebquantity_and_colors_press_name: TStringField
FieldName = 'quantity_and_colors_press_name'
Size = 64
end
object uqWebquantity_and_colors_anilox_info: TStringField
FieldName = 'quantity_and_colors_anilox_info'
Size = 64
end
object uqWebplate_marks_microdots: TStringField
FieldName = 'plate_marks_microdots'
Size = 10
end
object uqWebplate_marks_microdots_comments: TStringField
FieldName = 'plate_marks_microdots_comments'
Size = 128
end
object uqWebplate_marks_crosshairs: TStringField
FieldName = 'plate_marks_crosshairs'
Size = 10
end
object uqWebplate_marks_crosshairs_comments: TStringField
FieldName = 'plate_marks_crosshairs_comments'
Size = 128
end
object uqWebplate_marks_color_bars: TStringField
FieldName = 'plate_marks_color_bars'
Size = 10
end
object uqWebplate_marks_color_bars_comments: TStringField
FieldName = 'plate_marks_color_bars_comments'
Size = 128
end
object uqWebplate_marks_other: TStringField
FieldName = 'plate_marks_other'
Size = 16
end
object uqWebplate_marks_other_comments: TStringField
FieldName = 'plate_marks_other_comments'
Size = 128
end
object uqWebprint_orientation_print_orient: TStringField
FieldName = 'print_orientation_print_orient'
Size = 10
end
object uqWeblayout_around: TStringField
FieldName = 'layout_around'
Size = 10
end
object uqWeblayout_accross: TStringField
FieldName = 'layout_accross'
Size = 10
end
object uqWeblayout_surface_print: TStringField
FieldName = 'layout_surface_print'
Size = 10
end
object uqWeblayout_reverse_print: TStringField
FieldName = 'layout_reverse_print'
Size = 10
end
object uqWeblayout_cylinder_repeat: TStringField
FieldName = 'layout_cylinder_repeat'
Size = 16
end
object uqWeblayout_cutoff_dimension: TStringField
FieldName = 'layout_cutoff_dimension'
Size = 16
end
object uqWeblayout_pitch: TStringField
FieldName = 'layout_pitch'
Size = 16
end
object uqWeblayout_teeth: TStringField
FieldName = 'layout_teeth'
Size = 16
end
object uqWeblayout_bleed: TStringField
FieldName = 'layout_bleed'
Size = 16
end
object uqWeblayout_cutback: TStringField
FieldName = 'layout_cutback'
Size = 16
end
object uqWeblayout_minimum_trap_dim: TStringField
FieldName = 'layout_minimum_trap_dim'
Size = 10
end
object uqWeblayout_maximum_trap_dim: TStringField
FieldName = 'layout_maximum_trap_dim'
Size = 10
end
object uqWebupc_size: TStringField
FieldName = 'upc_size'
Size = 16
end
object uqWebupc_bar_width_reduction: TStringField
FieldName = 'upc_bar_width_reduction'
Size = 16
end
object uqWebquantity_and_colors_qty_colors: TStringField
FieldName = 'quantity_and_colors_qty_colors'
Size = 4096
end
object uqWebgeneral_comments: TStringField
FieldName = 'general_comments'
Size = 4096
end
object uqWebstaff_fields_quickbooks_item: TStringField
FieldName = 'staff_fields_quickbooks_item'
Size = 45
end
object uqWebstaff_fields_quantity: TStringField
FieldName = 'staff_fields_quantity'
Size = 10
end
object uqWebupc_distortion_percent: TStringField
FieldName = 'upc_distortion_percent'
Size = 16
end
object uqWebupc_distortion_amount: TStringField
FieldName = 'upc_distortion_amount'
Size = 16
end
object uqWebstaff_fields_art_location: TStringField
FieldName = 'staff_fields_art_location'
Size = 16
end
end
object ucKG: TUniConnection
ProviderName = 'MySQL'
Database = 'kg_order_entry'
Username = 'root'
Server = '192.168.159.132'
Connected = True
LoginPrompt = False
Left = 855
Top = 457
EncryptedPassword = '9AFF92FF8CFF86FF8CFFCFFFCEFF'
end
end end
...@@ -36,10 +36,99 @@ type ...@@ -36,10 +36,99 @@ type
edtEmailAddress: TEdit; edtEmailAddress: TEdit;
btnPDF: TButton; btnPDF: TButton;
Timer1: TTimer; Timer1: TTimer;
Button1: TButton;
uqWeb: TUniQuery;
ucKG: TUniConnection;
uqWebORDER_ID: TIntegerField;
uqWebCOMPANY_ID: TIntegerField;
uqWebUSER_ID: TIntegerField;
uqWebORDER_DATE: TDateTimeField;
uqWebSTART_DATE: TDateField;
uqWebEND_DATE: TDateField;
uqWebORDER_STATUS: TStringField;
uqWebSCHED_JSON: TStringField;
uqWebstaff_fields_order_date: TDateField;
uqWebstaff_fields_proof_date: TDateField;
uqWebstaff_fields_ship_date: TDateField;
uqWebstaff_fields_ship_via: TStringField;
uqWebstaff_fields_price: TStringField;
uqWebstaff_fields_invoice_to: TStringField;
uqWebstaff_fields_invoice_attention: TStringField;
uqWebstaff_fields_ship_to: TStringField;
uqWebstaff_fields_ship_attention: TStringField;
uqWebstaff_fields_po_number: TStringField;
uqWebstaff_fields_job_name: TStringField;
uqWebstaff_fields_art_due: TDateField;
uqWebstaff_fields_plate_due: TDateField;
uqWebplates_job_number: TStringField;
uqWebsupplied_by_customer_b_w_or_co: TStringField;
uqWebsupplied_by_customer_plates: TStringField;
uqWebsupplied_by_customer_sample: TStringField;
uqWebsupplied_by_customer_dimension: TStringField;
uqWebsupplied_by_customer_other: TStringField;
uqWebsupplied_by_customer_disk: TStringField;
uqWebsupplied_by_customer_e_mail: TStringField;
uqWebsupplied_by_customer_ftp: TStringField;
uqWebplates_plate_material: TStringField;
uqWebplates_thickness: TStringField;
uqWebsupplied_by_customer_total_inc: TStringField;
uqWebsupplied_by_customer_sheets_us: TStringField;
uqWebsupplied_by_customer_initials: TStringField;
uqWebproofing_pdf: TStringField;
uqWebproofing_pdf_to: TStringField;
uqWebproofing_pdf_date_1: TDateField;
uqWebproofing_pdf_date_2: TDateField;
uqWebproofing_pdf_date_3: TDateField;
uqWebproofing_full_size_ink_jet_for: TStringField;
uqWebproofing_ink_jet_to: TStringField;
uqWebproofing_ink_jet_to_2: TStringField;
uqWebproofing_ink_jet_date_1: TDateField;
uqWebproofing_ink_jet_date_2: TDateField;
uqWebproofing_ink_jet_date_3: TDateField;
uqWebproofing_color_contract: TStringField;
uqWebproofing_color_contrac_to: TStringField;
uqWebproofing_color_contrac_date_1: TDateField;
uqWebproofing_color_contrac_date_2: TDateField;
uqWebproofing_digital_color_key: TStringField;
uqWebproofing_digital_color_to: TStringField;
uqWebproofing_digital_color_date_1: TDateField;
uqWebquantity_and_colors_press_name: TStringField;
uqWebquantity_and_colors_anilox_info: TStringField;
uqWebplate_marks_microdots: TStringField;
uqWebplate_marks_microdots_comments: TStringField;
uqWebplate_marks_crosshairs: TStringField;
uqWebplate_marks_crosshairs_comments: TStringField;
uqWebplate_marks_color_bars: TStringField;
uqWebplate_marks_color_bars_comments: TStringField;
uqWebplate_marks_other: TStringField;
uqWebplate_marks_other_comments: TStringField;
uqWebprint_orientation_print_orient: TStringField;
uqWeblayout_around: TStringField;
uqWeblayout_accross: TStringField;
uqWeblayout_surface_print: TStringField;
uqWeblayout_reverse_print: TStringField;
uqWeblayout_cylinder_repeat: TStringField;
uqWeblayout_cutoff_dimension: TStringField;
uqWeblayout_pitch: TStringField;
uqWeblayout_teeth: TStringField;
uqWeblayout_bleed: TStringField;
uqWeblayout_cutback: TStringField;
uqWeblayout_minimum_trap_dim: TStringField;
uqWeblayout_maximum_trap_dim: TStringField;
uqWebupc_size: TStringField;
uqWebupc_bar_width_reduction: TStringField;
uqWebquantity_and_colors_qty_colors: TStringField;
uqWebgeneral_comments: TStringField;
uqWebstaff_fields_quickbooks_item: TStringField;
uqWebstaff_fields_quantity: TStringField;
uqWebupc_distortion_percent: TStringField;
uqWebupc_distortion_amount: TStringField;
uqWebstaff_fields_art_location: TStringField;
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure btnFindClick(Sender: TObject); procedure btnFindClick(Sender: TObject);
procedure btnPDFClick(Sender: TObject); procedure btnPDFClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject); procedure Timer1Timer(Sender: TObject);
procedure Button1Click(Sender: TObject);
private private
kgDB: TApiDatabase; kgDB: TApiDatabase;
accountSID: string; accountSID: string;
...@@ -55,7 +144,7 @@ implementation ...@@ -55,7 +144,7 @@ implementation
{$R *.dfm} {$R *.dfm}
uses uLibrary, rOrderList; uses uLibrary, rOrderList, rOrderWeb, rOrderCorrugated;
procedure TFData.FormCreate(Sender: TObject); procedure TFData.FormCreate(Sender: TObject);
begin begin
...@@ -80,6 +169,22 @@ begin ...@@ -80,6 +169,22 @@ begin
end; end;
procedure TFData.Button1Click(Sender: TObject);
var
Field: TField;
SQL: string;
begin
for Field in uqWeb.Fields do
begin
SQL := 'SELECT ORDER_ID, ORDER_DATE, ' + Field.AsString + ' LENGTH( ' + Field.AsString +
') AS max_length FROM web_plate_orders ORDER BY max_length DESC LIMIT 1';
doQuery(uqUsers, SQL);
memo1.Lines.Add(Field.AsString + ', ' + uqUsers.FieldByName('ORDER_ID').AsString +
', ' + uqUsers.FieldByName('ORDER_DATE').AsString +', ' + uqUsers.FieldByName('max_length').AsString);
end;
end;
procedure TFData.btnFindClick(Sender: TObject); procedure TFData.btnFindClick(Sender: TObject);
// Retrieves calls from a specific number from the database. // Retrieves calls from a specific number from the database.
// SQL: SQL statement to retrieve calls from the database // SQL: SQL statement to retrieve calls from the database
......
...@@ -366,6 +366,7 @@ type ...@@ -366,6 +366,7 @@ type
[HttpGet] function GetOrders(searchOptions: string): TOrderList; [HttpGet] function GetOrders(searchOptions: string): TOrderList;
[HttpGet] function GetOrder(orderInfo: string): TFullOrder; [HttpGet] function GetOrder(orderInfo: string): TFullOrder;
[HttpGet] function GetWebOrder(orderInfo: string): TWebOrder; [HttpGet] function GetWebOrder(orderInfo: string): TWebOrder;
[HttpGet] function GetCuttingDieOrder(orderInfo: string): TCuttingDie;
[HttpGet] function GetCustomers(): TCustomerList; [HttpGet] function GetCustomers(): TCustomerList;
[HttpGet] function GetCustomer(ID: string): TCustomerItem; [HttpGet] function GetCustomer(ID: string): TCustomerItem;
[HttpGet] function GenerateOrderListPDF(searchOptions: string): string; [HttpGet] function GenerateOrderListPDF(searchOptions: string): string;
...@@ -379,6 +380,7 @@ type ...@@ -379,6 +380,7 @@ type
function EditUser(const editOptions: string): string; function EditUser(const editOptions: string): string;
function AddCorrugatedOrder(orderInfo: string): TJSONObject; function AddCorrugatedOrder(orderInfo: string): TJSONObject;
function AddWebOrder(orderInfo: string): TJSONObject; function AddWebOrder(orderInfo: string): TJSONObject;
function AddCuttingDieOrder(orderInfo: string): TJSONObject;
function AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string; function AddStatusSchedule(StatusType: string; order: TJSONObject; ORDER_ID: integer): string;
function SetStatus(statusOptions: string): string; function SetStatus(statusOptions: string): string;
end; end;
......
...@@ -35,6 +35,7 @@ type ...@@ -35,6 +35,7 @@ type
function GetCustomers(): TCustomerList; function GetCustomers(): TCustomerList;
function GetCustomer(ID: string): TCustomerItem; function GetCustomer(ID: string): TCustomerItem;
function GetWebOrder(orderInfo: string): TWebOrder; function GetWebOrder(orderInfo: string): TWebOrder;
function GetCuttingDieOrder(orderInfo: string): TCuttingDie;
function EditUser(const editOptions: string): string; function EditUser(const editOptions: string): string;
...@@ -871,6 +872,61 @@ begin ...@@ -871,6 +872,61 @@ begin
end; end;
function TLookupService.GetCuttingDieOrder(orderInfo: string): TCuttingDie;
var
orderType: string;
orderID: string;
SQL: string;
ADDRESS: TAddressItem;
begin
orderID := orderInfo;
SQL := 'select * from cutting_die_orders o JOIN customers c ON c.CUSTOMER_ID = o.COMPANY_ID where ORDER_ID = ' + quotedStr(orderID);
doQuery(ordersDB.UniQuery1, SQL);
result := TCuttingDie.Create;
// Company
result.COMPANY_ID := ordersDB.UniQuery1.FieldByName('COMPANY_ID').AsInteger;
result.NAME := ordersDB.UniQuery1.FieldByName('NAME').AsString;
result.SHORT_NAME := ordersDB.UniQuery1.FieldByName('SHORT_NAME').AsString;
result.inQuickBooks := '?';
// Staff Fields
result.staff_fields_order_date := ordersDB.UniQuery1.FieldByName('staff_fields_order_date').AsString;
result.staff_fields_proof_date := ordersDB.UniQuery1.FieldByName('staff_fields_proof_date').AsString;
result.staff_fields_ship_date := ordersDB.UniQuery1.FieldByName('staff_fields_ship_date').AsString;
result.staff_fields_ship_via := ordersDB.UniQuery1.FieldByName('staff_fields_ship_via').AsString;
result.staff_fields_quantity := ordersDB.UniQuery1.FieldByName('staff_fields_quantity').AsString;
result.staff_fields_ship_to := ordersDB.UniQuery1.FieldByName('staff_fields_ship_to').AsString;
result.staff_fields_po_number := ordersDB.UniQuery1.FieldByName('staff_fields_po_number').AsString;
result.staff_fields_job_name := ordersDB.UniQuery1.FieldByName('staff_fields_job_name').AsString;
result.staff_fields_quickbooks_item := ordersDB.UniQuery1.FieldByName('staff_fields_quickbooks_item').AsString;
result.staff_fields_price := ordersDB.UniQuery1.FieldByName('staff_fields_price').AsString;
result.staff_fields_invoice_to := ordersDB.UniQuery1.FieldByName('staff_fields_invoice_to').AsString;
result.general_special_instructions := ordersDB.UniQuery1.FieldByName('general_special_instructions').AsString;
ordersDB.UniQuery1.Close;
SQL := 'SELECT s.ship_block FROM customers c JOIN customers_ship s ON c.CUSTOMER_ID = s.customer_id WHERE c.CUSTOMER_ID = ' + IntToStr(result.COMPANY_ID);
doQuery(ordersDB.UniQuery1, SQL);
result.ADDRESS_LIST := TList<TAddressItem>.Create;
TXDataOperationContext.Current.Handler.ManagedObjects.Add( Result.ADDRESS_LIST );
while not ordersDB.UniQuery1.Eof do
begin
ADDRESS := TAddressItem.Create;
TXDataOperationContext.Current.Handler.ManagedObjects.Add( ADDRESS );
ADDRESS.ADDRESS := ordersDB.UniQuery1.FieldByName('ship_block').AsString;
result.ADDRESS_LIST.Add(ADDRESS);
ordersDB.UniQuery1.Next;
end;
ordersDB.UniQuery1.Close;
result.ITEMS := GetItems('');
end;
function TLookupService.GetItems(searchOptions: string): TItemList; function TLookupService.GetItems(searchOptions: string): TItemList;
// retrueves all the quickbooks items for the items page on client. // retrueves all the quickbooks items for the items page on client.
// searchOptions: probably not needed but adds limits to the page to prevent // searchOptions: probably not needed but adds limits to the page to prevent
...@@ -1087,7 +1143,7 @@ begin ...@@ -1087,7 +1143,7 @@ begin
else else
begin begin
// No idea why I need this line but without it an error gets thrown // No idea why I need this line but without it an error gets thrown
ordersDB.UniQuery1.FieldByName('ORDER_DATE').AsDateTime := ordersDB.UniQuery1.FieldByName('ORDER_DATE').AsDateTime; //ordersDB.UniQuery1.FieldByName('ORDER_DATE').AsDateTime := ordersDB.UniQuery1.FieldByName('ORDER_DATE').AsDateTime;
end; end;
if JSONData.GetValue<string>('staff_fields_price') = '' then if JSONData.GetValue<string>('staff_fields_price') = '' then
...@@ -1097,7 +1153,7 @@ begin ...@@ -1097,7 +1153,7 @@ begin
ordersDB.UniQuery1.FieldByName('JOB_NAME').AsString := JSONData.GetValue<string>('staff_fields_job_name'); ordersDB.UniQuery1.FieldByName('JOB_NAME').AsString := JSONData.GetValue<string>('staff_fields_job_name');
ordersDB.UniQuery1.FieldByName('USER_ID').AsString := JSONData.GetValue<string>('USER_ID'); ordersDB.UniQuery1.FieldByName('USER_ID').AsString := JSONData.GetValue<string>('USER_ID');
ordersDB.UniQuery1.FieldByName('LOCATION').AsString := JSONData.GetValue<string>('staff_fields_art_location'); ordersDB.UniQuery1.FieldByName('LOCATION').AsString := '';//JSONData.GetValue<string>('staff_fields_art_location');
ordersDB.UniQuery1.Post; ordersDB.UniQuery1.Post;
...@@ -1554,8 +1610,9 @@ begin ...@@ -1554,8 +1610,9 @@ begin
if JSONData = nil then if JSONData = nil then
raise Exception.Create('Invalid JSON format'); // If parsing fails, raise an exception raise Exception.Create('Invalid JSON format'); // If parsing fails, raise an exception
mode := JSONData.GetValue<string>('mode'); mode := JSONData.GetValue<string>('mode');
ORDER_ID := JSONData.GetValue<integer>('ORDER_ID');
AddToOrdersTable(mode, 'web_plate', JSONData); AddToOrdersTable(mode, 'cutting_die', JSONData);
if mode = 'ADD' then if mode = 'ADD' then
begin begin
......
object rptOrderCorrugated: TrptOrderCorrugated object rptOrderCorrugated: TrptOrderCorrugated
OnCreate = DataModuleCreate
Height = 480 Height = 480
Width = 640 Width = 640
object ucKG: TUniConnection object ucKG: TUniConnection
...@@ -1006,7 +1005,7 @@ object rptOrderCorrugated: TrptOrderCorrugated ...@@ -1006,7 +1005,7 @@ object rptOrderCorrugated: TrptOrderCorrugated
DataSetName = 'frxDBOrderCorrugated' DataSetName = 'frxDBOrderCorrugated'
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -11 Font.Height = -8
Font.Name = 'Arial' Font.Name = 'Arial'
Font.Style = [] Font.Style = []
Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom] Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom]
...@@ -1214,9 +1213,15 @@ object rptOrderCorrugated: TrptOrderCorrugated ...@@ -1214,9 +1213,15 @@ object rptOrderCorrugated: TrptOrderCorrugated
DataField = 'proofing_other' DataField = 'proofing_other'
DataSet = frxDBOrderCorrugated DataSet = frxDBOrderCorrugated
DataSetName = 'frxDBOrderCorrugated' DataSetName = 'frxDBOrderCorrugated'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -8
Font.Name = 'Arial'
Font.Style = []
Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom] Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom]
Memo.UTF8W = ( Memo.UTF8W = (
'[frxDBOrderCorrugated."proofing_other"]') '[frxDBOrderCorrugated."proofing_other"]')
ParentFont = False
ColSpan = 2 ColSpan = 2
end end
object TableCell133: TfrxTableCell object TableCell133: TfrxTableCell
...@@ -1594,9 +1599,15 @@ object rptOrderCorrugated: TrptOrderCorrugated ...@@ -1594,9 +1599,15 @@ object rptOrderCorrugated: TrptOrderCorrugated
DataField = 'general_special_instructions' DataField = 'general_special_instructions'
DataSet = frxDBOrderCorrugated DataSet = frxDBOrderCorrugated
DataSetName = 'frxDBOrderCorrugated' DataSetName = 'frxDBOrderCorrugated'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -11
Font.Name = 'Arial'
Font.Style = []
Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom] Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom]
Memo.UTF8W = ( Memo.UTF8W = (
'[frxDBOrderCorrugated."general_special_instructions"]') '[frxDBOrderCorrugated."general_special_instructions"]')
ParentFont = False
end end
end end
end end
...@@ -2367,7 +2378,7 @@ object rptOrderCorrugated: TrptOrderCorrugated ...@@ -2367,7 +2378,7 @@ object rptOrderCorrugated: TrptOrderCorrugated
DataSetName = 'frxDBOrderCorrugated' DataSetName = 'frxDBOrderCorrugated'
Font.Charset = DEFAULT_CHARSET Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack Font.Color = clBlack
Font.Height = -13 Font.Height = -9
Font.Name = 'Arial' Font.Name = 'Arial'
Font.Style = [] Font.Style = []
Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom] Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom]
...@@ -2575,9 +2586,15 @@ object rptOrderCorrugated: TrptOrderCorrugated ...@@ -2575,9 +2586,15 @@ object rptOrderCorrugated: TrptOrderCorrugated
DataField = 'colors_machine_ident' DataField = 'colors_machine_ident'
DataSet = frxDBOrderCorrugated DataSet = frxDBOrderCorrugated
DataSetName = 'frxDBOrderCorrugated' DataSetName = 'frxDBOrderCorrugated'
Font.Charset = DEFAULT_CHARSET
Font.Color = clBlack
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom] Frame.Typ = [ftLeft, ftRight, ftTop, ftBottom]
Memo.UTF8W = ( Memo.UTF8W = (
'[frxDBOrderCorrugated."colors_machine_ident"]') '[frxDBOrderCorrugated."colors_machine_ident"]')
ParentFont = False
ColSpan = 2 ColSpan = 2
end end
object TableCell131: TfrxTableCell object TableCell131: TfrxTableCell
...@@ -3299,7 +3316,7 @@ object rptOrderCorrugated: TrptOrderCorrugated ...@@ -3299,7 +3316,7 @@ object rptOrderCorrugated: TrptOrderCorrugated
object uqOrderCorrugated: TUniQuery object uqOrderCorrugated: TUniQuery
Connection = ucKG Connection = ucKG
SQL.Strings = ( SQL.Strings = (
'select * from corrugated_plate_orders where ORDER_ID = 15742') 'select * from corrugated_plate_orders where ORDER_ID = 11424')
Active = True Active = True
Left = 457 Left = 457
Top = 106 Top = 106
......
...@@ -101,7 +101,6 @@ type ...@@ -101,7 +101,6 @@ type
uqOrderCorrugatedstaff_fields_quantity: TStringField; uqOrderCorrugatedstaff_fields_quantity: TStringField;
uqOrderCorrugatedlayout_rsc_style: TStringField; uqOrderCorrugatedlayout_rsc_style: TStringField;
uqOrderCorrugatedstaff_fields_art_location: TStringField; uqOrderCorrugatedstaff_fields_art_location: TStringField;
procedure DataModuleCreate(Sender: TObject);
private private
{ Private declarations } { Private declarations }
public public
......
object rptOrderWeb: TrptOrderWeb object rptOrderWeb: TrptOrderWeb
OnCreate = DataModuleCreate
Height = 480 Height = 480
Width = 640 Width = 640
object ucKG: TUniConnection object ucKG: TUniConnection
......
...@@ -108,7 +108,6 @@ type ...@@ -108,7 +108,6 @@ type
uqOrderWebCREATE_TIME: TDateTimeField; uqOrderWebCREATE_TIME: TDateTimeField;
uqOrderWebQB_TXN_ID: TStringField; uqOrderWebQB_TXN_ID: TStringField;
uqOrderWebQB_REF_NUM: TStringField; uqOrderWebQB_REF_NUM: TStringField;
procedure DataModuleCreate(Sender: TObject);
private private
{ Private declarations } { Private declarations }
public public
......
[Settings] [Settings]
MemoLogLevel=4 MemoLogLevel=4
FileLogLevel=5 FileLogLevel=5
LogFileNum=206 LogFileNum=221
webClientVersion=1.0.0 webClientVersion=1.0.0
[Database] [Database]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment