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
c4ce4a58
Commit
c4ce4a58
authored
Oct 01, 2024
by
cam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
got autofill working properly and began work on Web Plate order entry
parent
0b8080eb
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
213 deletions
+23
-213
View.OrderEntry.pas
kgOrdersClient/View.OrderEntry.pas
+4
-2
View.Orders.dfm
kgOrdersClient/View.Orders.dfm
+3
-0
View.Orders.pas
kgOrdersClient/View.Orders.pas
+13
-7
Lookup.Service.pas
kgOrdersServer/Source/Lookup.Service.pas
+1
-0
Lookup.ServiceImpl.pas
kgOrdersServer/Source/Lookup.ServiceImpl.pas
+1
-203
kgOrdersServer.ini
kgOrdersServer/kgOrdersServer.ini
+1
-1
No files found.
kgOrdersClient/View.OrderEntry.pas
View file @
c4ce4a58
...
...
@@ -175,6 +175,7 @@ type
FAgencyCode
:
string
;
FCurrentReportType
:
string
;
FSelectProc
:
TSelectProc
;
orderID
:
string
;
//FJSONProc1: TJSONProc1;
public
class
function
CreateForm
(
AElementID
,
orderInfo
:
string
):
TWebForm
;
...
...
@@ -198,9 +199,11 @@ begin
with
TFOrderEntry
(
AForm
)
do
begin
HideNotification
;
TFOrderEntry
(
AForm
).
orderID
:=
orderInfo
;
end
;
end
);
end
;
procedure
TFOrderEntry
.
addColorRow
(
num
:
string
;
Color
:
string
;
LPI
:
string
;
Size
:
string
);
...
...
@@ -320,8 +323,7 @@ end;
procedure
TFOrderEntry
.
WebFormShow
(
Sender
:
TObject
);
begin
getOrder
(
'7394'
);
{}
getOrder
(
orderID
);
end
;
procedure
TFOrderEntry
.
HideNotification
;
...
...
kgOrdersClient/View.Orders.dfm
View file @
c4ce4a58
...
...
@@ -224,6 +224,9 @@ object FViewOrders: TFViewOrders
object XDataWebDataSet1plateDone: TStringField
FieldName = 'plateDone'
end
object XDataWebDataSet1orderType: TStringField
FieldName = 'orderType'
end
end
object WebDataSource1: TWebDataSource
DataSet = XDataWebDataSet1
...
...
kgOrdersClient/View.Orders.pas
View file @
c4ce4a58
...
...
@@ -46,6 +46,7 @@ type
lblEntries2
:
TWebLabel
;
XDataWebDataSet1plateDue
:
TStringField
;
XDataWebDataSet1plateDone
:
TStringField
;
XDataWebDataSet1orderType
:
TStringField
;
procedure
WebFormCreate
(
Sender
:
TObject
);
procedure
btnApplyClick
(
Sender
:
TObject
);
procedure
btnSearchClick
(
Sender
:
TObject
);
...
...
@@ -57,7 +58,7 @@ type
procedure
ClearTable
();
procedure
GeneratePagination
(
TotalPages
:
Integer
);
function
GenerateSearchOptions
():
string
;
procedure
orderEntry
();
procedure
orderEntry
(
orderInfo
:
string
);
[
async
]
procedure
Search
(
searchOptions
:
string
);
[
async
]
procedure
GetOrders
(
searchOptions
:
string
);
[
async
]
procedure
getUser
();
...
...
@@ -117,7 +118,6 @@ begin
user
:=
TJSObject
(
data
[
0
]);
end
;
procedure
TFViewOrders
.
AddRowToTable
(
temp
:
string
);
// Adds rows to the table
// PhoneNumber: phone number of the location
...
...
@@ -130,10 +130,17 @@ var
colorObject
:
TJSObject
;
colorList
:
TJSArray
;
colors
:
integer
;
ClickHandler
:
TJSFunction
;
id
:
string
;
begin
NewRow
:=
TJSHTMLElement
(
document
.
createElement
(
'tr'
));
NewRow
.
Attrs
[
'orderType'
]
:=
XDataWebDataSet1orderType
.
Value
;
NewRow
.
addEventListener
(
'click'
,
procedure
begin
orderEntry
(
NewRow
.
Attrs
[
'id'
]);
end
);
// Order ID Cell
NewRow
.
Attrs
[
'id'
]
:=
XDataWebDataSet1ID
.
Value
;
Cell
:=
TJSHTMLElement
(
document
.
createElement
(
'td'
));
Cell
.
setAttribute
(
'data-label'
,
'Order ID'
);
if
XDataWebDataSet1ID
.
Value
=
''
then
...
...
@@ -292,7 +299,6 @@ begin
end
;
NewRow
.
appendChild
(
Cell
);
// Appends new rows to the table body
TJSHTMLElement
(
document
.
getElementById
(
'tblPhoneGrid'
).
getElementsByTagName
(
'tbody'
)[
0
]).
appendChild
(
NewRow
);
end
;
...
...
@@ -561,12 +567,12 @@ end;
procedure
TFViewOrders
.
btnaddOrderClick
(
Sender
:
TObject
);
begin
orderEntry
();
orderEntry
(
''
);
end
;
procedure
TFViewOrders
.
orderEntry
();
procedure
TFViewOrders
.
orderEntry
(
orderInfo
:
string
);
begin
FViewMain
.
ViewOrderEntry
(
''
);
FViewMain
.
ViewOrderEntry
(
orderInfo
);
end
;
procedure
TFViewOrders
.
btnApplyClick
(
Sender
:
TObject
);
...
...
kgOrdersServer/Source/Lookup.Service.pas
View file @
c4ce4a58
...
...
@@ -74,6 +74,7 @@ type
price
:
string
;
qbRefNum
:
string
;
colors
:
string
;
orderType
:
string
;
end
;
TOrderList
=
class
...
...
kgOrdersServer/Source/Lookup.ServiceImpl.pas
View file @
c4ce4a58
...
...
@@ -145,209 +145,6 @@ begin
limit
:=
IntToStr
(
PageSize
);
whereSQL
:=
'WHERE '
;
{SQL := 'SELECT o.ORDER_ID, o.LOCATION AS Loc, c.NAME AS COMPANY_NAME, o.JOB_NAME, o.ORDER_DATE, o.ORDER_TYPE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ';
// if proof is chosen as the filter
if filterType = 'proof' then
begin
if startDate <> '' then
begin
whereSQL := 'WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'' AND ' +
quotedStr(startDate) +' <= oss.STATUS_DATE';
end;
if endDate <> '' then
begin
if whereSQL = 'WHERE ' then
begin
whereSQL := 'WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'' AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) '
end
else
begin
whereSQL := whereSQL + ' AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) ';
end;
end
else
begin
whereSQL := 'WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'') ';
end;
end
else
begin
whereSQL := 'WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PROOF'') '
end;
SQL := SQL + whereSQL + 'AS PROOF_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''PROOF'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS PROOF_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ';
// if art is chosen as the filter
whereSQL := 'WHERE ';
if filterType = 'art' then
begin
if startDate <> '' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''ART'' AND oss.STATUS_DATE >= ' +
quotedStr(startDate);
end;
if endDate <> '' then
begin
if whereSQL = 'WHERE ' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''ART'' AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) '
end
else
begin
whereSQL := whereSQL + ' AND oss.STATUS_DATE <= ' + quotedStr(endDate);
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''ART'') ';
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''ART'') '
end;
SQL := SQL + whereSQL + 'AS ART_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''ART'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS ART_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ';
// if plate is chosen as the filter
whereSQL := 'WHERE ';
if filterType = 'plate' then
begin
if startDate <> '' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PLATE'' AND ' +
quotedStr(startDate) +' <= oss.STATUS_DATE';
end;
if endDate <> '' then
begin
if whereSQL = 'WHERE ' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PLATE'' AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) '
end
else
begin
whereSQL := whereSQL + 'AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) ';
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PLATE'') ';
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''PLATE'') '
end;
SQL := SQL + whereSQL + 'AS PLATE_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''PLATE'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS PLATE_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ';
// if mount is selected as the filter
whereSQL := 'WHERE ';
if filterType = 'mount' then
begin
if startDate <> '' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''MOUNT'' AND ' +
quotedStr(startDate) +' <= oss.STATUS_DATE';
end;
if endDate <> '' then
begin
if whereSQL = 'WHERE ' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''MOUNT'' AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) '
end
else
begin
whereSQL := whereSQL + 'AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) ';
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''MOUNT'') ';
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''MOUNT'') '
end;
SQL := SQL + whereSQL + 'AS MOUNT_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''MOUNT'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS MOUNT_DONE, ' +
'(SELECT oss.STATUS_DATE ' +
' FROM orders_status_schedule oss ';
// if ship is chosen as the filter
whereSQL := 'WHERE ';
if filterType = 'mount' then
begin
if startDate <> '' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''SHIP'' AND ' +
quotedStr(startDate) +' <= oss.STATUS_DATE';
end;
if endDate <> '' then
begin
if whereSQL = 'WHERE ' then
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''SHIP'' AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) '
end
else
begin
whereSQL := whereSQL + 'AND ' +
quotedStr(endDate) + ' >= oss.STATUS_DATE ) ';
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''SHIP'') ';
end;
end
else
begin
whereSQL := ' WHERE oss.ORDER_ID = o.ORDER_ID AND oss.ORDER_STATUS = ''SHIP'') '
end;
SQL := SQL + whereSQL + 'AS SHIP_DUE, ' +
'(SELECT os.STATUS_TIMESTAMP ' +
' FROM orders_status os ' +
' WHERE os.ORDER_ID = o.ORDER_ID AND os.ORDER_STATUS = ''SHIP'' ' +
' ORDER BY os.STATUS_TIMESTAMP DESC LIMIT 1) AS SHIP_DONE, ' +
'o.PRICE, qb.QB_REF_NUM ' +
'FROM orders o ' +
'JOIN customers c ON c.CUSTOMER_ID = o.COMPANY_ID ' +
'LEFT JOIN qb_sales_orders qb ON qb.ORDER_ID = o.ORDER_ID ' +
'ORDER BY o.ORDER_DATE DESC ' +
'LIMIT ' + limit + ' OFFSET ' + offset; }
if
filterType
<>
''
then
begin
SQL
:=
'SELECT o.ORDER_ID, oss.STATUS_DATE AS '
+
filterType
.
ToUpper
+
'_DUE'
+
...
...
@@ -407,6 +204,7 @@ begin
order
.
shipDone
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'SHIP_DONE'
).
AsString
;
order
.
price
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'PRICE'
).
AsString
;
order
.
qbRefNum
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'QB_REF_NUM'
).
AsString
;
order
.
orderType
:=
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_TYPE'
).
AsString
;
if
ordersDB
.
UniQuery1
.
FieldByName
(
'ORDER_TYPE'
).
AsString
=
'web_plate'
then
begin
...
...
kgOrdersServer/kgOrdersServer.ini
View file @
c4ce4a58
[Options]
LogFileNum
=
13
4
LogFileNum
=
13
7
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