Commit a143692e by emsys

Finished Items page, and added pagination to customer page.

parent 4fa14ae7
...@@ -4,9 +4,9 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -4,9 +4,9 @@ object FViewAddCustomer: TFViewAddCustomer
CSSLibrary = cssBootstrap CSSLibrary = cssBootstrap
ElementFont = efCSS ElementFont = efCSS
object lblFormState: TWebLabel object lblFormState: TWebLabel
Left = 18 Left = 19
Top = 16 Top = 578
Width = 3 Width = 79
Height = 15 Height = 15
ElementID = 'lbl_form_state' ElementID = 'lbl_form_state'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
...@@ -39,7 +39,7 @@ object FViewAddCustomer: TFViewAddCustomer ...@@ -39,7 +39,7 @@ object FViewAddCustomer: TFViewAddCustomer
Text = '' Text = ''
end end
object edtShortName: TWebDBEdit object edtShortName: TWebDBEdit
Left = 19 Left = 24
Top = 12 Top = 12
Width = 121 Width = 121
Height = 22 Height = 22
......
...@@ -79,7 +79,7 @@ type ...@@ -79,7 +79,7 @@ type
XDataWebDataSet1REP_USER_ID: TStringField; XDataWebDataSet1REP_USER_ID: TStringField;
xdwdsUsersfull_name: TStringField; xdwdsUsersfull_name: TStringField;
lblFormState: TWebLabel; lblFormState: TWebLabel;
procedure btnSaveClick(Sender: TObject); [async] procedure btnSaveClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject); procedure btnCancelClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject); procedure btnCloseClick(Sender: TObject);
procedure btnEditClick(Sender: TObject); procedure btnEditClick(Sender: TObject);
...@@ -424,8 +424,8 @@ procedure TFViewAddCustomer.btnSaveClick(Sender: TObject); ...@@ -424,8 +424,8 @@ procedure TFViewAddCustomer.btnSaveClick(Sender: TObject);
begin begin
if VerifyCustomer() then if VerifyCustomer() then
begin begin
sendCustomerToServer(); await(sendCustomerToServer());
GetCustomer(); await(GetCustomer());
ViewMode(); ViewMode();
end; end;
end; end;
......
...@@ -43,6 +43,8 @@ type ...@@ -43,6 +43,8 @@ type
public public
{ Public declarations } { Public declarations }
notification: string; notification: string;
confirm: Boolean;
QB_ID, name, description, status: string;
end; end;
var var
...@@ -80,7 +82,18 @@ begin ...@@ -80,7 +82,18 @@ begin
else if xdwdsCustomers.FieldByName('qb_items_id').AsString <> '' then else if xdwdsCustomers.FieldByName('qb_items_id').AsString <> '' then
edtNotification.Text := 'Item Already In Database' edtNotification.Text := 'Item Already In Database'
else else
SendItemToServer(); begin
QB_ID := xdwdsCustomers.FieldByName('qb_items_qb_id').AsString;
name := xdwdsCustomers.FieldByName('qb_item_name').AsString;
description := xdwdsCustomers.FieldByName('item_desc').AsString;
if xdwdsCustomers.FieldByName('status').AsBoolean then
status := 'ACTIVE'
else
status := 'INACTIVE';
confirm := true;
Close;
end;
//SendItemToServer();
end; end;
procedure TfViewAddItem.getItems; procedure TfViewAddItem.getItems;
...@@ -90,18 +103,25 @@ var ...@@ -90,18 +103,25 @@ var
i: integer; i: integer;
begin begin
// Fetch data from XData service // Fetch data from XData service
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.getQBItems', [])); Utils.ShowSpinner('spinner');
customerList := TJSObject(xdcResponse.Result); try
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.getQBItems', []));
customerList := TJSObject(xdcResponse.Result);
// Load data into TXDataWebDataset // Load data into TXDataWebDataset
xdwdsCustomers.Close; xdwdsCustomers.Close;
xdwdsCustomers.SetJsonData(customerList); xdwdsCustomers.SetJsonData(customerList);
xdwdsCustomers.Open; xdwdsCustomers.Open;
// Manually populate the grid // Manually populate the grid
PopulateGridManually; PopulateGridManually;
//Utils.HideSpinner('spinner'); //Utils.HideSpinner('spinner');
except
on E: EXDataClientRequestException do
Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end;
Utils.HideSpinner('spinner');
end; end;
procedure TFViewAddItem.PopulateGridManually; procedure TFViewAddItem.PopulateGridManually;
......
...@@ -42,15 +42,14 @@ object FViewCustomers: TFViewCustomers ...@@ -42,15 +42,14 @@ object FViewCustomers: TFViewCustomers
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
Text = '500' Text = '50'
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
OnChange = wcbPageSizeChange OnChange = wcbPageSizeChange
ItemIndex = -1 ItemIndex = -1
Items.Strings = ( Items.Strings = (
'100' '10'
'250' '25'
'500' '50')
'1000')
end end
object pnlMessage: TWebPanel object pnlMessage: TWebPanel
Left = 12 Left = 12
......
...@@ -83,16 +83,7 @@ begin ...@@ -83,16 +83,7 @@ begin
newform.ShowModal( newform.ShowModal(
procedure(AValue: TModalResult) procedure(AValue: TModalResult)
begin begin
{if newform.confirm then
begin
if newform.cbCorrugatedPlate.Checked then
orderType := 'corrugated'
else if newform.cbWebPlate.Checked then
orderType := 'web'
else
orderType := 'cutting';
orderEntry('', newForm.DBID, 'ADD', orderType);
end; }
end end
); );
end; end;
...@@ -108,8 +99,8 @@ begin ...@@ -108,8 +99,8 @@ begin
DMConnection.ApiConnection.Connected := True; DMConnection.ApiConnection.Connected := True;
PageNumber := 1; PageNumber := 1;
TotalPages := 1; // Initial total pages TotalPages := 1; // Initial total pages
wcbPageSize.Text := '500'; wcbPageSize.Text := '50';
PageSize := 500; PageSize := 50;
HideNotification(); HideNotification();
getCustomers(GenerateSearchOptions()); getCustomers(GenerateSearchOptions());
end; end;
...@@ -135,21 +126,23 @@ begin ...@@ -135,21 +126,23 @@ begin
xdwdsCustomers.Open; xdwdsCustomers.Open;
customerListLength := integer(customerList['count']); customerListLength := integer(customerList['count']);
TotalPages := ( (customerListLength + PageSize - 1) div PageSize); TotalPages := (customerListLength + PageSize - 1) div PageSize;
generatePagination(TotalPages);
if customerListLength = 0 then if customerListLength = 0 then
lblEntries.Caption := 'No entries found' begin
else if (PageNumber * PageSize) < customerListLength then lblEntries.Caption := 'No entries found';
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) + ShowToast('No entries found', 'danger');
' - ' + IntToStr(customerListLength) + end
' of ' + IntToStr(customerListLength) else if (PageNumber * PageSize) < customerListLength then
else lblEntries.Caption := Format('Showing entries %d - %d of %d',
lblEntries.Caption := 'Showing entries ' + IntToStr((PageNumber - 1) * PageSize + 1) + [(PageNumber - 1) * PageSize + 1, PageNumber * PageSize, customerListLength])
' - ' + IntToStr(customerListLength) + else
' of ' + IntToStr(customerListLength); lblEntries.Caption := Format('Showing entries %d - %d of %d',
[(PageNumber - 1) * PageSize + 1, customerListLength, customerListLength]);
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve customers: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
Utils.HideSpinner('spinner'); Utils.HideSpinner('spinner');
end; end;
...@@ -180,7 +173,6 @@ begin ...@@ -180,7 +173,6 @@ begin
getCustomers(GenerateSearchOptions()); getCustomers(GenerateSearchOptions());
end; end;
procedure TFViewCustomers.wdbtcCustomersDblClickCell(Sender: TObject; ACol, procedure TFViewCustomers.wdbtcCustomersDblClickCell(Sender: TObject; ACol,
ARow: Integer); ARow: Integer);
begin begin
......
...@@ -107,7 +107,7 @@ begin ...@@ -107,7 +107,7 @@ begin
Info := string(responseString['value']); Info := string(responseString['value']);
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not add user: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
......
...@@ -21,6 +21,17 @@ object FViewItems: TFViewItems ...@@ -21,6 +21,17 @@ object FViewItems: TFViewItems
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
end end
object lblFormState: TWebLabel
Left = 380
Top = 422
Width = 3
Height = 13
ElementID = 'lbl_form_state'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object wcbPageSize: TWebComboBox object wcbPageSize: TWebComboBox
Left = 0 Left = 0
Top = 0 Top = 0
...@@ -150,10 +161,11 @@ object FViewItems: TFViewItems ...@@ -150,10 +161,11 @@ object FViewItems: TFViewItems
Header.ListItemElementClassName = 'page-item' Header.ListItemElementClassName = 'page-item'
Header.ListLinkElementClassName = 'page-link' Header.ListLinkElementClassName = 'page-link'
WordWrap = True WordWrap = True
OnClickCell = wdbtcItemsClickCell
Columns = < Columns = <
item item
DataField = 'ID' DataField = 'ID'
Title = 'KG Orders ID' Title = 'Item ID'
end end
item item
DataField = 'name' DataField = 'name'
...@@ -166,6 +178,10 @@ object FViewItems: TFViewItems ...@@ -166,6 +178,10 @@ object FViewItems: TFViewItems
item item
DataField = 'status' DataField = 'status'
Title = 'Status' Title = 'Status'
end
item
DataField = 'QB_ID'
Title = 'QB ID'
end> end>
DataSource = wdsItems DataSource = wdsItems
end end
...@@ -175,7 +191,6 @@ object FViewItems: TFViewItems ...@@ -175,7 +191,6 @@ object FViewItems: TFViewItems
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 8 ChildOrder = 8
ElementClassName = 'form-control'
ElementID = 'edtname' ElementID = 'edtname'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto HeightStyle = ssAuto
...@@ -190,7 +205,6 @@ object FViewItems: TFViewItems ...@@ -190,7 +205,6 @@ object FViewItems: TFViewItems
Width = 121 Width = 121
Height = 22 Height = 22
ChildOrder = 8 ChildOrder = 8
ElementClassName = 'form-control'
ElementID = 'edtdescription' ElementID = 'edtdescription'
ElementFont = efCSS ElementFont = efCSS
HeightStyle = ssAuto HeightStyle = ssAuto
...@@ -199,13 +213,13 @@ object FViewItems: TFViewItems ...@@ -199,13 +213,13 @@ object FViewItems: TFViewItems
DataField = 'description' DataField = 'description'
DataSource = wdsItems DataSource = wdsItems
end end
object cbStatus: TWebCheckBox object CBStatus: TWebDBCheckBox
Left = 352 Left = 352
Top = 36 Top = 34
Width = 113 Width = 113
Height = 22 Height = 22
Caption = 'Active?' Caption = 'Active?'
ChildOrder = 10 ChildOrder = 11
ElementClassName = 'custom-control custom-checkbox' ElementClassName = 'custom-control custom-checkbox'
ElementButtonClassName = 'custom-control-input' ElementButtonClassName = 'custom-control-input'
ElementLabelClassName = 'custom-control-label' ElementLabelClassName = 'custom-control-label'
...@@ -214,6 +228,10 @@ object FViewItems: TFViewItems ...@@ -214,6 +228,10 @@ object FViewItems: TFViewItems
HeightStyle = ssAuto HeightStyle = ssAuto
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'status'
DataSource = wdsItems
ValueChecked = 'ACTIVE'
ValueUnChecked = 'INACTIVE'
end end
object XDataWebClient1: TXDataWebClient object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection Connection = DMConnection.ApiConnection
...@@ -226,10 +244,6 @@ object FViewItems: TFViewItems ...@@ -226,10 +244,6 @@ object FViewItems: TFViewItems
object xdwdsItemsstatus: TStringField object xdwdsItemsstatus: TStringField
FieldName = 'status' FieldName = 'status'
end end
object xdwdsItemsqb_items_qb_id: TStringField
FieldName = 'qb_items_qb_id'
Size = 0
end
object xdwdsItemsID: TStringField object xdwdsItemsID: TStringField
FieldName = 'ID' FieldName = 'ID'
end end
...@@ -239,8 +253,12 @@ object FViewItems: TFViewItems ...@@ -239,8 +253,12 @@ object FViewItems: TFViewItems
object xdwdsItemsdescription: TStringField object xdwdsItemsdescription: TStringField
FieldName = 'description' FieldName = 'description'
end end
object xdwdsItemsQB_ID: TStringField
FieldName = 'QB_ID'
end
end end
object wdsItems: TWebDataSource object wdsItems: TWebDataSource
AutoEdit = False
DataSet = xdwdsItems DataSet = xdwdsItems
Left = 268 Left = 268
Top = 300 Top = 300
......
<nav class="navbar navbar-expand navbar-light bg-light sticky-top" style="z-index: 100;"> <nav class="navbar navbar-expand navbar-light bg-light sticky-top border-light" style="z-index: 100;">
<div class="container-fluid ps-0"> <div class="container-fluid d-flex align-items-center ps-0 pe-0">
<ul class="navbar-nav me-auto ps-2">
<li class="nav-item pe-2"> <!-- Left-aligned form state label -->
<button id="btnadd" class="btn btn-primary btn-sm">Add</button> <div class="me-auto ps-3">
</li> <label id="lbl_form_state" class="form-label mb-0 fw-bold text-uppercase text-nowrap text-danger" style="font-size: 16px;">View Mode</label>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
</ul>
</div> </div>
<!-- Right-aligned buttons -->
<ul class="navbar-nav ms-auto pe-2 mb-0">
<li class="nav-item pe-2">
<button id="btnadd" class="btn btn-primary btn-sm">Add</button>
</li>
<li class="nav-item pe-2">
<button id="btnedit" class="btn btn-primary btn-sm">Edit</button>
</li>
<li class="nav-item pe-2">
<button id="btndelete" class="btn btn-danger btn-sm">Delete</button>
</li>
<li class="nav-item pe-2">
<button id="btnconfirm" class="btn btn-success btn-sm">Save</button>
</li>
<li class="nav-item pe-2">
<button id="btncancel" class="btn btn-danger btn-sm">Cancel</button>
</li>
</ul>
</div>
</nav> </nav>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="container mt-4"> <div class="container mt-4">
...@@ -80,46 +89,4 @@ ...@@ -80,46 +89,4 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Modal -->
<div class="modal fade" id="audioModal" tabindex="-1" aria-labelledby="audioModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="audioModalLabel">Audio Player</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onclick="stopAudio()"></button>
</div>
<div class="modal-body">
<audio controls id="audioPlayer">
<source src="" type="audio/mp3" id="audioSource">
Your browser does not support the audio element.
</audio>
</div>
</div>
</div>
</div> </div>
<script>
document.getElementById('tblPhoneGrid').addEventListener('click', function(event) {
// Check if the clicked element is a table cell (td)
if (event.target.tagName === 'TD') {
const row = event.target.parentNode;
const cells = row.getElementsByTagName('td');
// Extract data from the row
const id = cells[0].textContent;
const name = cells[1].textContent;
const description = cells[2].textContent;
const status = cells[3].textContent.trim().toLowerCase();
// Populate form fields
document.getElementById('edtname').value = name;
document.getElementById('edtdescription').value = description;
// Set the checkbox based on the status
const isActive = status === 'active';
document.getElementById('cbstatus').checked = isActive;
console.log(`Row clicked! ID: ${id}, Name: ${name}, Description: ${description}, Status: ${status}`);
}
});
</script>
...@@ -1586,6 +1586,9 @@ object FOrderEntryCorrugated: TFOrderEntryCorrugated ...@@ -1586,6 +1586,9 @@ object FOrderEntryCorrugated: TFOrderEntryCorrugated
object XDataWebDataSet1supplied_by_customer_order_date: TStringField object XDataWebDataSet1supplied_by_customer_order_date: TStringField
FieldName = 'supplied_by_customer_order_date' FieldName = 'supplied_by_customer_order_date'
end end
object XDataWebDataSet1inQuickBooks: TStringField
FieldName = 'inQuickBooks'
end
end end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
AutoEdit = False AutoEdit = False
......
...@@ -199,6 +199,7 @@ type ...@@ -199,6 +199,7 @@ type
btnAdd: TWebButton; btnAdd: TWebButton;
WebButton2: TWebButton; WebButton2: TWebButton;
lblFormState: TWebLabel; lblFormState: TWebLabel;
XDataWebDataSet1inQuickBooks: TStringField;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
[async] procedure getOrder(Order_ID: string); [async] procedure getOrder(Order_ID: string);
[async] procedure getCustomer(customerID: string); [async] procedure getCustomer(customerID: string);
...@@ -568,7 +569,7 @@ begin ...@@ -568,7 +569,7 @@ begin
window.open(pdfURL, '_blank'); window.open(pdfURL, '_blank');
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not generate corrugated PDF: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
...@@ -600,7 +601,7 @@ begin ...@@ -600,7 +601,7 @@ begin
[OrderID, 'corrugated', JS.toString(AuthService.TokenPayload.Properties['user_id'])])); [OrderID, 'corrugated', JS.toString(AuthService.TokenPayload.Properties['user_id'])]));
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not delete order: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
...@@ -986,7 +987,7 @@ begin ...@@ -986,7 +987,7 @@ begin
xdwdsQBITEM.Open; xdwdsQBITEM.Open;
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve order: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
...@@ -1025,7 +1026,7 @@ begin ...@@ -1025,7 +1026,7 @@ begin
dtpApprovedDate.Date := 0; dtpApprovedDate.Date := 0;
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve customer: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
......
...@@ -64,7 +64,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie ...@@ -64,7 +64,6 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtinquickbooks' ElementID = 'edtinquickbooks'
HeightPercent = 100.000000000000000000 HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000 WidthPercent = 100.000000000000000000
DataField = 'inQuickBooks'
DataSource = WebDataSource1 DataSource = WebDataSource1
end end
object dtpOrderDate: TWebDateTimePicker object dtpOrderDate: TWebDateTimePicker
......
...@@ -420,7 +420,7 @@ begin ...@@ -420,7 +420,7 @@ begin
window.open(pdfURL, '_blank'); window.open(pdfURL, '_blank');
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not generate cutting die PDF: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
...@@ -441,7 +441,7 @@ begin ...@@ -441,7 +441,7 @@ begin
mode := 'EDIT'; mode := 'EDIT';
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not save cutting die order: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
...@@ -572,7 +572,7 @@ begin ...@@ -572,7 +572,7 @@ begin
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve order: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
Utils.HideSpinner('spinner'); Utils.HideSpinner('spinner');
end; end;
......
...@@ -1668,6 +1668,9 @@ object FOrderEntryWeb: TFOrderEntryWeb ...@@ -1668,6 +1668,9 @@ object FOrderEntryWeb: TFOrderEntryWeb
object XDataWebDataSet1supplied_by_customer_b_w_or_co: TStringField object XDataWebDataSet1supplied_by_customer_b_w_or_co: TStringField
FieldName = 'supplied_by_customer_b_w_or_co' FieldName = 'supplied_by_customer_b_w_or_co'
end end
object XDataWebDataSet1InQuickbooks: TStringField
FieldName = 'InQuickbooks'
end
end end
object WebDataSource1: TWebDataSource object WebDataSource1: TWebDataSource
AutoEdit = False AutoEdit = False
......
...@@ -203,6 +203,7 @@ type ...@@ -203,6 +203,7 @@ type
btnAdd: TWebButton; btnAdd: TWebButton;
WebButton2: TWebButton; WebButton2: TWebButton;
lblFormState: TWebLabel; lblFormState: TWebLabel;
XDataWebDataSet1InQuickbooks: TStringField;
procedure WebFormCreate(Sender: TObject); procedure WebFormCreate(Sender: TObject);
[async] procedure getOrder(Order_ID: string); [async] procedure getOrder(Order_ID: string);
[async] procedure getCustomer(customerID: string); [async] procedure getCustomer(customerID: string);
...@@ -594,7 +595,7 @@ begin ...@@ -594,7 +595,7 @@ begin
window.open(pdfURL, '_blank'); window.open(pdfURL, '_blank');
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not generate web order PDF: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
...@@ -614,7 +615,7 @@ begin ...@@ -614,7 +615,7 @@ begin
mode := 'EDIT'; mode := 'EDIT';
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not save web order: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
...@@ -883,7 +884,7 @@ begin ...@@ -883,7 +884,7 @@ begin
xdwdsQBITEM.Open; xdwdsQBITEM.Open;
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve order: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
Utils.HideSpinner('spinner'); Utils.HideSpinner('spinner');
end; end;
......
...@@ -416,7 +416,7 @@ object FViewOrders: TFViewOrders ...@@ -416,7 +416,7 @@ object FViewOrders: TFViewOrders
object tmrReturn: TWebTimer object tmrReturn: TWebTimer
Enabled = False Enabled = False
OnTimer = tmrReturnTimer OnTimer = tmrReturnTimer
Left = 294 Left = 292
Top = 362 Top = 414
end end
end end
// Displays orders in the grid. Allows the user // Displays orders in the grid. Allows the user
// to sort the entries, filter their search, and search for a specific person. // to sort the entries, filter their search, and search for a specific person.
// Authors: // Authors:
// Cameron Hayes // Cameron Hayes
...@@ -235,8 +235,7 @@ begin ...@@ -235,8 +235,7 @@ begin
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
begin begin
Utils.ShowErrorModal('Could not generate report PDF: ' + Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
E.ErrorResult.ErrorMessage);
if Assigned(APdfTab) then if Assigned(APdfTab) then
APdfTab.close; // close the blank tab on failure APdfTab.close; // close the blank tab on failure
end; end;
...@@ -248,7 +247,7 @@ end; ...@@ -248,7 +247,7 @@ end;
procedure TFViewOrders.WebButton1Click(Sender: TObject); procedure TFViewOrders.WebButton1Click(Sender: TObject);
begin begin
if statusOrderID <> '' then if OrderID <> '' then
ShowSetStatusForm() ShowSetStatusForm()
else else
ShowToast('Failure: Please select an order'); ShowToast('Failure: Please select an order');
...@@ -769,7 +768,7 @@ begin ...@@ -769,7 +768,7 @@ begin
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve orders: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
finally finally
Utils.HideSpinner('spinner'); Utils.HideSpinner('spinner');
......
...@@ -126,7 +126,7 @@ begin ...@@ -126,7 +126,7 @@ begin
PopulateGridManually; PopulateGridManually;
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve QuickBooks customers: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
......
...@@ -91,7 +91,7 @@ begin ...@@ -91,7 +91,7 @@ begin
FViewMain.ViewOrders(''); FViewMain.ViewOrders('');
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Error editing user: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
on E: Exception do on E: Exception do
Utils.ShowErrorModal('Unexpected error: ' + E.Message); Utils.ShowErrorModal('Unexpected error: ' + E.Message);
end; end;
...@@ -145,7 +145,7 @@ begin ...@@ -145,7 +145,7 @@ begin
chkAdminUser.Checked := boolean(user['admin']); chkAdminUser.Checked := boolean(user['admin']);
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve users: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
end; end;
......
...@@ -362,7 +362,7 @@ begin ...@@ -362,7 +362,7 @@ begin
GeneratePagination(TotalPages); GeneratePagination(TotalPages);
except except
on E: EXDataClientRequestException do on E: EXDataClientRequestException do
Utils.ShowErrorModal('Could not retrieve users: ' + E.ErrorResult.ErrorMessage); Utils.ShowErrorModal(E.ErrorResult.ErrorMessage);
end; end;
Utils.HideSpinner('spinner'); Utils.HideSpinner('spinner');
end; end;
......
...@@ -47,6 +47,7 @@ type ...@@ -47,6 +47,7 @@ type
name: string; name: string;
description: string; description: string;
status: string; status: string;
QB_ID: string;
end; end;
TItemList = class TItemList = class
...@@ -481,7 +482,7 @@ type ...@@ -481,7 +482,7 @@ type
[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 GetCuttingDieOrder(orderInfo: string): TCuttingDie;
[HttpGet] function GetCustomers(): TCustomerList; [HttpGet] function GetCustomers(customerInfo: string): 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;
[HttpGet] function GenerateOrderCorrugatedPDF(orderID: string): string; [HttpGet] function GenerateOrderCorrugatedPDF(orderID: string): string;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
MemoLogLevel=3 MemoLogLevel=3
FileLogLevel=5 FileLogLevel=5
webClientVersion=0.9.7 webClientVersion=0.9.7
LogFileNum=826 LogFileNum=844
[Database] [Database]
Server=192.168.159.144 Server=192.168.159.144
...@@ -17,6 +17,8 @@ Password=emsys01 ...@@ -17,6 +17,8 @@ Password=emsys01
CompanyID=9341454272655710 CompanyID=9341454272655710
ClientID=ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy ClientID=ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy
ClientSecret=bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN ClientSecret=bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN
RefreshToken=RT1-10-H0-1760618473k44t73jittvqlr4wynn6 RefreshToken=RT1-119-H0-176089178955akizxqky85tnrj9nnl
AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..IwosInYT2Am8LdNGXuY-zQ._QdW6AZ0up2uAna580wQy7qAZPo3nkfHo0eeSpKllcJ_s69nh33Ld41MnTkxeAv1v1bxhvkDxEvkevfNGnggNHU3XSqIqb6tTKcAqR4zPf14JYgOkn82tw_q2VXWLgboMMpP6CfcBHeZPIbJcEOkmX5g4CY0NOum1-_beYmDHE2sxAxnKxcg3rhjBo33BTFjXSg1xknvkTO_GVbyAWdyZmQOpFRfdXAeUDnPAEZhYNVfACFkEDubdK7PyfcAs_7un_E0NZf270tMc2W0HTyk24wCSLbfeeH2Su-G2wi21JszcNsXSNt9ayGtHEXNcWG6A54k1M8U7o_mvpCXLPEXDtJkx8HnBvTz_ZXrFaztQf0_c8DLld5zW8FC1wn-SzHyoCbYbR2M6tBjVLiK80_FlAal_YjBI8fk9BX7nBab6LbCBIcunt7hRsLWCPiRI8_fwM_Nj8rlvxtIoClcyV7_VpIpxCVUgmxKmgf7zuWD3fYc3i8Bg-DpgGgWPVATXSlfNKhOWIDZfyy0YOlkreXPlNdQwCJ1Su3_3yzu_DioV76C5orqoeWk25NiopiAqJ7cBMj15EiuFx-w3jaqCv6ovzEc5r3by510TNu6msjUh2RQ-nxVqLjyLt6VIp3O00e_.2itJJ0rFwI-foW2v1hDSrw AccessToken=eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..nC8S1UW9Us5C-eV2R-Pz3Q.VQrMSJBJ_25MmQ0tiuGnhYhzDRhQhIOkV92ScgMb4ikGyYq4Br3QFT4AYA73WMEzD3uFLxKiCYdJ7I-B2L2q4u1YCg2n5vWLfmljecOvN64DVQNTksUFC71_9pUFtHL0VlqmV-p2RN2QDhnFjnGFa8CXRGW9K8njUWBrZdeJs4M2NRfbIJWdC2JnY2Fq3X5W26xc9cLXpY5BmijXEu8I7AK25NH7r2ZLdGrrh0aGmOj3JgnW68fYLaGONfBSgRcLyW69jDjM21DP1ujflaf9O2BGDb5LctGv-KgyZ-j9OVCMp7otPevN-o3DGL-Bdawmy_ZDN9L2USSSIXal4S3a6Q25_sOkoI7mp4R_onrsProjids8hzsUTSg7bfWOTu7elG_Hjie2cuZvH3eBsYMd8a-sAOo6hZrECUhHFjpULsRiGRIMLCU3nAOHlGP_IFxgIczYGDx27i54CZhvYgLZR7XBnhlpWMLIntogrU50FSw.4pHLJDZLlpzFGjk-oRqTtQ
LastRefresh=7/7/2025 1:49:30 PM LastRefresh=7/11/2025 11:51:34 AM
--RefreshToken=RT1-10-H0-1760618473k44t73jittvqlr4wynn6
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