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