-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathobjPosSale.pas
783 lines (632 loc) · 23.5 KB
/
objPosSale.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
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
unit objPosSale;
interface
uses
Windows,
Messages,
SysUtils,
Variants,
Classes,
Contnrs,
Dialogs,
NativeXML,
_Glob
, System.Generics.Collections
;
TYPE
//////////////////////////////////////////////////////////////////////////////
// TPosSaleItem
// Vörulína sem kemur frá POS Þessi vörulína fer síðan
// á uppsöfnunarreikning HOME
//////////////////////////////////////////////////////////////////////////////
TPosSaleItem = class
FSaleRefrence : string ;
FLineNumber : integer ;
FItemCode : string ;
FItemDescription : string ;
FUnitPrice : extended;
FQuantity : extended;
FVatCode : string ;
FVatPr : extended;
FAmount : extended;
FAmountWoVat : extended;
function GetSaleRefrence : string;
function GetLineNumber : integer;
function GetItemCode : string;
function GetItemDescription : string;
function GetUnitPrice : extended;
function GetQuantity : extended;
function GetVatCode : string;
function GetVatPr : extended;
function GetAmount : extended;
function GetAmountWoVat : extended;
procedure SetSaleRefrence(Value :string );
procedure SetLineNumber(Value :integer );
procedure SetItemCode(Value :string );
procedure SetItemDescription(Value :string );
procedure SetUnitPrice(Value :extended );
procedure SetQuantity(Value :extended );
procedure SetVatCode(Value :string );
procedure SetVatPr(Value :extended );
procedure SetAmount(Value :extended );
procedure SetAmountWoVat(Value :extended );
private
// **
public
constructor Create;
destructor Destroy; override;
property SaleRefrence : string read GetSaleRefrence write SetSaleRefrence ;
property LineNumber : integer read GetLineNumber write SetLineNumber ;
property ItemCode : string read GetItemCode write SetItemCode ;
property ItemDescription : string read GetItemDescription write SetItemDescription;
property UnitPrice : extended read GetUnitPrice write SetUnitPrice ;
property Quantity : extended read GetQuantity write SetQuantity ;
property VatCode : string read GetVatCode write SetVatCode ;
property VatPr : extended read GetVatPr write SetVatPr ;
property Amount : extended read GetAmount write SetAmount ;
property AmountWoVat : extended read GetAmountWoVat write SetAmountWoVat ;
end;
TPosSaleItemsList = TObjectList<TPosSaleItem>;
////////////////////////////////////////////////////////////////////
/// TPosItem
/// Positem er vara eins og hún er í vöruskrá þessi gildi eru notuð
/// til þess að viðhalda vöruskrá HOME til samræmis við vöruskra POS
/////////////////////////////////////////////////////////////////////
TPosItem = class
FItemCode : string ;
FItemDescription : string ;
FUnitPrice : extended;
FVatCode : string ;
FVatPr : extended;
FCategoryID : string ;
FCategoryDescription: string ;
function GetItemCode : string;
function GetItemDescription : string;
function GetUnitPrice : extended;
function GetVatCode : string;
function GetVatPr : extended;
function GetCategoryID : string;
function GetCategoryDescription : string;
procedure SetItemCode(Value :string );
procedure SetItemDescription(Value :string );
procedure SetUnitPrice(Value :extended );
procedure SetVatCode(Value :string );
procedure SetVatPr(Value :extended );
procedure SetCategoryID(Value :string );
procedure SetCategoryDescription(Value :string );
private
// **
public
constructor Create;
destructor Destroy; override;
property ItemCode : string read GetItemCode write SetItemCode ;
property ItemDescription : string read GetItemDescription write SetItemDescription;
property UnitPrice : extended read GetUnitPrice write SetUnitPrice ;
property VatCode : string read GetVatCode write SetVatCode ;
property VatPr : extended read GetVatPr write SetVatPr ;
property CategoryID : string read GetCategoryID write SetCategoryID ;
property CategoryDescription : string read GetCategoryDescription write SetCategoryDescription ;
end;
TPosItemsList = TObjectList<TPosItem>;
//////////////////////////////////////////////////////////////////////////////////////
///
///
///
/////////////////////////////////////////////////////////////////////////////////////
TPosSale = class
private
FXmlFileName : string;
FPosSaleItemsCount : integer;
FPosSaleItemsList : TPosSaleItemsList;
FPosItemsCount : integer;
FPosItemsList : TPosItemsList;
FHotelcode : string ;
FSaleRefrence : string ;
FStaff : string ;
FPosId : string ;
FExportDateTime : TDateTime ;
FImportDateTime : TDateTime ; // time of import
FRoomNumber : string ;
FIsGroupinvoice : boolean ;
FSaleNotes : string ;
FSalesPerson : string ;
FCustomer : string ;
FPersonalId : string ;
FCustomerName : string ;
FAddress1 : string ;
FAddress2 : string ;
FAddress3 : string ;
FAddress4 : string ;
FGuestName : string ;
function getPosSaleItemsCount : integer;
function getPosItemsCount : integer;
procedure FillLists(var PosSaleItemsCount, PosItemsCount : integer);
procedure Clear;
public
constructor Create(aXmlFileName : string);
destructor Destroy; override;
property XmlFileName : string read FXmlFileName write FXmlFileName;
property Hotelcode : string read FHotelcode write FHotelcode ;
property SaleRefrence : string read FSaleRefrence write FSaleRefrence ;
property Staff : string read FStaff write FStaff ;
property PosId : string read FPosId write FPosId ;
property ExportDateTime : TDateTime read FExportDateTime write FExportDateTime;
property ImportDateTime : TDateTime read FImportDateTime write FImportDateTime;
property RoomNumber : string read FRoomNumber write FRoomNumber ;
property IsGroupinvoice : boolean read FIsGroupinvoice write FIsGroupinvoice;
property SaleNotes : string read FSaleNotes write FSaleNotes ;
property SalesPerson : string read FSalesPerson write FSalesPerson ;
property Customer : string read FCustomer write FCustomer ;
property PersonalId : string read FPersonalId write FPersonalId ;
property CustomerName : string read FCustomerName write FCustomerName ;
property Address1 : string read FAddress1 write FAddress1 ;
property Address2 : string read FAddress2 write FAddress2 ;
property Address3 : string read FAddress3 write FAddress3 ;
property Address4 : string read FAddress4 write FAddress4 ;
property GuestName : string read FGuestName write FGuestName ;
function FindItemFromSaleItems(sSearchFor : string; StartAt : integer; caseSensitive : Boolean = false) : integer;
property PosSaleItemsList : TPosSaleItemsList read FPosSaleItemsList write FPosSaleItemsList;
property PosSaleItemsCount : integer read getPosSaleItemsCount;
property PosItemsList : TPosItemsList read FPosItemsList write FPosItemsList;
property PosItemsCount : integer read getPosItemsCount;
end;
function posSaleTextLog(posSale : TPosSale) : TStringList;
implementation
//////////////////////////////////////////////////////////////////////////////
// TPosSaleItem
// Vörulína sem kemur frá POS Þessi vörulína fer síðan
// á uppsöfnunarreikning HOME
//////////////////////////////////////////////////////////////////////////////
constructor TPosSaleItem.Create;
begin
end;
destructor TPosSaleItem.Destroy;
begin
inherited;
end;
function TPosSaleItem.GetAmount: extended;
begin
result := FAmount ;
end;
function TPosSaleItem.GetAmountWoVat: extended;
begin
result := FAmountWoVat ;
end;
function TPosSaleItem.GetItemCode: string;
begin
result := FItemCode ;
end;
function TPosSaleItem.GetItemDescription: string;
begin
result := FItemDescription ;
end;
function TPosSaleItem.GetLineNumber: integer;
begin
result := FLineNumber ;
end;
function TPosSaleItem.GetQuantity: extended;
begin
result := FQuantity ;
end;
function TPosSaleItem.GetSaleRefrence: string;
begin
result := FSaleRefrence ;
end;
function TPosSaleItem.GetUnitPrice: extended;
begin
result := FUnitPrice ;
end;
function TPosSaleItem.GetVatCode: string;
begin
result := FVatCode ;
end;
function TPosSaleItem.GetVatPr: extended;
begin
result := FVatPr ;
end;
//////////////////////////////////////////////
procedure TPosSaleItem.SetAmount(Value: extended);
begin
FAmount := value;
end;
procedure TPosSaleItem.SetAmountWoVat(Value: extended);
begin
FAmountWoVat := value;
end;
procedure TPosSaleItem.SetItemCode(Value: string);
begin
FItemCode := value;
end;
procedure TPosSaleItem.SetItemDescription(Value: string);
begin
FItemDescription := value;
end;
procedure TPosSaleItem.SetLineNumber(Value: integer);
begin
FLineNumber := value;
end;
procedure TPosSaleItem.SetQuantity(Value: extended);
begin
FQuantity := value;
end;
procedure TPosSaleItem.SetSaleRefrence(Value: string);
begin
FSaleRefrence := value;
end;
procedure TPosSaleItem.SetUnitPrice(Value: extended);
begin
FUnitPrice := value;
end;
procedure TPosSaleItem.SetVatCode(Value: string);
begin
FVatCode := value;
end;
procedure TPosSaleItem.SetVatPr(Value: extended);
begin
FVatPr := value;
end;
////////////////////////////////////////////////////////////////////
/// TPosItem
/// Positem er vara eins og hún er í vöruskrá þessi gildi eru notuð
/// til þess að viðhalda vöruskrá HOME til samræmis við vöruskra POS
/////////////////////////////////////////////////////////////////////
constructor TPosItem.Create;
begin
//**
end;
destructor TPosItem.Destroy;
begin
inherited;
end;
function TPosItem.GetCategoryDescription: string;
begin
result := FCategoryDescription ;
end;
function TPosItem.GetCategoryID: string;
begin
result := FCategoryID ;
end;
function TPosItem.GetItemCode: string;
begin
result := FItemCode ;
end;
function TPosItem.GetItemDescription: string;
begin
result := FItemDescription ;
end;
function TPosItem.GetUnitPrice: extended;
begin
result := FUnitPrice ;
end;
function TPosItem.GetVatCode: string;
begin
result := FVatCode ;
end;
function TPosItem.GetVatPr: extended;
begin
result := FVatPr ;
end;
procedure TPosItem.SetCategoryDescription(Value: string);
begin
FCategoryDescription := value;
end;
procedure TPosItem.SetCategoryID(Value: string);
begin
FCategoryID := value;
end;
procedure TPosItem.SetItemCode(Value: string);
begin
FItemCode := value;
end;
procedure TPosItem.SetItemDescription(Value: string);
begin
FItemDescription := value;
end;
procedure TPosItem.SetUnitPrice(Value: extended);
begin
FUnitPrice := value;
end;
procedure TPosItem.SetVatCode(Value: string);
begin
FVatCode := value;
end;
procedure TPosItem.SetVatPr(Value: extended);
begin
FVatPr := value;
end;
//////////////////////////////////////////////////////////////////////////////
/// TPosSale
///
///
///
//////////////////////////////////////////////////////////////////////////////
constructor TPosSale.Create(aXmlFileName: string);
begin
inherited Create;
FPosSaleItemsList := TPosSaleItemsList.Create(True);
FPosItemsList := TPosItemsList.Create(True);
FXmlFileName := aXmlFileName;
FPosSaleItemsCount := 0;
FPosItemsCount := 0;
FillLists(FPosSaleItemsCount,FPosItemsCount);
end;
destructor TPosSale.Destroy;
begin
Clear;
FPosSaleItemsList.Free;
FPosItemsList.Free;
inherited;
end;
procedure TPosSale.Clear;
begin
while FPosSaleItemsList.Count > 0 do
begin
FPosSaleItemsList[0].Free;
FPosSaleItemsList.Delete(0);
end;
while FPosItemsList.Count > 0 do
begin
FPosItemsList[0].Free;
FPosItemsList.Delete(0);
end;
end;
procedure TPosSale.FillLists(var PosSaleItemsCount, PosItemsCount : integer);
var
PosSaleItem : TPosSaleItem;
PosItem : TPosItem;
aDoc : TNativeXml;
rootNode : TXmlNode;
salesNode : TXmlNode;
saleheadNode : TXmlNode;
saleItemsNode : TXmlNode;
saleItemNode : TXmlNode;
ItemsNode : TXmlNode;
ItemNode : TXmlNode;
i, ii : Integer;
s : string;
lbx1 : tStringList;
SaleRefrence : string ;
LineNumber : integer ;
ItemCode : string ;
ItemDescription : string ;
UnitPrice : extended;
Quantity : extended;
VatCode : string ;
VatPr : extended;
Amount : extended;
AmountWoVat : extended;
categoryID : string;
categoryDescription : string;
sTmp : string;
begin
//**
Clear;
PosSaleItemsCount := 0;
PosItemsCount := 0;
lbx1 := TStringList.Create;
try
if fileexists('FxmlFilename') then
begin
aDoc := TNativeXml.Create(nil);
try
aDoc.Clear;
aDoc.LoadFromFile(FxmlFilename);
aDoc.XmlFormat := xfReadable;
rootNode := aDoc.Root;
salesNode := rootNode.FindNode('sale');
if assigned(salesNode) then
begin
FHotelcode := String(salesNode.ReadAttributeString(UTF8String('hotelcode')));
FSaleRefrence := String(salesNode.ReadAttributeString(UTF8String('sale_refrence')));
FStaff := String(salesNode.ReadAttributeString(UTF8String('staff')));
FPosId := String(salesNode.ReadAttributeString(UTF8String('pos_id')));
try
sTmp := String(salesNode.ReadAttributeString(UTF8String('exportdatetime')));
FExportDateTime:= StrToDateTime(sTmp);
Except
FExportDateTime:= now;
end;
FImportDateTime:= now ; //salesNode.ReadAttributeString('exportdatetime')
saleheadNode := salesNode.FindNode('salehead');
if assigned(saleheadNode) then
begin
FIsGroupinvoice:= false; //saleheadNode.ReadString('is_groupinvoice');
FSaleNotes := String(saleheadNode.ReadString(UTF8String('salenotes')));
FRoomNumber := String(saleheadNode.ReadString(UTF8String('roomnumber')));
FSalesPerson := String(saleheadNode.ReadString(UTF8String('salesperson')));
FCustomer := String(saleheadNode.ReadString(UTF8String('customer')));
FPersonalId := String(saleheadNode.ReadString(UTF8String('personalid')));
FCustomerName := String(saleheadNode.ReadString(UTF8String('customername')));
FAddress1 := String(saleheadNode.ReadString(UTF8String('address1')));
FAddress2 := String(saleheadNode.ReadString(UTF8String('address2')));
FAddress3 := String(saleheadNode.ReadString(UTF8String('address3')));
FAddress4 := String(saleheadNode.ReadString(UTF8String('address4')));
FGuestName := String(saleheadNode.ReadString(UTF8String('guestname')));
end;
saleItemsNode := salesNode.FindNode('sale_items');
if assigned(saleItemsNode) then
begin
for i := 0 to saleItemsNode.NodeCount - 1 do
begin
saleItemNode := saleItemsNode[i];
if saleItemNode.HasAttribute('line') then
begin
SaleRefrence := FSalerefrence;
try
LineNumber := strToInt(trim(String(saleItemNode.ReadAttributeString(UTF8String('line')))));
except
LineNumber := 0;
end;
ItemCode := trim(String(saleItemNode.ReadString(UTF8String('itemcode'))));
ItemDescription := trim(String(saleItemNode.ReadString(UTF8String('itemdescription'))));
try
UnitPrice := _strToFloat(trim(String(saleItemNode.ReadString(UTF8String('unitprice')))));
except
UnitPrice := 0.00;
end;
try
Quantity := _strToFloat(trim(String(saleItemNode.ReadString(UTF8String('quantity')))));
Except
Quantity := 0.00;
end;
VatCode := trim(String(saleItemNode.ReadString(UTF8String('vatcode'))));
try
VatPr := _strToFloat(trim(String(saleItemNode.ReadString(UTF8String('vatpr')))));
Except
VatPr := 0.00;
end;
try
Amount := _strToFloat(trim(String(saleItemNode.ReadString(UTF8String('amount')))));
Except
Amount := 0.00;
end;
try
AmountWoVat := _strToFloat(trim(String(saleItemNode.ReadString(UTF8String('amountwovat')))));
Except
AmountWoVat := 0.00;
end;
PosSaleItem := TPosSaleItem.Create;
try
PosSaleItem.SetSaleRefrence(SaleRefrence);
PosSaleItem.SetLineNumber(LineNumber);
PosSaleItem.SetItemCode(ItemCode);
PosSaleItem.SetItemDescription(ItemDescription);
PosSaleItem.SetUnitPrice(UnitPrice);
PosSaleItem.SetQuantity(Quantity);
PosSaleItem.SetVatCode(VatCode);
PosSaleItem.SetVatPr(VatPr);
PosSaleItem.SetAmount(Amount);
PosSaleItem.SetAmountWoVat(AmountWoVat);
FPosSaleItemsList.Add(PosSaleItem);
except
// logga
end;
end;
end;
end;
ItemsNode := salesNode.FindNode('items');
if assigned(ItemsNode) then
begin
for i := 0 to ItemsNode.NodeCount - 1 do
begin
ItemNode := ItemsNode[i];
if ItemNode.HasAttribute('itemcode') then
begin
ItemCode := trim(String(ItemNode.ReadAttributeString(UTF8String('itemcode'))));
ItemDescription := trim(String(ItemNode.ReadString(UTF8String('itemdescription'))));
try
UnitPrice := _strToFloat(trim(String(ItemNode.ReadString(UTF8String('unitprice')))));
except
UnitPrice := 0.00;
end;
VatCode := trim(String(ItemNode.ReadString(UTF8String('vatcode'))));
try
VatPr := _strToFloat(trim(String(ItemNode.ReadString(UTF8String('vatpr')))));
Except
VatPr := 0.00;
end;
categoryID := trim(String(ItemNode.ReadString(UTF8String('categoryID'))));
categoryDescription := trim(String(ItemNode.ReadString(UTF8String('category_description'))));
PosItem := TPosItem.Create;
try
PosItem.SetItemCode(ItemCode);
PosItem.SetItemDescription(ItemDescription);
PosItem.SetUnitPrice(UnitPrice);
PosItem.SetVatCode(VatCode);
PosItem.SetVatPr(VatPr);
PosItem.SetCategoryID(categoryID);
PosItem.SetCategoryDescription(categoryDescription);
FPosItemsList.Add(PosItem);
except
// logga
end;
end;
end;
end;
end;
finally
freeandnil(aDoc);
end;
end else
begin
// logg
end;
PosSaleItemsCount := FPosSaleItemsList.Count;
PosItemsCount := FPosItemsList.Count;
finally
lbx1.Free;
end;
end;
function TPosSale.FindItemFromSaleItems(sSearchFor: string; StartAt: integer; caseSensitive: Boolean): integer;
begin
//**
result := 0;
end;
function TPosSale.getPosItemsCount: integer;
begin
result := FPosItemsList.Count;
end;
function TPosSale.getPosSaleItemsCount: integer;
begin
result := FPosSaleItemsList.Count;
end;
function posSaleTextLog(posSale : TPosSale) : TstringList;
var
sTime : string;
i : integer;
begin
result := TStringList.Create;
try
datetimeTostring(sTime,'yyyy-mm-dd_hhnnss-zzz',now);
result.Add(sTime);
result.Add('');
result.Add('Hotelcode : '+posSale.Hotelcode );
result.Add('SaleRefrence : '+posSale.SaleRefrence );
result.Add('Staff : '+posSale.Staff );
result.Add('PosId : '+posSale.PosId );
result.Add('ExportDateTime : '+dateTimeTostr(posSale.ExportDateTime));
result.Add('ImportDateTime : '+dateTimeTostr(posSale.ImportDateTime));
result.Add('RoomNumber : '+posSale.RoomNumber );
result.Add('IsGroupinvoice : '+booltostr(posSale.IsGroupinvoice));
result.Add('SaleNotes : '+posSale.SaleNotes );
result.Add('SalesPerson : '+posSale.SalesPerson );
result.Add('Customer : '+posSale.Customer );
result.Add('PersonalId : '+posSale.PersonalId );
result.Add('CustomerName : '+posSale.CustomerName );
result.Add('Address1 : '+posSale.Address1 );
result.Add('Address2 : '+posSale.Address2 );
result.Add('Address3 : '+posSale.Address3 );
result.Add('Address4 : '+posSale.Address4 );
result.Add('GuestName : '+posSale.GuestName );
result.Add('');
result.Add(' ----- SaleItems ------- ');
for i := 0 to posSale.PosSaleItemsList.Count - 1 do
begin
result.Add('SaleRefrence : '+possale.PosSaleItemsList[i].SaleRefrence);
result.Add('LineNumber : '+inttostr(possale.PosSaleItemsList[i].LineNumber));
result.Add('ItemCode : '+possale.PosSaleItemsList[i].ItemCode);
result.Add('ItemDescription : '+possale.PosSaleItemsList[i].ItemDescription);
result.Add('UnitPrice : '+floattostr(possale.PosSaleItemsList[i].UnitPrice));
result.Add('Quantity : '+floattostr(possale.PosSaleItemsList[i].Quantity));
result.Add('VatCode : '+possale.PosSaleItemsList[i].VatCode);
result.Add('VatPr : '+floattostr(possale.PosSaleItemsList[i].VatPr));
result.Add('Amount : '+floattostr(possale.PosSaleItemsList[i].Amount));
result.Add('AmountWoVat : '+floattostr(possale.PosSaleItemsList[i].AmountWoVat));
result.Add('');
end;
result.Add('');
result.Add(' ----- Items ------- ');
for i := 0 to posSale.PosItemsList.Count - 1 do
begin
result.Add('ItemCode : '+possale.PosItemsList[i].ItemCode);
result.Add('ItemDescription : '+possale.PosItemsList[i].ItemDescription);
result.Add('UnitPrice : '+floattostr(possale.PosItemsList[i].UnitPrice));
result.Add('VatCode : '+possale.PosItemsList[i].VatCode);
result.Add('VatPr : '+floattostr(possale.PosItemsList[i].VatPr));
result.Add('CategoryID : '+possale.PosItemsList[i].categoryID);
result.Add('CategoryDescription: '+possale.PosItemsList[i].categoryDescription);
result.Add('');
end;
Except
end;
end;
end.