Commit 342290a5 by Cam Hayes

Commit and push to sync work with Mac

parent 5647a1d3
......@@ -403,10 +403,6 @@ begin
if mode = 'EDIT' then
orderJSON.AddPair('ORDER_ID', orderID);
if mode = 'ADD' then
ShowNotification('Success:Order Added Successfully!')
else
ShowNotification('Success:Order Edited Successfully');
AddCorrugatedOrder(orderJSON);
end;
......@@ -499,16 +495,9 @@ begin
document.getElementById('btn_confirm_cancel').innerText := 'Cancel';
document.getElementById('btn_confirm_delete').innerText := 'Delete';
asm
var modal = document.getElementById('confirmation_modal');
// ensure the modal lives directly under <body>
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, {
keyboard: false
});
bsModal.show();
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false });
confirmationModal.show();
end;
end;
......@@ -587,6 +576,9 @@ begin
if mode = 'ADD' then
OrderID := String(jsObj.Properties['OrderID']);
mode := 'EDIT';
console.log(jsObj);
ShowNotification(string(jsObj.Properties['status']));
end;
procedure TFOrderEntryCorrugated.DelOrder();
......@@ -781,20 +773,14 @@ end;
procedure TFOrderEntryCorrugated.btnCancelClick(Sender: TObject);
begin
console.log('click');
document.getElementById('modal_body').innerHTML := 'Are you sure you want to cancel all changes?';
document.getElementById('btn_confirm_cancel').innerText := 'No';
document.getElementById('btn_confirm_delete').innerText := 'Yes';
asm
var modal = document.getElementById('confirmation_modal');
// ensure the modal is directly under <body>
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, {
keyboard: false
});
bsModal.show();
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false });
confirmationModal.show();
end;
end;
......
......@@ -328,17 +328,13 @@ end;
procedure TFOrderEntryCuttingDie.btnDeleteClick(Sender: TObject);
begin
document.getElementById('modal_body').innerHTML := 'Are you sure you want to delete this order?';
document.getElementById('btn_confirm_cancel').innerText := 'Cancel';
document.getElementById('btn_confirm_delete').innerText := 'Delete';
asm
var modal = document.getElementById('confirmation_modal');
// ensure the modal is directly under <body>
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, {
keyboard: false
});
bsModal.show();
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false });
confirmationModal.show();
end;
end;
procedure TFOrderEntryCuttingDie.btnEditClick(Sender: TObject);
......@@ -484,20 +480,13 @@ end;
procedure TFOrderEntryCuttingDie.btnCancelClick(Sender: TObject);
begin
document.getElementById('modal_body').innerHTML := 'Are you sure you want to cancel all changes?';
document.getElementById('modal_body').innerHTML := 'Are you sure you want to cancel all changes to the customer?';
document.getElementById('btn_confirm_cancel').innerText := 'No';
document.getElementById('btn_confirm_delete').innerText := 'Yes';
asm
var modal = document.getElementById('confirmation_modal');
// ensure the modal is directly under <body>
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, {
keyboard: false
});
bsModal.show();
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false });
confirmationModal.show();
end;
end;
......
......@@ -418,17 +418,13 @@ end;
procedure TFOrderEntryWeb.btnDeleteClick(Sender: TObject);
begin
document.getElementById('modal_body').innerHTML := 'Are you sure you want to delete this order?';
document.getElementById('btn_confirm_cancel').innerText := 'Cancel';
document.getElementById('btn_confirm_delete').innerText := 'Delete';
asm
var modal = document.getElementById('confirmation_modal');
// ensure the modal is directly under <body>
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, {
keyboard: false
});
bsModal.show();
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false });
confirmationModal.show();
end;
end;
......@@ -741,20 +737,13 @@ end;
procedure TFOrderEntryWeb.btnCancelClick(Sender: TObject);
begin
document.getElementById('modal_body').innerHTML := 'Are you sure you want to cancel all changes?';
document.getElementById('modal_body').innerHTML := 'Are you sure you want to cancel all changes to the customer?';
document.getElementById('btn_confirm_cancel').innerText := 'No';
document.getElementById('btn_confirm_delete').innerText := 'Yes';
asm
var modal = document.getElementById('confirmation_modal');
// ensure the modal is directly under <body>
if (modal && modal.parentNode !== document.body) {
document.body.appendChild(modal);
}
var bsModal = new bootstrap.Modal(modal, {
keyboard: false
});
bsModal.show();
var confirmationModal = new bootstrap.Modal(document.getElementById('confirmation_modal'), {
keyboard: false });
confirmationModal.show();
end;
end;
......
......@@ -100,7 +100,6 @@ begin
// Fetch data from XData service
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.getQBCustomers', []));
customerList := TJSObject(xdcResponse.Result);
//console.log(customerList);
// Load data into TXDataWebDataset
......
......@@ -1527,7 +1527,7 @@ var
DateFormat: TFormatSettings;
ORDER_ID: integer;
mode: string;
temp: string;
msg: string;
begin
DateFormat := TFormatSettings.Create;
DateFormat.ShortDateFormat := 'yyyy-mm-dd';
......@@ -1581,26 +1581,27 @@ begin
// Post the record to the database
ordersDB.UniQuery1.Post;
temp := JSONData.GetValue<string>('staff_fields_proof_date');
if ( JSONData.GetValue<string>('staff_fields_proof_date') <> '' ) and ( JSONData.GetValue<string>('staff_fields_proof_date') <> '12/30/1899' ) then
AddStatusSchedule('PROOF', JSONData, ORDER_ID);
temp := JSONData.GetValue<string>('staff_fields_ship_date');
if ( JSONData.GetValue<string>('staff_fields_ship_date') <> '' ) and ( JSONData.GetValue<string>('staff_fields_ship_date') <> '12/30/1899' ) then
AddStatusSchedule('SHIP', JSONData, ORDER_ID);
temp := JSONData.GetValue<string>('staff_fields_art_due');
if ( JSONData.GetValue<string>('staff_fields_art_due') <> '' ) and ( JSONData.GetValue<string>('staff_fields_art_due') <> '12/30/1899' ) then
AddStatusSchedule('ART', JSONData, ORDER_ID);
temp := JSONData.GetValue<string>('staff_fields_plate_due');
if ( JSONData.GetValue<string>('staff_fields_plate_due') <> '' ) and ( JSONData.GetValue<string>('staff_fields_plate_due') <> '12/30/1899' ) then
AddStatusSchedule('PLATE', JSONData, ORDER_ID);
temp := JSONData.GetValue<string>('staff_fields_mount_due');
if ( JSONData.GetValue<string>('staff_fields_mount_due') <> '' ) and ( JSONData.GetValue<string>('staff_fields_mount_due') <> '12/30/1899' ) then
AddStatusSchedule('MOUNT', JSONData, ORDER_ID);
addToRevisionsTable(intToStr(ORDER_ID), 'corrugated_plate_orders_revisions', JSONData);
Result := TJSONObject.Create.AddPair('status', 'success');
if mode = 'ADD' then
msg := 'Success:Customer Successfully Added'
else
msg := 'Success:Customer Successfully Edited';
Result := TJSONObject.Create.AddPair('status', msg);
Result.AddPair('OrderID', ORDER_ID);
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
except
on E: Exception do
......@@ -1953,7 +1954,7 @@ var
CurrDate: TDateTime;
ORDER_ID: integer;
mode: string;
temp: string;
msg: string;
begin
DateFormat := TFormatSettings.Create;
DateFormat.ShortDateFormat := 'yyyy-mm-dd';
......@@ -2020,7 +2021,12 @@ begin
AddToRevisionsTable(IntToStr(ORDER_ID), 'web_plate_orders_revisions', JSONData);
Result := TJSONObject.Create.AddPair('status', 'success');
if mode = 'ADD' then
msg := 'Success:Customer Successfully Added'
else
msg := 'Success:Customer Successfully Edited';
Result := TJSONObject.Create.AddPair('status', msg);
Result.AddPair('OrderID', ORDER_ID);
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
except
......@@ -2041,7 +2047,7 @@ var
CurrDate: TDateTime;
ORDER_ID: integer;
mode: string;
temp: string;
msg: string;
begin
DateFormat := TFormatSettings.Create;
DateFormat.ShortDateFormat := 'yyyy-mm-dd';
......@@ -2104,7 +2110,12 @@ begin
AddToRevisionsTable(IntToStr(ORDER_ID), 'cutting_die_orders_revisions', JSONData);
Result := TJSONObject.Create.AddPair('status', 'success');
if mode = 'ADD' then
msg := 'Success:Customer Successfully Added'
else
msg := 'Success:Customer Successfully Edited';
Result := TJSONObject.Create.AddPair('status', msg);
Result.AddPair('OrderID', ORDER_ID);
TXDataOperationContext.Current.Handler.ManagedObjects.Add(Result);
except
......
......@@ -17,7 +17,6 @@ uses
type
TfQB = class(TForm)
Button2: TButton;
asgData: TAdvStringGrid;
Button3: TButton;
Button4: TButton;
Button5: TButton;
......@@ -108,10 +107,15 @@ type
uqupc_distortion_amount: TStringField;
uqstaff_fields_art_location: TStringField;
Memo1: TMemo;
asgData2: TAdvStringGrid;
Button6: TButton;
Button7: TButton;
Button1: TButton;
Panel1: TPanel;
asgData2: TAdvStringGrid;
Panel2: TPanel;
Splitter1: TSplitter;
asgData: TAdvStringGrid;
Splitter2: TSplitter;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Button2Click(Sender: TObject);
......@@ -122,6 +126,9 @@ type
procedure Button6Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
procedure asgData2ClickCell(Sender: TObject; ARow, ACol: Integer);
procedure asgDataClickCell(Sender: TObject; ARow, ACol: Integer);
procedure Panel1Resize(Sender: TObject);
procedure Panel2Resize(Sender: TObject);
private
{ Private declarations }
strict private
......@@ -157,10 +164,20 @@ procedure TfQB.asgData2ClickCell(Sender: TObject; ARow, ACol: Integer);
var
point, origin: TPoint;
begin
origin := TPoint.Create(0,0);
Memo1.Lines.Add( asgData2.Cells[2, ARow]);
origin := TPoint.Create(1,1);
point := asgData.find(origin, asgData2.Cells[2, ARow], []);
asgData.Row := point.Y;
asgData.Col := point.X;
end;
procedure TfQB.asgDataClickCell(Sender: TObject; ARow, ACol: Integer);
var
point, origin: TPoint;
begin
origin := TPoint.Create(1,1);
point := asgData2.find(origin, asgData.Cells[2, ARow], []);
asgData2.Row := point.Y;
asgData2.Col := point.X;
end;
procedure TfQB.Button1Click(Sender: TObject);
......@@ -229,7 +246,6 @@ begin
f.Free;
end;
procedure TfQB.Button2Click(Sender: TObject);
begin
GetCustomers();
......@@ -868,6 +884,18 @@ begin
asgData2.AutoSizeColumns(true);
end;
procedure TfQB.Panel1Resize(Sender: TObject);
begin
AsgData2.Width := Panel1.ClientWidth;
AsgData2.Height := Panel1.ClientHeight;
end;
procedure TfQB.Panel2Resize(Sender: TObject);
begin
AsgData.Width := Panel2.ClientWidth;
AsgData.Height := Panel2.ClientHeight;
end;
procedure tfQB.findMatches(CustomerList: TJSONArray; JSONfield, DBField: string);
var
I: integer;
......
......@@ -212,7 +212,7 @@ begin
ForceDirectories(ReportDir);
Logger.Log(5, 'Reports directory created: ' + ReportDir);
end;
reportURL := FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf';
reportURL := 'reports/' + FormatDateTime('yyyymmdd_hhnnss', Now) + '.pdf';
ReportFileName := reportDir + reportUrl;
......
......@@ -1168,10 +1168,6 @@ object rptOrderList: TrptOrderList
Required = True
Size = 128
end
object uqOrdersORDER_DATE: TDateTimeField
FieldName = 'ORDER_DATE'
Required = True
end
object uqOrdersORDER_TYPE: TStringField
FieldName = 'ORDER_TYPE'
Required = True
......@@ -1272,6 +1268,9 @@ object rptOrderList: TrptOrderList
FieldName = 'NEW_SHIP_DONE'
Calculated = True
end
object uqOrdersORDER_DATE: TDateField
FieldName = 'ORDER_DATE'
end
end
object frxDBOrders: TfrxDBDataset
UserName = 'frxDBOrders'
......@@ -1281,126 +1280,6 @@ object rptOrderList: TrptOrderList
DataSetOptions = []
Left = 444
Top = 232
FieldDefs = <
item
FieldName = 'ORDER_ID'
end
item
FieldName = 'Loc'
FieldType = fftString
Size = 16
end
item
FieldName = 'COMPANY_NAME'
FieldType = fftString
Size = 90
end
item
FieldName = 'JOB_NAME'
FieldType = fftString
Size = 128
end
item
FieldName = 'ORDER_DATE'
FieldType = fftDateTime
end
item
FieldName = 'ORDER_TYPE'
FieldType = fftString
Size = 45
end
item
FieldName = 'PROOF_DUE'
FieldType = fftDateTime
end
item
FieldName = 'PROOF_DONE'
FieldType = fftDateTime
end
item
FieldName = 'ART_DUE'
FieldType = fftDateTime
end
item
FieldName = 'ART_DONE'
FieldType = fftDateTime
end
item
FieldName = 'PLATE_DUE'
FieldType = fftDateTime
end
item
FieldName = 'PLATE_DONE'
FieldType = fftDateTime
end
item
FieldName = 'MOUNT_DUE'
FieldType = fftDateTime
end
item
FieldName = 'MOUNT_DONE'
FieldType = fftDateTime
end
item
FieldName = 'SHIP_DUE'
FieldType = fftDateTime
end
item
FieldName = 'SHIP_DONE'
FieldType = fftDateTime
end
item
FieldName = 'PRICE'
end
item
FieldName = 'QB_REF_NUM'
FieldType = fftString
Size = 24
end
item
FieldName = 'COLORS'
FieldType = fftString
end
item
FieldName = 'po_number'
FieldType = fftString
Size = 16
end
item
FieldName = 'quickbooks_item'
FieldType = fftString
Size = 45
end
item
FieldName = 'NEW_ORDER_DATE'
FieldType = fftString
Size = 20
end
item
FieldName = 'NEW_PROOF_DONE'
FieldType = fftString
Size = 20
end
item
FieldName = 'NEW_ART_DONE'
FieldType = fftString
Size = 20
end
item
FieldName = 'NEW_PLATE_DONE'
FieldType = fftString
Size = 20
end
item
FieldName = 'NEW_MOUNT_DONE'
FieldType = fftString
Size = 20
end
item
FieldName = 'NEW_SHIP_DONE'
FieldType = fftString
Size = 20
end>
end
object uqColors: TUniQuery
Connection = ucKG
......
......@@ -18,7 +18,6 @@ type
uqOrdersLoc: TStringField;
uqOrdersCOMPANY_NAME: TStringField;
uqOrdersJOB_NAME: TStringField;
uqOrdersORDER_DATE: TDateTimeField;
uqOrdersORDER_TYPE: TStringField;
uqOrdersPROOF_DUE: TDateField;
uqOrdersPROOF_DONE: TDateTimeField;
......@@ -42,6 +41,7 @@ type
uqOrdersNEW_PLATE_DONE: TStringField;
uqOrdersNEW_MOUNT_DONE: TStringField;
uqOrdersNEW_SHIP_DONE: TStringField;
uqOrdersORDER_DATE: TDateField;
procedure DataModuleCreate(Sender: TObject);
procedure uqOrdersCalcFields(DataSet: TDataSet);
......@@ -125,6 +125,7 @@ var
OrderID: LongWord;
jsonStr: string;
begin
OrderID := uqOrdersORDER_ID.AsInteger;
if uqOrdersORDER_TYPE.AsString = 'web_plate' then
begin
......@@ -147,22 +148,26 @@ begin
uqColors.Close; // Ensure it is closed
end;
if uqOrdersORDER_DATE.AsString <> '' then
//uqOrdersORD.AsDateTime := uqOrdersORDER_DATE.AsDateTime;
//logger.Log(3, uqOrders.FieldByName('ORDER_DATE').AsString);
if uqOrdersORDER_DATE.AsString <> '' then
uqOrdersNEW_ORDER_DATE.AsString := FormatDateTime('m/d/yyyy HH:nn', uqOrdersORDER_DATE.AsDateTime)
else
uqOrdersNEW_ORDER_DATE.AsString := '';
if uqOrdersPROOF_DONE.AsString <> '' then
if uqOrdersPROOF_DONE.AsString <> '' then
uqOrdersNEW_PROOF_DONE.AsString := FormatDateTime('m/d/yyyy HH:nn', uqOrdersPROOF_DONE.AsDateTime)
else
uqOrdersNEW_PROOF_DONE.AsString := '';
if uqOrdersART_DONE.AsString <> '' then
if uqOrdersART_DONE.AsString <> '' then
uqOrdersNEW_ART_DONE.AsString := FormatDateTime('m/d/yyyy HH:nn', uqOrdersART_DONE.AsDateTime)
else
uqOrdersNEW_ART_DONE.AsString := '';
if uqOrdersPLATE_DONE.AsString <> '' then
if uqOrdersPLATE_DONE.AsString <> '' then
uqOrdersNEW_PLATE_DONE.AsString := FormatDateTime('m/d/yyyy HH:nn', uqOrdersPLATE_DONE.AsDateTime)
else
uqOrdersNEW_PLATE_DONE.AsString := '';
......
......@@ -2,11 +2,11 @@
MemoLogLevel=3
FileLogLevel=5
webClientVersion=0.9.4
LogFileNum=661
LogFileNum=701
[Database]
--Server=192.168.159.131
Server=192.168.102.130
Server=192.168.159.131
--Server=192.168.102.130
--Server=192.168.75.133
Database=kg_order_entry
Username=root
......@@ -17,6 +17,6 @@ Password=emsys01
CompanyID=9341454272655710
ClientID=ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy
ClientSecret=bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN
RefreshToken=RT1-136-H0-1757775400coc1hvsehylf0uejgm7f
AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJB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dptn5UCF2VgN74bO3MbfSTtQIN8lKFJgGAKsnXolpK71D4OYS2-YW9dH8XFL1K8FD5fauNWb-pn4MxwQ1Y_vOEIB_bF26IM7Pdh7uG-mQSO-ljhXWTEqYmWjK-Z9P_Igznwcqy6RIhtEu216dGpF43JIuGgHxta_yRJLGYsdWjnQbIqW6VvZ4x8jwuLGX0cCu2mKcxkjgghABol6D34lWQcov3Q32oa5ZlIkTzolOxTnlYZ-hhtQBcY-X08CfnPJ3y2Yq4FKAFiu7wBRQ5V0l1RzyPHCkGDJKNNv-yY5aTpRkPwsjdko9xgIAB4gWSyGV-PKoSURNu5jodxQkAcMMIh59y7QuKM5WytAfAtpklGfqEj-vn-d2cWY9-zWfmw0D1KVakH0da5xxdnqr5qO4a1w_b2RT6zVfNvfJRApSlMpes1DZ6Bo_K0yo5rxzUpg0.kkYUlFG-TCl21bRQWpVMaA
LastRefresh=6/16/2025 10:38:38 AM
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