shareneus 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,7 +34,7 @@ class InvoicePortraitPrintService {
|
|
|
34
34
|
},
|
|
35
35
|
layout: this.HeaderLayOut()
|
|
36
36
|
},
|
|
37
|
-
this.GetItemsTable(InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.Settings.PoS.SType, printOptions, size),
|
|
37
|
+
this.GetItemsTable(InvoicePDFData.Ops, InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.Settings.PoS.SType, printOptions, size),
|
|
38
38
|
[this.TotalDetails(InvoicePDFData)],
|
|
39
39
|
{
|
|
40
40
|
style: 'tableExample',
|
|
@@ -315,7 +315,7 @@ class InvoicePortraitPrintService {
|
|
|
315
315
|
text: ['Customer Signature'], marginLeft: 90
|
|
316
316
|
};
|
|
317
317
|
}
|
|
318
|
-
static GetItemsTable(Items, ShowTaxColumn, SType, printOptions, size) {
|
|
318
|
+
static GetItemsTable(Services, Items, ShowTaxColumn, SType, printOptions, size) {
|
|
319
319
|
return {
|
|
320
320
|
style: 'tableExample',
|
|
321
321
|
marginTop: 3,
|
|
@@ -323,7 +323,7 @@ class InvoicePortraitPrintService {
|
|
|
323
323
|
table: {
|
|
324
324
|
widths: this.GetWidths(ShowTaxColumn, printOptions),
|
|
325
325
|
headerRows: 1,
|
|
326
|
-
body: this.BuildTableBodyForLaborAndParts(Items, ShowTaxColumn, SType, printOptions, size)
|
|
326
|
+
body: this.BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size)
|
|
327
327
|
},
|
|
328
328
|
layout: {
|
|
329
329
|
hLineWidth: function (i, node) {
|
|
@@ -362,49 +362,93 @@ class InvoicePortraitPrintService {
|
|
|
362
362
|
static GetAddress(Entity) {
|
|
363
363
|
return Entity.Adrs1 + ', ' + Entity.Adrs2 + ', ' + Entity.City + '-' + Entity.PIN + ', Cell : ' + Entity.Phone;
|
|
364
364
|
}
|
|
365
|
-
static BuildTableBodyForLaborAndParts(Items, ShowTaxColumn, SType, printOptions, size) {
|
|
365
|
+
static BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size) {
|
|
366
366
|
let body = this.GetHeaderNames(ShowTaxColumn, SType, printOptions);
|
|
367
367
|
let j = 1;
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
dataRow.push({ text: (_a = item.Batch) === null || _a === void 0 ? void 0 : _a.BN, alignment: 'center', style: ['headerstyle'], });
|
|
377
|
-
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(item['Batch'].ExDt), alignment: 'center', style: ['headerstyle'], });
|
|
378
|
-
dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
|
|
379
|
-
dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
|
|
380
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
|
|
381
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
|
|
382
|
-
if (printOptions.Disc !== 'NO') {
|
|
383
|
-
if (printOptions.Disc === 'PERC') {
|
|
384
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
|
|
368
|
+
if (!tr_utils_1.TrUtils.IsNull(Services) && Services.length !== 0) {
|
|
369
|
+
Services.forEach((item, index) => {
|
|
370
|
+
var _a;
|
|
371
|
+
let dataRow = [];
|
|
372
|
+
dataRow.push({ text: index + 1, });
|
|
373
|
+
dataRow.push({ text: item.Desc, });
|
|
374
|
+
if (ShowTaxColumn) {
|
|
375
|
+
dataRow.push({ text: item.SAC, alignment: 'center', style: ['headerstyle'], });
|
|
385
376
|
}
|
|
386
|
-
|
|
387
|
-
|
|
377
|
+
dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
|
|
378
|
+
dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
|
|
379
|
+
dataRow.push({ text: item.Qty, alignment: 'right', style: ['headerstyle'], });
|
|
380
|
+
dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
|
|
381
|
+
dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
|
|
382
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Pr), alignment: 'right', style: ['headerstyle'], });
|
|
383
|
+
if (printOptions.Disc !== 'NO') {
|
|
384
|
+
if (printOptions.Disc === 'PERC') {
|
|
385
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
|
|
389
|
+
}
|
|
388
390
|
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
391
|
+
if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
|
|
392
|
+
let Tax = (_a = item.TaxName) === null || _a === void 0 ? void 0 : _a.split('%');
|
|
393
|
+
dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
|
|
394
|
+
}
|
|
395
|
+
dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
|
|
396
|
+
body.push(dataRow);
|
|
397
|
+
if (index + 1 === j * 9) {
|
|
398
|
+
j++;
|
|
399
|
+
if (size === 'diff') {
|
|
400
|
+
let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
|
|
401
|
+
if (ShowTaxColumn) {
|
|
402
|
+
dataRow1.push('');
|
|
403
|
+
dataRow1.push('');
|
|
404
|
+
}
|
|
405
|
+
body.push(dataRow1);
|
|
403
406
|
}
|
|
404
|
-
body.push(dataRow1);
|
|
405
407
|
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
if (!tr_utils_1.TrUtils.IsNull(Items) && Items.length !== 0) {
|
|
411
|
+
Items.forEach((item, index) => {
|
|
412
|
+
var _a, _b;
|
|
413
|
+
let dataRow = [];
|
|
414
|
+
dataRow.push({ text: index + 1, });
|
|
415
|
+
dataRow.push({ text: item.Desc, });
|
|
416
|
+
if (ShowTaxColumn) {
|
|
417
|
+
dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
|
|
418
|
+
}
|
|
419
|
+
dataRow.push({ text: (_a = item.Batch) === null || _a === void 0 ? void 0 : _a.BN, alignment: 'center', style: ['headerstyle'], });
|
|
420
|
+
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(item['Batch'].ExDt), alignment: 'center', style: ['headerstyle'], });
|
|
421
|
+
dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
|
|
422
|
+
dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
|
|
423
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
|
|
424
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
|
|
425
|
+
if (printOptions.Disc !== 'NO') {
|
|
426
|
+
if (printOptions.Disc === 'PERC') {
|
|
427
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
|
|
434
|
+
let Tax = (_b = item.TaxName) === null || _b === void 0 ? void 0 : _b.split('%');
|
|
435
|
+
dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
|
|
436
|
+
}
|
|
437
|
+
dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
|
|
438
|
+
body.push(dataRow);
|
|
439
|
+
if (index + 1 === j * 9) {
|
|
440
|
+
j++;
|
|
441
|
+
if (size === 'diff') {
|
|
442
|
+
let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
|
|
443
|
+
if (ShowTaxColumn) {
|
|
444
|
+
dataRow1.push('');
|
|
445
|
+
dataRow1.push('');
|
|
446
|
+
}
|
|
447
|
+
body.push(dataRow1);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
});
|
|
451
|
+
}
|
|
408
452
|
return body;
|
|
409
453
|
}
|
|
410
454
|
static GetHeaderNames(ShowTaxColumn, SType, printOptions) {
|