-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypesunit.pas
175 lines (148 loc) · 5.74 KB
/
typesunit.pas
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
unit TypesUnit;
//------------------------------------------------------------------------------
// Типы данных
//------------------------------------------------------------------------------
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, AtolKKTUnit;
const
// размер входного и выходного буфера именованного канала 65536 байт
// команды в формате json, превышающие размер в байтах в 65536 должны быть разделены на более короткие и отосланы специальной командой
PIPE_BUFFER = $FFFF;
PIPE_TIMEOUT = 5000;
PIPE_SHUTDOWN = 'SHUTDOWN';
TEST_CHEQUE = ' Магазин "Детский Мир" '#13#10
+' Москва,ул.Вавилова,д.19, '#13#10
+' тел. 123-4567 '#13#10
+' '#13#10
+'24.12.14 10:41'#13#10
+' ЧЕК '#13#10
+' Оплата '#13#10
+'Номер операции: 0007'#13#10
+'Терминал: 00859916'#13#10
+'Пункт обслуживания: 854444445555'#13#10
+' Visa '#13#10
+'Карта:(D) ************0002'#13#10
+'Клиент: '#13#10
+' '#13#10
+'Сумма (Руб): '#13#10
+' 4.28 '#13#10
+'Комиссия за операцию - 0 руб. '#13#10
+'ОДОБРЕНО Код авторизации: 12Y561'#13#10
+' '#13#10
+' '#13#10
+' '#13#10
+' ________________________________ '#13#10
+' подпись клиента '#13#10
+' '#13#10
+' '#13#10
+' _________________________________ '#13#10
+' подпись кассира(контролера) '#13#10
+'2FEBABF549641069E2C9DCAC831DD04373B24A83'#13#10
+'========================================';
type
RequestComandType=(rctUnknown, rctPrintTestCheque, rctCashRegisterInf,
rctPrintTStringList, rctPrintStringList, rctChequePartialCut,
rctChequeFullCut, rctResetSummary, rctTechReset, rctIncome,
rctXReport, rctZReport, rctCashIncome, rctCashOutcome,
rctReturn, rctOpenSession, rctPrintLastCheckCopy,
rctSegment);
AtolDeviceDataType=record
atol_device_number: integer;
atol_operator_password: string;
end;
RequestType=record
comand: RequestComandType;
data: string;
atol_device_data: AtolDeviceDataType;
end;
ResponseType=record
response: string;
error_code: integer;
error: string;
end;
RequestSegmentType=record
guid: string;
num: integer;
count: integer;
text: string;
end;
CashRegisterInfType=record
KKMDateTime: string;
KKMEarnings: real;
KKMEarningSession: real;
KKMSum: real;
Mode: integer;
SerialNumber: string;
CheckFontSizeString: string;
CheckLineSpacing: integer;
SessionNumber: integer;
isFiskal: boolean;
isSessionExceedLimit24: boolean;
isSessionOpened: boolean;
CashRegisterNum: integer;
end;
TFileVersionInfo = record
FileType,
CompanyName,
FileDescription,
FileVersion,
InternalName,
LegalCopyRight,
LegalTradeMarks,
OriginalFileName,
ProductName,
ProductVersion,
Comments,
SpecialBuildStr,
PrivateBuildStr,
FileFunction : string;
DebugBuild,
PreRelease,
SpecialBuild,
PrivateBuild,
Patched,
InfoInferred : Boolean;
end;
ExceptionEventLogType=(eeltSQL, eeltInput, eeltOther);
EventLogType=(eltInf,eltWarn,eltErr);
CashRegAtolConnectModeType=(crAtolCM_NO_DEVICE, crAtolCM_OLE);
AtolDeviceType=record
atol_cash_register: boolean; // подключаться или нет
atol_device_number: integer;
atol_ffd_version: FFDVersionType;
atol: TAtolKKT;
atol_set_time_on_connect: boolean;
atol_reg_product_discount,
atol_reg_product_barcode: boolean;
atol_admin_password: string;
atol_operator_password: string;
atol_cash_register_num: integer; // номер кассы для печати на чеке АТОЛ
atol_view_options_button: boolean;
atol_connect_mode: CashRegAtolConnectModeType; // режим взаимодействия с АТОЛ
atol_reg_product_nds_zero: boolean;
atol_print_reports_on_real_printer: boolean;
atol_cut_acquiring_cheque: integer;
end;
AtolDeviceArrayType=array of AtolDeviceType;
ChequeGoodsType = record
name: string;
price: real;
kol: integer;
nds: NDSType;
barcode: string;
dep: integer;
discount: real;
end;
ChequeGoodsArrayType = array of ChequeGoodsType;
ChequeDataType = record
goods: ChequeGoodsArrayType;
check_sm: real;
check_discount_sm: real;
type_close: TypeCloseType;
cash_sm: real;
tr_id: integer;
end;
implementation
end.