-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRetailShiftTransactionService_Extension.xml
131 lines (119 loc) · 4.73 KB
/
RetailShiftTransactionService_Extension.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0" encoding="utf-8"?>
<AxClass xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>RetailShiftTransactionService_Extension</Name>
<SourceCode>
<Declaration><![CDATA[
[ExtensionOf(classStr(RetailTransactionServiceEx))]
final class RetailShiftTransactionService_Extension
{
}
]]></Declaration>
<Methods>
<Method>
<Name>CreateNewShift</Name>
<Source><![CDATA[
public static container CreateNewShift(
RefRecId _channel,
RetailTerminalId _terminalId,
RetailStoreId _storeId,
RetailPosBatchID _shiftId,
RetailStaffId _staffId,
RetailStaffId _currentStaffId,
int _status,
RetailTerminalId _currentTerminalId,
NoYes _isShared,
Name _cashDrawer,
DataAreaId _dataAreaId = curExt()
)
{
boolean success = true;
str error = '';
RetailShiftUnclosedTable retailShiftUnclosedTable;
select firstonly retailShiftUnclosedTable
where retailShiftUnclosedTable.Channel == _channel &&
retailShiftUnclosedTable.TerminalId == _terminalId &&
retailShiftUnclosedTable.ShiftID == _shiftId;
if (!retailShiftUnclosedTable.RecId)
{
ttsbegin;
ShiftStatus _shiftStatus = any2Enum(_status);
retailShiftUnclosedTable.Channel = _channel;
retailShiftUnclosedTable.TerminalId = _terminalId;
retailShiftUnclosedTable.StoreId = _storeId;
retailShiftUnclosedTable.ShiftID = _shiftId;
retailShiftUnclosedTable.StaffId = _staffId;
retailShiftUnclosedTable.CurrentStaffId = _currentStaffId;
retailShiftUnclosedTable.Status = _shiftStatus;
retailShiftUnclosedTable.CurrentTerminalId = _currentTerminalId;
retailShiftUnclosedTable.IsShared = _isShared;
retailShiftUnclosedTable.StartDateTimeUTC = DateTimeUtil::getSystemDateTime();;
retailShiftUnclosedTable.StatusDateTimeUTC = DateTimeUtil::getSystemDateTime();;
retailShiftUnclosedTable.CashDrawer = _cashDrawer;
retailShiftUnclosedTable.insert();
ttscommit;
}
return [success, error, RetailShiftUnclosedTable.RecId];
}
]]></Source>
</Method>
<Method>
<Name>RemoveOpenedShift</Name>
<Source><![CDATA[
public static container RemoveOpenedShift(
RefRecId _channel,
RetailTerminalId _terminalId,
RetailPosBatchID _shiftId)
{
boolean success = true;
str error = "";
RetailShiftUnclosedTable retailShiftUnclosedTable;
select forupdate retailShiftUnclosedTable
where retailShiftUnclosedTable.Channel == _channel &&
retailShiftUnclosedTable.TerminalId == _terminalId &&
retailShiftUnclosedTable.ShiftID == _shiftId;
if (retailShiftUnclosedTable.RecId)
{
ttsbegin;
retailShiftUnclosedTable.delete();
ttscommit;
}
return [success, error, RetailShiftUnclosedTable.RecId];
}
]]></Source>
</Method>
<Method>
<Name>ChangeShiftStatus</Name>
<Source><![CDATA[
public static container ChangeShiftStatus(
RefRecId _channel,
RetailTerminalId _terminalId,
RetailPosBatchID _shiftId,
int _status,
RetailTerminalId _currentTerminalId,
RetailStaffId _currentStaffId)
{
boolean success = true;
str error = '';
RetailShiftUnclosedTable retailShiftUnclosedTable;
ShiftStatus shiftStatus = any2Enum(_status);
select forupdate retailShiftUnclosedTable
where retailShiftUnclosedTable.Channel == _channel &&
retailShiftUnclosedTable.TerminalId == _terminalId &&
retailShiftUnclosedTable.ShiftID == _shiftId;
if (retailShiftUnclosedTable.RecId)
{
ttsbegin;
retailShiftUnclosedTable.Status = shiftStatus;
retailShiftUnclosedTable.StartDateTimeUTC = DateTimeUtil::getSystemDateTime();
retailShiftUnclosedTable.CurrentTerminalId = _currentTerminalId;
retailShiftUnclosedTable.CurrentStaffId = _currentStaffId;
retailShiftUnclosedTable.update();
ttscommit;
}
return [success, error, RetailShiftUnclosedTable.RecId];
}
]]></Source>
</Method>
</Methods>
</SourceCode>
</AxClass>