Commit 601d01e1 by cam

Fixed width of the boxes on the order entry form

parent d479324a
......@@ -239,13 +239,14 @@ object FOrderEntry: TFOrderEntry
object edtCompanyName: TWebDBEdit
Left = 24
Top = 92
Width = 121
Width = 260
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtcompanyname'
HeightPercent = 100.000000000000000000
MaxLength = 90
WidthStyle = ssAuto
WidthPercent = 100.000000000000000000
DataField = 'NAME'
DataSource = WebDataSource1
......@@ -327,19 +328,6 @@ object FOrderEntry: TFOrderEntry
DataField = 'staff_fields_invoice_to'
DataSource = WebDataSource1
end
object edtShipTo: TWebDBEdit
Left = 26
Top = 430
Width = 121
Height = 22
AutoSize = True
ChildOrder = 79
ElementID = 'edtshipto'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'staff_fields_ship_to'
DataSource = WebDataSource1
end
object edtPONumber: TWebDBEdit
Left = 26
Top = 458
......@@ -965,6 +953,20 @@ object FOrderEntry: TFOrderEntry
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebDBComboBox1: TWebDBComboBox
Left = 26
Top = 430
Width = 145
Height = 22
ElementID = 'wcbshipto'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
ItemIndex = -1
DataField = 'staff_fields_ship_to'
DataSource = WebDataSource1
ListField = 'ADDRESS'
ListSource = wdsShipTo
end
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Left = 244
......@@ -1247,10 +1249,25 @@ object FOrderEntry: TFOrderEntry
object XDataWebDataSet1staff_fields_mount_due: TStringField
FieldName = 'staff_fields_mount_due'
end
object XDataWebDataSet1ADDRESS_LIST: TStringField
FieldName = 'ADDRESS_LIST'
end
end
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
Left = 216
Top = 104
end
object wdsShipTo: TWebDataSource
DataSet = xdwdsShipTo
Left = 212
Top = 436
end
object xdwdsShipTo: TXDataWebDataSet
Left = 192
Top = 486
object xdwdsShipToADDRESS: TStringField
FieldName = 'ADDRESS'
end
end
end
......@@ -38,7 +38,6 @@ type
edtQuantity: TWebDBEdit;
edtPrice: TWebDBEdit;
edtInvoiceTo: TWebDBEdit;
edtShipTo: TWebDBEdit;
edtPONumber: TWebDBEdit;
edtJobName: TWebDBEdit;
edtQuickBooksItem: TWebDBEdit;
......@@ -182,6 +181,11 @@ type
cbStickyBak: TWebCheckBox;
cbLoose: TWebCheckBox;
cbExcaliburDie: TWebCheckBox;
XDataWebDataSet1ADDRESS_LIST: TStringField;
wdsShipTo: TWebDataSource;
xdwdsShipTo: TXDataWebDataSet;
xdwdsShipToADDRESS: TStringField;
WebDBComboBox1: TWebDBComboBox;
procedure WebFormCreate(Sender: TObject);
procedure HideNotification();
procedure ShowNotification(Notification: string);
......@@ -518,15 +522,30 @@ procedure TFOrderEntry.getCustomer(customerID: string);
var
xdcResponse: TXDataClientResponse;
customer : TJSObject;
address: string;
begin
xdcResponse := await(XDataWebClient1.RawInvokeAsync('ILookupService.GetCustomer',
[customerID]));
customer := TJSObject(xdcResponse.Result);
XDataWebDataSet1.Close;
XDataWebDataSet1.SetJsonData(customer);
XDataWebDataSet1.Open;
xdwdsShipTo.Close;
xdwdsShipTo.SetJSONData(customer['ADDRESS_LIST']);
xdwdsShipTo.Open;
console.log(xdwdsShipToADDRESS.AsString);
console.log(customer['ADDRESS_LIST']);
end;
procedure TFOrderEntry.WebFormShow(Sender: TObject);
begin
getOrder(orderID);
if mode <> 'ADD' then
getOrder(orderID)
else
getCustomer(customerID);
console.log(customerID);
//getCustomer(customerID);
HideNotification();
end;
......
......@@ -190,7 +190,8 @@ begin
newform.ShowModal(
procedure(AValue: TModalResult)
begin
orderEntry('', newForm.edtID.Text, 'ADD');
if newForm.edtID.Text <> '' then
orderEntry('', newForm.edtID.Text, 'ADD');
end
);
end;
......
......@@ -7,7 +7,12 @@
background-color: #fff;
}
input[type="text"] {
min-width: 50px;
max-width: 100%;
width: auto;
padding-left: 5px;
}
.card-header {
width: 100%;
......
......@@ -84,12 +84,18 @@ type
data: TList<TOrderItem>;
end;
TAddressItem = class
Public
ADDRESS: string;
end;
TCustomerItem = class
Public
NAME: string;
ID: integer;
SHORT_NAME: string;
ADDRESS: string;
staff_fields_invoice_to: string;
ADDRESS_LIST: TList<TAddressItem>;
end;
TCustomerList = class
......@@ -202,7 +208,7 @@ type
[HttpGet] function GetOrders(searchOptions: string): TOrderList;
[HttpGet] function GetOrder(orderInfo: string): TFullOrder;
[HttpGet] function GetCustomers(): TCustomerList;
//[HttpGet] function GetCustomer(): TFullCustomer;
[HttpGet] function GetCustomer(ID: string): TCustomerItem;
function AddUser(userInfo: string): string;
function AddItem(itemInfo: string): string;
......
......@@ -26,6 +26,7 @@ type
function GetOrders(searchOptions: string): TOrderList;
function GetOrder(orderInfo: string): TFullOrder;
function GetCustomers(): TCustomerList;
function GetCustomer(ID: string): TCustomerItem;
function EditUser(const editOptions: string): string;
function Search(phoneNum: string): TOrderList;
function AddUser(userInfo: string): string;
......@@ -80,7 +81,7 @@ begin
customer.NAME := ordersDB.UniQuery1.FieldByName('NAME').AsString;
customer.ID := ordersDB.UniQuery1.FieldByName('CUSTOMER_ID').AsInteger;
customer.SHORT_NAME := ordersDB.UniQuery1.FieldByName('SHORT_NAME').AsString;
customer.ADDRESS := ordersDB.UniQuery1.FieldByName('BILL_ADDRESS').AsString +
customer.staff_fields_invoice_to := ordersDB.UniQuery1.FieldByName('BILL_ADDRESS').AsString +
', ' + ordersDB.UniQuery1.FieldByName('BILL_CITY').AsString +
' ' + ordersDB.UniQuery1.FieldByName('BILL_ZIP').AsString;
result.data.Add(customer);
......@@ -90,6 +91,35 @@ begin
ordersDB.UniQuery1.Close;
end;
function TLookupService.GetCustomer(ID: string): TCustomerItem;
var
SQL: string;
ADDRESS: TAddressItem;
begin
SQL := 'SELECT c.NAME, c.SHORT_NAME, c.BILL_ADDRESS_BLOCK, s.ship_block FROM customers c JOIN customers_ship s ON c.CUSTOMER_ID = s.customer_id WHERE c.CUSTOMER_ID = ' + ID;
doQuery(ordersDB.UniQuery1, SQL);
result := TCustomerItem.Create;
result.ADDRESS_LIST := TList<TAddressItem>.Create;
TXDataOperationContext.Current.Handler.ManagedObjects.Add( Result.ADDRESS_LIST );
result.NAME := ordersDB.UniQuery1.FieldByName('NAME').AsString;
result.ID := StrToInt(ID);
result.SHORT_NAME := ordersDB.UniQuery1.FieldByName('SHORT_NAME').AsString;
result.staff_fields_invoice_to := ordersDB.UniQuery1.FieldByName('BILL_ADDRESS_BLOCK').AsString;
while not ordersDB.UniQuery1.Eof do
begin
ADDRESS := TAddressItem.Create;
TXDataOperationContext.Current.Handler.ManagedObjects.Add( ADDRESS );
ADDRESS.ADDRESS := ordersDB.UniQuery1.FieldByName('ship_block').AsString;
result.ADDRESS_LIST.Add(ADDRESS);
ordersDB.UniQuery1.Next;
end;
ordersDB.UniQuery1.Close;
end;
function TLookupService.Search(phoneNum: string): TOrderList;
// Searchs the database for a specific from phone number then returns a list of
// calls from said number
......
[Options]
LogFileNum=225
LogFileNum=230
UpdateTimerLength=0
......
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