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
aadb8619
Commit
aadb8619
authored
Nov 15, 2024
by
cam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned Up order page UI and fixed bugs that editting introduced
parent
39e0e52b
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
396 additions
and
142 deletions
+396
-142
View.EditUser.html
kgOrdersClient/View.EditUser.html
+0
-1
View.Items.html
kgOrdersClient/View.Items.html
+0
-1
View.Main.dfm
kgOrdersClient/View.Main.dfm
+30
-4
View.Main.html
kgOrdersClient/View.Main.html
+14
-6
View.Main.pas
kgOrdersClient/View.Main.pas
+51
-1
View.OrderEntryCorrugated.dfm
kgOrdersClient/View.OrderEntryCorrugated.dfm
+80
-93
View.OrderEntryCorrugated.html
kgOrdersClient/View.OrderEntryCorrugated.html
+2
-3
View.OrderEntryCorrugated.pas
kgOrdersClient/View.OrderEntryCorrugated.pas
+55
-8
View.Orders.dfm
kgOrdersClient/View.Orders.dfm
+30
-2
View.Orders.html
kgOrdersClient/View.Orders.html
+8
-6
View.Orders.pas
kgOrdersClient/View.Orders.pas
+7
-1
View.UserProfile.html
kgOrdersClient/View.UserProfile.html
+0
-1
View.Users.html
kgOrdersClient/View.Users.html
+0
-1
app.css
kgOrdersClient/template/css/app.css
+65
-0
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+53
-13
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/View.EditUser.html
View file @
aadb8619
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
<h1
class=
"page-header pt-3"
id=
"view.edituser.title"
style=
"font-size: 24px;"
>
Users
</h1>
<div
class=
"container mt-4"
>
<div
class=
"container mt-4"
>
<div
class=
"row justify-content-center"
>
<div
class=
"row justify-content-center"
>
<div
class=
"col-12 col-md-8"
>
<div
class=
"col-12 col-md-8"
>
...
...
kgOrdersClient/View.Items.html
View file @
aadb8619
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
<h1
class=
"page-header pt-3"
id=
"view.items.title"
style=
"font-size: 24px;"
>
Items
</h1>
<div
class=
"container mt-4"
>
<div
class=
"container mt-4"
>
<div
class=
"row justify-content-center"
>
<div
class=
"row justify-content-center"
>
<div
class=
"col-12 col-md-8"
>
<div
class=
"col-12 col-md-8"
>
...
...
kgOrdersClient/View.Main.dfm
View file @
aadb8619
...
@@ -27,8 +27,8 @@ object FViewMain: TFViewMain
...
@@ -27,8 +27,8 @@ object FViewMain: TFViewMain
Caption = ' User Profile'
Caption = ' User Profile'
end
end
object wllblLogout: TWebLinkLabel
object wllblLogout: TWebLinkLabel
Left = 5
48
Left = 5
51
Top = 1
0
3
Top = 1
4
3
Width = 41
Width = 41
Height = 15
Height = 15
ElementID = 'dropdown.menu.logout'
ElementID = 'dropdown.menu.logout'
...
@@ -61,7 +61,7 @@ object FViewMain: TFViewMain
...
@@ -61,7 +61,7 @@ object FViewMain: TFViewMain
end
end
object lblItemsList: TWebLinkLabel
object lblItemsList: TWebLinkLabel
Left = 560
Left = 560
Top =
69
Top =
85
Width = 29
Width = 29
Height = 15
Height = 15
ElementID = 'dropdown.menu.itemlist'
ElementID = 'dropdown.menu.itemlist'
...
@@ -73,7 +73,7 @@ object FViewMain: TFViewMain
...
@@ -73,7 +73,7 @@ object FViewMain: TFViewMain
end
end
object lblUsers: TWebLinkLabel
object lblUsers: TWebLinkLabel
Left = 561
Left = 561
Top =
86
Top =
108
Width = 28
Width = 28
Height = 15
Height = 15
ElementID = 'dropdown.menu.users'
ElementID = 'dropdown.menu.users'
...
@@ -96,6 +96,32 @@ object FViewMain: TFViewMain
...
@@ -96,6 +96,32 @@ object FViewMain: TFViewMain
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblordersClick
OnClick = lblordersClick
end
end
object lblCustomers: TWebLabel
Left = 540
Top = 69
Width = 57
Height = 15
Caption = 'Customers'
ElementID = 'lblcustomers'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblCustomersClick
end
object lblQuickbooks: TWebLabel
Left = 546
Top = 125
Width = 63
Height = 15
Caption = 'QuickBooks'
ElementID = 'lblquickbooks'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = lblQuickbooksClick
end
object WebPanel1: TWebPanel
object WebPanel1: TWebPanel
Left = 77
Left = 77
Top = 112
Top = 112
...
...
kgOrdersClient/View.Main.html
View file @
aadb8619
...
@@ -2,6 +2,20 @@
...
@@ -2,6 +2,20 @@
<nav
class=
"navbar navbar-expand navbar-light bg-light"
style=
"margin-bottom: 0px;"
>
<nav
class=
"navbar navbar-expand navbar-light bg-light"
style=
"margin-bottom: 0px;"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<a
id=
"view.main.apptitle"
class=
"navbar-brand"
href=
"index.html"
>
Koehler-Gibson Orders
</a>
<a
id=
"view.main.apptitle"
class=
"navbar-brand"
href=
"index.html"
>
Koehler-Gibson Orders
</a>
<ul
class=
"navbar-nav ml-auto"
>
<li
class=
"nav-item"
>
<a
class=
"dropdown-item"
id=
"lblorders"
href=
"#"
><i
class=
"fa fa-tags fa-fw"
></i><span>
Orders
</span></a>
</li>
<li
class=
"nav-item"
>
<a
class=
"dropdown-item"
id=
"lblcustomers"
href=
"#"
><i
class=
"fa fa-tags fa-fw"
></i><span>
Customers
</span></a>
</li>
<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>
</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>
<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"
>
<li
class=
"nav-item dropdown"
>
<li
class=
"nav-item dropdown"
>
...
@@ -16,12 +30,6 @@
...
@@ -16,12 +30,6 @@
<a
class=
"dropdown-item"
id=
"dropdown.menu.userprofile"
href=
"#"
><i
class=
"fa fa-user fa-fw"
></i><span>
User Profile
</span></a>
<a
class=
"dropdown-item"
id=
"dropdown.menu.userprofile"
href=
"#"
><i
class=
"fa fa-user fa-fw"
></i><span>
User Profile
</span></a>
</li>
</li>
<li>
<li>
<a
class=
"dropdown-item"
id=
"lblorders"
href=
"#"
><i
class=
"fa fa-tags fa-fw"
></i><span>
Orders
</span></a>
</li>
<li>
<a
class=
"dropdown-item"
id=
"dropdown.menu.itemlist"
href=
"#"
><i
class=
"fa fa-cubes fa-fw"
></i><span>
Items
</span></a>
</li>
<li>
<a
class=
"dropdown-item"
id=
"dropdown.menu.users"
href=
"#"
><i
class=
"fas fa-address-book fa-fw"
></i><span>
Users
</span></abbr></a>
<a
class=
"dropdown-item"
id=
"dropdown.menu.users"
href=
"#"
><i
class=
"fas fa-address-book fa-fw"
></i><span>
Users
</span></abbr></a>
</li>
</li>
<li>
<li>
...
...
kgOrdersClient/View.Main.pas
View file @
aadb8619
...
@@ -22,6 +22,8 @@ type
...
@@ -22,6 +22,8 @@ type
lblItemsList
:
TWebLinkLabel
;
lblItemsList
:
TWebLinkLabel
;
lblUsers
:
TWebLinkLabel
;
lblUsers
:
TWebLinkLabel
;
lblorders
:
TWebLabel
;
lblorders
:
TWebLabel
;
lblCustomers
:
TWebLabel
;
lblQuickbooks
:
TWebLabel
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
mnuLogoutClick
(
Sender
:
TObject
);
procedure
mnuLogoutClick
(
Sender
:
TObject
);
procedure
wllblUserProfileClick
(
Sender
:
TObject
);
procedure
wllblUserProfileClick
(
Sender
:
TObject
);
...
@@ -30,6 +32,8 @@ type
...
@@ -30,6 +32,8 @@ type
procedure
lblItemsListClick
(
Sender
:
TObject
);
procedure
lblItemsListClick
(
Sender
:
TObject
);
procedure
lblUsersClick
(
Sender
:
TObject
);
procedure
lblUsersClick
(
Sender
:
TObject
);
procedure
lblordersClick
(
Sender
:
TObject
);
procedure
lblordersClick
(
Sender
:
TObject
);
procedure
lblCustomersClick
(
Sender
:
TObject
);
procedure
lblQuickbooksClick
(
Sender
:
TObject
);
private
private
{ Private declarations }
{ Private declarations }
FUserInfo
:
string
;
FUserInfo
:
string
;
...
@@ -40,6 +44,7 @@ type
...
@@ -40,6 +44,7 @@ type
procedure
ShowCrudForm
(
AFormClass
:
TWebFormClass
);
procedure
ShowCrudForm
(
AFormClass
:
TWebFormClass
);
//procedure EditUser( AParam, BParam, CParam, DParam, EParam: string);
//procedure EditUser( AParam, BParam, CParam, DParam, EParam: string);
function
GetUserInfo
:
string
;
function
GetUserInfo
:
string
;
procedure
setActive
(
page
:
string
);
public
public
{ Public declarations }
{ Public declarations }
class
procedure
Display
(
LogoutProc
:
TLogoutProc
);
class
procedure
Display
(
LogoutProc
:
TLogoutProc
);
...
@@ -82,30 +87,73 @@ begin
...
@@ -82,30 +87,73 @@ begin
//Change this later
//Change this later
lblUsers
.
Visible
:=
true
;
lblUsers
.
Visible
:=
true
;
ShowForm
(
TFViewHome
);
ShowForm
(
TFViewOrders
);
lblAppTitle
.
Caption
:=
'Koehler-Gibson Orders'
;
setActive
(
'Orders'
);
end
;
end
;
procedure
TFViewMain
.
lblCustomersClick
(
Sender
:
TObject
);
begin
//ShowForm(TFViewCustomers);
lblAppTitle
.
Caption
:=
'Koehler-Gibson Customers'
;
setActive
(
'Customers'
);
end
;
procedure
TFViewMain
.
lblHomeClick
(
Sender
:
TObject
);
procedure
TFViewMain
.
lblHomeClick
(
Sender
:
TObject
);
begin
begin
ShowForm
(
TFViewHome
);
ShowForm
(
TFViewHome
);
lblAppTitle
.
Caption
:=
'Koehler-Gibson Home'
;
//setActive('Home');
end
;
end
;
procedure
TFViewMain
.
lblordersClick
(
Sender
:
TObject
);
procedure
TFViewMain
.
lblordersClick
(
Sender
:
TObject
);
begin
begin
ShowForm
(
TFViewOrders
);
ShowForm
(
TFViewOrders
);
lblAppTitle
.
Caption
:=
'Koehler-Gibson Orders'
;
setActive
(
'Orders'
);
end
;
procedure
TFViewMain
.
lblQuickbooksClick
(
Sender
:
TObject
);
begin
//ShowForm(TFViewQuickbooks);
lblAppTitle
.
Caption
:=
'Koehler-Gibson QuickBooks'
;
setActive
(
'QuickBooks'
);
end
;
end
;
procedure
TFViewMain
.
lblUsersClick
(
Sender
:
TObject
);
procedure
TFViewMain
.
lblUsersClick
(
Sender
:
TObject
);
begin
begin
ShowForm
(
TFViewUsers
);
ShowForm
(
TFViewUsers
);
lblAppTitle
.
Caption
:=
'Koehler-Gibson Users'
;
end
;
end
;
procedure
TFViewMain
.
lblItemsListClick
(
Sender
:
TObject
);
procedure
TFViewMain
.
lblItemsListClick
(
Sender
:
TObject
);
begin
begin
ShowForm
(
TFViewItems
);
ShowForm
(
TFViewItems
);
lblAppTitle
.
Caption
:=
'Koehler-Gibson Items'
;
setActive
(
'Items'
);
end
;
procedure
TFViewMain
.
setActive
(
page
:
string
);
var
links
:
TJSNodeList
;
link
:
TJSHTMLElement
;
i
:
integer
;
begin
// Get all the links in the navbar
links
:=
document
.
querySelectorAll
(
'.navbar-nav .nav-item a'
);
for
i
:=
0
to
links
.
length
-
1
do
begin
link
:=
TJSHTMLElement
(
links
[
i
]);
link
.
classList
.
remove
(
'active'
);
console
.
log
(
link
.
innerHTML
);
console
.
log
(
link
.
innerText
);
if
link
.
innerText
.
Contains
(
page
)
then
link
.
classList
.
add
(
'active'
);
end
;
end
;
end
;
procedure
TFViewMain
.
mnuLogoutClick
(
Sender
:
TObject
);
procedure
TFViewMain
.
mnuLogoutClick
(
Sender
:
TObject
);
...
@@ -123,6 +171,7 @@ end;
...
@@ -123,6 +171,7 @@ end;
procedure
TFViewMain
.
wllblUserProfileClick
(
Sender
:
TObject
);
procedure
TFViewMain
.
wllblUserProfileClick
(
Sender
:
TObject
);
begin
begin
ShowCrudForm
(
TFViewUserProfile
);
ShowCrudForm
(
TFViewUserProfile
);
lblAppTitle
.
Caption
:=
'Koehler-Gibson User Profile'
;
end
;
end
;
...
@@ -183,6 +232,7 @@ end;
...
@@ -183,6 +232,7 @@ end;
procedure
TFViewMain
.
ViewOrderEntry
(
orderInfo
,
mode
:
string
);
procedure
TFViewMain
.
ViewOrderEntry
(
orderInfo
,
mode
:
string
);
begin
begin
lblAppTitle
.
Caption
:=
'Koehler-Gibson Order Entry'
;
if
Assigned
(
FChildForm
)
then
if
Assigned
(
FChildForm
)
then
FChildForm
.
Free
;
FChildForm
.
Free
;
FChildForm
:=
TFOrderEntry
.
CreateForm
(
WebPanel1
.
ElementID
,
orderInfo
,
mode
);
FChildForm
:=
TFOrderEntry
.
CreateForm
(
WebPanel1
.
ElementID
,
orderInfo
,
mode
);
...
...
kgOrdersClient/View.OrderEntryCorrugated.dfm
View file @
aadb8619
...
@@ -808,171 +808,158 @@ object FOrderEntry: TFOrderEntry
...
@@ -808,171 +808,158 @@ object FOrderEntry: TFOrderEntry
DataField = 'proofing_full_size_panel'
DataField = 'proofing_full_size_panel'
DataSource = WebDataSource1
DataSource = WebDataSource1
end
end
object
cbStripMount: TWebDBCheckBox
object
edtSpecialInstructions: TWebDBEdit
Left =
496
Left =
852
Top =
407
Top =
185
Width = 1
13
Width = 1
21
Height = 22
Height = 22
Caption = 'Strip Mount'
AutoSize = True
ChildOrder = 78
ElementID = 'edtspecialinstructions'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'general_special_instructions'
DataSource = WebDataSource1
end
object btnConfirm: TWebButton
Left = 752
Top = 558
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 79
ChildOrder = 79
ElementID = '
cbstripmount
'
ElementID = '
btnconfirm
'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
end
object cb
FullMount: TWebDB
CheckBox
object cb
RefArtAPDF: TWeb
CheckBox
Left =
49
6
Left =
31
6
Top =
386
Top =
463
Width = 113
Width = 113
Height = 2
0
Height = 2
2
Caption = '
Full Mount
'
Caption = '
Ref Art A PDF?
'
ChildOrder = 7
9
ChildOrder = 7
6
ElementID = '
cbfullmount
'
ElementID = '
edtrefartapdf
'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'mounting_full_mount'
DataSource = WebDataSource1
end
end
object cb
StickyBak: TWebDB
CheckBox
object cb
RefArtPrintCard: TWeb
CheckBox
Left =
49
6
Left =
31
6
Top =
362
Top =
435
Width = 113
Width = 113
Height = 22
Height = 22
Caption = '
Sticky Bak
'
Caption = '
Ref Art Print Card?
'
ChildOrder = 7
9
ChildOrder = 7
6
ElementID = '
cbstickybak
'
ElementID = '
edtrefartprintcard
'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'mounting_sticky_bak'
DataSource = WebDataSource1
end
end
object
WebDBCheckBox9: TWebDB
CheckBox
object
cbExistingCuttingDie: TWeb
CheckBox
Left =
49
6
Left =
31
6
Top =
306
Top =
407
Width = 113
Width = 113
Height = 22
Height = 22
Caption = '
Loose
'
Caption = '
Existing Cutting Die?
'
ChildOrder = 7
9
ChildOrder = 7
6
ElementID = '
cbloos
e'
ElementID = '
edtexistingcuttingdi
e'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataSource = WebDataSource1
end
end
object cb
ExcaliburDie: TWebDB
CheckBox
object cb
FTP: TWeb
CheckBox
Left =
496
Left =
320
Top =
233
Top =
318
Width = 113
Width = 113
Height = 22
Height = 22
Caption = '
Excalibur Die
'
Caption = '
FTP?
'
ChildOrder = 7
9
ChildOrder = 7
6
ElementID = '
cbexcaliburdie
'
ElementID = '
edtftp
'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'layout_excalibur_die'
DataSource = WebDataSource1
end
end
object cbSampleCarton: TWeb
DB
CheckBox
object cbSampleCarton: TWebCheckBox
Left = 316
Left = 316
Top = 28
6
Top = 28
3
Width = 113
Width = 113
Height = 22
Height = 22
Caption = 'Sample Carton'
Caption = 'Sample Carton'
ChildOrder = 7
9
ChildOrder = 7
6
ElementID = 'cbs
i
mpleCarton'
ElementID = 'cbs
a
mpleCarton'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_sample_ca'
DataSource = WebDataSource1
end
end
object cbPlate
: TWebDB
CheckBox
object cbPlate
s: TWeb
CheckBox
Left = 316
Left = 316
Top = 255
Top = 255
Width = 113
Width = 113
Height = 22
Height = 22
Caption = 'Plates'
Caption = 'Plates'
ChildOrder = 7
9
ChildOrder = 7
6
ElementID = 'cbplates'
ElementID = 'cbplates'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_plates'
DataSource = WebDataSource1
end
end
object cbColorCopy: TWeb
DB
CheckBox
object cbColorCopy: TWebCheckBox
Left = 316
Left = 316
Top = 2
30
Top = 2
27
Width = 113
Width = 113
Height = 22
Height = 22
Caption = 'Color Copy'
Caption = 'Color Copy'
ChildOrder = 7
9
ChildOrder = 7
6
ElementID = 'cbcolorcopy'
ElementID = 'cbcolorcopy'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'supplied_by_customer_color_copy'
DataSource = WebDataSource1
end
end
object
edtSpecialInstructions: TWebDBEdit
object
cbStripMount: TWebCheckBox
Left =
852
Left =
496
Top =
185
Top =
406
Width = 1
21
Width = 1
13
Height = 22
Height = 22
AutoSize = True
Caption = 'Strip Mount'
ChildOrder = 78
ChildOrder = 76
ElementID = 'edtspecialinstructions'
ElementID = 'cbstripmount'
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
DataField = 'general_special_instructions'
DataSource = WebDataSource1
end
object btnConfirm: TWebButton
Left = 752
Top = 558
Width = 96
Height = 25
Caption = 'Confirm'
ChildOrder = 79
ElementID = 'btnconfirm'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
OnClick = btnConfirmClick
end
end
object cb
RefArtAPDF
: TWebCheckBox
object cb
FullMount
: TWebCheckBox
Left =
31
6
Left =
49
6
Top =
463
Top =
382
Width = 113
Width = 113
Height = 22
Height = 22
Caption = '
Ref Art A PDF?
'
Caption = '
Full Mount
'
ChildOrder = 76
ChildOrder = 76
ElementID = '
edtrefartapdf
'
ElementID = '
cbfullmount
'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
end
object cb
RefArtPrintCard
: TWebCheckBox
object cb
StickyBak
: TWebCheckBox
Left =
31
6
Left =
49
6
Top =
435
Top =
358
Width = 113
Width = 113
Height = 22
Height = 22
Caption = '
Ref Art Print Card?
'
Caption = '
Sticky Bak
'
ChildOrder = 76
ChildOrder = 76
ElementID = '
edtrefartprintcard
'
ElementID = '
cbstickybak
'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
end
object cb
ExistingCuttingDi
e: TWebCheckBox
object cb
Loos
e: TWebCheckBox
Left =
31
6
Left =
49
6
Top =
407
Top =
309
Width = 113
Width = 113
Height = 22
Height = 22
Caption = '
Existing Cutting Die?
'
Caption = '
Loose
'
ChildOrder = 76
ChildOrder = 76
ElementID = '
edtexistingcuttingdi
e'
ElementID = '
cbloos
e'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
end
object cb
FTP
: TWebCheckBox
object cb
ExcaliburDie
: TWebCheckBox
Left =
320
Left =
496
Top =
318
Top =
233
Width = 113
Width = 113
Height = 22
Height = 22
Caption = '
FTP?
'
Caption = '
Excalibur Die
'
ChildOrder = 76
ChildOrder = 76
ElementID = 'edtftp'
ElementID = 'edtftp'
HeightPercent = 100.000000000000000000
HeightPercent = 100.000000000000000000
...
...
kgOrdersClient/View.OrderEntryCorrugated.html
View file @
aadb8619
<h1
class=
"page-header pt-3"
id=
"view.users.title"
style=
"font-size: 24px;"
>
Order Entry
</h1>
<div
class=
"col-12 col-md-8"
>
<div
class=
"col-12 col-md-8"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
col-sm
>
<div
class=
col-sm
>
...
@@ -100,8 +99,8 @@
...
@@ -100,8 +99,8 @@
<input
type=
"checkbox"
id=
"cbplates"
>
<input
type=
"checkbox"
id=
"cbplates"
>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
class=
'pe-2'
style=
"font-weight: 700; font-size: 15px;"
>
S
i
mple Carton:
</label>
<label
class=
'pe-2'
style=
"font-weight: 700; font-size: 15px;"
>
S
a
mple Carton:
</label>
<input
type=
"checkbox"
id=
"cbs
i
mpleCarton"
>
<input
type=
"checkbox"
id=
"cbs
a
mpleCarton"
>
</div>
</div>
<div
class=
"col-auto"
>
<div
class=
"col-auto"
>
<label
class=
'pe-2'
style=
"font-weight: 700; font-size: 15px;"
>
Disk or CD:
</label>
<label
class=
'pe-2'
style=
"font-weight: 700; font-size: 15px;"
>
Disk or CD:
</label>
...
...
kgOrdersClient/View.OrderEntryCorrugated.pas
View file @
aadb8619
...
@@ -75,14 +75,6 @@ type
...
@@ -75,14 +75,6 @@ type
cbWideFormat
:
TWebDBCheckBox
;
cbWideFormat
:
TWebDBCheckBox
;
cbPrintCard
:
TWebDBCheckBox
;
cbPrintCard
:
TWebDBCheckBox
;
cbFullSizePanel
:
TWebDBCheckBox
;
cbFullSizePanel
:
TWebDBCheckBox
;
cbStripMount
:
TWebDBCheckBox
;
cbFullMount
:
TWebDBCheckBox
;
cbStickyBak
:
TWebDBCheckBox
;
WebDBCheckBox9
:
TWebDBCheckBox
;
cbExcaliburDie
:
TWebDBCheckBox
;
cbSampleCarton
:
TWebDBCheckBox
;
cbPlate
:
TWebDBCheckBox
;
cbColorCopy
:
TWebDBCheckBox
;
XDataWebClient1
:
TXDataWebClient
;
XDataWebClient1
:
TXDataWebClient
;
edtSpecialInstructions
:
TWebDBEdit
;
edtSpecialInstructions
:
TWebDBEdit
;
tmrScrollTop
:
TWebTimer
;
tmrScrollTop
:
TWebTimer
;
...
@@ -182,6 +174,14 @@ type
...
@@ -182,6 +174,14 @@ type
cbRefArtPrintCard
:
TWebCheckBox
;
cbRefArtPrintCard
:
TWebCheckBox
;
cbExistingCuttingDie
:
TWebCheckBox
;
cbExistingCuttingDie
:
TWebCheckBox
;
cbFTP
:
TWebCheckBox
;
cbFTP
:
TWebCheckBox
;
cbSampleCarton
:
TWebCheckBox
;
cbPlates
:
TWebCheckBox
;
cbColorCopy
:
TWebCheckBox
;
cbStripMount
:
TWebCheckBox
;
cbFullMount
:
TWebCheckBox
;
cbStickyBak
:
TWebCheckBox
;
cbLoose
:
TWebCheckBox
;
cbExcaliburDie
:
TWebCheckBox
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
HideNotification
();
procedure
HideNotification
();
procedure
ShowNotification
(
Notification
:
string
);
procedure
ShowNotification
(
Notification
:
string
);
...
@@ -247,13 +247,18 @@ begin
...
@@ -247,13 +247,18 @@ begin
colorListJSON
:=
TJSONObject
.
Create
;
colorListJSON
:=
TJSONObject
.
Create
;
colorListJSON
.
AddPair
(
'items'
,
colorList
);
colorListJSON
.
AddPair
(
'items'
,
colorList
);
XDataWebDataSet1
.
Edit
;
XDataWebDataSet1
.
Edit
;
XDataWebDataSet1colors_colors
.
Value
:=
colorListJSON
.
ToString
;
XDataWebDataSet1colors_colors
.
Value
:=
colorListJSON
.
ToString
;
//Convert all dates to strings because I was having less issues with that data type.
XDataWebDataSet1staff_fields_proof_date
.
Value
:=
DateTimeToStr
(
dtpProofDate
.
Date
);
XDataWebDataSet1staff_fields_proof_date
.
Value
:=
DateTimeToStr
(
dtpProofDate
.
Date
);
XDataWebDataSet1staff_fields_ship_date
.
Value
:=
DateTimeToStr
(
dtpShipDate
.
Date
);
XDataWebDataSet1staff_fields_ship_date
.
Value
:=
DateTimeToStr
(
dtpShipDate
.
Date
);
XDataWebDataSet1staff_fields_art_due
.
Value
:=
DateTimeToStr
(
dtpArtDue
.
Date
);
XDataWebDataSet1staff_fields_art_due
.
Value
:=
DateTimeToStr
(
dtpArtDue
.
Date
);
XDataWebDataSet1staff_fields_mount_due
.
Value
:=
DateTimeToStr
(
dtpMountDue
.
Date
);
XDataWebDataSet1staff_fields_mount_due
.
Value
:=
DateTimeToStr
(
dtpMountDue
.
Date
);
XDataWebDataSet1staff_fields_plate_due
.
Value
:=
DateTimeToStr
(
dtpPlateDue
.
Date
);
XDataWebDataSet1staff_fields_plate_due
.
Value
:=
DateTimeToStr
(
dtpPlateDue
.
Date
);
XDataWebDataSet1ORDER_DATE
.
Value
:=
dtpOrderDate
.
Date
;
XDataWebDataSet1ORDER_DATE
.
Value
:=
dtpOrderDate
.
Date
;
// Convert all check boxes to strings because the database stores them as strings
if
cbFTP
.
Checked
then
if
cbFTP
.
Checked
then
XDataWebDataSet1supplied_by_customer_ftp
.
AsString
:=
'T'
XDataWebDataSet1supplied_by_customer_ftp
.
AsString
:=
'T'
else
else
...
@@ -270,8 +275,26 @@ begin
...
@@ -270,8 +275,26 @@ begin
XDataWebDataSet1supplied_by_customer_ref_art_a
.
AsString
:=
'T'
XDataWebDataSet1supplied_by_customer_ref_art_a
.
AsString
:=
'T'
else
else
XDataWebDataSet1supplied_by_customer_ref_art_a
.
AsString
:=
''
;
XDataWebDataSet1supplied_by_customer_ref_art_a
.
AsString
:=
''
;
if
cbColorCopy
.
Checked
then
XDataWebDataSet1supplied_by_customer_color_copy
.
AsString
:=
'T'
else
XDataWebDataSet1supplied_by_customer_color_copy
.
AsString
:=
''
;
if
cbPlates
.
Checked
then
XDataWebDataSet1supplied_by_customer_plates
.
AsString
:=
'T'
else
XDataWebDataSet1supplied_by_customer_plates
.
AsString
:=
''
;
if
cbSampleCarton
.
Checked
then
XDataWebDataSet1supplied_by_customer_sample_ca
.
AsString
:=
'T'
else
XDataWebDataSet1supplied_by_customer_sample_ca
.
AsString
:=
''
;
if
cbPDFFile
.
Checked
then
XDataWebDataSet1proofing_pdf_file
.
AsString
:=
'T'
else
XDataWebDataSet1proofing_pdf_file
.
AsString
:=
''
;
XDataWebDataSet1
.
Post
;
XDataWebDataSet1
.
Post
;
XDataWebDataSet1
.
First
;
XDataWebDataSet1
.
First
;
console
.
log
(
XDataWebDataSet1supplied_by_customer_sample_ca
.
AsString
);
while
not
XDataWebDataSet1
.
Eof
do
while
not
XDataWebDataSet1
.
Eof
do
begin
begin
for
Field
in
XDataWebDataSet1
.
Fields
do
for
Field
in
XDataWebDataSet1
.
Fields
do
...
@@ -283,11 +306,21 @@ begin
...
@@ -283,11 +306,21 @@ begin
else
else
orderJSON
.
AddPair
(
Field
.
FieldName
,
Field
.
AsString
);
// Add all other fields
orderJSON
.
AddPair
(
Field
.
FieldName
,
Field
.
AsString
);
// Add all other fields
end
end
else
if
Field
is
TBooleanField
then
begin
if
Field
.
AsBoolean
then
orderJSON
.
AddPair
(
Field
.
FieldName
,
'T'
)
else
orderJSON
.
AddPair
(
Field
.
FieldName
,
''
);
end
;
end
;
end
;
XDataWebDataSet1
.
Next
;
XDataWebDataSet1
.
Next
;
end
;
end
;
orderJSON
.
AddPair
(
'COMPANY_ID'
,
'749'
);
orderJSON
.
AddPair
(
'COMPANY_ID'
,
'749'
);
orderJSON
.
AddPair
(
'USER_ID'
,
'1011'
);
orderJSON
.
AddPair
(
'USER_ID'
,
'1011'
);
orderJSON
.
AddPair
(
'mode'
,
mode
);
if
mode
=
'EDIT'
then
orderJSON
.
AddPair
(
'ORDER_ID'
,
orderID
);
AddCorrugatedOrder
(
orderJSON
);
AddCorrugatedOrder
(
orderJSON
);
FViewMain
.
ViewOrders
(
'Success'
);
FViewMain
.
ViewOrders
(
'Success'
);
end
;
end
;
...
@@ -463,12 +496,26 @@ begin
...
@@ -463,12 +496,26 @@ begin
cbRefArtPrintCard
.
Checked
:=
true
cbRefArtPrintCard
.
Checked
:=
true
else
else
cbRefArtPrintCard
.
Checked
:=
false
;
cbRefArtPrintCard
.
Checked
:=
false
;
if
XDataWebDataSet1supplied_by_customer_color_copy
.
AsString
=
'T'
then
cbColorCopy
.
Checked
:=
true
else
cbColorCopy
.
checked
:=
false
;
if
XDataWebDataSet1supplied_by_customer_plates
.
AsString
=
'T'
then
cbPlates
.
Checked
:=
true
else
cbPlates
.
Checked
:=
false
;
if
XDataWebDataSet1supplied_by_customer_sample_ca
.
AsString
=
'T'
then
cbSampleCarton
.
Checked
:=
true
else
cbSampleCarton
.
Checked
:=
false
;
end
;
end
;
procedure
TFOrderEntry
.
WebFormShow
(
Sender
:
TObject
);
procedure
TFOrderEntry
.
WebFormShow
(
Sender
:
TObject
);
begin
begin
getOrder
(
orderID
);
getOrder
(
orderID
);
HideNotification
();
end
;
end
;
procedure
TFOrderEntry
.
HideNotification
;
procedure
TFOrderEntry
.
HideNotification
;
...
...
kgOrdersClient/View.Orders.dfm
View file @
aadb8619
...
@@ -171,8 +171,8 @@ object FViewOrders: TFViewOrders
...
@@ -171,8 +171,8 @@ object FViewOrders: TFViewOrders
Text = ''
Text = ''
end
end
object pnlMessage: TWebPanel
object pnlMessage: TWebPanel
Left = 2
66
Left = 2
20
Top =
61
Top =
429
Width = 121
Width = 121
Height = 33
Height = 33
ElementClassName = 'card'
ElementClassName = 'card'
...
@@ -214,6 +214,34 @@ object FViewOrders: TFViewOrders
...
@@ -214,6 +214,34 @@ object FViewOrders: TFViewOrders
OnClick = btnCloseNotificationClick
OnClick = btnCloseNotificationClick
end
end
end
end
object WebButton1: TWebButton
Left = 174
Top = 79
Width = 96
Height = 25
Caption = 'Set Status'
ChildOrder = 11
ElementClassName = 'btn btn-light'
ElementID = 'btnsetstatus'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object WebButton2: TWebButton
Left = 344
Top = 79
Width = 96
Height = 25
Caption = 'PDF'
ChildOrder = 12
ElementClassName = 'btn btn-light'
ElementID = 'btngeneratepdf'
ElementFont = efCSS
HeightStyle = ssAuto
HeightPercent = 100.000000000000000000
WidthPercent = 100.000000000000000000
end
object XDataWebClient1: TXDataWebClient
object XDataWebClient1: TXDataWebClient
Connection = DMConnection.ApiConnection
Connection = DMConnection.ApiConnection
Left = 426
Left = 426
...
...
kgOrdersClient/View.Orders.html
View file @
aadb8619
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
<h1
class=
"page-header pt-3"
id=
"view.orders.title"
style=
"font-size: 24px;"
>
Orders
</h1>
<div
class=
"container mt-4"
>
<div
class=
"container mt-4"
>
<div
class=
"row justify-content-center"
>
<div
class=
"row justify-content-center"
>
<div
class=
"col-12 col-md-8"
>
<div
class=
"col-12 col-md-8"
>
...
@@ -43,17 +42,20 @@
...
@@ -43,17 +42,20 @@
</div>
</div>
<form
class=
"form-inline"
>
<form
class=
"form-inline"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
3
"
>
<label
class=
"py-2"
style=
"font-weight: 700;"
>
Show
<select
class=
"custom-select"
id=
"wcbpagesize"
style=
"font-size: 1.00rem;"
></select>
entries
</label>
<label
class=
"py-2"
style=
"font-weight: 700;"
>
Show
<select
class=
"custom-select"
id=
"wcbpagesize"
style=
"font-size: 1.00rem;"
></select>
entries
</label>
</div>
</div>
<div
class=
"col-sm-
5
"
>
<div
class=
"col-sm-
2
"
>
<button
class=
"ps-3"
id=
"btnaddorder"
></button>
</div>
</div>
<div
class=
"col-sm-2"
>
<div
class=
"col-sm-2"
>
<button
class=
"ps-3"
id=
"btn
filter
s"
></button>
<button
class=
"ps-3"
id=
"btn
setstatu
s"
></button>
</div>
</div>
<div
class=
"col-sm-2"
>
<div
class=
"col-sm-2"
>
<button
class=
"ps-3"
id=
"btnaddorder"
></button>
<button
class=
"ps-3"
id=
"btngeneratepdf"
></button>
</div>
<div
class=
"col-sm-2"
>
<button
class=
"ps-3"
id=
"btnfilters"
></button>
</div>
</div>
</div>
</div>
</form>
</form>
...
...
kgOrdersClient/View.Orders.pas
View file @
aadb8619
...
@@ -51,6 +51,8 @@ type
...
@@ -51,6 +51,8 @@ type
pnlMessage
:
TWebPanel
;
pnlMessage
:
TWebPanel
;
lblMessage
:
TWebLabel
;
lblMessage
:
TWebLabel
;
btnCloseNotification
:
TWebButton
;
btnCloseNotification
:
TWebButton
;
WebButton1
:
TWebButton
;
WebButton2
:
TWebButton
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
btnApplyClick
(
Sender
:
TObject
);
procedure
btnApplyClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
...
@@ -117,7 +119,10 @@ end;
...
@@ -117,7 +119,10 @@ end;
procedure
TFViewOrders
.
WebFormShow
(
Sender
:
TObject
);
procedure
TFViewOrders
.
WebFormShow
(
Sender
:
TObject
);
begin
begin
console
.
log
(
info
);
console
.
log
(
info
);
ShowNotification
(
info
);
if
info
<>
''
then
ShowNotification
(
info
)
else
HideNotification
();
end
;
end
;
procedure
TFViewOrders
.
getUser
();
procedure
TFViewOrders
.
getUser
();
...
@@ -719,6 +724,7 @@ end;
...
@@ -719,6 +724,7 @@ end;
procedure
TFViewOrders
.
HideNotification
;
procedure
TFViewOrders
.
HideNotification
;
begin
begin
pnlMessage
.
ElementHandle
.
hidden
:=
True
;
pnlMessage
.
ElementHandle
.
hidden
:=
True
;
info
:=
''
;
end
;
end
;
procedure
TFViewOrders
.
ShowNotification
(
Notification
:
string
);
procedure
TFViewOrders
.
ShowNotification
(
Notification
:
string
);
...
...
kgOrdersClient/View.UserProfile.html
View file @
aadb8619
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
<h1
class=
"page-header"
id=
"view.userprofile.title"
>
User Profile
</h1>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
col-sm
>
<div
class=
col-sm
>
<div
id=
"view.login.message"
class=
"alert alert-danger"
>
<div
id=
"view.login.message"
class=
"alert alert-danger"
>
...
...
kgOrdersClient/View.Users.html
View file @
aadb8619
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-12"
>
<div
class=
"col-12"
>
<h1
class=
"page-header pt-3"
id=
"view.users.title"
style=
"font-size: 24px;"
>
Users
</h1>
<div
class=
"container mt-4 px-0"
>
<div
class=
"container mt-4 px-0"
>
<div
class=
"row justify-content-center"
>
<div
class=
"row justify-content-center"
>
<div
class=
"col-12 col-md-8"
>
<div
class=
"col-12 col-md-8"
>
...
...
kgOrdersClient/template/css/app.css
View file @
aadb8619
...
@@ -19,6 +19,71 @@
...
@@ -19,6 +19,71 @@
box-sizing
:
border-box
;
/* Ensure padding is included in the element's total width and height */
box-sizing
:
border-box
;
/* Ensure padding is included in the element's total width and height */
}
}
/* Ensure that the title does not affect the navbar layout */
#view
.main.apptitle
{
display
:
flex
;
align-items
:
center
;
justify-content
:
flex-start
;
/* Align title to the left */
width
:
auto
;
/* Ensure it doesn't stretch the container */
margin-right
:
20px
;
/* Optional: add space between title and navbar items */
}
/* Fixed width for title area to prevent shifting */
#title
{
white-space
:
nowrap
;
/* Prevent the title text from wrapping */
width
:
200px
;
/* Fixed width for the title */
text-overflow
:
ellipsis
;
/* Truncate text with ellipsis if it overflows */
overflow
:
hidden
;
font-weight
:
bold
;
/* Optional: make the title text bold */
}
/* Navbar items - keep them aligned and spaced out */
.navbar-nav
.nav-item
{
padding
:
0
15px
;
/* Adjust spacing between navbar items */
}
/* Flexbox for the entire navbar */
.navbar-nav
{
display
:
flex
;
justify-content
:
flex-end
;
/* Align navbar items to the right */
width
:
100%
;
}
/* Additional mobile responsiveness (optional) */
@media
(
max-width
:
1200px
)
{
.navbar-nav
{
flex-direction
:
column
;
/* Stack items vertically on smaller screens */
align-items
:
flex-start
;
/* Align items to the left */
}
.navbar-nav-spaced
.nav-item
{
padding
:
10px
0
;
/* Adjust vertical spacing between items */
}
}
/* Make sure active navbar item color gets applied */
.navbar-nav
.nav-item
a
.active
{
color
:
#fff
!important
;
/* Set text color to white for active item */
background-color
:
#004F84
!important
;
/* Darker blue for active background */
font-weight
:
bold
;
}
/* Default navbar item color */
.navbar-nav
.nav-item
a
{
color
:
#000
!important
;
/* Default color for links */
transition
:
color
0.3s
ease
;
}
/* Navbar item hover state */
.navbar-nav
.nav-item
a
:hover
{
color
:
#fff
!important
;
/* Set hover text color to white */
background-color
:
#286090
!important
;
/* Light blue on hover */
}
.nav-item
{
padding
:
0
20px
;
/* Adjust this value for desired spacing between labels */
}
.mr-2
{
.mr-2
{
margin-right
:
0.5rem
;
margin-right
:
0.5rem
;
}
}
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
aadb8619
...
@@ -34,6 +34,7 @@ type
...
@@ -34,6 +34,7 @@ type
function
generateSubQuery
(
filterType
,
statusType
,
currStatus
:
string
):
string
;
function
generateSubQuery
(
filterType
,
statusType
,
currStatus
:
string
):
string
;
function
AddCorrugatedOrder
(
orderInfo
:
string
):
TJSONObject
;
function
AddCorrugatedOrder
(
orderInfo
:
string
):
TJSONObject
;
function
AddStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
integer
):
string
;
function
AddStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
integer
):
string
;
function
EditStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
string
):
string
;
procedure
AfterConstruction
;
override
;
procedure
AfterConstruction
;
override
;
procedure
BeforeDestruction
;
override
;
procedure
BeforeDestruction
;
override
;
end
;
end
;
...
@@ -650,6 +651,7 @@ var
...
@@ -650,6 +651,7 @@ var
DateFormat
:
TFormatSettings
;
DateFormat
:
TFormatSettings
;
CurrDate
:
TDateTime
;
CurrDate
:
TDateTime
;
ORDER_ID
:
integer
;
ORDER_ID
:
integer
;
mode
:
string
;
begin
begin
DateFormat
:=
TFormatSettings
.
Create
;
DateFormat
:=
TFormatSettings
.
Create
;
DateFormat
.
ShortDateFormat
:=
'yyyy-mm-dd'
;
DateFormat
.
ShortDateFormat
:=
'yyyy-mm-dd'
;
...
@@ -657,12 +659,21 @@ begin
...
@@ -657,12 +659,21 @@ begin
JSONData
:=
TJSONObject
.
ParseJSONValue
(
orderInfo
)
as
TJSONObject
;
JSONData
:=
TJSONObject
.
ParseJSONValue
(
orderInfo
)
as
TJSONObject
;
if
JSONData
=
nil
then
if
JSONData
=
nil
then
raise
Exception
.
Create
(
'Invalid JSON format'
);
// If parsing fails, raise an exception
raise
Exception
.
Create
(
'Invalid JSON format'
);
// If parsing fails, raise an exception
SQL
:=
'select * from corrugated_plate_orders where ORDER_ID = 0 and ORDER_ID <> 0'
;
mode
:=
JSONData
.
GetValue
<
string
>(
'mode'
);
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
if
mode
=
'ADD'
then
if
(
True
)
then
SQL
:=
'select * from corrugated_plate_orders where ORDER_ID = 0 and ORDER_ID <> 0'
else
begin
begin
ORDER_ID
:=
JSONData
.
GetValue
<
integer
>(
'ORDER_ID'
);
SQL
:=
'select * from corrugated_plate_orders where ORDER_ID = '
+
IntToStr
(
ORDER_ID
);
end
;
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
try
try
ordersDB
.
UniQuery1
.
Insert
;
if
mode
=
'ADD'
then
ordersDB
.
UniQuery1
.
Insert
else
ordersDB
.
UniQuery1
.
Edit
;
for
Pair
in
JSONData
do
for
Pair
in
JSONData
do
begin
begin
Field
:=
ordersDB
.
UniQuery1
.
FindField
(
Pair
.
JsonString
.
Value
);
// Checks if the field exists in the dataset
Field
:=
ordersDB
.
UniQuery1
.
FindField
(
Pair
.
JsonString
.
Value
);
// Checks if the field exists in the dataset
...
@@ -676,16 +687,27 @@ begin
...
@@ -676,16 +687,27 @@ begin
end
;
end
;
end
;
end
;
// Post the new
record to the database
// Post the
record to the database
ordersDB
.
UniQuery1
.
Post
;
ordersDB
.
UniQuery1
.
Post
;
if
mode
=
'ADD'
then
begin
SQL
:=
'select * from orders where ORDER_ID = 0 and ORDER_ID <> 0'
;
SQL
:=
'select * from orders where ORDER_ID = 0 and ORDER_ID <> 0'
;
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
ordersDB
.
UniQuery1
.
Insert
;
ordersDB
.
UniQuery1
.
Insert
;
end
else
begin
SQL
:=
'select * from orders where ORDER_ID = '
+
IntToStr
(
ORDER_ID
);
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
end
;
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'
;
if
mode
=
'ADD'
then
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_DATE'
).
AsDateTime
:=
Now
;
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_DATE'
).
AsDateTime
:=
Now
;
if
JSONData
.
GetValue
<
string
>(
'staff_fields_price'
)
=
''
then
if
JSONData
.
GetValue
<
string
>(
'staff_fields_price'
)
=
''
then
ordersDB
.
UniQuery1
.
FieldByName
(
'PRICE'
).
AsString
:=
'0'
ordersDB
.
UniQuery1
.
FieldByName
(
'PRICE'
).
AsString
:=
'0'
else
else
...
@@ -697,9 +719,12 @@ begin
...
@@ -697,9 +719,12 @@ begin
ordersDB
.
UniQuery1
.
Post
;
ordersDB
.
UniQuery1
.
Post
;
ordersDB
.
UniQuery1
.
Close
;
ordersDB
.
UniQuery1
.
Close
;
if
mode
=
'ADD'
then
begin
ordersDB
.
UniQuery1
.
SQL
.
Text
:=
'SELECT LAST_INSERT_ID() AS OrderID'
;
// Use database's method to get the last inserted ID
ordersDB
.
UniQuery1
.
SQL
.
Text
:=
'SELECT LAST_INSERT_ID() AS OrderID'
;
// Use database's method to get the last inserted ID
ordersDB
.
UniQuery1
.
Open
;
ordersDB
.
UniQuery1
.
Open
;
ORDER_ID
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'OrderID'
).
AsInteger
;
ORDER_ID
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'OrderID'
).
AsInteger
;
end
;
if
JSONData
.
GetValue
<
string
>(
'staff_fields_proof_date'
)
<>
''
then
if
JSONData
.
GetValue
<
string
>(
'staff_fields_proof_date'
)
<>
''
then
AddStatusSchedule
(
'PROOF'
,
JSONData
,
ORDER_ID
);
AddStatusSchedule
(
'PROOF'
,
JSONData
,
ORDER_ID
);
...
@@ -720,43 +745,58 @@ begin
...
@@ -720,43 +745,58 @@ begin
Result
:=
TJSONObject
.
Create
.
AddPair
(
'error'
,
E
.
Message
);
Result
:=
TJSONObject
.
Create
.
AddPair
(
'error'
,
E
.
Message
);
end
;
end
;
end
;
end
;
end
else
Result
:=
TJSONObject
.
Create
.
AddPair
(
'error'
,
'Order Already Exists'
);
end
;
end
;
function
TLookupService
.
AddStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
integer
):
string
;
function
TLookupService
.
AddStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
integer
):
string
;
var
var
SQL
:
string
;
SQL
:
string
;
temp
:
string
;
mode
:
string
;
begin
begin
mode
:=
order
.
GetValue
<
string
>(
'mode'
);
if
mode
=
'ADD'
then
begin
SQL
:=
'select * from orders_status_schedule where ORDER_ID = 0 and ORDER_ID <> 0'
;
SQL
:=
'select * from orders_status_schedule where ORDER_ID = 0 and ORDER_ID <> 0'
;
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
ordersDB
.
UniQuery1
.
Insert
;
ordersDB
.
UniQuery1
.
Insert
;
end
else
begin
SQL
:=
'select * from orders_status_schedule where ORDER_ID = '
+
IntToStr
(
ORDER_ID
);
doQuery
(
ordersDB
.
UniQuery1
,
SQL
);
ordersDB
.
UniQuery1
.
Edit
;
end
;
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_ID'
).
AsInteger
:=
ORDER_ID
;
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_ID'
).
AsInteger
:=
ORDER_ID
;
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_STATUS'
).
AsString
:=
StatusType
;
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_STATUS'
).
AsString
:=
StatusType
;
if
(
(
StatusType
=
'PROOF'
)
or
(
StatusType
=
'SHIP'
)
)
then
if
(
(
StatusType
=
'PROOF'
)
or
(
StatusType
=
'SHIP'
)
)
then
begin
begin
//temp := order.GetValue<string>('staff_fields_'+ StatusType.ToLower +'_date');
ordersDB
.
UniQuery1
.
FieldByName
(
'STATUS_DATE'
).
AsString
:=
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_date'
);
ordersDB
.
UniQuery1
.
FieldByName
(
'STATUS_DATE'
).
AsString
:=
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_date'
);
ordersDB
.
UniQuery1
.
FieldByName
(
'ORIGINAL_STATUS_DATE'
).
AsString
:=
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_date'
);
ordersDB
.
UniQuery1
.
FieldByName
(
'ORIGINAL_STATUS_DATE'
).
AsString
:=
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_date'
);
end
end
else
else
begin
begin
//temp := order.GetValue<string>('staff_fields_'+ StatusType.ToLower +'_due');
ordersDB
.
UniQuery1
.
FieldByName
(
'STATUS_DATE'
).
AsDateTime
:=
StrToDateTime
(
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_due'
));
ordersDB
.
UniQuery1
.
FieldByName
(
'STATUS_DATE'
).
AsDateTime
:=
StrToDateTime
(
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_due'
));
ordersDB
.
UniQuery1
.
FieldByName
(
'ORIGINAL_STATUS_DATE'
).
AsDateTime
:=
StrToDateTime
(
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_due'
));
ordersDB
.
UniQuery1
.
FieldByName
(
'ORIGINAL_STATUS_DATE'
).
AsDateTime
:=
StrToDateTime
(
order
.
GetValue
<
string
>(
'staff_fields_'
+
StatusType
.
ToLower
+
'_due'
));
end
;
end
;
ordersDB
.
UniQuery1
.
FieldByName
(
'USER_ID'
).
AsString
:=
order
.
GetValue
<
string
>(
'USER_ID'
);
ordersDB
.
UniQuery1
.
FieldByName
(
'USER_ID'
).
AsString
:=
order
.
GetValue
<
string
>(
'USER_ID'
);
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_REVISION'
).
AsInteger
:=
1
;
if
mode
=
'ADD'
then
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_REVISION'
).
AsInteger
:=
1
else
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_REVISION'
).
AsInteger
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_REVISION'
).
AsInteger
+
1
;
ordersDB
.
UniQuery1
.
Post
;
ordersDB
.
UniQuery1
.
Post
;
Result
:=
'success'
;
Result
:=
'success'
;
end
;
end
;
function
TLookupService
.
EditStatusSchedule
(
StatusType
:
string
;
order
:
TJSONObject
;
ORDER_ID
:
string
):
string
;
var
SQL
:
string
;
begin
end
;
function
TLookupService
.
AddUser
(
userInfo
:
string
):
string
;
function
TLookupService
.
AddUser
(
userInfo
:
string
):
string
;
var
var
user
:
string
;
user
:
string
;
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
aadb8619
[Options]
[Options]
LogFileNum
=
198
LogFileNum
=
207
UpdateTimerLength
=
0
UpdateTimerLength
=
0
...
...
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