Commit 7a2dffa1 by cam

Order now opens on double click of a row

Also fixed editing orders that seems to have been broken with recent changes
parent 03dea1fa
......@@ -589,7 +589,11 @@ begin
else
cbStripMount.Checked := false;
console.log(mode);
console.log(XDataWebDataSet1COMPANY_ID.AsString);
if mode = 'EDIT' then
CustomerID := XDataWebDataSet1COMPANY_ID.AsString;
console.log(CustomerID);
end;
......@@ -606,6 +610,8 @@ begin
XDataWebDataSet1.SetJsonData(customer);
XDataWebDataSet1.Open;
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(customer['ADDRESS_LIST']);
xdwdsShipTo.Open;
......
......@@ -163,6 +163,7 @@ object FViewOrders: TFViewOrders
Header.ListItemElementClassName = 'page-item'
Header.ListLinkElementClassName = 'page-link'
WordWrap = True
OnDblClickCell = wdbtcOrdersDblClickCell
Columns = <
item
DataField = 'ID'
......
......@@ -68,6 +68,7 @@ type
procedure btnPDFClick(Sender: TObject);
procedure wcbPageSizeChange(Sender: TObject);
procedure wlcbOrderByChange(Sender: TObject);
procedure wdbtcOrdersDblClickCell(Sender: TObject; ACol, ARow: Integer);
private
FChildForm: TWebForm;
procedure ClearTable();
......@@ -305,6 +306,13 @@ begin
getOrders(generateSearchOptions());
end;
procedure TFViewOrders.wdbtcOrdersDblClickCell(Sender: TObject; ACol,
ARow: Integer);
begin
OrderID := wdbtcOrders.Cells[0, ARow];
orderEntry(OrderID, '', 'EDIT');
end;
procedure TFViewOrders.GeneratePagination(TotalPages: Integer);
// Generates pagination for the table.
// TotalPages: Total amount of pages generated by the search
......
......@@ -128,6 +128,7 @@ type
TFullOrder = class
Public
//Company
COMPANY_ID: integer;
NAME: string;
SHORT_NAME: string;
inQuickBooks: string;
......
......@@ -498,6 +498,7 @@ begin
result := TFullOrder.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 := '?';
......@@ -842,6 +843,7 @@ var
CurrDate: TDateTime;
ORDER_ID: integer;
mode: string;
temp: string;
begin
DateFormat := TFormatSettings.Create;
DateFormat.ShortDateFormat := 'yyyy-mm-dd';
......@@ -890,8 +892,10 @@ begin
begin
SQL := 'select * from orders where ORDER_ID = ' + IntToStr(ORDER_ID);
doQuery(ordersDB.UniQuery1, SQL);
ordersDB.UniQuery1.Edit;
end;
temp := JSONData.GetValue<string>('COMPANY_ID');
ordersDB.UniQuery1.FieldByName('COMPANY_ID').AsString := JSONData.GetValue<string>('COMPANY_ID');
ordersDB.UniQuery1.FieldByName('ORDER_TYPE').AsString := 'corrugated_plate';
......
[Settings]
MemoLogLevel=4
FileLogLevel=5
LogFileNum=71
LogFileNum=79
webClientVersion=1.0.0
[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