shareneus 1.7.6 → 1.7.8
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/services/ro-pdf.service.d.ts +1 -0
- package/dist/services/ro-pdf.service.js +15 -1
- package/dist/shared/shared-pdf.service.js +4 -2
- package/dist/shared/totals-section/pdf-totals.section.js +17 -5
- package/dist/shared/transactions-pdf.service.js +4 -4
- package/package.json +1 -1
- package/src/services/ro-pdf.service.ts +16 -1
- package/src/shared/shared-pdf.service.ts +3 -2
- package/src/shared/totals-section/pdf-totals.section.ts +19 -5
- package/src/shared/transactions-pdf.service.ts +4 -4
|
@@ -284,6 +284,7 @@ export declare class RoprintService {
|
|
|
284
284
|
marginBottom: number;
|
|
285
285
|
};
|
|
286
286
|
static CompanyDetails(Entity: any): any;
|
|
287
|
+
static GetEntityGSTIN(Entity: any): any;
|
|
287
288
|
static GetFileName(ROPrintData: any): string;
|
|
288
289
|
static CustomersparePartsTable(ROPrintData: any): any;
|
|
289
290
|
static GetCustomerIndPartsTable(Colli: any, Type: any, Status: any, PrintPartNo: any, ShowTaxColumn: any): any;
|
|
@@ -99,12 +99,13 @@ class RoprintService {
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
static CompanyDetails(Entity) {
|
|
102
|
+
const gstin = this.GetEntityGSTIN(Entity);
|
|
102
103
|
let Details = [
|
|
103
104
|
{ text: Entity.CName, alignment: 'right', lineHeight: 1.5, fontSize: 8 },
|
|
104
105
|
{ text: Entity.Adrs1 + ',', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
105
106
|
{ text: '' + Entity.City + shared_pdf_service_1.SharedPDFService.getPinCode(Entity.PIN) + ', ' + 'Ph: ' + Entity.Phone, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
106
107
|
{ text: '' + shared_pdf_service_1.SharedPDFService.GetEmail(Entity.Email) + '', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
107
|
-
{ text: 'GSTIN : ' +
|
|
108
|
+
{ text: 'GSTIN : ' + gstin, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
108
109
|
{ text: 'PAN No : ' + Entity.PAN, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 }
|
|
109
110
|
];
|
|
110
111
|
if (!tr_utils_1.TrUtils.IsEmpty(Entity.Adrs2)) {
|
|
@@ -112,6 +113,19 @@ class RoprintService {
|
|
|
112
113
|
}
|
|
113
114
|
return Details;
|
|
114
115
|
}
|
|
116
|
+
static GetEntityGSTIN(Entity) {
|
|
117
|
+
if (!tr_utils_1.TrUtils.IsNull(Entity) && Array.isArray(Entity.TaxIds)) {
|
|
118
|
+
const gstinEntry = Entity.TaxIds.find((taxId) => {
|
|
119
|
+
const label = ((taxId === null || taxId === void 0 ? void 0 : taxId.Label) || (taxId === null || taxId === void 0 ? void 0 : taxId.label) || '').toString().trim().toUpperCase();
|
|
120
|
+
const value = (taxId === null || taxId === void 0 ? void 0 : taxId.Value) || (taxId === null || taxId === void 0 ? void 0 : taxId.value);
|
|
121
|
+
return label === 'GSTIN' && !tr_utils_1.TrUtils.IsEmpty(value);
|
|
122
|
+
});
|
|
123
|
+
if (!tr_utils_1.TrUtils.IsNull(gstinEntry)) {
|
|
124
|
+
return gstinEntry.Value || gstinEntry.value;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return tr_utils_1.TrUtils.IsNull(Entity === null || Entity === void 0 ? void 0 : Entity.GSTIN) ? '' : Entity.GSTIN;
|
|
128
|
+
}
|
|
115
129
|
static GetFileName(ROPrintData) {
|
|
116
130
|
let fileName = ROPrintData.HeaderName;
|
|
117
131
|
if (!tr_utils_1.TrUtils.IsEmpty(ROPrintData.Vehicle.RegNo)) {
|
|
@@ -1235,8 +1235,10 @@ class SharedPDFService {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
1237
1237
|
static GetCustomerGSTIN(Customer) {
|
|
1238
|
-
|
|
1239
|
-
|
|
1238
|
+
var _a;
|
|
1239
|
+
const customerTaxId = tr_utils_1.TrUtils.IsEmpty((_a = Customer === null || Customer === void 0 ? void 0 : Customer.TaxId) === null || _a === void 0 ? void 0 : _a.Value) ? Customer === null || Customer === void 0 ? void 0 : Customer.GSTIN : Customer.TaxId.Value;
|
|
1240
|
+
if (!tr_utils_1.TrUtils.IsEmpty(customerTaxId)) {
|
|
1241
|
+
let GSTIN = { columns: [{ text: 'GSTIN :', width: 33, style: 'hed' }, { text: customerTaxId, marginTop: 1.5 }] };
|
|
1240
1242
|
return GSTIN;
|
|
1241
1243
|
}
|
|
1242
1244
|
else {
|
|
@@ -11,15 +11,16 @@ function buildInvoiceTotalsAndNotesSection(invoiceData, availableWidth, PrintCon
|
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
const normalizedInvoice = invoiceData || {};
|
|
13
13
|
const sType = (0, pdf_shared_utils_1.firstValue)(normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.SType);
|
|
14
|
+
const taxMode = resolveInvoiceTaxMode(normalizedInvoice);
|
|
14
15
|
const companyName = (0, pdf_shared_utils_1.firstValue)((_a = normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Entity) === null || _a === void 0 ? void 0 : _a.CName, (_b = normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Entity) === null || _b === void 0 ? void 0 : _b.Name, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.CName, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.CompanyName);
|
|
15
16
|
const hideTopSection = isTruthy((_c = normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Settings) === null || _c === void 0 ? void 0 : _c.NoPr);
|
|
16
17
|
const isPoSPrint = isTruthy(PrintConfigData === null || PrintConfigData === void 0 ? void 0 : PrintConfigData.IsPoSPrint);
|
|
17
|
-
const shouldShowTaxSummary = resolveShowTaxSummary(normalizedInvoice, PrintConfigData);
|
|
18
|
+
const shouldShowTaxSummary = resolveShowTaxSummary(normalizedInvoice, PrintConfigData, taxMode);
|
|
18
19
|
const taxSummary = resolveTaxSummary(normalizedInvoice, shouldShowTaxSummary);
|
|
19
20
|
const showBankDetails = resolveShowBankDetails(normalizedInvoice, PrintConfigData);
|
|
20
21
|
const showDueSection = shouldShowDueSection(PrintConfigData);
|
|
21
22
|
const bankDetails = showBankDetails ? resolveBankDetails(normalizedInvoice) : { lines: [], hasData: false };
|
|
22
|
-
const totals = resolveTotals(normalizedInvoice, taxSummary.totalTax, PrintConfigData);
|
|
23
|
+
const totals = resolveTotals(normalizedInvoice, taxSummary.totalTax, PrintConfigData, taxMode);
|
|
23
24
|
const totalInWords = resolveTotalInWords(normalizedInvoice);
|
|
24
25
|
const notes = (0, pdf_shared_utils_1.firstValue)(normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Notes, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Note, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Remarks, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Remark);
|
|
25
26
|
const terms = (0, pdf_shared_utils_1.firstValue)(normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.TermsAndConditions, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.TermsCondition, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Terms, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.TC);
|
|
@@ -487,7 +488,10 @@ function resolveTaxSummary(invoiceData, shouldShowTaxSummary) {
|
|
|
487
488
|
hasData: rows.length > 0
|
|
488
489
|
};
|
|
489
490
|
}
|
|
490
|
-
function resolveShowTaxSummary(invoiceData, printConfigData = {}) {
|
|
491
|
+
function resolveShowTaxSummary(invoiceData, printConfigData = {}, taxMode = '') {
|
|
492
|
+
if (shouldHideTaxDetails(taxMode)) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
491
495
|
const value = (0, pdf_shared_utils_1.firstValue)(printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.ShowTaxSummary, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.ShowTaxSummary);
|
|
492
496
|
return isTruthy(value);
|
|
493
497
|
}
|
|
@@ -549,10 +553,11 @@ function hasDisplayValue(value) {
|
|
|
549
553
|
}
|
|
550
554
|
return true;
|
|
551
555
|
}
|
|
552
|
-
function resolveTotals(invoiceData, totalTax, printConfigData = {}) {
|
|
556
|
+
function resolveTotals(invoiceData, totalTax, printConfigData = {}, taxMode = '') {
|
|
553
557
|
var _a;
|
|
554
558
|
const subtotal = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['SIndTotal', 'STotal', 'SubTotal', 'SubTot', 'TaxableAmount', 'TaxableValue']);
|
|
555
559
|
const isPoSPrint = isTruthy((_a = printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.IsPoSPrint) !== null && _a !== void 0 ? _a : printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.isPoSPrint);
|
|
560
|
+
const hideTaxDetails = shouldHideTaxDetails(taxMode);
|
|
556
561
|
const showDetailedDisc = isTruthy((0, pdf_shared_utils_1.firstValue)(printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.ShowDetailedDisc));
|
|
557
562
|
const itemsDiscount = parseNumber((0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.PDisc));
|
|
558
563
|
const servicesDiscount = parseNumber((0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.LDisc));
|
|
@@ -600,7 +605,7 @@ function resolveTotals(invoiceData, totalTax, printConfigData = {}) {
|
|
|
600
605
|
const totalLines = [
|
|
601
606
|
{ label: 'SubTotal', amount: subtotal },
|
|
602
607
|
...discountLines,
|
|
603
|
-
{ label: 'Total Tax', amount: totalTaxValue },
|
|
608
|
+
...(!hideTaxDetails ? [{ label: 'Total Tax', amount: totalTaxValue }] : []),
|
|
604
609
|
{ label: 'Return Total', amount: returnTotal },
|
|
605
610
|
{ label: 'Total', amount: totalBeforeRound },
|
|
606
611
|
{ label: 'Rounding', amount: roundOff },
|
|
@@ -680,6 +685,13 @@ function parseNumber(value) {
|
|
|
680
685
|
const numeric = Number(normalized);
|
|
681
686
|
return Number.isFinite(numeric) ? numeric : 0;
|
|
682
687
|
}
|
|
688
|
+
function resolveInvoiceTaxMode(invoiceData) {
|
|
689
|
+
var _a, _b;
|
|
690
|
+
return String((_b = (_a = invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.Settings) === null || _a === void 0 ? void 0 : _a.Tax) !== null && _b !== void 0 ? _b : '').trim().toUpperCase();
|
|
691
|
+
}
|
|
692
|
+
function shouldHideTaxDetails(taxMode) {
|
|
693
|
+
return taxMode === 'BS' || taxMode === 'NO';
|
|
694
|
+
}
|
|
683
695
|
function formatTaxRate(value) {
|
|
684
696
|
const normalized = (0, pdf_shared_utils_1.firstValue)(value);
|
|
685
697
|
if (!normalized) {
|
|
@@ -67,7 +67,7 @@ function GetSalesOrderPDF(salesOrderData, entityData, headerConfig, printConfig,
|
|
|
67
67
|
const printConfigData = tr_utils_1.TrUtils.ConcatObjects(tr_utils_1.TrUtils.Stringify(headerConfig), tr_utils_1.TrUtils.Stringify(printConfig));
|
|
68
68
|
const soPrintData = sales_print_service_1.SalesPrintService.GetSalesPrintInfo(salesOrderData, entityData, image, options.ShowGST, options.ConsolidateGST, taxCodes, false, options.isOtherIndustry);
|
|
69
69
|
let soPrint;
|
|
70
|
-
if (options.ConsolidateGST
|
|
70
|
+
if (options.ConsolidateGST) {
|
|
71
71
|
soPrint = sales_pdf_service_1.SalesPdfService.GetSalesPrint(salesOrderData, numberofCopies, options.isOtherIndustry, entityData, options.Design, options.SoItems, image, options.MoreDiscDetails);
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
@@ -93,7 +93,7 @@ function GetDeliveryChallanPDF(deliveryChallanData, entityData, headerConfig, pr
|
|
|
93
93
|
const printConfigData = tr_utils_1.TrUtils.ConcatObjects(tr_utils_1.TrUtils.Stringify(headerConfig), tr_utils_1.TrUtils.Stringify(printConfig));
|
|
94
94
|
const dcPrintData = delivery_challan_print_service_1.DeliveryChallanPrintService.GetChallanDataPrintInfo(deliveryChallanData, entityData, image, options.ShowGST, options.ConsolidateGST, taxCodes, false);
|
|
95
95
|
let dcPrint;
|
|
96
|
-
if (options.ConsolidateGST
|
|
96
|
+
if (options.ConsolidateGST) {
|
|
97
97
|
dcPrint = delivery_challan_pdf_service_1.DeliveryChallanPdfService.GetDeliveryChallanPrint(deliveryChallanData, numberofCopies, false);
|
|
98
98
|
}
|
|
99
99
|
else {
|
|
@@ -119,7 +119,7 @@ function GetCreditNotePDF(creditNoteData, entityData, headerConfig, printConfig,
|
|
|
119
119
|
const printConfigData = tr_utils_1.TrUtils.ConcatObjects(tr_utils_1.TrUtils.Stringify(headerConfig), tr_utils_1.TrUtils.Stringify(printConfig));
|
|
120
120
|
const creditNotePrintData = cn_print_service_1.CNPrintService.GetCreditNotePrintInfo(creditNoteData, entityData, image, options.ShowGST, options.ConsolidateGST, taxCodes, false);
|
|
121
121
|
let cnPrint;
|
|
122
|
-
if (options.ConsolidateGST
|
|
122
|
+
if (options.ConsolidateGST) {
|
|
123
123
|
cnPrint = credit_note_pdf_service_1.CreditNotePdfService.GetInvoicePrint(creditNotePrintData, null, false);
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
@@ -151,7 +151,7 @@ function GetSalesReceiptPDF(salesReceiptData, entityData, headerConfig, printCon
|
|
|
151
151
|
posPrintData.TotalTax = (0, math_operations_1.Add)(posPrintData.CustPartCGST, posPrintData.CustPartSGST, posPrintData.CustPartIGST);
|
|
152
152
|
posPrintData.Customer.Code = salesReceiptData.BillTo.Code;
|
|
153
153
|
let posPrint;
|
|
154
|
-
if (options.ConsolidateGST
|
|
154
|
+
if (options.ConsolidateGST) {
|
|
155
155
|
posPrint = pos_receipt_pdf_1.PosReceiptPrintService.GetPrint(posPrintData, options.Size);
|
|
156
156
|
}
|
|
157
157
|
else {
|
package/package.json
CHANGED
|
@@ -136,12 +136,13 @@ export class RoprintService {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
static CompanyDetails(Entity: any) {
|
|
139
|
+
const gstin = this.GetEntityGSTIN(Entity);
|
|
139
140
|
let Details: any = [
|
|
140
141
|
{ text: Entity.CName, alignment: 'right', lineHeight: 1.5, fontSize: 8 },
|
|
141
142
|
{ text: Entity.Adrs1 + ',', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
142
143
|
{ text: '' + Entity.City + SharedPDFService.getPinCode(Entity.PIN) + ', ' + 'Ph: ' + Entity.Phone, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
143
144
|
{ text: '' + SharedPDFService.GetEmail(Entity.Email) + '', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
144
|
-
{ text: 'GSTIN : ' +
|
|
145
|
+
{ text: 'GSTIN : ' + gstin, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 },
|
|
145
146
|
{ text: 'PAN No : ' + Entity.PAN, alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 }]
|
|
146
147
|
if (!TrUtils.IsEmpty(Entity.Adrs2)) {
|
|
147
148
|
Details.splice(2, 0, { text: Entity.Adrs2 + '', alignment: 'right', color: 'gray', lineHeight: 1.5, fontSize: 8 });
|
|
@@ -149,6 +150,20 @@ export class RoprintService {
|
|
|
149
150
|
return Details;
|
|
150
151
|
}
|
|
151
152
|
|
|
153
|
+
static GetEntityGSTIN(Entity: any) {
|
|
154
|
+
if (!TrUtils.IsNull(Entity) && Array.isArray(Entity.TaxIds)) {
|
|
155
|
+
const gstinEntry = Entity.TaxIds.find((taxId: any) => {
|
|
156
|
+
const label = (taxId?.Label || taxId?.label || '').toString().trim().toUpperCase();
|
|
157
|
+
const value = taxId?.Value || taxId?.value;
|
|
158
|
+
return label === 'GSTIN' && !TrUtils.IsEmpty(value);
|
|
159
|
+
});
|
|
160
|
+
if (!TrUtils.IsNull(gstinEntry)) {
|
|
161
|
+
return gstinEntry.Value || gstinEntry.value;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return TrUtils.IsNull(Entity?.GSTIN) ? '' : Entity.GSTIN;
|
|
165
|
+
}
|
|
166
|
+
|
|
152
167
|
static GetFileName(ROPrintData: any) {
|
|
153
168
|
let fileName: string = ROPrintData.HeaderName;
|
|
154
169
|
if (!TrUtils.IsEmpty(ROPrintData.Vehicle.RegNo)) {
|
|
@@ -1323,8 +1323,9 @@ export class SharedPDFService {
|
|
|
1323
1323
|
}
|
|
1324
1324
|
|
|
1325
1325
|
static GetCustomerGSTIN(Customer: any) {
|
|
1326
|
-
|
|
1327
|
-
|
|
1326
|
+
const customerTaxId = TrUtils.IsEmpty(Customer?.TaxId?.Value) ? Customer?.GSTIN : Customer.TaxId.Value;
|
|
1327
|
+
if (!TrUtils.IsEmpty(customerTaxId)) {
|
|
1328
|
+
let GSTIN = { columns: [{ text: 'GSTIN :', width: 33, style: 'hed' }, { text: customerTaxId, marginTop: 1.5 }] };
|
|
1328
1329
|
return GSTIN;
|
|
1329
1330
|
} else {
|
|
1330
1331
|
return this.emptyObject();
|
|
@@ -8,6 +8,7 @@ import { formatAmount, readNumericValue } from '../table-section/pdf-table.secti
|
|
|
8
8
|
export function buildInvoiceTotalsAndNotesSection(invoiceData: any, availableWidth: number, PrintConfigData: any = {}) {
|
|
9
9
|
const normalizedInvoice = invoiceData || {};
|
|
10
10
|
const sType = firstValue(normalizedInvoice?.SType);
|
|
11
|
+
const taxMode = resolveInvoiceTaxMode(normalizedInvoice);
|
|
11
12
|
const companyName = firstValue(
|
|
12
13
|
normalizedInvoice?.Entity?.CName,
|
|
13
14
|
normalizedInvoice?.Entity?.Name,
|
|
@@ -16,12 +17,12 @@ export function buildInvoiceTotalsAndNotesSection(invoiceData: any, availableWid
|
|
|
16
17
|
);
|
|
17
18
|
const hideTopSection = isTruthy(normalizedInvoice?.Settings?.NoPr);
|
|
18
19
|
const isPoSPrint = isTruthy(PrintConfigData?.IsPoSPrint);
|
|
19
|
-
const shouldShowTaxSummary = resolveShowTaxSummary(normalizedInvoice, PrintConfigData);
|
|
20
|
+
const shouldShowTaxSummary = resolveShowTaxSummary(normalizedInvoice, PrintConfigData, taxMode);
|
|
20
21
|
const taxSummary = resolveTaxSummary(normalizedInvoice, shouldShowTaxSummary);
|
|
21
22
|
const showBankDetails = resolveShowBankDetails(normalizedInvoice, PrintConfigData);
|
|
22
23
|
const showDueSection = shouldShowDueSection(PrintConfigData);
|
|
23
24
|
const bankDetails = showBankDetails ? resolveBankDetails(normalizedInvoice) : { lines: [], hasData: false };
|
|
24
|
-
const totals = resolveTotals(normalizedInvoice, taxSummary.totalTax, PrintConfigData);
|
|
25
|
+
const totals = resolveTotals(normalizedInvoice, taxSummary.totalTax, PrintConfigData, taxMode);
|
|
25
26
|
const totalInWords = resolveTotalInWords(normalizedInvoice);
|
|
26
27
|
const notes = firstValue(
|
|
27
28
|
normalizedInvoice?.Notes,
|
|
@@ -595,7 +596,11 @@ function resolveTaxSummary(invoiceData: any, shouldShowTaxSummary: boolean) {
|
|
|
595
596
|
};
|
|
596
597
|
}
|
|
597
598
|
|
|
598
|
-
function resolveShowTaxSummary(invoiceData: any, printConfigData: any = {}) {
|
|
599
|
+
function resolveShowTaxSummary(invoiceData: any, printConfigData: any = {}, taxMode: string = '') {
|
|
600
|
+
if (shouldHideTaxDetails(taxMode)) {
|
|
601
|
+
return false;
|
|
602
|
+
}
|
|
603
|
+
|
|
599
604
|
const value = firstValue(
|
|
600
605
|
printConfigData?.ShowTaxSummary,
|
|
601
606
|
invoiceData?.ShowTaxSummary
|
|
@@ -670,9 +675,10 @@ function hasDisplayValue(value: any) {
|
|
|
670
675
|
return true;
|
|
671
676
|
}
|
|
672
677
|
|
|
673
|
-
function resolveTotals(invoiceData: any, totalTax: number, printConfigData: any = {}) {
|
|
678
|
+
function resolveTotals(invoiceData: any, totalTax: number, printConfigData: any = {}, taxMode: string = '') {
|
|
674
679
|
const subtotal = readNumericValue(invoiceData, ['SIndTotal', 'STotal', 'SubTotal', 'SubTot', 'TaxableAmount', 'TaxableValue']);
|
|
675
680
|
const isPoSPrint = isTruthy(printConfigData?.IsPoSPrint ?? printConfigData?.isPoSPrint);
|
|
681
|
+
const hideTaxDetails = shouldHideTaxDetails(taxMode);
|
|
676
682
|
const showDetailedDisc = isTruthy(firstValue(printConfigData?.ShowDetailedDisc));
|
|
677
683
|
const itemsDiscount = parseNumber(firstValue(invoiceData?.PDisc));
|
|
678
684
|
const servicesDiscount = parseNumber(firstValue(invoiceData?.LDisc));
|
|
@@ -721,7 +727,7 @@ function resolveTotals(invoiceData: any, totalTax: number, printConfigData: any
|
|
|
721
727
|
const totalLines = [
|
|
722
728
|
{ label: 'SubTotal', amount: subtotal },
|
|
723
729
|
...discountLines,
|
|
724
|
-
{ label: 'Total Tax', amount: totalTaxValue },
|
|
730
|
+
...(!hideTaxDetails ? [{ label: 'Total Tax', amount: totalTaxValue }] : []),
|
|
725
731
|
{ label: 'Return Total', amount: returnTotal },
|
|
726
732
|
{ label: 'Total', amount: totalBeforeRound },
|
|
727
733
|
{ label: 'Rounding', amount: roundOff },
|
|
@@ -827,6 +833,14 @@ function parseNumber(value: any) {
|
|
|
827
833
|
return Number.isFinite(numeric) ? numeric : 0;
|
|
828
834
|
}
|
|
829
835
|
|
|
836
|
+
function resolveInvoiceTaxMode(invoiceData: any) {
|
|
837
|
+
return String(invoiceData?.Settings?.Tax ?? '').trim().toUpperCase();
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
function shouldHideTaxDetails(taxMode: string) {
|
|
841
|
+
return taxMode === 'BS' || taxMode === 'NO';
|
|
842
|
+
}
|
|
843
|
+
|
|
830
844
|
function formatTaxRate(value: string) {
|
|
831
845
|
const normalized = firstValue(value);
|
|
832
846
|
if (!normalized) {
|
|
@@ -68,7 +68,7 @@ export function GetSalesOrderPDF(salesOrderData: any, entityData: any, headerCon
|
|
|
68
68
|
const soPrintData: any = SalesPrintService.GetSalesPrintInfo(salesOrderData, entityData, image,
|
|
69
69
|
options.ShowGST, options.ConsolidateGST, taxCodes, false, options.isOtherIndustry);
|
|
70
70
|
let soPrint: any;
|
|
71
|
-
if (options.ConsolidateGST
|
|
71
|
+
if (options.ConsolidateGST) {
|
|
72
72
|
soPrint = SalesPdfService.GetSalesPrint(salesOrderData, numberofCopies, options.isOtherIndustry,
|
|
73
73
|
entityData, options.Design, options.SoItems, image, options.MoreDiscDetails);
|
|
74
74
|
} else {
|
|
@@ -100,7 +100,7 @@ export function GetDeliveryChallanPDF(deliveryChallanData: any, entityData: any,
|
|
|
100
100
|
const dcPrintData: any = DeliveryChallanPrintService.GetChallanDataPrintInfo(deliveryChallanData, entityData, image,
|
|
101
101
|
options.ShowGST, options.ConsolidateGST, taxCodes, false);
|
|
102
102
|
let dcPrint: any;
|
|
103
|
-
if (options.ConsolidateGST
|
|
103
|
+
if (options.ConsolidateGST) {
|
|
104
104
|
dcPrint = DeliveryChallanPdfService.GetDeliveryChallanPrint(deliveryChallanData, numberofCopies, false);
|
|
105
105
|
} else {
|
|
106
106
|
dcPrintData.Round = TrUtils.FixedTo(deliveryChallanData.Round);
|
|
@@ -130,7 +130,7 @@ export function GetCreditNotePDF(creditNoteData: any, entityData: any, headerCon
|
|
|
130
130
|
const creditNotePrintData: any = CNPrintService.GetCreditNotePrintInfo(creditNoteData, entityData, image,
|
|
131
131
|
options.ShowGST, options.ConsolidateGST, taxCodes, false);
|
|
132
132
|
let cnPrint: any;
|
|
133
|
-
if (options.ConsolidateGST
|
|
133
|
+
if (options.ConsolidateGST) {
|
|
134
134
|
cnPrint = CreditNotePdfService.GetInvoicePrint(creditNotePrintData, null, false);
|
|
135
135
|
} else {
|
|
136
136
|
creditNotePrintData.Round = TrUtils.FixedTo(creditNoteData.Round);
|
|
@@ -168,7 +168,7 @@ export function GetSalesReceiptPDF(salesReceiptData: any, entityData: any, heade
|
|
|
168
168
|
posPrintData.TotalTax = Add(posPrintData.CustPartCGST, posPrintData.CustPartSGST, posPrintData.CustPartIGST);
|
|
169
169
|
posPrintData.Customer.Code = salesReceiptData.BillTo.Code;
|
|
170
170
|
let posPrint: any;
|
|
171
|
-
if (options.ConsolidateGST
|
|
171
|
+
if (options.ConsolidateGST) {
|
|
172
172
|
posPrint = PosReceiptPrintService.GetPrint(posPrintData, options.Size);
|
|
173
173
|
} else {
|
|
174
174
|
posPrint = CreateInvoicePDFService(posPrintData, printConfigData, numberofCopies);
|