Commit df22fc95 by Cam Hayes

Finished misc bug fixes previously found

parent 41023b04
...@@ -651,10 +651,7 @@ begin ...@@ -651,10 +651,7 @@ begin
else else
showNotification(notification); showNotification(notification);
if mode = 'ADD' then EditMode();
EditMode()
else
ViewMode();
getCustomer(); getCustomer();
......
...@@ -1198,7 +1198,7 @@ object FOrderEntryWeb: TFOrderEntryWeb ...@@ -1198,7 +1198,7 @@ object FOrderEntryWeb: TFOrderEntryWeb
Items.Strings = ( Items.Strings = (
'Cromapro Ink Jet' 'Cromapro Ink Jet'
'Kodak Approval') 'Kodak Approval')
DataField = 'print_orientation_print_orient' DataField = 'proofing_color_contract'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
object btnCopy: TWebButton object btnCopy: TWebButton
......
...@@ -538,6 +538,7 @@ begin ...@@ -538,6 +538,7 @@ begin
orderJSON.AddPair('COMPANY_ID', customerID); orderJSON.AddPair('COMPANY_ID', customerID);
orderJSON.AddPair('USER_ID', JS.toString(AuthService.TokenPayload.Properties['user_id'])); orderJSON.AddPair('USER_ID', JS.toString(AuthService.TokenPayload.Properties['user_id']));
orderJSON.AddPair('mode', mode); orderJSON.AddPair('mode', mode);
console.log(orderJSON);
if mode = 'EDIT' then if mode = 'EDIT' then
begin begin
orderJSON.AddPair('ORDER_ID', orderID); orderJSON.AddPair('ORDER_ID', orderID);
......
...@@ -91,10 +91,12 @@ type ...@@ -91,10 +91,12 @@ type
PageNumber: integer; PageNumber: integer;
PageSize: integer; PageSize: integer;
TotalPages: integer; TotalPages: integer;
OrderID: string; statusOrderID: string; // used strictly for setting status.
OrderID: string; // used strictly for search string.
CompanyID: string; CompanyID: string;
JobName: string; JobName: string;
orderType: string; statusOrderType: string; // used strictly for setting status.
orderType: string; // used strictly for search string.on
//Status 1 //Status 1
StartDate1: string; StartDate1: string;
...@@ -177,7 +179,7 @@ end; ...@@ -177,7 +179,7 @@ end;
procedure TFViewOrders.WebButton1Click(Sender: TObject); procedure TFViewOrders.WebButton1Click(Sender: TObject);
begin begin
if OrderID <> '' then if statusOrderID <> '' then
ShowSetStatusForm() ShowSetStatusForm()
else else
ShowNotification('Failure:Please select an order'); ShowNotification('Failure:Please select an order');
...@@ -232,8 +234,8 @@ begin ...@@ -232,8 +234,8 @@ begin
wcbPageSize.Text := IntToStr(PageSize); wcbPageSize.Text := IntToStr(PageSize);
OrderBy := params.Values['orderby']; OrderBy := params.Values['orderby'];
wlcbOrderBy.DisplayText := OrderBy; wlcbOrderBy.DisplayText := OrderBy;
orderType := params.Values['orderType'].ToLower(); statusOrderType := params.Values['orderType'].ToLower();
OrderID := params.Values['orderID']; statusOrderID := params.Values['orderID'];
companyID := params.Values['companyID']; companyID := params.Values['companyID'];
jobName := params.Values['jobName']; jobName := params.Values['jobName'];
...@@ -368,7 +370,7 @@ begin ...@@ -368,7 +370,7 @@ begin
newform.Caption := 'Input Search Options'; newform.Caption := 'Input Search Options';
newForm.Popup := True; newForm.Popup := True;
newForm.Border := fbDialog; newForm.Border := fbDialog;
newForm.OrderID := OrderID; newForm.OrderID := statusOrderID;
newForm.JobName := wdbtcOrders.Cells[3, row]; newForm.JobName := wdbtcOrders.Cells[3, row];
if wdbtcOrders.Cells[14, row] <> '' then if wdbtcOrders.Cells[14, row] <> '' then
newForm.ShipDue := StrToDateTime(wdbtcOrders.Cells[14, row]) newForm.ShipDue := StrToDateTime(wdbtcOrders.Cells[14, row])
...@@ -386,7 +388,7 @@ begin ...@@ -386,7 +388,7 @@ begin
newForm.ArtDue := StrToDateTime(wdbtcOrders.Cells[8, row]) newForm.ArtDue := StrToDateTime(wdbtcOrders.Cells[8, row])
else else
newForm.ArtDue := 0 ; newForm.ArtDue := 0 ;
newForm.OrderType := OrderType; newForm.OrderType := statusOrderType;
// used to manage Back button handling to close subform // used to manage Back button handling to close subform
window.location.hash := 'subform'; window.location.hash := 'subform';
...@@ -401,7 +403,7 @@ begin ...@@ -401,7 +403,7 @@ begin
begin begin
Utils.ShowSpinner('spinner'); Utils.ShowSpinner('spinner');
StatusJSON := TJSONObject.Create; StatusJSON := TJSONObject.Create;
StatusJSON.AddPair('ORDER_ID', OrderID); StatusJSON.AddPair('ORDER_ID', StatusOrderID);
StatusJSON.AddPair('date', DateTimeToStr(newform.dtpDate.Date)); StatusJSON.AddPair('date', DateTimeToStr(newform.dtpDate.Date));
StatusJSON.AddPair('status', newform.wlcbStatus.Value); StatusJSON.AddPair('status', newform.wlcbStatus.Value);
StatusJSON.AddPair('USER_ID', 1011); StatusJSON.AddPair('USER_ID', 1011);
...@@ -446,8 +448,8 @@ end; ...@@ -446,8 +448,8 @@ end;
procedure TFViewOrders.wdbtcOrdersClickCell(Sender: TObject; ACol, procedure TFViewOrders.wdbtcOrdersClickCell(Sender: TObject; ACol,
ARow: Integer); ARow: Integer);
begin begin
OrderID := wdbtcOrders.Cells[0, ARow]; statusOrderID := wdbtcOrders.Cells[0, ARow];
OrderType := wdbtcOrders.Cells[4, ARow]; statusOrderType := wdbtcOrders.Cells[4, ARow];
row := ARow; row := ARow;
end; end;
......
...@@ -53,6 +53,9 @@ type ...@@ -53,6 +53,9 @@ type
[Async] procedure SendCustomerToServer(); [Async] procedure SendCustomerToServer();
procedure PopulateGridManually(); procedure PopulateGridManually();
procedure ApplyFilter(); procedure ApplyFilter();
var
customerID: string;
msg: string;
public public
{ Public declarations } { Public declarations }
end; end;
...@@ -206,9 +209,10 @@ begin ...@@ -206,9 +209,10 @@ begin
notification := TJSObject(Response.Result); notification := TJSObject(Response.Result);
customerID := string(notification['CustomerID']);
msg := string(notification['status']);
Utils.HideSpinner('spinner'); Utils.HideSpinner('spinner');
FViewMain.ViewAddCustomer(customerID, msg);
FViewMain.ViewAddCustomer(string(notification['CustomerID']), string(notification['status']));
Close(); Close();
end; end;
......
...@@ -68,7 +68,7 @@ begin ...@@ -68,7 +68,7 @@ begin
ShowNotification('Failure:Please fill in all information') ShowNotification('Failure:Please fill in all information')
else if ( ( OrderType = 'web plate' ) and ( wlcbStatus.Value = 'MOUNT' ) ) then else if ( ( OrderType = 'web plate' ) and ( wlcbStatus.Value = 'MOUNT' ) ) then
ShowNotification('Failure:Web Plate Orders do not have Mount Due/Done dates') ShowNotification('Failure:Web Plate Orders do not have Mount Due/Done dates')
else if ( ( OrderType = 'cutting die' ) and ( wlcbStatus.Value = 'MOUNT' ) or ( wlcbStatus.Value = 'ART' ) or (wlcbStatus.Value = 'PLATE') ) then else if ( ( OrderType = 'cutting die' ) and ( ( wlcbStatus.Value = 'MOUNT' ) or ( wlcbStatus.Value = 'ART' ) or (wlcbStatus.Value = 'PLATE') ) ) then
ShowNotification('Failure:Cutting Die Orders do not have Art/Plate/Mount Due or Done Dates') ShowNotification('Failure:Cutting Die Orders do not have Art/Plate/Mount Due or Done Dates')
else else
begin begin
...@@ -96,6 +96,7 @@ begin ...@@ -96,6 +96,7 @@ begin
dtpNewPlateDue.Date := 0; dtpNewPlateDue.Date := 0;
dtpNewArtDue.Date := 0; dtpNewArtDue.Date := 0;
ItemsToRemove := TStringList.Create; ItemsToRemove := TStringList.Create;
console.log(orderType);
if orderType = 'web plate' then if orderType = 'web plate' then
begin begin
dtpNewMountDue.Visible := false; dtpNewMountDue.Visible := false;
...@@ -103,7 +104,7 @@ begin ...@@ -103,7 +104,7 @@ begin
lblMount.Visible := false; lblMount.Visible := false;
lblMountNew.Visible := false; lblMountNew.Visible := false;
wlcbStatus.LookupValues.AddPair('PROOF', 'Proof Done'); wlcbStatus.LookupValues.AddPair('PROOF', 'Proof Done');
wlcbStatus.LookupValues.AddPair('Art', 'Art Done'); wlcbStatus.LookupValues.AddPair('ART', 'Art Done');
wlcbStatus.LookupValues.AddPair('PLATE', 'Plate Done'); wlcbStatus.LookupValues.AddPair('PLATE', 'Plate Done');
wlcbStatus.LookupValues.AddPair('SHIP', 'Ship Done'); wlcbStatus.LookupValues.AddPair('SHIP', 'Ship Done');
end end
...@@ -130,7 +131,7 @@ begin ...@@ -130,7 +131,7 @@ begin
else else
begin begin
wlcbStatus.LookupValues.AddPair('PROOF', 'Proof Done'); wlcbStatus.LookupValues.AddPair('PROOF', 'Proof Done');
wlcbStatus.LookupValues.AddPair('Art', 'Art Done'); wlcbStatus.LookupValues.AddPair('ART', 'Art Done');
wlcbStatus.LookupValues.AddPair('PLATE', 'Plate Done'); wlcbStatus.LookupValues.AddPair('PLATE', 'Plate Done');
wlcbStatus.LookupValues.AddPair('MOUNT', 'Mount Done'); wlcbStatus.LookupValues.AddPair('MOUNT', 'Mount Done');
wlcbStatus.LookupValues.AddPair('SHIP', 'Ship Done'); wlcbStatus.LookupValues.AddPair('SHIP', 'Ship Done');
......
...@@ -1686,9 +1686,9 @@ begin ...@@ -1686,9 +1686,9 @@ begin
addToRevisionsTable(intToStr(ORDER_ID), 'corrugated_plate_orders_revisions', JSONData); addToRevisionsTable(intToStr(ORDER_ID), 'corrugated_plate_orders_revisions', JSONData);
if mode = 'ADD' then if mode = 'ADD' then
msg := 'Success:Customer Successfully Added' msg := 'Success:Order Successfully Added'
else else
msg := 'Success:Customer Successfully Edited'; msg := 'Success:Order Successfully Edited';
Result := TJSONObject.Create.AddPair('status', msg); Result := TJSONObject.Create.AddPair('status', msg);
Result.AddPair('OrderID', ORDER_ID); Result.AddPair('OrderID', ORDER_ID);
...@@ -2122,9 +2122,9 @@ begin ...@@ -2122,9 +2122,9 @@ begin
AddToRevisionsTable(IntToStr(ORDER_ID), 'web_plate_orders_revisions', JSONData); AddToRevisionsTable(IntToStr(ORDER_ID), 'web_plate_orders_revisions', JSONData);
if mode = 'ADD' then if mode = 'ADD' then
msg := 'Success:Customer Successfully Added' msg := 'Success:Order Successfully Added'
else else
msg := 'Success:Customer Successfully Edited'; msg := 'Success:Order Successfully Edited';
Result := TJSONObject.Create.AddPair('status', msg); Result := TJSONObject.Create.AddPair('status', msg);
Result.AddPair('OrderID', ORDER_ID); Result.AddPair('OrderID', ORDER_ID);
...@@ -2213,9 +2213,9 @@ begin ...@@ -2213,9 +2213,9 @@ begin
AddToRevisionsTable(IntToStr(ORDER_ID), 'cutting_die_orders_revisions', JSONData); AddToRevisionsTable(IntToStr(ORDER_ID), 'cutting_die_orders_revisions', JSONData);
if mode = 'ADD' then if mode = 'ADD' then
msg := 'Success:Customer Successfully Added' msg := 'Success:Order Successfully Added'
else else
msg := 'Success:Customer Successfully Edited'; msg := 'Success:Order Successfully Edited';
Result := TJSONObject.Create.AddPair('status', msg); Result := TJSONObject.Create.AddPair('status', msg);
Result.AddPair('OrderID', ORDER_ID); Result.AddPair('OrderID', ORDER_ID);
...@@ -2417,7 +2417,7 @@ begin ...@@ -2417,7 +2417,7 @@ begin
// End Area // End Area
ordersDB.UniQuery1.FieldByName('ORDER_STATUS').AsString := 'ACTIVE'; ordersDB.UniQuery1.FieldByName('ORDER_STATUS').AsString := 'ACTIVE';
ordersDB.UniQuery1.FieldByName('REVISION_NUMBER').AsInteger := 1; ordersDB.UniQuery1.FieldByName('REVISION_NUMBER').AsInteger := rev_num;
ordersDB.UniQuery1.FieldByName('ORDER_REVISION_ID').AsInteger := RevisionID; ordersDB.UniQuery1.FieldByName('ORDER_REVISION_ID').AsInteger := RevisionID;
ordersDB.UniQuery1.FieldByName('REVISION_USER_ID').AsString := order.GetValue<string>('USER_ID'); ordersDB.UniQuery1.FieldByName('REVISION_USER_ID').AsString := order.GetValue<string>('USER_ID');
// Post the record to the database // Post the record to the database
...@@ -2435,6 +2435,7 @@ var ...@@ -2435,6 +2435,7 @@ var
jsValue: TJSONValue; jsValue: TJSONValue;
ParsedCustomer, Customer, BillAddr: TJSONObject; ParsedCustomer, Customer, BillAddr: TJSONObject;
jsObj: TJSONObject; jsObj: TJSONObject;
PhoneObj: TJSONObject;
CustomerList: TJSONArray; CustomerList: TJSONArray;
AccessToken, RefreshToken, CompanyID, Client, Secret: string; AccessToken, RefreshToken, CompanyID, Client, Secret: string;
LastRefresh: TDateTime; LastRefresh: TDateTime;
...@@ -2503,6 +2504,8 @@ begin ...@@ -2503,6 +2504,8 @@ begin
ParsedCustomer.AddPair('In KGOrders', not(ordersDB.UniQuery1.IsEmpty)); ParsedCustomer.AddPair('In KGOrders', not(ordersDB.UniQuery1.IsEmpty));
ParsedCustomer.AddPair('Id', Customer.GetValue<string>('Id')); ParsedCustomer.AddPair('Id', Customer.GetValue<string>('Id'));
ParsedCustomer.AddPair('CompanyName', Customer.GetValue<string>('DisplayName')); ParsedCustomer.AddPair('CompanyName', Customer.GetValue<string>('DisplayName'));
if Customer.TryGetValue<TJSONObject>('PrimaryPhone', PhoneObj) then
ParsedCustomer.AddPair('PrimaryPhone', PhoneObj.GetValue<string>('FreeFormNumber'));
// Handle Bill Address // Handle Bill Address
if Customer.GetValue('BillAddr') is TJSONObject then if Customer.GetValue('BillAddr') is TJSONObject then
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
MemoLogLevel=3 MemoLogLevel=3
FileLogLevel=5 FileLogLevel=5
webClientVersion=0.9.4 webClientVersion=0.9.4
LogFileNum=722 LogFileNum=735
[Database] [Database]
Server=192.168.159.131 Server=192.168.159.131
...@@ -17,6 +17,7 @@ Password=emsys01 ...@@ -17,6 +17,7 @@ Password=emsys01
CompanyID=9341454272655710 CompanyID=9341454272655710
ClientID=ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy ClientID=ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy
ClientSecret=bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN ClientSecret=bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN
RefreshToken=RT1-7-H0-1758919884sgbdvdaawcewm26l9f9k
AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..PLd51yew2irHDBrcsT_EpA.iOyzK2ssY_1bRGAyxZIrqJyl2wvT70A6JrZt-oaBITJUTUp9NLql9g06PxuhgKB8t-ajFDCXtqyZEbtLx0T9-XntK5IkGuXXW5KZcWLGYAUm-T7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4LuXnYBm_qh2vztX6fk7r-Cja51508Z-YjjBi4uwEpnKf7dBBNpI6J-z7bfKffuVRdVBxuQo1ZUePwz6Df41nkjPqv1cw3NLp4IyyCToqX_wzGhnkx19zzMbjkK5ZaHRxpsms29qpHxpikR8QOtXni0o2DBK9xNGhRuCRTPxuEDZzaf26_c258rz0bd2xFl0IfMsfid9iki8O_u6KLfDcQJPPR50UI150HqvNlzPZQuYBRKzXDnwv7h75igYH0NH2rwellgU_k.Y_Nxh6SpCFATsEzsAUs26g
LastRefresh=6/24/2025 9:57:16 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