Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
KGOrders
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cam Hayes
KGOrders
Commits
4ee28e36
Commit
4ee28e36
authored
Jul 24, 2025
by
emsys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished the cutting die page
parent
344aa169
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
383 additions
and
103 deletions
+383
-103
AddCustomer.html
kgOrdersClient/AddCustomer.html
+1
-1
Utils.pas
kgOrdersClient/Utils.pas
+7
-0
View.Main.dfm
kgOrdersClient/View.Main.dfm
+0
-14
View.Main.html
kgOrdersClient/View.Main.html
+0
-3
View.Main.pas
kgOrdersClient/View.Main.pas
+0
-1
View.OrderEntryCuttingDie.dfm
kgOrdersClient/View.OrderEntryCuttingDie.dfm
+26
-2
View.OrderEntryCuttingDie.html
kgOrdersClient/View.OrderEntryCuttingDie.html
+28
-8
View.OrderEntryCuttingDie.pas
kgOrdersClient/View.OrderEntryCuttingDie.pas
+195
-15
View.Orders.dfm
kgOrdersClient/View.Orders.dfm
+11
-4
View.Orders.pas
kgOrdersClient/View.Orders.pas
+2
-1
webKGOrders.dproj
kgOrdersClient/webKGOrders.dproj
+1
-1
Lookup.Service.pas
kgOrdersServer/Source/Lookup.Service.pas
+2
-17
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+0
-0
qbAPI.pas
kgOrdersServer/Source/qbAPI.pas
+35
-30
rOrderCorrugated.pas
kgOrdersServer/Source/rOrderCorrugated.pas
+1
-1
rOrderCutting.dfm
kgOrdersServer/Source/rOrderCutting.dfm
+69
-0
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+5
-5
No files found.
kgOrdersClient/AddCustomer.html
View file @
4ee28e36
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<input
id=
"edtcompanyid"
class=
"form-control input-sm"
style=
"width: 100px"
required
/>
<input
id=
"edtcompanyid"
class=
"form-control input-sm"
style=
"width: 100px"
required
/>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Q
uickbooks
ID:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Q
B
ID:
</label>
<input
id=
"edtqbid"
class=
"form-control input-sm"
style=
"width: 200px"
required
/>
<input
id=
"edtqbid"
class=
"form-control input-sm"
style=
"width: 200px"
required
/>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
...
...
kgOrdersClient/Utils.pas
View file @
4ee28e36
...
@@ -135,6 +135,13 @@ end;
...
@@ -135,6 +135,13 @@ end;
// if confirmed then DeleteOrder();
// if confirmed then DeleteOrder();
// end);
// end);
// function ShowConfirmationModal(msg, leftLabel, rightLabel: string;): Boolean;
// if ShowConfirmationModal then
// doThing()
// else
// doOtherThing();
procedure
ShowConfirmationModal
(
msg
,
leftLabel
,
rightLabel
:
string
;
ConfirmProc
:
TProc
<
Boolean
>);
procedure
ShowConfirmationModal
(
msg
,
leftLabel
,
rightLabel
:
string
;
ConfirmProc
:
TProc
<
Boolean
>);
begin
begin
...
...
kgOrdersClient/View.Main.dfm
View file @
4ee28e36
...
@@ -119,20 +119,6 @@ object FViewMain: TFViewMain
...
@@ -119,20 +119,6 @@ object FViewMain: TFViewMain
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblCustomersClick
OnClick = lblCustomersClick
end
end
object lblQuickbooks: TWebLabel
Left = 546
Top = 125
Width = 57
Height = 14
Caption = 'QuickBooks'
ElementID = 'lblquickbooks'
ElementFont = efCSS
ElementPosition = epRelative
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblQuickbooksClick
end
object lblVersion: TWebLabel
object lblVersion: TWebLabel
Left = 358
Left = 358
Top = 209
Top = 209
...
...
kgOrdersClient/View.Main.html
View file @
4ee28e36
...
@@ -15,9 +15,6 @@
...
@@ -15,9 +15,6 @@
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"dropdown-item"
id=
"dropdown.menu.itemlist"
href=
"#"
><i
class=
"fa fa-cubes fa-fw"
></i><span>
Items
</span></a>
<a
class=
"dropdown-item"
id=
"dropdown.menu.itemlist"
href=
"#"
><i
class=
"fa fa-cubes fa-fw"
></i><span>
Items
</span></a>
</li>
</li>
<li
class=
"nav-item"
>
<a
class=
"dropdown-item"
id=
"lblquickbooks"
href=
"#"
><i
class=
"fa fa-tags fa-fw"
></i><span>
QuickBooks
</span></a>
</li>
</ul>
</ul>
<div
class=
"collapse navbar-collapse show"
id=
"navbarNavDropdown"
>
<div
class=
"collapse navbar-collapse show"
id=
"navbarNavDropdown"
>
<ul
class=
"navbar-nav ms-auto"
>
<ul
class=
"navbar-nav ms-auto"
>
...
...
kgOrdersClient/View.Main.pas
View file @
4ee28e36
...
@@ -23,7 +23,6 @@ type
...
@@ -23,7 +23,6 @@ type
lblUsers
:
TWebLinkLabel
;
lblUsers
:
TWebLinkLabel
;
lblorders
:
TWebLabel
;
lblorders
:
TWebLabel
;
lblCustomers
:
TWebLabel
;
lblCustomers
:
TWebLabel
;
lblQuickbooks
:
TWebLabel
;
lblVersion
:
TWebLabel
;
lblVersion
:
TWebLabel
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
mnuLogoutClick
(
Sender
:
TObject
);
procedure
mnuLogoutClick
(
Sender
:
TObject
);
...
...
kgOrdersClient/View.OrderEntryCuttingDie.dfm
View file @
4ee28e36
...
@@ -62,6 +62,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -62,6 +62,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
AutoSize = True
AutoSize = True
ChildOrder = 79
ChildOrder = 79
ElementID = 'edtqbordernum'
ElementID = 'edtqbordernum'
Enabled = False
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'QB_ORDER_NUM'
DataField = 'QB_ORDER_NUM'
...
@@ -148,7 +149,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -148,7 +149,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
end
end
object edtJobName: TWebDBEdit
object edtJobName: TWebDBEdit
Left = 26
Left = 26
Top =
48
6
Top =
51
6
Width = 121
Width = 121
Height = 23
Height = 23
AutoSize = True
AutoSize = True
...
@@ -156,6 +157,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -156,6 +157,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
ElementID = 'edtjobname'
ElementID = 'edtjobname'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnExit = edtJobNameExit
DataField = 'staff_fields_job_name'
DataField = 'staff_fields_job_name'
DataSource = wdsOrder
DataSource = wdsOrder
end
end
...
@@ -210,12 +212,13 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -210,12 +212,13 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
end
end
object wcbQBItem: TWebDBComboBox
object wcbQBItem: TWebDBComboBox
Left = 26
Left = 26
Top =
515
Top =
487
Width = 145
Width = 145
Height = 23
Height = 23
ElementID = 'wcbqbitem'
ElementID = 'wcbqbitem'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnChange = wcbQBItemChange
ItemIndex = -1
ItemIndex = -1
DataField = 'staff_fields_quickbooks_item'
DataField = 'staff_fields_quickbooks_item'
DataSource = wdsOrder
DataSource = wdsOrder
...
@@ -314,6 +317,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -314,6 +317,7 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
Caption = 'In Quickbooks?'
Caption = 'In Quickbooks?'
ChildOrder = 29
ChildOrder = 29
ElementID = 'wdbcbinqb'
ElementID = 'wdbcbinqb'
Enabled = False
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'IN_QB'
DataField = 'IN_QB'
...
@@ -391,6 +395,17 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -391,6 +395,17 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
DataField = 'staff_fields_ship_date'
DataField = 'staff_fields_ship_date'
DataSource = wdsOrder
DataSource = wdsOrder
end
end
object edtQBItemDescription: TWebEdit
Left = 26
Top = 548
Width = 121
Height = 22
ChildOrder = 31
ElementID = 'edtitemdescription'
Enabled = False
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object wdsOrder: TWebDataSource
object wdsOrder: TWebDataSource
AutoEdit = False
AutoEdit = False
DataSet = xdwdsOrder
DataSet = xdwdsOrder
...
@@ -471,6 +486,9 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -471,6 +486,9 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
object xdwdsOrderIN_QB: TStringField
object xdwdsOrderIN_QB: TStringField
FieldName = 'IN_QB'
FieldName = 'IN_QB'
end
end
object xdwdsOrderQB_LIST_ID: TStringField
FieldName = 'QB_LIST_ID'
end
end
end
object XDataWebClient1: TXDataWebClient
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Connection = DMConnection.ApiConnection
...
@@ -500,6 +518,12 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
...
@@ -500,6 +518,12 @@ object FOrderEntryCuttingDie: TFOrderEntryCuttingDie
object xdwdsQBItemname: TStringField
object xdwdsQBItemname: TStringField
FieldName = 'name'
FieldName = 'name'
end
end
object xdwdsQBItemQB_ID: TStringField
FieldName = 'QB_ID'
end
object xdwdsQBItemdescription: TStringField
FieldName = 'description'
end
end
end
object tmrReturn: TWebTimer
object tmrReturn: TWebTimer
Enabled = False
Enabled = False
...
...
kgOrdersClient/View.OrderEntryCuttingDie.html
View file @
4ee28e36
...
@@ -61,11 +61,11 @@
...
@@ -61,11 +61,11 @@
</div>
</div>
</div>
</div>
<div
class=
"col-auto d-flex flex-column"
>
<div
class=
"col-auto d-flex flex-column"
>
<label
for=
"wdbcbinqb"
class=
"form-label mt-2"
style=
"font-weight: 700; font-size: 15px;"
>
In Q
uickbooks
?:
</label>
<label
for=
"wdbcbinqb"
class=
"form-label mt-2"
style=
"font-weight: 700; font-size: 15px;"
>
In Q
B
?:
</label>
<input
id=
"wdbcbinqb"
type=
"checkbox"
class=
"form-check-input mt-1"
>
<input
id=
"wdbcbinqb"
type=
"checkbox"
class=
"form-check-input mt-1"
>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Q
uickbooks
Order Number:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Q
B
Order Number:
</label>
<input
id=
"edtqbordernum"
type=
"text"
class=
"form-control"
style=
"width: 150px"
required
/>
<input
id=
"edtqbordernum"
type=
"text"
class=
"form-control"
style=
"width: 150px"
required
/>
</div>
</div>
</div>
</div>
...
@@ -97,11 +97,17 @@
...
@@ -97,11 +97,17 @@
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Quantity:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Quantity:
</label>
<input
id=
"edtquantity"
class=
"form-control input-sm"
style=
"width: 100px"
/>
<input
id=
"edtquantity"
class=
"form-control input-sm"
style=
"width: 100px"
type=
"number"
min=
"1"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
required
>
Please Provide a Quantity.
</div>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Price:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Price:
</label>
<input
id=
"edtprice"
class=
"form-control input-sm"
style=
"width: 100px"
type=
"number"
min=
"0"
/>
<input
id=
"edtprice"
class=
"form-control input-sm"
style=
"width: 100px"
type=
"number"
min=
"1"
required
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a Price.
</div>
</div>
</div>
<div>
<div>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Invoice To:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Invoice To:
</label>
...
@@ -125,12 +131,26 @@
...
@@ -125,12 +131,26 @@
<input
id=
"edtponumber"
class=
"form-control input-sm"
width=
'50%'
/>
<input
id=
"edtponumber"
class=
"form-control input-sm"
width=
'50%'
/>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Job Name:
</label>
<label
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
QB Item:
</label>
<input
id=
"edtjobname"
class=
"form-control input-sm"
style=
"width: 300px"
/>
<select
id=
"wcbqbitem"
class=
'form-select'
required
></select>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a QB Item.
</div>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
QuickBooks Item:
</label>
<label
for=
"wdbe_first_name"
style=
"font-weight: 700; font-size: 15px;"
class=
"form-label mt-2"
>
Job Name:
</label>
<select
id=
"wcbqbitem"
class=
'form-select'
></select>
<input
id=
"edtjobname"
class=
"form-control input-sm"
style=
"width: 600px"
/>
<div
class=
"invalid-feedback"
style=
"font-size: 15px;"
>
Please Provide a Job Name.
</div>
</div>
<div
class=
"row"
>
<div
class=
"col-12"
>
<label
for=
"edtitemdescription"
class=
"form-label mt-2"
style=
"font-weight: 700; font-size: 15px;"
>
Item Description:
</label>
<input
id=
"edtitemdescription"
class=
"form-control"
style=
"width: 100%;"
/>
</div>
</div>
</div>
</div>
</div>
<h4
class=
"custom-h4 mt-3"
>
General
</h4>
<h4
class=
"custom-h4 mt-3"
>
General
</h4>
...
...
kgOrdersClient/View.OrderEntryCuttingDie.pas
View file @
4ee28e36
...
@@ -75,6 +75,10 @@ type
...
@@ -75,6 +75,10 @@ type
dtpOrderDate
:
TWebDBDateTimePicker
;
dtpOrderDate
:
TWebDBDateTimePicker
;
dtpProofDate
:
TWebDBDateTimePicker
;
dtpProofDate
:
TWebDBDateTimePicker
;
dtpShipDate
:
TWebDBDateTimePicker
;
dtpShipDate
:
TWebDBDateTimePicker
;
xdwdsQBItemQB_ID
:
TStringField
;
xdwdsOrderQB_LIST_ID
:
TStringField
;
xdwdsQBItemdescription
:
TStringField
;
edtQBItemDescription
:
TWebEdit
;
procedure
btnSaveClick
(
Sender
:
TObject
);
procedure
btnSaveClick
(
Sender
:
TObject
);
procedure
btnCancelClick
(
Sender
:
TObject
);
procedure
btnCancelClick
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
...
@@ -98,12 +102,17 @@ type
...
@@ -98,12 +102,17 @@ type
[
async
]
procedure
SendAddressToServer
(
AddressJSON
:
TJSONObject
);
[
async
]
procedure
SendAddressToServer
(
AddressJSON
:
TJSONObject
);
procedure
btnQBClick
(
Sender
:
TObject
);
procedure
btnQBClick
(
Sender
:
TObject
);
procedure
xdwdsOrderCalcFields
(
DataSet
:
TDataSet
);
procedure
xdwdsOrderCalcFields
(
DataSet
:
TDataSet
);
[
async
]
procedure
AddEstimate
(
orderID
:
string
);
function
VerifyQBOrder
():
boolean
;
procedure
wcbQBItemChange
(
Sender
:
TObject
);
procedure
edtJobNameExit
(
Sender
:
TObject
);
private
private
FAgencyCode
:
string
;
FAgencyCode
:
string
;
FCurrentReportType
:
string
;
FCurrentReportType
:
string
;
FSelectProc
:
TSelectProc
;
FSelectProc
:
TSelectProc
;
orderID
:
string
;
orderID
:
string
;
customerID
:
string
;
customerID
:
string
;
customer_qb_id
:
string
;
mode
:
string
;
mode
:
string
;
notification
:
string
;
notification
:
string
;
procedure
EditMode
;
procedure
EditMode
;
...
@@ -159,10 +168,46 @@ begin
...
@@ -159,10 +168,46 @@ begin
ShowToast
(
notification
);
ShowToast
(
notification
);
end
;
end
;
procedure
TFOrderEntryCuttingDie
.
AddEstimate
(
orderID
:
string
);
var
Response
:
TXDataClientResponse
;
notification
:
TJSObject
;
msg
:
string
;
begin
try
Response
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.AddEstimate'
,
[
orderID
]));
notification
:=
TJSObject
(
Response
.
Result
);
msg
:=
string
(
notification
[
'status'
]);
Utils
.
HideSpinner
(
'spinner'
);
getCuttingDieOrder
(
orderID
);
ShowToast
(
msg
);
except
on
E
:
EXDataClientRequestException
do
Utils
.
ShowErrorModal
(
E
.
ErrorResult
.
ErrorMessage
);
end
;
end
;
procedure
TFOrderEntryCuttingDie
.
btnQBClick
(
Sender
:
TObject
);
procedure
TFOrderEntryCuttingDie
.
btnQBClick
(
Sender
:
TObject
);
begin
begin
ShowToast
(
'Sending Orders To QuickBooks is not yet Implemented'
,
'info'
);
//ShowToast('Sending Orders To QuickBooks is not yet Implemented', 'info');
console
.
log
(
customer_qb_id
);
if
JS
.
toString
(
AuthService
.
TokenPayload
.
Properties
[
'user_qb_id'
])
<>
''
then
begin
if
(
VerifyQBOrder
()
)
then
begin
if
wdbcbINQB
.
Checked
=
false
then
begin
Utils
.
ShowSpinner
(
'spinner'
);
addEstimate
(
xdwdsOrder
.
FieldByName
(
'ORDER_ID'
).
AsString
);
end
else
ShowToast
(
'Failure:Cannot submit orders already in QuickBooks'
,
'failure'
);
end
;
end
else
ShowToast
(
'Failure:User not authorized to add to QuickBooks'
,
'failure'
);
end
;
end
;
procedure
TFOrderEntryCuttingDie
.
WebButton2Click
(
Sender
:
TObject
);
procedure
TFOrderEntryCuttingDie
.
WebButton2Click
(
Sender
:
TObject
);
...
@@ -178,7 +223,6 @@ var
...
@@ -178,7 +223,6 @@ var
begin
begin
Response
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.AddShippingAddress'
,
Response
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.AddShippingAddress'
,
[
AddressJSON
.
ToString
]));
[
AddressJSON
.
ToString
]));
notification
:=
TJSObject
(
Response
.
Result
);
notification
:=
TJSObject
(
Response
.
Result
);
ShowToast
(
string
(
notification
[
'status'
]));
ShowToast
(
string
(
notification
[
'status'
]));
xdwdsShipTo
.
Close
;
xdwdsShipTo
.
Close
;
...
@@ -250,6 +294,15 @@ begin
...
@@ -250,6 +294,15 @@ begin
else
else
input
.
classList
.
remove
(
'is-invalid'
);
input
.
classList
.
remove
(
'is-invalid'
);
input
:=
TJSHTMLInputElement
(
document
.
getElementById
(
'edtjobname'
));
if
edtJobName
.
Text
=
''
then
begin
input
.
classList
.
add
(
'is-invalid'
);
result
:=
false
;
end
else
input
.
classList
.
remove
(
'is-invalid'
);
input
:=
TJSHTMLInputElement
(
document
.
getElementById
(
'edtaccountcompanyname'
));
input
:=
TJSHTMLInputElement
(
document
.
getElementById
(
'edtaccountcompanyname'
));
if
edtCompanyAccountName
.
Text
=
''
then
if
edtCompanyAccountName
.
Text
=
''
then
...
@@ -288,6 +341,36 @@ begin
...
@@ -288,6 +341,36 @@ begin
end
end
else
else
input
.
classList
.
remove
(
'is-invalid'
);
input
.
classList
.
remove
(
'is-invalid'
);
input
:=
TJSHTMLInputElement
(
document
.
getElementById
(
'edtprice'
));
if
edtPrice
.
Text
=
''
then
begin
input
.
classList
.
add
(
'is-invalid'
);
result
:=
false
;
end
else
input
.
classList
.
remove
(
'is-invalid'
);
input
:=
TJSHTMLInputElement
(
document
.
getElementById
(
'edtquantity'
));
if
edtQuantity
.
Text
=
''
then
begin
input
.
classList
.
add
(
'is-invalid'
);
result
:=
false
;
end
else
input
.
classList
.
remove
(
'is-invalid'
);
input
:=
TJSHTMLInputElement
(
document
.
getElementById
(
'wcbqbitem'
));
if
wcbQBItem
.
Text
=
''
then
begin
input
.
classList
.
add
(
'is-invalid'
);
result
:=
false
;
end
else
input
.
classList
.
remove
(
'is-invalid'
);
end
;
end
;
...
@@ -303,11 +386,6 @@ begin
...
@@ -303,11 +386,6 @@ begin
orderJSON
:=
TJSONObject
.
Create
;
orderJSON
:=
TJSONObject
.
Create
;
xdwdsOrder
.
Edit
;
xdwdsOrder
.
Edit
;
//Convert all dates to strings because I was having less issues with that data type.
{xdwdsOrderstaff_fields_proof_date.Value := DateTimeToStr(dtpProofDate.Date);
xdwdsOrderstaff_fields_ship_date.Value := DateTimeToStr(dtpShipDate.Date);
xdwdsOrderstaff_fields_order_date.Value := DateTimeToStr(dtpOrderDate.Date);}
xdwdsOrder
.
Post
;
xdwdsOrder
.
Post
;
xdwdsOrder
.
First
;
xdwdsOrder
.
First
;
while
not
xdwdsOrder
.
Eof
do
while
not
xdwdsOrder
.
Eof
do
...
@@ -335,7 +413,7 @@ begin
...
@@ -335,7 +413,7 @@ begin
end
;
end
;
orderJSON
.
AddPair
(
'mode'
,
mode
);
orderJSON
.
AddPair
(
'mode'
,
mode
);
console
.
log
(
orderJSON
);
AddCuttingDieOrder
(
orderJSON
);
AddCuttingDieOrder
(
orderJSON
);
end
;
end
;
...
@@ -416,7 +494,7 @@ var
...
@@ -416,7 +494,7 @@ var
begin
begin
try
try
// Call the server method to generate the PDF
// Call the server method to generate the PDF
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.GenerateOrderCuttingPDF'
,
[
orderID
]));
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.GenerateOrderCuttingPDF'
,
[
xdwdsOrder
.
FieldByName
(
'ORDER_ID'
).
AsString
]));
jsObject
:=
JS
.
TJSObject
(
xdcResponse
.
Result
);
jsObject
:=
JS
.
TJSObject
(
xdcResponse
.
Result
);
pdfURL
:=
JS
.
toString
(
jsObject
.
Properties
[
'value'
]);
pdfURL
:=
JS
.
toString
(
jsObject
.
Properties
[
'value'
]);
...
@@ -447,7 +525,7 @@ begin
...
@@ -447,7 +525,7 @@ begin
xdwdsOrder
.
SetJsonData
(
jsObj
);
xdwdsOrder
.
SetJsonData
(
jsObj
);
xdwdsOrder
.
Open
;
xdwdsOrder
.
Open
;
edtOrderNum
.
Text
:=
OrderID
;
edtOrderNum
.
Text
:=
xdwdsOrder
.
FieldByName
(
'ORDER_ID'
).
AsString
;
mode
:=
'EDIT'
;
mode
:=
'EDIT'
;
ShowToast
(
String
(
jsObj
.
Properties
[
'status'
]));
ShowToast
(
String
(
jsObj
.
Properties
[
'status'
]));
except
except
...
@@ -542,7 +620,7 @@ var
...
@@ -542,7 +620,7 @@ var
orderList
:
TJSObject
;
orderList
:
TJSObject
;
i
:
integer
;
i
:
integer
;
data
:
TJSArray
;
data
:
TJSArray
;
order
,
items
:
TJSObject
;
order
,
items
,
customer
:
TJSObject
;
begin
begin
Utils
.
ShowSpinner
(
'spinner'
);
Utils
.
ShowSpinner
(
'spinner'
);
try
try
...
@@ -555,16 +633,27 @@ begin
...
@@ -555,16 +633,27 @@ begin
xdwdsOrder
.
SetJsonData
(
order
);
xdwdsOrder
.
SetJsonData
(
order
);
xdwdsOrder
.
Open
;
xdwdsOrder
.
Open
;
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.GetCustomer'
,
[
xdwdsOrder
.
FieldByName
(
'COMPANY_ID'
).
AsString
]));
customer
:=
TJSObject
(
xdcResponse
.
Result
);
xdwdsShipTo
.
Close
;
xdwdsShipTo
.
Close
;
xdwdsShipTo
.
SetJSONData
(
order
[
'
ADDRESS_LIST'
]);
xdwdsShipTo
.
SetJSONData
(
customer
[
'SHIPPING_
ADDRESS_LIST'
]);
xdwdsShipTo
.
Open
;
xdwdsShipTo
.
Open
;
customer_qb_id
:=
string
(
customer
[
'QB_LIST_ID'
]);
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.GetItems'
,
[]));
items
:=
TJSObject
(
xdcResponse
.
Result
);
xdwdsQBItem
.
Close
;
xdwdsQBItem
.
Close
;
items
:=
TJSObject
(
order
[
'ITEMS'
]);
xdwdsQBItem
.
SetJsonData
(
items
[
'data'
]);
xdwdsQBItem
.
SetJsonData
(
items
[
'data'
]);
xdwdsQBITEM
.
Open
;
xdwdsQBITEM
.
Open
;
edtQBItemDescription
.
text
:=
xdwdsQBItem
.
FieldByName
(
'description'
).
AsString
+
' - '
+
xdwdsOrder
.
FieldByName
(
'staff_fields_job_name'
).
AsString
;
except
except
on
E
:
EXDataClientRequestException
do
on
E
:
EXDataClientRequestException
do
Utils
.
ShowErrorModal
(
E
.
ErrorResult
.
ErrorMessage
);
Utils
.
ShowErrorModal
(
E
.
ErrorResult
.
ErrorMessage
);
...
@@ -585,7 +674,7 @@ begin
...
@@ -585,7 +674,7 @@ begin
[
customerID
]));
[
customerID
]));
customer
:=
TJSObject
(
xdcResponse
.
Result
);
customer
:=
TJSObject
(
xdcResponse
.
Result
);
customer_qb_id
:=
string
(
customer
[
'QB_LIST_ID'
]);
xdwdsOrder
.
Close
;
xdwdsOrder
.
Close
;
xdwdsOrder
.
Open
;
xdwdsOrder
.
Open
;
...
@@ -603,7 +692,7 @@ begin
...
@@ -603,7 +692,7 @@ begin
xdwdsShipTo
.
Open
;
xdwdsShipTo
.
Open
;
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.GetItems'
,
xdcResponse
:=
await
(
XDataWebClient1
.
RawInvokeAsync
(
'ILookupService.GetItems'
,
[
customerID
]));
[]));
items
:=
TJSObject
(
xdcResponse
.
Result
);
items
:=
TJSObject
(
xdcResponse
.
Result
);
xdwdsQBItem
.
Close
;
xdwdsQBItem
.
Close
;
...
@@ -640,6 +729,12 @@ begin
...
@@ -640,6 +729,12 @@ begin
end
;
end
;
procedure
TFOrderEntryCuttingDie
.
edtJobNameExit
(
Sender
:
TObject
);
begin
edtQBItemDescription
.
text
:=
xdwdsQBItem
.
FieldByName
(
'description'
).
AsString
+
' - '
+
xdwdsOrder
.
FieldByName
(
'staff_fields_job_name'
).
AsString
;
end
;
procedure
TFOrderEntryCuttingDie
.
ViewMode
;
procedure
TFOrderEntryCuttingDie
.
ViewMode
;
begin
begin
btnPDF
.
Enabled
:=
true
;
btnPDF
.
Enabled
:=
true
;
...
@@ -658,6 +753,91 @@ begin
...
@@ -658,6 +753,91 @@ begin
lblFormState
.
ElementHandle
.
classList
.
add
(
'text-danger'
);
lblFormState
.
ElementHandle
.
classList
.
add
(
'text-danger'
);
end
;
end
;
procedure
TFOrderEntryCuttingDie
.
wcbQBItemChange
(
Sender
:
TObject
);
begin
edtQBItemDescription
.
text
:=
xdwdsQBItem
.
FieldByName
(
'description'
).
AsString
+
' - '
+
xdwdsOrder
.
FieldByName
(
'staff_fields_job_name'
).
AsString
;
end
;
function
TFOrderEntryCuttingDie
.
VerifyQBOrder
:
Boolean
;
var
msg
,
SQL
:
string
;
begin
Result
:=
True
;
msg
:=
'To add an order to QuickBooks, the following must be present:'
+
sLineBreak
;
if
edtCompanyName
.
Text
=
''
then
begin
msg
:=
msg
+
'- Company Name cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
edtCompanyAccountName
.
Text
=
''
then
begin
msg
:=
msg
+
'- Company ID cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
edtInvoiceTo
.
Text
=
''
then
begin
msg
:=
msg
+
'- Invoice To cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
wdbcbShipTo
.
Text
=
''
then
begin
msg
:=
msg
+
'- Ship To cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
dtpOrderDate
.
Date
=
0
then
begin
msg
:=
msg
+
'- Order Date cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
edtPrice
.
Text
=
''
then
begin
msg
:=
msg
+
'- Price cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
edtQuantity
.
Text
=
''
then
begin
msg
:=
msg
+
'- Quantity cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
wcbQBItem
.
Text
=
''
then
begin
msg
:=
msg
+
'- Item cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
if
edtJobName
.
Text
=
''
then
begin
msg
:=
msg
+
'- Job Name Cannot be empty'
+
sLineBreak
;
Result
:=
False
;
end
;
xdwdsQBItem
.
Locate
(
'name'
,
xdwdsOrder
.
FieldByName
(
'staff_fields_quickbooks_item'
).
AsString
,
[]);
if
xdwdsQBItem
.
FieldByName
(
'QB_ID'
).
AsString
=
''
then
begin
msg
:=
msg
+
'- Item Must be Linked to QuickBooks'
+
sLineBreak
;
Result
:=
False
;
end
;
if
customer_qb_id
=
''
then
begin
msg
:=
msg
+
'- Customer Must be Linked to QuickBooks'
+
sLineBreak
;
Result
:=
False
;
end
;
if
not
result
then
asm
alert
(
msg
);
end
;
end
;
initialization
initialization
RegisterClass
(
TFOrderEntryCuttingDie
);
RegisterClass
(
TFOrderEntryCuttingDie
);
...
...
kgOrdersClient/View.Orders.dfm
View file @
4ee28e36
...
@@ -128,6 +128,10 @@ object FViewOrders: TFViewOrders
...
@@ -128,6 +128,10 @@ object FViewOrders: TFViewOrders
Title = 'Order Num'
Title = 'Order Num'
end
end
item
item
DataField = 'IN_QB'
Title = 'In QB'
end
item
DataField = 'ID'
DataField = 'ID'
Title = 'Customer ID'
Title = 'Customer ID'
end
end
...
@@ -194,7 +198,7 @@ object FViewOrders: TFViewOrders
...
@@ -194,7 +198,7 @@ object FViewOrders: TFViewOrders
item
item
ElementClassName = 'text-nowrap'
ElementClassName = 'text-nowrap'
DataField = 'qbRefNum'
DataField = 'qbRefNum'
Title = 'QB
Ref
Num'
Title = 'QB
Order
Num'
TitleElementClassName = 'min-w-80'
TitleElementClassName = 'min-w-80'
end
end
item
item
...
@@ -369,12 +373,15 @@ object FViewOrders: TFViewOrders
...
@@ -369,12 +373,15 @@ object FViewOrders: TFViewOrders
object xdwdsOrdersprice: TStringField
object xdwdsOrdersprice: TStringField
FieldName = 'price'
FieldName = 'price'
end
end
object xdwdsOrdersqbRefNum: TStringField
FieldName = 'qbRefNum'
end
object xdwdsOrderscolors: TStringField
object xdwdsOrderscolors: TStringField
FieldName = 'colors'
FieldName = 'colors'
end
end
object xdwdsOrdersIN_QB: TStringField
FieldName = 'IN_QB'
end
object xdwdsOrdersqbRefNum: TStringField
FieldName = 'qbRefNum'
end
end
end
object wdsOrders: TWebDataSource
object wdsOrders: TWebDataSource
DataSet = xdwdsOrders
DataSet = xdwdsOrders
...
...
kgOrdersClient/View.Orders.pas
View file @
4ee28e36
...
@@ -35,7 +35,6 @@ type
...
@@ -35,7 +35,6 @@ type
xdwdsOrdersshipDone
:
TStringField
;
xdwdsOrdersshipDone
:
TStringField
;
xdwdsOrdersprice
:
TStringField
;
xdwdsOrdersprice
:
TStringField
;
xdwdsOrdersID
:
TStringField
;
xdwdsOrdersID
:
TStringField
;
xdwdsOrdersqbRefNum
:
TStringField
;
xdwdsOrderscolors
:
TStringField
;
xdwdsOrderscolors
:
TStringField
;
btnAddOrder
:
TWebButton
;
btnAddOrder
:
TWebButton
;
btnSearch
:
TWebButton
;
btnSearch
:
TWebButton
;
...
@@ -58,6 +57,8 @@ type
...
@@ -58,6 +57,8 @@ type
edtSearch
:
TWebEdit
;
edtSearch
:
TWebEdit
;
xdwdsOrdersDBID
:
TStringField
;
xdwdsOrdersDBID
:
TStringField
;
tmrReturn
:
TWebTimer
;
tmrReturn
:
TWebTimer
;
xdwdsOrdersIN_QB
:
TStringField
;
xdwdsOrdersqbRefNum
:
TStringField
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
btnAddOrderClick
(
Sender
:
TObject
);
procedure
btnAddOrderClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
...
...
kgOrdersClient/webKGOrders.dproj
View file @
4ee28e36
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<FrameworkType>VCL</FrameworkType>
<FrameworkType>VCL</FrameworkType>
<MainSource>webKGOrders.dpr</MainSource>
<MainSource>webKGOrders.dpr</MainSource>
<Base>True</Base>
<Base>True</Base>
<Config Condition="'$(Config)'==''">
Release
</Config>
<Config Condition="'$(Config)'==''">
Debug
</Config>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<Platform Condition="'$(Platform)'==''">Win32</Platform>
<TargetedPlatforms>1</TargetedPlatforms>
<TargetedPlatforms>1</TargetedPlatforms>
<AppType>Application</AppType>
<AppType>Application</AppType>
...
...
kgOrdersServer/Source/Lookup.Service.pas
View file @
4ee28e36
...
@@ -59,6 +59,7 @@ type
...
@@ -59,6 +59,7 @@ type
TOrderItem
=
class
TOrderItem
=
class
public
public
DBID
,
DBID
,
IN_QB
,
ID
,
ID
,
companyName
,
companyName
,
jobName
,
jobName
,
...
@@ -118,15 +119,6 @@ type
...
@@ -118,15 +119,6 @@ type
ship_id
:
string
;
ship_id
:
string
;
end
;
end
;
TOrderCustomerInfoItem
=
class
public
NAME
:
string
;
CUSTOMER_ID
:
integer
;
SHORT_NAME
:
string
;
staff_fields_invoice_to
:
string
;
SHIPPING_ADDRESS_LIST
:
TList
<
TAddressItem
>;
end
;
TCustomerItem
=
class
TCustomerItem
=
class
Public
Public
NAME
:
string
;
NAME
:
string
;
...
@@ -367,8 +359,6 @@ type
...
@@ -367,8 +359,6 @@ type
SHORT_NAME
:
string
;
SHORT_NAME
:
string
;
IN_QB
:
string
;
IN_QB
:
string
;
QB_ORDER_NUM
:
string
;
QB_ORDER_NUM
:
string
;
ADDRESS_LIST
:
TList
<
TAddressItem
>;
ITEMS
:
TItemList
;
// Staff Fields:
// Staff Fields:
staff_fields_order_date
:
string
;
staff_fields_order_date
:
string
;
...
@@ -387,12 +377,6 @@ type
...
@@ -387,12 +377,6 @@ type
general_special_instructions
:
string
;
general_special_instructions
:
string
;
end
;
end
;
TEmptyOrderInfo
=
class
public
CustomerInfo
:
TOrderCustomerInfoItem
;
ITEMS
:
TItemList
;
end
;
// These objects are only used for quickbooks estimates.
// These objects are only used for quickbooks estimates.
TRef
=
record
TRef
=
record
value
:
string
;
value
:
string
;
...
@@ -523,6 +507,7 @@ type
...
@@ -523,6 +507,7 @@ type
function
SetStatus
(
statusOptions
:
string
):
string
;
function
SetStatus
(
statusOptions
:
string
):
string
;
function
AddCustomer
(
customerInfo
:
string
):
TJSONObject
;
function
AddCustomer
(
customerInfo
:
string
):
TJSONObject
;
function
ImportQBCustomer
(
CustomerInfo
:
string
):
TJSONObject
;
function
ImportQBCustomer
(
CustomerInfo
:
string
):
TJSONObject
;
function
AddEstimate
(
orderInfo
:
string
):
TJSONObject
;
end
;
end
;
implementation
implementation
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
4ee28e36
This diff is collapsed.
Click to expand it.
kgOrdersServer/Source/qbAPI.pas
View file @
4ee28e36
...
@@ -162,9 +162,8 @@ type
...
@@ -162,9 +162,8 @@ type
procedure
addEstimate
(
orderInfo
:
string
);
procedure
addEstimate
(
orderInfo
:
string
);
procedure
getQBCustomers
();
procedure
getQBCustomers
();
procedure
ShowDeleteConfirm
(
msg
:
string
);
procedure
ShowDeleteConfirm
(
msg
:
string
);
procedure
ShowLinkConfirm
(
msg
:
string
);
procedure
DeleteCustomers
();
procedure
DeleteCustomers
();
procedure
LinkCustomer
s
();
procedure
LinkCustomer
();
end
;
end
;
var
var
...
@@ -221,37 +220,39 @@ begin
...
@@ -221,37 +220,39 @@ begin
else
else
begin
begin
msg
:=
'Are you sure you want to link QB ID: '
+
QB_ID
+
' with KG Orders ID: '
+
ID
;
msg
:=
'Are you sure you want to link QB ID: '
+
QB_ID
+
' with KG Orders ID: '
+
ID
;
ShowLinkConfirm
(
msg
);
if
MessageDlg
(
msg
,
mtConfirmation
,
[
mbYes
,
mbNo
],
0
)
=
mrYes
then
begin
// User confirmed
LinkCustomer
();
end
else
begin
// User canceled
ShowMessage
(
'Cancelled.'
);
end
;
end
;
end
;
end
;
end
;
procedure
TfQB
.
LinkCustomer
s
();
procedure
TfQB
.
LinkCustomer
();
var
var
sql
:
string
;
sql
:
string
;
begin
begin
sql
:=
'select QB_LIST_ID from customers where CUSTOMER_ID = '
+
ID
;
sql
:=
'select * from customers where CUSTOMER_ID = '
+
ID
;
Memo1
.
Lines
.
Add
(
'SQL: '
+
SQL
);
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
ordersDB
.
UniQuery1
.
Edit
;
if
ordersDB
.
UniQuery1
.
RecordCount
=
1
then
ordersDB
.
UniQuery1
.
FieldByName
(
'QB_LIST_ID'
).
AsString
:=
QB_ID
;
ordersDB
.
UniQuery1
.
Post
;
getCustomers
();
QB_ID
:=
''
;
ID
:=
''
;
end
;
procedure
TfQB
.
ShowLinkConfirm
(
msg
:
string
);
begin
if
MessageDlg
(
msg
,
mtConfirmation
,
[
mbYes
,
mbNo
],
0
)
=
mrYes
then
begin
begin
// User confirmed
ordersDB
.
UniQuery1
.
Edit
;
LinkCustomers
();
ordersDB
.
UniQuery1
.
FieldByName
(
'QB_LIST_ID'
).
AsString
:=
QB_ID
;
ordersDB
.
UniQuery1
.
Post
;
getCustomers
();
QB_ID
:=
''
;
ID
:=
''
;
end
end
else
else
begin
MessageDlg
(
'Wrong # of records return'
,
mtConfirmation
,
[
mbOk
],
0
)
// User canceled
ShowMessage
(
'Cancelled.'
);
end
;
end
;
end
;
procedure
TfQB
.
Button11Click
(
Sender
:
TObject
);
procedure
TfQB
.
Button11Click
(
Sender
:
TObject
);
var
var
restClient
:
TRESTClient
;
restClient
:
TRESTClient
;
...
@@ -550,7 +551,7 @@ var
...
@@ -550,7 +551,7 @@ var
orderJSON
:
TJSONObject
;
orderJSON
:
TJSONObject
;
begin
begin
orderJSON
:=
TJSONObject
.
Create
;
orderJSON
:=
TJSONObject
.
Create
;
orderJSON
.
AddPair
(
'ORDER_ID'
,
'198
14
'
);
orderJSON
.
AddPair
(
'ORDER_ID'
,
'198
42
'
);
addEstimate
(
orderJSON
.
ToString
);
addEstimate
(
orderJSON
.
ToString
);
end
;
end
;
...
@@ -591,6 +592,7 @@ var
...
@@ -591,6 +592,7 @@ var
ORDER_ID
:
string
;
ORDER_ID
:
string
;
table
:
string
;
table
:
string
;
ShipMethodRef
:
TJSONObject
;
ShipMethodRef
:
TJSONObject
;
unitPrice
:
double
;
begin
begin
BillAddrJSON
:=
TJSONObject
.
Create
;
BillAddrJSON
:=
TJSONObject
.
Create
;
ShipAddrJSON
:=
TJSONObject
.
Create
;
ShipAddrJSON
:=
TJSONObject
.
Create
;
...
@@ -637,15 +639,15 @@ begin
...
@@ -637,15 +639,15 @@ begin
;
;
estimateJSON
.
AddPair
(
'CustomerRef'
,
CustomerRefJSON
);
estimateJSON
.
AddPair
(
'CustomerRef'
,
CustomerRefJSON
);
Lines
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_invoice_to'
).
AsString
.
Split
([
sLineBreak
]);
Lines
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_invoice_to'
).
AsString
.
Split
([
#
10
]);
for
i
:=
0
to
Length
(
Lines
)
-
2
do
for
i
:=
0
to
Length
(
Lines
)
-
2
do
begin
begin
case
i
of
case
i
of
0
:
BillAddrJSON
.
AddPair
(
'Line1'
,
Lines
[
0
]
);
0
:
BillAddrJSON
.
AddPair
(
'Line1'
,
Lines
[
i
].
Trim
.
Replace
(#
13
,
''
).
Replace
(#
10
,
''
)
);
1
:
BillAddrJSON
.
AddPair
(
'Line2'
,
Lines
[
1
]
);
1
:
BillAddrJSON
.
AddPair
(
'Line2'
,
Lines
[
i
].
Trim
.
Replace
(#
13
,
''
).
Replace
(#
10
,
''
)
);
2
:
BillAddrJSON
.
AddPair
(
'Line3'
,
Lines
[
2
]
);
2
:
BillAddrJSON
.
AddPair
(
'Line3'
,
Lines
[
i
].
Trim
.
Replace
(#
13
,
''
).
Replace
(#
10
,
''
)
);
3
:
BillAddrJSON
.
AddPair
(
'Line4'
,
Lines
[
3
]
);
3
:
BillAddrJSON
.
AddPair
(
'Line4'
,
Lines
[
i
].
Trim
.
Replace
(#
13
,
''
).
Replace
(#
10
,
''
)
);
4
:
BillAddrJSON
.
AddPair
(
'Line5'
,
Lines
[
4
]
);
4
:
BillAddrJSON
.
AddPair
(
'Line5'
,
Lines
[
i
].
Trim
.
Replace
(#
13
,
''
).
Replace
(#
10
,
''
)
);
end
;
end
;
end
;
end
;
...
@@ -700,7 +702,10 @@ begin
...
@@ -700,7 +702,10 @@ begin
DetailObj
.
AddPair
(
'ItemRef'
,
ItemRefObj
);
DetailObj
.
AddPair
(
'ItemRef'
,
ItemRefObj
);
DetailObj
.
AddPair
(
'Qty'
,
TJSONNumber
.
Create
(
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_quantity'
).
AsFloat
));
DetailObj
.
AddPair
(
'Qty'
,
TJSONNumber
.
Create
(
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_quantity'
).
AsFloat
));
DetailObj
.
AddPair
(
'UnitPrice'
,
TJSONNumber
.
Create
(
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_price'
).
AsFloat
));
unitPrice
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_price'
).
AsFloat
/
ordersDB
.
UniQuery1
.
FieldByName
(
'staff_fields_quantity'
).
AsInteger
;
DetailObj
.
AddPair
(
'UnitPrice'
,
TJSONNumber
.
Create
(
unitPrice
));
LineObj
.
AddPair
(
'SalesItemLineDetail'
,
DetailObj
);
LineObj
.
AddPair
(
'SalesItemLineDetail'
,
DetailObj
);
LineArray
.
AddElement
(
LineObj
);
LineArray
.
AddElement
(
LineObj
);
...
...
kgOrdersServer/Source/rOrderCorrugated.pas
View file @
4ee28e36
...
@@ -184,7 +184,6 @@ var
...
@@ -184,7 +184,6 @@ var
items
:
TJSObject
;
items
:
TJSObject
;
begin
begin
Logger
.
Log
(
3
,
'Generated SQL for Prepare Report: '
+
SQL
);
Logger
.
Log
(
3
,
'Generated SQL for Prepare Report: '
+
SQL
);
//SQL := 'select * from corrugated_plate_orders where ORDER_ID = 18381';
doQuery
(
uqOrderCorrugated
,
SQL
);
doQuery
(
uqOrderCorrugated
,
SQL
);
if
(
string
(
uqOrderCorrugated
.
FieldByName
(
'colors_colors'
).
AsString
)
)
<>
''
then
if
(
string
(
uqOrderCorrugated
.
FieldByName
(
'colors_colors'
).
AsString
)
)
<>
''
then
...
@@ -212,6 +211,7 @@ begin
...
@@ -212,6 +211,7 @@ begin
ForceDirectories
(
ReportDir
);
ForceDirectories
(
ReportDir
);
Logger
.
Log
(
5
,
'Reports directory created: '
+
ReportDir
);
Logger
.
Log
(
5
,
'Reports directory created: '
+
ReportDir
);
end
;
end
;
reportURL
:=
'reports/'
+
FormatDateTime
(
'yyyymmdd_hhnnss'
,
Now
)
+
'.pdf'
;
reportURL
:=
'reports/'
+
FormatDateTime
(
'yyyymmdd_hhnnss'
,
Now
)
+
'.pdf'
;
ReportFileName
:=
reportDir
+
reportUrl
;
ReportFileName
:=
reportDir
+
reportUrl
;
...
...
kgOrdersServer/Source/rOrderCutting.dfm
View file @
4ee28e36
...
@@ -47,6 +47,75 @@ object rptOrderCutting: TrptOrderCutting
...
@@ -47,6 +47,75 @@ object rptOrderCutting: TrptOrderCutting
DataSetOptions = []
DataSetOptions = []
Left = 444
Left = 444
Top = 206
Top = 206
FieldDefs = <
item
FieldName = 'ORDER_ID'
end
item
FieldName = 'COMPANY_ID'
end
item
FieldName = 'USER_ID'
end
item
FieldName = 'ORDER_DATE'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_order_date'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_proof_date'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_ship_date'
FieldType = fftDateTime
end
item
FieldName = 'staff_fields_ship_via'
FieldType = fftString
Size = 45
end
item
FieldName = 'staff_fields_quantity'
FieldType = fftString
end
item
FieldName = 'staff_fields_price'
FieldType = fftString
end
item
FieldName = 'staff_fields_invoice_to'
FieldType = fftString
Size = 128
end
item
FieldName = 'staff_fields_ship_to'
FieldType = fftString
Size = 128
end
item
FieldName = 'staff_fields_po_number'
FieldType = fftString
Size = 16
end
item
FieldName = 'staff_fields_job_name'
FieldType = fftString
Size = 45
end
item
FieldName = 'staff_fields_quickbooks_item'
FieldType = fftString
Size = 45
end
item
FieldName = 'general_special_instructions'
FieldType = fftString
Size = 2048
end>
end
end
object frxOrderCutting: TfrxReport
object frxOrderCutting: TfrxReport
Version = '2025.1.4'
Version = '2025.1.4'
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
4ee28e36
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
MemoLogLevel
=
3
MemoLogLevel
=
3
FileLogLevel
=
5
FileLogLevel
=
5
webClientVersion
=
0.9.7
webClientVersion
=
0.9.7
LogFileNum
=
873
LogFileNum
=
926
[Database]
[Database]
Server
=
192.168.159.15
8
Server
=
192.168.159.15
5
--Server
=
192.168.102.130
--Server
=
192.168.102.130
--Server
=
192.168.75.133
--Server
=
192.168.75.133
Database
=
kg_order_entry
Database
=
kg_order_entry
...
@@ -17,8 +17,8 @@ Password=emsys01
...
@@ -17,8 +17,8 @@ Password=emsys01
CompanyID
=
9341454272655710
CompanyID
=
9341454272655710
ClientID
=
ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy
ClientID
=
ABgO14uvjh8XqLud7spQ8lkb98AUpcdA7HbyMJfCAtl65sQ5yy
ClientSecret
=
bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN
ClientSecret
=
bQ06TRemHeAGFzVHRaTUvUoBU9jpU9itK6MOMgqN
RefreshToken
=
RT1-
119-H0-176089178955akizxqky85tnrj9nnl
RefreshToken
=
RT1-
44-H0-1762010333a3v07cb5eb0luyn2rppm
AccessToken
=
eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..
nC8S1UW9Us5C-eV2R-Pz3Q.VQrMSJBJ_25MmQ0tiuGnhYhzDRhQhIOkV92ScgMb4ikGyYq4Br3QFT4AYA73WMEzD3uFLxKiCYdJ7I-B2L2q4u1YCg2n5vWLfmljecOvN64DVQNTksUFC71_9pUFtHL0VlqmV-p2RN2QDhnFjnGFa8CXRGW9K8njUWBrZdeJs4M2NRfbIJWdC2JnY2Fq3X5W26xc9cLXpY5BmijXEu8I7AK25NH7r2ZLdGrrh0aGmOj3JgnW68fYLaGONfBSgRcLyW69jDjM21DP1ujflaf9O2BGDb5LctGv-KgyZ-j9OVCMp7otPevN-o3DGL-Bdawmy_ZDN9L2USSSIXal4S3a6Q25_sOkoI7mp4R_onrsProjids8hzsUTSg7bfWOTu7elG_Hjie2cuZvH3eBsYMd8a-sAOo6hZrECUhHFjpULsRiGRIMLCU3nAOHlGP_IFxgIczYGDx27i54CZhvYgLZR7XBnhlpWMLIntogrU50FSw.4pHLJDZLlpzFGjk-oRqTtQ
AccessToken
=
eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwieC5vcmciOiJIMCJ9..
7T78YBCSmvuJPRsZ9lGwuQ.1VJssLuNBAPKI7RAJOPluhtlA8DYgNcmXebNkWSxrHJ1949vjY4SPt5JjruuLsNOV09i_xKrQ76w9Zhjom1MiQaSyNoZHU-CZLfOtWgr9r3-gLxizdTlrTs9cEZs__8ep4_oe2r3n2u34QlM0xdVdLWxQbKYjpCl0k_58XPbS5Z_Vo2Y5qqoAuGJIRxMaTueMOH1ut-bV4Em318Ca1jN2DFCh_NYjLwFQQenWxOrCRMBaj7ZgB2yjtS5mEUxhuxsB7FAeONYqBSJ0OAy1yzWE-Ycxzt4dcZBCTHxzUCTH0-P0Mb_M6ivfmiYyKctf2gsZD8Xw91MgnF9TPwG8yXdej05fWr94VWeC3tFp0V-RYYv3_XRuim6fCvxJjWzfVEZwv9jUiZ6WByNSzu1k1W5_rQuSG7_Hs8WiDC1sBChJLfDclLO8pMoznqpSrM8ZmiNoYm4aZPQrpO6rgY8NiTokZRyeTw2adtW1YgDJsZdoEw.i2MSpKztX0v6UN0vZz5gQg
LastRefresh
=
7/
11/2025 11:51:3
4 AM
LastRefresh
=
7/
23/2025 11:18:5
4 AM
--RefreshToken
=
RT1-10-H0-1760618473k44t73jittvqlr4wynn6
--RefreshToken
=
RT1-10-H0-1760618473k44t73jittvqlr4wynn6
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment