-
Notifications
You must be signed in to change notification settings - Fork 4
/
JSON.InvoiceList.pas
521 lines (438 loc) · 14.3 KB
/
JSON.InvoiceList.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
unit JSON.InvoiceList;
// *************************************************
// Generated By: JsonToDelphiClass - 0.65
// Project link: https://github.com/PKGeorgiev/Delphi-JsonToDelphiClass
// Generated On: 2019-05-22 08:20:03
// *************************************************
// Created By : Petar Georgiev - 2014
// WebSite : http://pgeorgiev.com
// *************************************************
interface
uses
Generics.Collections
, Rest.Json
, REST.JSON.Types
;
type
TCreditChargeInfoClass = class
private
FProcessPayment: Boolean;
public
property ProcessPayment: Boolean read FProcessPayment write FProcessPayment;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TCreditChargeInfoClass;
end;
TCreditCardPaymentClass = class
private
FCreditChargeInfo: TCreditChargeInfoClass;
public
property CreditChargeInfo: TCreditChargeInfoClass read FCreditChargeInfo write FCreditChargeInfo;
constructor Create;
destructor Destroy; override;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TCreditCardPaymentClass;
end;
TCustomerRefClass = class
private
FName: String;
FValue: String;
public
property name: String read FName write FName;
property value: String read FValue write FValue;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TCustomerRefClass;
end;
TCustomerMemoClass = class
private
FValue: String;
public
property value: String read FValue write FValue;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TCustomerMemoClass;
end;
TItemRefClass = class
private
FName: String;
FValue: String;
public
property name: String read FName write FName;
property value: String read FValue write FValue;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TItemRefClass;
end;
TSalesItemLineDetailClass = class
private
[JSONName('ItemRef')]
FItemRef: TItemRefClass;
[JSONName('Qty')]
FQty: Extended;
[JSONName('UnitPrice')]
FUnitPrice: Extended;
public
property ItemRef: TItemRefClass read FItemRef write FItemRef;
property Qty: Extended read FQty write FQty;
property UnitPrice: Extended read FUnitPrice write FUnitPrice;
constructor Create;
destructor Destroy; override;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TSalesItemLineDetailClass;
end;
TLineClass = class
private
[JSONName('Amount')]
FAmount: Extended;
[JSONName('Description')]
FDescription: String;
[JSONName('DetailType')]
FDetailType: String;
[JSONName('Id')]
FId: String;
[JSONName('LineNum')]
FLineNum: Extended;
[JSONName('SalesItemLineDetail')]
FSalesItemLineDetail: TSalesItemLineDetailClass;
public
property Amount: Extended read FAmount write FAmount;
property Description: String read FDescription write FDescription;
property DetailType: String read FDetailType write FDetailType;
property Id: String read FId write FId;
property LineNum: Extended read FLineNum write FLineNum;
property SalesItemLineDetail: TSalesItemLineDetailClass read FSalesItemLineDetail write FSalesItemLineDetail;
constructor Create;
destructor Destroy; override;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TLineClass;
end;
TLinkedTxnClass = class
private
[JSONName('TxnId')]
FTxnId: String;
[JSONName('TxnType')]
FTxnType: String;
public
property TxnId: String read FTxnId write FTxnId;
property TxnType: String read FTxnType write FTxnType;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TLinkedTxnClass;
end;
TCurrencyRefClass = class
private
FName: String;
FValue: String;
public
property name: String read FName write FName;
property value: String read FValue write FValue;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TCurrencyRefClass;
end;
TMetaDataClass = class
private
FCreateTime: String;
FLastUpdatedTime: String;
public
property CreateTime: String read FCreateTime write FCreateTime;
property LastUpdatedTime: String read FLastUpdatedTime write FLastUpdatedTime;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TMetaDataClass;
end;
TInvoiceClass = class
private
FAllowIPNPayment: Boolean;
FAllowOnlineACHPayment: Boolean;
FAllowOnlineCreditCardPayment: Boolean;
FAllowOnlinePayment: Boolean;
[JSONName('Balance')]
FBalance: Extended;
[JSONName('CreditCardPayment')]
FCreditCardPayment: TCreditCardPaymentClass;
[JSONName('CurrencyRef')]
FCurrencyRef: TCurrencyRefClass;
[JSONName('CustomerRef')]
FCustomerRef: TCustomerRefClass;
[JSONName('CustomerMemo')]
FCustomerMemo: TCustomerMemoClass;
[JSONName('Deposit')]
FDeposit: Extended;
[JSONName('DocNumber')]
FDocNumber: String;
[JSONName('DueDate')]
FDueDate: TDate;
[JSONName('EmailStatus')]
FEmailStatus: String;
[JSONName('GlobalTaxCalculation')]
FGlobalTaxCalculation: String;
[JSONName('Id')]
FId: String;
[JSONName('Line')]
FLine: TArray<TLineClass>;
[JSONName('LinkedTxn')]
FLinkedTxn: TArray<TLinkedTxnClass>;
[JSONName('MetaData')]
FMetaData: TMetaDataClass;
[JSONName('PrintStatus')]
FPrintStatus: String;
[JSONName('PrivateNote')]
FPrivateNote: String;
[JSONName('SyncToken')]
FSyncToken: String;
[JSONName('TotalAmt')]
FTotalAmt: Extended;
[JSONName('TrackingNum')]
FTrackingNum : string;
[JSONName('TxnDate')]
FTxnDate: String;
[JSONName('TxnSource')]
FTxnSource: String;
FDomain: String;
FSparse: Boolean;
public
property AllowIPNPayment: Boolean read FAllowIPNPayment write FAllowIPNPayment;
property AllowOnlineACHPayment: Boolean read FAllowOnlineACHPayment write FAllowOnlineACHPayment;
property AllowOnlineCreditCardPayment: Boolean read FAllowOnlineCreditCardPayment write FAllowOnlineCreditCardPayment;
property AllowOnlinePayment: Boolean read FAllowOnlinePayment write FAllowOnlinePayment;
property Balance: Extended read FBalance write FBalance;
property CreditCardPayment: TCreditCardPaymentClass read FCreditCardPayment write FCreditCardPayment;
property CurrencyRef: TCurrencyRefClass read FCurrencyRef write FCurrencyRef;
property CustomerRef: TCustomerRefClass read FCustomerRef write FCustomerRef;
property CustomerMemo: TCustomerMemoClass read FCustomerMemo write FCustomerMemo;
property Deposit: Extended read FDeposit write FDeposit;
property DocNumber: String read FDocNumber write FDocNumber;
property DueDate: TDate read FDueDate write FDueDate;
property EmailStatus: String read FEmailStatus write FEmailStatus;
property GlobalTaxCalculation: String read FGlobalTaxCalculation write FGlobalTaxCalculation;
property Id: String read FId write FId;
property Line: TArray<TLineClass> read FLine write FLine;
property LinkedTxn: TArray<TLinkedTxnClass> read FLinkedTxn write FLinkedTxn;
property MetaData: TMetaDataClass read FMetaData write FMetaData;
property PrintStatus: String read FPrintStatus write FPrintStatus;
property PrivateNote: String read FPrivateNote write FPrivateNote;
property SyncToken: String read FSyncToken write FSyncToken;
property TotalAmt: Extended read FTotalAmt write FTotalAmt;
property TrackingNum: String read FTrackingNum write FTrackingNum;
property TxnDate: String read FTxnDate write FTxnDate;
property TxnSource: String read FTxnSource write FTxnSource;
property domain: String read FDomain write FDomain;
property sparse: Boolean read FSparse write FSparse;
constructor Create;
destructor Destroy; override;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TInvoiceClass;
end;
TQueryResponseClass = class
private
FInvoice: TArray<TInvoiceClass>;
FMaxResults: Extended;
FStartPosition: Extended;
FTotalCount: Extended;
public
property Invoice: TArray<TInvoiceClass> read FInvoice write FInvoice;
property maxResults: Extended read FMaxResults write FMaxResults;
property startPosition: Extended read FStartPosition write FStartPosition;
property totalCount: Extended read FTotalCount write FTotalCount;
destructor Destroy; override;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TQueryResponseClass;
end;
TJSONInvoiceListClass = class
private
FQueryResponse: TQueryResponseClass;
FTime: String;
public
property QueryResponse: TQueryResponseClass read FQueryResponse write FQueryResponse;
property time: String read FTime write FTime;
constructor Create;
destructor Destroy; override;
function ToJsonString: string;
class function FromJsonString(AJsonString: string): TJSONInvoiceListClass;
end;
implementation
{TCreditChargeInfoClass}
function TCreditChargeInfoClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TCreditChargeInfoClass.FromJsonString(AJsonString: string): TCreditChargeInfoClass;
begin
result := TJson.JsonToObject<TCreditChargeInfoClass>(AJsonString)
end;
{TCreditCardPaymentClass}
constructor TCreditCardPaymentClass.Create;
begin
inherited;
FCreditChargeInfo := TCreditChargeInfoClass.Create;
end;
destructor TCreditCardPaymentClass.Destroy;
begin
FCreditChargeInfo.free;
inherited;
end;
function TCreditCardPaymentClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TCreditCardPaymentClass.FromJsonString(AJsonString: string): TCreditCardPaymentClass;
begin
result := TJson.JsonToObject<TCreditCardPaymentClass>(AJsonString)
end;
{TCustomerRefClass}
function TCustomerRefClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TCustomerRefClass.FromJsonString(AJsonString: string): TCustomerRefClass;
begin
result := TJson.JsonToObject<TCustomerRefClass>(AJsonString)
end;
{TItemRefClass}
function TItemRefClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TItemRefClass.FromJsonString(AJsonString: string): TItemRefClass;
begin
result := TJson.JsonToObject<TItemRefClass>(AJsonString)
end;
{TSalesItemLineDetailClass}
constructor TSalesItemLineDetailClass.Create;
begin
inherited;
FItemRef := TItemRefClass.Create;
end;
destructor TSalesItemLineDetailClass.Destroy;
begin
FItemRef.free;
inherited;
end;
function TSalesItemLineDetailClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TSalesItemLineDetailClass.FromJsonString(AJsonString: string): TSalesItemLineDetailClass;
begin
result := TJson.JsonToObject<TSalesItemLineDetailClass>(AJsonString)
end;
{TLineClass}
constructor TLineClass.Create;
begin
inherited;
FSalesItemLineDetail := TSalesItemLineDetailClass.Create;
end;
destructor TLineClass.Destroy;
begin
FSalesItemLineDetail.free;
inherited;
end;
function TLineClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TLineClass.FromJsonString(AJsonString: string): TLineClass;
begin
result := TJson.JsonToObject<TLineClass>(AJsonString)
end;
{TLinkedTxnClass}
function TLinkedTxnClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TLinkedTxnClass.FromJsonString(AJsonString: string): TLinkedTxnClass;
begin
result := TJson.JsonToObject<TLinkedTxnClass>(AJsonString)
end;
{TCurrencyRefClass}
function TCurrencyRefClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TCurrencyRefClass.FromJsonString(AJsonString: string): TCurrencyRefClass;
begin
result := TJson.JsonToObject<TCurrencyRefClass>(AJsonString)
end;
{TMetaDataClass}
function TMetaDataClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TMetaDataClass.FromJsonString(AJsonString: string): TMetaDataClass;
begin
result := TJson.JsonToObject<TMetaDataClass>(AJsonString)
end;
{TInvoiceClass}
constructor TInvoiceClass.Create;
begin
inherited;
FMetaData := TMetaDataClass.Create;
FCurrencyRef := TCurrencyRefClass.Create;
FCustomerRef := TCustomerRefClass.Create;
FCustomerMemo := TCustomerMemoClass.Create;
FCreditCardPayment := TCreditCardPaymentClass.Create;
end;
destructor TInvoiceClass.Destroy;
var
LLinkedTxnItem: TLinkedTxnClass;
LLineItem: TLineClass;
begin
for LLinkedTxnItem in FLinkedTxn do
LLinkedTxnItem.free;
for LLineItem in FLine do
LLineItem.free;
FMetaData.free;
FCurrencyRef.free;
FCustomerRef.free;
FCreditCardPayment.free;
inherited;
end;
function TInvoiceClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TInvoiceClass.FromJsonString(AJsonString: string): TInvoiceClass;
begin
result := TJson.JsonToObject<TInvoiceClass>(AJsonString)
end;
{TQueryResponseClass}
destructor TQueryResponseClass.Destroy;
var
LInvoiceItem: TInvoiceClass;
begin
for LInvoiceItem in FInvoice do
LInvoiceItem.free;
inherited;
end;
function TQueryResponseClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TQueryResponseClass.FromJsonString(AJsonString: string): TQueryResponseClass;
begin
result := TJson.JsonToObject<TQueryResponseClass>(AJsonString)
end;
{TRootClass}
constructor TJSONInvoiceListClass.Create;
begin
inherited;
FQueryResponse := TQueryResponseClass.Create;
end;
destructor TJSONInvoiceListClass.Destroy;
begin
FQueryResponse.free;
inherited;
end;
function TJSONInvoiceListClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
class function TJSONInvoiceListClass.FromJsonString(AJsonString: string): TJSONInvoiceListClass;
begin
result := TJson.JsonToObject<TJSONInvoiceListClass>(AJsonString)
end;
{ TCustomerMemoClass }
class function TCustomerMemoClass.FromJsonString(AJsonString: string): TCustomerMemoClass;
begin
result := TJson.JsonToObject<TCustomerMemoClass>(AJsonString)
end;
function TCustomerMemoClass.ToJsonString: string;
begin
result := TJson.ObjectToJsonString(self);
end;
end.