shareneus 1.4.35 → 1.4.36
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.
- package/dist/aggregation/aggregation.js +13 -13
- package/dist/excel-files/GSTR-RO-excel.service.js +3 -3
- package/dist/excel-files/GSTR1-excel.service.js +7 -7
- package/dist/excel-files/GSTR2-excel.service.js +6 -6
- package/dist/excel-files/analysis-excel.service.js +4 -4
- package/dist/excel-files/category-wise-item-excel.service.js +10 -10
- package/dist/excel-files/cust-balance-excel.service.js +5 -5
- package/dist/excel-files/cust-wise-sales-details.js +5 -5
- package/dist/excel-files/cust-wise-sales-summary-excel.service.js +5 -5
- package/dist/excel-files/expiring-drugs-excel.service.js +7 -7
- package/dist/excel-files/insurance-expire-excel.service.js +4 -4
- package/dist/excel-files/invoice-wise-excel.service.js +3 -3
- package/dist/excel-files/item-wise-doctor-sale-excel.service.js +7 -7
- package/dist/excel-files/item-wise-mout-details.js +4 -4
- package/dist/excel-files/item-wise-mout-summary.js +4 -4
- package/dist/excel-files/items-wise-sales-excel.service.js +10 -10
- package/dist/excel-files/manf-wise-sales-excel.service.js +4 -4
- package/dist/excel-files/next-service-date-excel.service.js +5 -5
- package/dist/excel-files/operator-wise-details.js +4 -4
- package/dist/excel-files/operator-wise-summary.js +4 -4
- package/dist/excel-files/payment-receive-excel.service.js +6 -6
- package/dist/excel-files/payments-made-excel.service.js +6 -6
- package/dist/excel-files/repair-orders-excel.service.js +10 -10
- package/dist/excel-files/sa-wise-labor-sales-excel.service.js +6 -6
- package/dist/excel-files/sa-wise-part-sales-excel.service.js +6 -6
- package/dist/excel-files/sale-summary-excel.service.js +3 -3
- package/dist/excel-files/sales-by-service-summary-excel.service.js +14 -14
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +8 -8
- package/dist/excel-files/scheduled-drugs-excel.service.js +10 -10
- package/dist/excel-files/spares-issue-excel.service.js +14 -14
- package/dist/excel-files/stock-excel.service.js +3 -3
- package/dist/excel-files/tally-sales-import.service.js +3 -3
- package/dist/excel-files/ven-balance-excel.service.js +3 -3
- package/dist/index.js +6 -6
- package/dist/services/analysis-pdf.service.js +8 -8
- package/dist/services/appointment-total.service.js +37 -37
- package/dist/services/auto-sales-receipt-pdf.service.js +24 -24
- package/dist/services/category-wise-item-pdf.service.js +6 -6
- package/dist/services/checklist-pdf.js +3 -3
- package/dist/services/cn-print.service.js +33 -33
- package/dist/services/consultation-fee-receipt.service.js +16 -16
- package/dist/services/consultation-full-pdf.service.js +10 -10
- package/dist/services/consultation-letterhead-pdf.service.js +15 -15
- package/dist/services/consultation-pdf.service.js +15 -15
- package/dist/services/credit-note-pdf.service.js +16 -16
- package/dist/services/credit-note-totals.service.js +31 -31
- package/dist/services/cust-wise-sales-details-pdf.service.js +8 -8
- package/dist/services/cust-wise-sales-summary-pdf.service.js +7 -7
- package/dist/services/customer-balances-pdf.service.js +7 -7
- package/dist/services/dc-landscape-pdf.service.js +28 -28
- package/dist/services/dc-landscape-without-price-pdf.service.js +24 -24
- package/dist/services/dc-without-price-pdf.service.js +15 -15
- package/dist/services/debit-note-pdf.service.js +14 -14
- package/dist/services/debit-note-print.service.js +33 -33
- package/dist/services/debit-note-totals.service.js +28 -28
- package/dist/services/delivery-challan-pdf.service.js +16 -16
- package/dist/services/delivery-challan-print.service.js +26 -26
- package/dist/services/delivery-challan-totals.js +32 -32
- package/dist/services/equipment-design-pdf.service.js +10 -10
- package/dist/services/est.print-service.js +150 -150
- package/dist/services/expiring-drugs-pdf.service.js +6 -6
- package/dist/services/hc-inv-pdf.service.js +42 -42
- package/dist/services/insurance-expire-pdf.service.js +1 -1
- package/dist/services/inv-pdf.service.js +54 -54
- package/dist/services/inv-print.service.js +59 -59
- package/dist/services/invoice-landscape-pdf.service.js +29 -29
- package/dist/services/invoice-letterhead-pdf.service.js +54 -54
- package/dist/services/invoice-portrait-pdf.js +51 -51
- package/dist/services/invoice-total.service.js +78 -78
- package/dist/services/issue-parts-pdf.service.js +43 -43
- package/dist/services/item-bar-code-label-pdf.js +2 -2
- package/dist/services/item-price-for-pricelist.js +29 -46
- package/dist/services/item-wise-doctor-sale-pdf.service.js +3 -3
- package/dist/services/item-wise-mout-details-pdf.js +3 -3
- package/dist/services/item-wise-mout-summary-pdf.js +2 -2
- package/dist/services/item-wise-sales-pdf.service.js +6 -6
- package/dist/services/manf-wise-sales-pdf.service.js +5 -5
- package/dist/services/meeting-pdf.js +14 -14
- package/dist/services/mout-pdf.service.js +17 -17
- package/dist/services/next-service-date-pdf.service.js +1 -1
- package/dist/services/operator-wise-details-pdf.service.js +8 -8
- package/dist/services/operator-wise-summary-pdf.js +7 -7
- package/dist/services/pack-ship-pdf.service.js +3 -3
- package/dist/services/pack-ship-print.service.js +26 -26
- package/dist/services/payment-pdf.service.js +4 -4
- package/dist/services/payment-report-pdf.service.js +3 -3
- package/dist/services/po-totals.service.js +28 -28
- package/dist/services/pos-receipt-pdf.js +19 -19
- package/dist/services/purchase-order-pdf.service.js +40 -40
- package/dist/services/purchase-order-print.service.js +43 -43
- package/dist/services/purchase-order-totals.service.js +53 -53
- package/dist/services/receipt-print.service.js +5 -5
- package/dist/services/reorder-point-pdf.service.js +3 -3
- package/dist/services/repair-orders-pdf.service.js +3 -3
- package/dist/services/ro-pdf.service.js +80 -80
- package/dist/services/ro-print-service.js +87 -87
- package/dist/services/ro-totals.service.js +123 -123
- package/dist/services/sales-by-service-pdf.service.js +6 -6
- package/dist/services/sales-pdf.service.js +23 -23
- package/dist/services/sales-print.service.js +54 -54
- package/dist/services/sales-receipt-pdf.service.js +25 -25
- package/dist/services/sales-receipt-print.service.js +62 -62
- package/dist/services/sales-totals.service.js +33 -33
- package/dist/services/scheduled-drug-pdf.service.js +7 -7
- package/dist/services/scheduled-drug-summary-pdf.service.js +4 -4
- package/dist/services/separate-wo-print.service.js +9 -9
- package/dist/services/shared-inv-pdf.service.js +44 -44
- package/dist/services/shared-pdf.service.js +119 -119
- package/dist/services/shared-print.service.js +68 -68
- package/dist/services/task-pdf.service.js +10 -10
- package/dist/services/task-reports-pdf.service.js +9 -9
- package/dist/services/technician-pdf.service.js +10 -10
- package/dist/services/technician-print.service.js +9 -9
- package/dist/services/vendor-balances-pdf.service.js +6 -6
- package/dist/services/vendor-credit-note-pdf.service.js +27 -27
- package/dist/services/vendor-credit-note-print.service.js +29 -29
- package/dist/services/vendor-credit-note-totals.service.js +37 -37
- package/dist/services/vendor-debit-note-pdf.service.js +16 -16
- package/dist/services/vendor-debit-note-print.service.js +29 -29
- package/dist/services/vendor-debit-note-totals.service.js +30 -30
- package/dist/shared/math-operations.js +184 -0
- package/dist/shared/util.js +15 -0
- package/dist/{shared → utils}/my-date.js +31 -31
- package/dist/{shared/utils.js → utils/tr-utils.js} +0 -8
- package/package.json +2 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreditNotePdfService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
5
5
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
6
|
const shared_print_service_1 = require("./shared-print.service");
|
|
7
7
|
class CreditNotePdfService {
|
|
@@ -31,7 +31,7 @@ class CreditNotePdfService {
|
|
|
31
31
|
}
|
|
32
32
|
static GetFileName(ROPrintData) {
|
|
33
33
|
let fileName = ROPrintData.HeaderName;
|
|
34
|
-
if (!
|
|
34
|
+
if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
35
35
|
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
36
36
|
}
|
|
37
37
|
return fileName;
|
|
@@ -57,19 +57,19 @@ class CreditNotePdfService {
|
|
|
57
57
|
let List = [];
|
|
58
58
|
if (ROPrintData.Entity.Body === 1) {
|
|
59
59
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
60
|
-
if (
|
|
60
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
61
61
|
ROPrintData.PrintInfo[i].Text = '';
|
|
62
62
|
}
|
|
63
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetLaborPartsTableForView(
|
|
63
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.GetLaborPartsTableForView(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), [], ROPrintData.Entity.MPN));
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
else {
|
|
67
67
|
if (ROPrintData.Entity.Body === 2) {
|
|
68
68
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
69
|
-
if (
|
|
69
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
70
70
|
ROPrintData.PrintInfo[i].Text = '';
|
|
71
71
|
}
|
|
72
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
72
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), [], ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
else {
|
|
@@ -78,10 +78,10 @@ class CreditNotePdfService {
|
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
80
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
81
|
-
if (
|
|
81
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
82
82
|
ROPrintData.PrintInfo[i].Text = '';
|
|
83
83
|
}
|
|
84
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
84
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), [], ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -177,14 +177,14 @@ class CreditNotePdfService {
|
|
|
177
177
|
Parts.forEach((part) => {
|
|
178
178
|
var dataRow = [];
|
|
179
179
|
columns.forEach((column) => {
|
|
180
|
-
if ((!
|
|
180
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
181
181
|
|| (column.text === 'Line Total')) {
|
|
182
182
|
if (part[column.Field] === 'Spare Parts') {
|
|
183
183
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
184
184
|
}
|
|
185
185
|
else {
|
|
186
186
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
187
|
-
&&
|
|
187
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
188
188
|
part[column.Field] = '';
|
|
189
189
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
190
190
|
}
|
|
@@ -194,7 +194,7 @@ class CreditNotePdfService {
|
|
|
194
194
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
195
195
|
if (column.Field === 'Disc') {
|
|
196
196
|
if (column.type === 'percentage') {
|
|
197
|
-
if (!
|
|
197
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
198
198
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
199
199
|
}
|
|
200
200
|
else {
|
|
@@ -202,7 +202,7 @@ class CreditNotePdfService {
|
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
else {
|
|
205
|
-
if (!
|
|
205
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
206
206
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
207
207
|
}
|
|
208
208
|
else {
|
|
@@ -211,7 +211,7 @@ class CreditNotePdfService {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
214
|
-
if (!
|
|
214
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
215
215
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
216
216
|
}
|
|
217
217
|
else {
|
|
@@ -449,7 +449,7 @@ class CreditNotePdfService {
|
|
|
449
449
|
Parts.forEach((part) => {
|
|
450
450
|
var dataRow = [];
|
|
451
451
|
columns.forEach((column) => {
|
|
452
|
-
if (!
|
|
452
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])
|
|
453
453
|
|| column.text === 'Line Total') {
|
|
454
454
|
if (part[column.Field] === 'Spare Parts') {
|
|
455
455
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -470,7 +470,7 @@ class CreditNotePdfService {
|
|
|
470
470
|
if (column.Field === 'Desc') {
|
|
471
471
|
let DescData = [];
|
|
472
472
|
DescData.push(part[column.Field].toString());
|
|
473
|
-
if (!
|
|
473
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
474
474
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
475
475
|
}
|
|
476
476
|
dataRow.push({ stack: DescData });
|
|
@@ -563,7 +563,7 @@ class CreditNotePdfService {
|
|
|
563
563
|
}
|
|
564
564
|
static CommonTotalDetails(ROPrintData, moreDiscDetails) {
|
|
565
565
|
let CommonDetails = [
|
|
566
|
-
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(ROPrintData, 0, 0, 0, 0, 0, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
|
|
566
|
+
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(ROPrintData, 0, 0, 0, 0, 0, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, moreDiscDetails),
|
|
567
567
|
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
|
|
568
568
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
569
569
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreditNoteTotalsService = void 0;
|
|
4
4
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
|
-
const
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
class CreditNoteTotalsService {
|
|
7
7
|
static GetTotalsValue(opCodesList, PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
// PPerc = TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
|
-
Perc =
|
|
10
|
+
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
11
11
|
// LDisc = TrUtils.SetValueToZeroIfNull(LDisc);
|
|
12
12
|
// PDisc = TrUtils.SetValueToZeroIfNull(PDisc);
|
|
13
|
-
Disc =
|
|
13
|
+
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
PartsList = this.CalculateLaborPartValues(PartsList, IsIndependentTax);
|
|
16
16
|
let finalTotalsData = this.GetFinalRODataForSave(opCodesList, PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
@@ -30,7 +30,7 @@ class CreditNoteTotalsService {
|
|
|
30
30
|
static ResetLaborPartValues(PartsList, IsIndependentTax) {
|
|
31
31
|
PartsList.forEach((Part) => {
|
|
32
32
|
Part = this.ResetLaborPartValueIfInvalid(Part);
|
|
33
|
-
if (
|
|
33
|
+
if (tr_utils_1.TrUtils.IsZero(Part.Qty)) {
|
|
34
34
|
Part.Qty = 1;
|
|
35
35
|
}
|
|
36
36
|
Part.DiscountedPrice = (0, aggregation_1.addition)(Part.Disc, Part.RecDisc);
|
|
@@ -46,12 +46,12 @@ class CreditNoteTotalsService {
|
|
|
46
46
|
return PartsList;
|
|
47
47
|
}
|
|
48
48
|
static ResetLaborPartValueIfInvalid(Part) {
|
|
49
|
-
Part.UnPr =
|
|
50
|
-
Part.Disc =
|
|
51
|
-
Part.RecDisc =
|
|
52
|
-
Part.CGST =
|
|
53
|
-
Part.SGST =
|
|
54
|
-
Part.IGST =
|
|
49
|
+
Part.UnPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.UnPr);
|
|
50
|
+
Part.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.Disc);
|
|
51
|
+
Part.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc);
|
|
52
|
+
Part.CGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.CGST);
|
|
53
|
+
Part.SGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.SGST);
|
|
54
|
+
Part.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.IGST);
|
|
55
55
|
return Part;
|
|
56
56
|
}
|
|
57
57
|
static GetFinalRODataForSave(LaborList, PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
@@ -79,7 +79,7 @@ class CreditNoteTotalsService {
|
|
|
79
79
|
let CustomerAfterDiscTotals = this.GetSubTotalFor([], PartsList);
|
|
80
80
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor([], IsIndependentTax);
|
|
81
81
|
let CustPartTaxTotal = this.GetPartsTaxTotalFor(PartsList, IsIndependentTax);
|
|
82
|
-
finalTotalsData.SubTotal =
|
|
82
|
+
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
83
83
|
// let CustLaborDiscTotal = this.GetLaborDiscountedTotal(LaborList, IsIndependentTax, finalTotalsData);
|
|
84
84
|
let CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
|
|
85
85
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
@@ -89,8 +89,8 @@ class CreditNoteTotalsService {
|
|
|
89
89
|
finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
90
90
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
91
91
|
if (DetailedInfo) {
|
|
92
|
-
finalTotalsData.FixedSubTotal =
|
|
93
|
-
finalTotalsData.FixedTotal =
|
|
92
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
93
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
94
94
|
}
|
|
95
95
|
return finalTotalsData;
|
|
96
96
|
}
|
|
@@ -119,21 +119,21 @@ class CreditNoteTotalsService {
|
|
|
119
119
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
120
120
|
// finalTotalsData.CustLaborIGST = this.GetLaborIGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
121
121
|
let TaxInfo = this.GetPartGSTTaxTotal(PartsList, IsIndependentTax);
|
|
122
|
-
finalTotalsData.CustPartITax =
|
|
123
|
-
finalTotalsData.CustPartCGST =
|
|
124
|
-
finalTotalsData.CustPartIGST =
|
|
125
|
-
finalTotalsData.CustPartSGST =
|
|
122
|
+
finalTotalsData.CustPartITax = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[3]);
|
|
123
|
+
finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
124
|
+
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
125
|
+
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
126
126
|
// finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
|
|
127
127
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
128
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(
|
|
129
|
-
finalTotalsData.CustTotalRoundedBy =
|
|
130
|
-
finalTotalsData.CustRoundedTotal =
|
|
128
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes);
|
|
129
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
130
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
131
131
|
for (var key in finalTotalsData) {
|
|
132
132
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
133
133
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
134
134
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
135
135
|
&& typeof finalTotalsData[key] === 'number') {
|
|
136
|
-
finalTotalsData[key] =
|
|
136
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
return finalTotalsData;
|
|
@@ -142,7 +142,7 @@ class CreditNoteTotalsService {
|
|
|
142
142
|
let PartsDiscountedTotal = 0;
|
|
143
143
|
let overallPartDisc = 0;
|
|
144
144
|
if (!isTaxable) {
|
|
145
|
-
overallPartDisc =
|
|
145
|
+
overallPartDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
146
146
|
}
|
|
147
147
|
PartsList.forEach((Part) => {
|
|
148
148
|
PartsDiscountedTotal = (0, aggregation_1.addition)(PartsDiscountedTotal, Part.DiscountedPrice);
|
|
@@ -170,8 +170,8 @@ class CreditNoteTotalsService {
|
|
|
170
170
|
}
|
|
171
171
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
172
172
|
let ItemsTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
173
|
-
if (!
|
|
174
|
-
if (!
|
|
173
|
+
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
174
|
+
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
175
175
|
ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
@@ -230,13 +230,13 @@ class CreditNoteTotalsService {
|
|
|
230
230
|
}
|
|
231
231
|
static GetCombinedTaxPercentage(Parts, TaxCodes) {
|
|
232
232
|
Parts.forEach((Part) => {
|
|
233
|
-
if (
|
|
233
|
+
if (tr_utils_1.TrUtils.IsNull(Part.HSN)) {
|
|
234
234
|
Part.HSN = '';
|
|
235
235
|
}
|
|
236
236
|
let GSTValues = this.GetGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
237
|
-
Part.CGSTAmt =
|
|
238
|
-
Part.SGSTAmt =
|
|
239
|
-
Part.IGSTAmt =
|
|
237
|
+
Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
|
|
238
|
+
Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
|
|
239
|
+
Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
|
|
240
240
|
Part.CombinedTaxPercentage = (0, aggregation_1.addition)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
241
241
|
});
|
|
242
242
|
return Parts;
|
|
@@ -287,8 +287,8 @@ class CreditNoteTotalsService {
|
|
|
287
287
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
288
288
|
});
|
|
289
289
|
TaxInfo.HSN = HSN;
|
|
290
|
-
TaxInfo.TotalTaxableAmount =
|
|
291
|
-
TaxInfo.TotalTaxAmount =
|
|
290
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
291
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
292
292
|
TaxInfo.ItemsCount = MatchedPart.length;
|
|
293
293
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
294
294
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -307,7 +307,7 @@ class CreditNoteTotalsService {
|
|
|
307
307
|
let CGST = 0;
|
|
308
308
|
let SGST = 0;
|
|
309
309
|
let IGST = 0;
|
|
310
|
-
if (
|
|
310
|
+
if (tr_utils_1.TrUtils.IsNull(TCode)) {
|
|
311
311
|
return [CGST, SGST, IGST];
|
|
312
312
|
}
|
|
313
313
|
let TCodeIndex = TaxCodes.findIndex((TaxCode) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CustWiseSalesDetailsService = void 0;
|
|
4
|
-
const my_date_1 = require("../
|
|
5
|
-
const
|
|
4
|
+
const my_date_1 = require("../utils/my-date");
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
7
7
|
class CustWiseSalesDetailsService {
|
|
8
8
|
static GetCustWiseSalesDetailsPrint(InvoicesData, CName, isPhar, isHC, isSale, searchValue) {
|
|
@@ -90,12 +90,12 @@ class CustWiseSalesDetailsService {
|
|
|
90
90
|
else {
|
|
91
91
|
dataRow.push({ text: invoice.VendName });
|
|
92
92
|
}
|
|
93
|
-
dataRow.push({ text:
|
|
94
|
-
dataRow.push({ text:
|
|
95
|
-
dataRow.push({ text:
|
|
96
|
-
dataRow.push({ text:
|
|
97
|
-
dataRow.push({ text:
|
|
98
|
-
dataRow.push({ text:
|
|
93
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.SubTotal), alignment: 'right' });
|
|
94
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Disc), alignment: 'right' });
|
|
95
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Tax), alignment: 'right' });
|
|
96
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Adjust), alignment: 'right' });
|
|
97
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Round), alignment: 'right' });
|
|
98
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Total), alignment: 'right' });
|
|
99
99
|
body.push(dataRow);
|
|
100
100
|
});
|
|
101
101
|
return body;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SalesByCustomerPDFService = void 0;
|
|
4
4
|
// import { MyDate } from '../utils/my-date';
|
|
5
|
-
const
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
7
7
|
class SalesByCustomerPDFService {
|
|
8
8
|
static GetSaleByCustPrint(InvoicesData, CName, isPhar, isHC, IsSales, HeaerName, searchValue) {
|
|
@@ -84,12 +84,12 @@ class SalesByCustomerPDFService {
|
|
|
84
84
|
dataRow.push({ text: invoice.VendName, style: ['headerstyle'], });
|
|
85
85
|
}
|
|
86
86
|
dataRow.push({ text: invoice.Count, alignment: 'right' });
|
|
87
|
-
dataRow.push({ text:
|
|
88
|
-
dataRow.push({ text:
|
|
89
|
-
dataRow.push({ text:
|
|
90
|
-
dataRow.push({ text:
|
|
91
|
-
dataRow.push({ text:
|
|
92
|
-
dataRow.push({ text:
|
|
87
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.SubTotal), alignment: 'right' });
|
|
88
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Disc), alignment: 'right' });
|
|
89
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Tax), alignment: 'right' });
|
|
90
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Adjust), alignment: 'right' });
|
|
91
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Round), alignment: 'right' });
|
|
92
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Total), alignment: 'right', style: ['headerstyle'], });
|
|
93
93
|
body.push(dataRow);
|
|
94
94
|
});
|
|
95
95
|
return body;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CustomerBalancesService = void 0;
|
|
4
|
-
const my_date_1 = require("../
|
|
5
|
-
const
|
|
4
|
+
const my_date_1 = require("../utils/my-date");
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
7
7
|
class CustomerBalancesService {
|
|
8
8
|
static GetCustomerBalancesPrint(InvoicesData, CName, isPhar, isHC) {
|
|
@@ -90,15 +90,15 @@ class CustomerBalancesService {
|
|
|
90
90
|
dataRow.push({ text: invoice.Code });
|
|
91
91
|
if (!isHC) {
|
|
92
92
|
dataRow.push({ text: (_a = invoice.Prod) === null || _a === void 0 ? void 0 : _a.RegNo });
|
|
93
|
-
dataRow.push({ text:
|
|
93
|
+
dataRow.push({ text: tr_utils_1.TrUtils.IsNull(invoice.Prod) ? '' : ((_b = invoice.Prod) === null || _b === void 0 ? void 0 : _b.Model) + ' ' + ((_c = invoice.Prod) === null || _c === void 0 ? void 0 : _c.Var) });
|
|
94
94
|
}
|
|
95
95
|
// dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
96
96
|
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadable(invoice.CrDate), alignment: 'center', style: ['headerstyle'], });
|
|
97
|
-
dataRow.push({ text:
|
|
98
|
-
dataRow.push({ text:
|
|
97
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Total), alignment: 'right', style: ['headerstyle'], });
|
|
98
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
99
99
|
body.push(dataRow);
|
|
100
100
|
if (InvoiceData.Invoices.length === (index + 1)) {
|
|
101
|
-
let Row = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC ? 4 : 6, bold: true, fontSize: 9 }, {}, {}, {}, { text:
|
|
101
|
+
let Row = [{ text: 'Total Due ', alignment: 'right', colSpan: isHC ? 4 : 6, bold: true, fontSize: 9 }, {}, {}, {}, { text: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.Balance), fontSize: 9, alignment: 'right', bold: true }];
|
|
102
102
|
if (!isHC) {
|
|
103
103
|
Row.splice(2, 0, {}, {});
|
|
104
104
|
// Row.push({});
|
|
@@ -118,7 +118,7 @@ class CustomerBalancesService {
|
|
|
118
118
|
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
119
119
|
// }
|
|
120
120
|
// dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
121
|
-
dataRow.push({ text:
|
|
121
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Total), alignment: 'right', style: ['headerstyle'], });
|
|
122
122
|
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
123
123
|
body.push(dataRow);
|
|
124
124
|
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DCLandscapePdfService = void 0;
|
|
4
|
-
const my_date_1 = require("../
|
|
5
|
-
const
|
|
4
|
+
const my_date_1 = require("../utils/my-date");
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
7
7
|
const shared_print_service_1 = require("./shared-print.service");
|
|
8
8
|
class DCLandscapePdfService {
|
|
@@ -11,7 +11,7 @@ class DCLandscapePdfService {
|
|
|
11
11
|
}
|
|
12
12
|
static GetDeliveryChallanPrint(ROPrintData, numberofCopies, moreDiscDetails) {
|
|
13
13
|
var contents = [];
|
|
14
|
-
if (
|
|
14
|
+
if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
|
|
15
15
|
contents.push(this.CommonHeaderDetails(ROPrintData, null), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies, moreDiscDetails));
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
@@ -42,7 +42,7 @@ class DCLandscapePdfService {
|
|
|
42
42
|
}
|
|
43
43
|
static GetFileName(ROPrintData) {
|
|
44
44
|
let fileName = ROPrintData.HeaderName;
|
|
45
|
-
if (!
|
|
45
|
+
if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
46
46
|
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
47
47
|
}
|
|
48
48
|
return fileName;
|
|
@@ -52,10 +52,10 @@ class DCLandscapePdfService {
|
|
|
52
52
|
}
|
|
53
53
|
static GetHeaderInfo(InvoicePDFData) {
|
|
54
54
|
let TaxInfo = [];
|
|
55
|
-
if (!
|
|
55
|
+
if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.GSTIN)) {
|
|
56
56
|
TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' });
|
|
57
57
|
}
|
|
58
|
-
if (!
|
|
58
|
+
if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.DLNo)) {
|
|
59
59
|
TaxInfo.push({ text: 'D.L.NO : ' + InvoicePDFData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' });
|
|
60
60
|
}
|
|
61
61
|
TaxInfo.push(this.GetBillofSupplyName(InvoicePDFData.Settings));
|
|
@@ -129,19 +129,19 @@ class DCLandscapePdfService {
|
|
|
129
129
|
]
|
|
130
130
|
}
|
|
131
131
|
];
|
|
132
|
-
if (!
|
|
132
|
+
if (!tr_utils_1.TrUtils.IsNull(Image)) {
|
|
133
133
|
// Details.unshift({ text: '', width: 120 });
|
|
134
134
|
if (Entity.CName.length < 28) {
|
|
135
135
|
Details[0].stack[0].columns.push({ text: '', width: 140 });
|
|
136
136
|
}
|
|
137
|
-
if (!
|
|
137
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
138
138
|
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
139
139
|
}
|
|
140
140
|
Details.unshift({ image: Image, width: 120, height: 80 });
|
|
141
141
|
}
|
|
142
142
|
else {
|
|
143
143
|
Details[0].stack[1].columns.unshift({ text: '', width: 130 });
|
|
144
|
-
if (!
|
|
144
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
145
145
|
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -159,7 +159,7 @@ class DCLandscapePdfService {
|
|
|
159
159
|
let List = [];
|
|
160
160
|
if (ROPrintData.Entity.Body === 1) {
|
|
161
161
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
162
|
-
if (
|
|
162
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
163
163
|
ROPrintData.PrintInfo[i].Text = '';
|
|
164
164
|
}
|
|
165
165
|
// List.push(ROPrintData.PrintInfo[i].Text,
|
|
@@ -170,10 +170,10 @@ class DCLandscapePdfService {
|
|
|
170
170
|
else {
|
|
171
171
|
if (ROPrintData.Entity.Body === 2) {
|
|
172
172
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
173
|
-
if (
|
|
173
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
174
174
|
ROPrintData.PrintInfo[i].Text = '';
|
|
175
175
|
}
|
|
176
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
176
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
else {
|
|
@@ -184,10 +184,10 @@ class DCLandscapePdfService {
|
|
|
184
184
|
}
|
|
185
185
|
else {
|
|
186
186
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
187
|
-
if (
|
|
187
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
188
188
|
ROPrintData.PrintInfo[i].Text = '';
|
|
189
189
|
}
|
|
190
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
190
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}
|
|
@@ -421,14 +421,14 @@ class DCLandscapePdfService {
|
|
|
421
421
|
Parts.forEach((part) => {
|
|
422
422
|
var dataRow = [];
|
|
423
423
|
columns.forEach((column) => {
|
|
424
|
-
if ((!
|
|
424
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
425
425
|
|| (column.text === 'Line Total' || column.text === 'Expiry')) {
|
|
426
426
|
if (part[column.Field] === 'Spare Parts') {
|
|
427
427
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
428
428
|
}
|
|
429
429
|
else {
|
|
430
430
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
431
|
-
&&
|
|
431
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
432
432
|
part[column.Field] = '';
|
|
433
433
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
434
434
|
}
|
|
@@ -438,7 +438,7 @@ class DCLandscapePdfService {
|
|
|
438
438
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
439
439
|
if (column.Field === 'Disc') {
|
|
440
440
|
if (column.type === 'percentage') {
|
|
441
|
-
if (!
|
|
441
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
442
442
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
443
443
|
}
|
|
444
444
|
else {
|
|
@@ -446,7 +446,7 @@ class DCLandscapePdfService {
|
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
else {
|
|
449
|
-
if (!
|
|
449
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
450
450
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
451
451
|
}
|
|
452
452
|
else {
|
|
@@ -456,7 +456,7 @@ class DCLandscapePdfService {
|
|
|
456
456
|
}
|
|
457
457
|
else {
|
|
458
458
|
if (column.Field === 'Batch') {
|
|
459
|
-
if (!
|
|
459
|
+
if (!tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
460
460
|
dataRow.push({ text: part[column.Field].BN, nowrap: true });
|
|
461
461
|
}
|
|
462
462
|
else {
|
|
@@ -464,7 +464,7 @@ class DCLandscapePdfService {
|
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
466
|
else if (column.Field === 'ExDate') {
|
|
467
|
-
if (!
|
|
467
|
+
if (!tr_utils_1.TrUtils.IsNull(part['Batch'])) {
|
|
468
468
|
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(part['Batch'].ExDt), nowrap: true });
|
|
469
469
|
}
|
|
470
470
|
else {
|
|
@@ -472,7 +472,7 @@ class DCLandscapePdfService {
|
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
474
|
else {
|
|
475
|
-
if (!
|
|
475
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
476
476
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
477
477
|
}
|
|
478
478
|
else {
|
|
@@ -486,7 +486,7 @@ class DCLandscapePdfService {
|
|
|
486
486
|
if (column.Field === 'Desc') {
|
|
487
487
|
let DescData = [];
|
|
488
488
|
DescData.push(part[column.Field].toString());
|
|
489
|
-
if (!
|
|
489
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
490
490
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
491
491
|
}
|
|
492
492
|
dataRow.push({ stack: DescData });
|
|
@@ -499,7 +499,7 @@ class DCLandscapePdfService {
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
else {
|
|
502
|
-
if (column.Field === 'SNo' && !
|
|
502
|
+
if (column.Field === 'SNo' && !tr_utils_1.TrUtils.IsNull(part.Desc)) {
|
|
503
503
|
part[column.Field] = SNo;
|
|
504
504
|
SNo = SNo + 1;
|
|
505
505
|
}
|
|
@@ -818,7 +818,7 @@ class DCLandscapePdfService {
|
|
|
818
818
|
// if (ROPrintData.Type !== 'Invoice') {
|
|
819
819
|
// CommonDetails.splice(2, 0, SharedPDFService.GetUnderLine());
|
|
820
820
|
// }
|
|
821
|
-
if (!
|
|
821
|
+
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
822
822
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
823
823
|
}
|
|
824
824
|
return CommonDetails;
|
|
@@ -855,12 +855,12 @@ class DCLandscapePdfService {
|
|
|
855
855
|
let totalDisc;
|
|
856
856
|
let totalTax;
|
|
857
857
|
if (!ROPrintData.Consolidate) {
|
|
858
|
-
totalTax =
|
|
859
|
-
if (
|
|
860
|
-
totalDisc =
|
|
858
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(0) + Number(ROPrintData.CustPartITax));
|
|
859
|
+
if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
|
|
860
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(0) + Number(ROPrintData.CustPartsDiscTotal));
|
|
861
861
|
}
|
|
862
862
|
else {
|
|
863
|
-
totalDisc =
|
|
863
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(0) + Number(ROPrintData.CustPartsDiscTotal) + Number(ROPrintData.FixedDisc));
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
866
|
return [
|