shareneus 1.7.316 → 1.7.317
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/shared/party-details-section/pdf-party-details.section.js +11 -8
- package/dist/shared/table-section/pdf-table.header.js +2 -2
- package/package.json +1 -1
- package/src/shared/party-details-section/pdf-party-details.section.ts +7 -7
- package/src/shared/table-section/pdf-table.header.ts +84 -84
|
@@ -85,7 +85,7 @@ function buildPartyDetailsSectionLayout(config) {
|
|
|
85
85
|
}];
|
|
86
86
|
}
|
|
87
87
|
function resolveSalesBillToDetails(transactionData) {
|
|
88
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
88
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
89
89
|
const billTo = (transactionData === null || transactionData === void 0 ? void 0 : transactionData.BillTo) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Customer) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Cust) || {};
|
|
90
90
|
const address = normalizeAddress((billTo === null || billTo === void 0 ? void 0 : billTo.Adrs)
|
|
91
91
|
|| ((_a = transactionData === null || transactionData === void 0 ? void 0 : transactionData.BillTo) === null || _a === void 0 ? void 0 : _a.Adrs)
|
|
@@ -94,10 +94,10 @@ function resolveSalesBillToDetails(transactionData) {
|
|
|
94
94
|
|| ((_b = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Customer) === null || _b === void 0 ? void 0 : _b.Adrs)
|
|
95
95
|
|| ((_c = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Cust) === null || _c === void 0 ? void 0 : _c.Adrs));
|
|
96
96
|
const name = (0, pdf_shared_utils_1.firstValue)(billTo === null || billTo === void 0 ? void 0 : billTo.Name, billTo === null || billTo === void 0 ? void 0 : billTo.CName, (_d = transactionData === null || transactionData === void 0 ? void 0 : transactionData.BillTo) === null || _d === void 0 ? void 0 : _d.Name, (_e = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Customer) === null || _e === void 0 ? void 0 : _e.Name, (_f = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Cust) === null || _f === void 0 ? void 0 : _f.Name, transactionData === null || transactionData === void 0 ? void 0 : transactionData.CustomerName);
|
|
97
|
-
const gstin = (0, pdf_shared_utils_1.firstValue)(billTo === null || billTo === void 0 ? void 0 : billTo.GSTIN, billTo === null || billTo === void 0 ? void 0 : billTo.GSTNo);
|
|
97
|
+
const gstin = (0, pdf_shared_utils_1.firstValue)((_g = billTo === null || billTo === void 0 ? void 0 : billTo.TaxId) === null || _g === void 0 ? void 0 : _g.GSTIN, (_h = billTo === null || billTo === void 0 ? void 0 : billTo.TaxId) === null || _h === void 0 ? void 0 : _h.GSTNo);
|
|
98
98
|
const contactInfo = resolvePhoneFromContacts(billTo === null || billTo === void 0 ? void 0 : billTo.Cons);
|
|
99
99
|
const directPhone = (0, pdf_shared_utils_1.firstValue)(billTo === null || billTo === void 0 ? void 0 : billTo.Ph, billTo === null || billTo === void 0 ? void 0 : billTo.Phone, billTo === null || billTo === void 0 ? void 0 : billTo.Mobile);
|
|
100
|
-
const ownerName = (0, pdf_shared_utils_1.firstValue)((
|
|
100
|
+
const ownerName = (0, pdf_shared_utils_1.firstValue)((_j = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Cust) === null || _j === void 0 ? void 0 : _j.Name);
|
|
101
101
|
return {
|
|
102
102
|
name,
|
|
103
103
|
addressLines: buildAddressLines(address),
|
|
@@ -109,12 +109,13 @@ function resolveSalesBillToDetails(transactionData) {
|
|
|
109
109
|
};
|
|
110
110
|
}
|
|
111
111
|
function resolveSalesShipToDetails(transactionData) {
|
|
112
|
+
var _a, _b;
|
|
112
113
|
const shipTo = (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipTo) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShippmentTo) || {};
|
|
113
114
|
const address = normalizeAddress((shipTo === null || shipTo === void 0 ? void 0 : shipTo.Adrs)
|
|
114
115
|
|| (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipAddress)
|
|
115
116
|
|| (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipToAddress));
|
|
116
117
|
const name = (0, pdf_shared_utils_1.firstValue)(shipTo === null || shipTo === void 0 ? void 0 : shipTo.Name, shipTo === null || shipTo === void 0 ? void 0 : shipTo.CName);
|
|
117
|
-
const gstin = (0, pdf_shared_utils_1.firstValue)(shipTo === null || shipTo === void 0 ? void 0 : shipTo.GSTIN, shipTo === null || shipTo === void 0 ? void 0 : shipTo.GSTNo);
|
|
118
|
+
const gstin = (0, pdf_shared_utils_1.firstValue)((_a = shipTo === null || shipTo === void 0 ? void 0 : shipTo.TaxId) === null || _a === void 0 ? void 0 : _a.GSTIN, (_b = shipTo === null || shipTo === void 0 ? void 0 : shipTo.TaxId) === null || _b === void 0 ? void 0 : _b.GSTNo);
|
|
118
119
|
return {
|
|
119
120
|
name,
|
|
120
121
|
addressLines: buildAddressLines(address),
|
|
@@ -123,7 +124,7 @@ function resolveSalesShipToDetails(transactionData) {
|
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
126
|
function resolvePurchaseBFromDetails(transactionData) {
|
|
126
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
127
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
127
128
|
const billTo = (transactionData === null || transactionData === void 0 ? void 0 : transactionData.BFrom) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.BillTo) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Vendor) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Vnd) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Supplier) || {};
|
|
128
129
|
const address = normalizeAddress((billTo === null || billTo === void 0 ? void 0 : billTo.Adrs)
|
|
129
130
|
|| ((_a = transactionData === null || transactionData === void 0 ? void 0 : transactionData.BFrom) === null || _a === void 0 ? void 0 : _a.Adrs)
|
|
@@ -135,7 +136,7 @@ function resolvePurchaseBFromDetails(transactionData) {
|
|
|
135
136
|
|| ((_d = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Vnd) === null || _d === void 0 ? void 0 : _d.Adrs)
|
|
136
137
|
|| ((_e = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Supplier) === null || _e === void 0 ? void 0 : _e.Adrs));
|
|
137
138
|
const name = (0, pdf_shared_utils_1.firstValue)(billTo === null || billTo === void 0 ? void 0 : billTo.Name, billTo === null || billTo === void 0 ? void 0 : billTo.CName, (_f = transactionData === null || transactionData === void 0 ? void 0 : transactionData.BFrom) === null || _f === void 0 ? void 0 : _f.Name, (_g = transactionData === null || transactionData === void 0 ? void 0 : transactionData.BillTo) === null || _g === void 0 ? void 0 : _g.Name, (_h = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Vendor) === null || _h === void 0 ? void 0 : _h.Name, (_j = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Vnd) === null || _j === void 0 ? void 0 : _j.Name, (_k = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Supplier) === null || _k === void 0 ? void 0 : _k.Name, transactionData === null || transactionData === void 0 ? void 0 : transactionData.BFromName, transactionData === null || transactionData === void 0 ? void 0 : transactionData.VendorName);
|
|
138
|
-
const gstin = (0, pdf_shared_utils_1.firstValue)(billTo === null || billTo === void 0 ? void 0 : billTo.GSTIN, billTo === null || billTo === void 0 ? void 0 : billTo.GSTNo);
|
|
139
|
+
const gstin = (0, pdf_shared_utils_1.firstValue)((_l = billTo === null || billTo === void 0 ? void 0 : billTo.TaxId) === null || _l === void 0 ? void 0 : _l.GSTIN, (_m = billTo === null || billTo === void 0 ? void 0 : billTo.TaxId) === null || _m === void 0 ? void 0 : _m.GSTNo);
|
|
139
140
|
const contactInfo = resolvePhoneFromContacts(billTo === null || billTo === void 0 ? void 0 : billTo.Contact);
|
|
140
141
|
const directPhone = (0, pdf_shared_utils_1.firstValue)(billTo === null || billTo === void 0 ? void 0 : billTo.Ph, billTo === null || billTo === void 0 ? void 0 : billTo.Phone, billTo === null || billTo === void 0 ? void 0 : billTo.Mobile);
|
|
141
142
|
return {
|
|
@@ -188,13 +189,14 @@ function resolvePurchaseOtherDetails(transactionData, printConfig = {}) {
|
|
|
188
189
|
};
|
|
189
190
|
}
|
|
190
191
|
function resolvePurchaseShipFromDetails(transactionData) {
|
|
192
|
+
var _a, _b;
|
|
191
193
|
const shipFrom = (transactionData === null || transactionData === void 0 ? void 0 : transactionData.SFrom) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipFrom) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.From) || {};
|
|
192
194
|
const address = normalizeAddress((shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.Adrs)
|
|
193
195
|
|| (transactionData === null || transactionData === void 0 ? void 0 : transactionData.SFromAddress)
|
|
194
196
|
|| (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipFromAddress)
|
|
195
197
|
|| (transactionData === null || transactionData === void 0 ? void 0 : transactionData.FromAddress));
|
|
196
198
|
const name = (0, pdf_shared_utils_1.firstValue)(shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.Name, shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.CName, shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.WhName, transactionData === null || transactionData === void 0 ? void 0 : transactionData.SFromName, transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipFromName);
|
|
197
|
-
const gstin = (0, pdf_shared_utils_1.firstValue)(shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.GSTIN, shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.GSTNo);
|
|
199
|
+
const gstin = (0, pdf_shared_utils_1.firstValue)((_a = shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.TaxId) === null || _a === void 0 ? void 0 : _a.GSTIN, (_b = shipFrom === null || shipFrom === void 0 ? void 0 : shipFrom.TaxId) === null || _b === void 0 ? void 0 : _b.GSTNo);
|
|
198
200
|
return {
|
|
199
201
|
name,
|
|
200
202
|
addressLines: buildAddressLines(address),
|
|
@@ -203,10 +205,11 @@ function resolvePurchaseShipFromDetails(transactionData) {
|
|
|
203
205
|
};
|
|
204
206
|
}
|
|
205
207
|
function resolveInsuranceDetails(transactionData) {
|
|
208
|
+
var _a, _b;
|
|
206
209
|
const insurance = (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Insurance) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Ins) || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.Insurer) || {};
|
|
207
210
|
const address = normalizeAddress((insurance === null || insurance === void 0 ? void 0 : insurance.Adrs) || (insurance === null || insurance === void 0 ? void 0 : insurance.Address));
|
|
208
211
|
const name = (0, pdf_shared_utils_1.firstValue)(insurance === null || insurance === void 0 ? void 0 : insurance.Name, insurance === null || insurance === void 0 ? void 0 : insurance.Company, insurance === null || insurance === void 0 ? void 0 : insurance.Provider, insurance === null || insurance === void 0 ? void 0 : insurance.InsName);
|
|
209
|
-
const gstin = (0, pdf_shared_utils_1.firstValue)(insurance === null || insurance === void 0 ? void 0 : insurance.GSTIN, insurance === null || insurance === void 0 ? void 0 : insurance.GSTNo);
|
|
212
|
+
const gstin = (0, pdf_shared_utils_1.firstValue)((_a = insurance === null || insurance === void 0 ? void 0 : insurance.TaxId) === null || _a === void 0 ? void 0 : _a.GSTIN, (_b = insurance === null || insurance === void 0 ? void 0 : insurance.TaxId) === null || _b === void 0 ? void 0 : _b.GSTNo);
|
|
210
213
|
return {
|
|
211
214
|
name,
|
|
212
215
|
addressLines: buildAddressLines(address),
|
|
@@ -272,8 +272,8 @@ function getSingleTaxHeaderText(header) {
|
|
|
272
272
|
return header.text;
|
|
273
273
|
}
|
|
274
274
|
function isTaxHeaderConfig(header) {
|
|
275
|
-
var _a, _b, _c;
|
|
276
|
-
const title = (_c = (_b = (_a = header === null || header === void 0 ? void 0 : header.
|
|
275
|
+
var _a, _b, _c, _d;
|
|
276
|
+
const title = (_d = (_c = (_b = (_a = header === null || header === void 0 ? void 0 : header.Title) !== null && _a !== void 0 ? _a : header === null || header === void 0 ? void 0 : header.Tital) !== null && _b !== void 0 ? _b : header === null || header === void 0 ? void 0 : header.CustTitle) !== null && _c !== void 0 ? _c : header === null || header === void 0 ? void 0 : header.Tital) !== null && _d !== void 0 ? _d : header === null || header === void 0 ? void 0 : header.text;
|
|
277
277
|
const normalizedTitle = normalizeHeaderText(title);
|
|
278
278
|
return normalizedTitle === 'TAX%' || normalizedTitle === 'TAXAMOUNT';
|
|
279
279
|
}
|
package/package.json
CHANGED
|
@@ -104,8 +104,8 @@ function resolveSalesBillToDetails(transactionData: any) {
|
|
|
104
104
|
transactionData?.CustomerName
|
|
105
105
|
);
|
|
106
106
|
const gstin = firstValue(
|
|
107
|
-
billTo?.GSTIN,
|
|
108
|
-
billTo?.GSTNo
|
|
107
|
+
billTo?.TaxId?.GSTIN,
|
|
108
|
+
billTo?.TaxId?.GSTNo
|
|
109
109
|
);
|
|
110
110
|
const contactInfo = resolvePhoneFromContacts(billTo?.Cons);
|
|
111
111
|
const directPhone = firstValue(billTo?.Ph, billTo?.Phone, billTo?.Mobile);
|
|
@@ -129,7 +129,7 @@ function resolveSalesShipToDetails(transactionData: any) {
|
|
|
129
129
|
|| transactionData?.ShipToAddress
|
|
130
130
|
);
|
|
131
131
|
const name = firstValue(shipTo?.Name, shipTo?.CName);
|
|
132
|
-
const gstin = firstValue(shipTo?.GSTIN, shipTo?.GSTNo);
|
|
132
|
+
const gstin = firstValue(shipTo?.TaxId?.GSTIN, shipTo?.TaxId?.GSTNo);
|
|
133
133
|
return {
|
|
134
134
|
name,
|
|
135
135
|
addressLines: buildAddressLines(address),
|
|
@@ -163,8 +163,8 @@ function resolvePurchaseBFromDetails(transactionData: any) {
|
|
|
163
163
|
transactionData?.VendorName
|
|
164
164
|
);
|
|
165
165
|
const gstin = firstValue(
|
|
166
|
-
billTo?.GSTIN,
|
|
167
|
-
billTo?.GSTNo
|
|
166
|
+
billTo?.TaxId?.GSTIN,
|
|
167
|
+
billTo?.TaxId?.GSTNo
|
|
168
168
|
);
|
|
169
169
|
const contactInfo = resolvePhoneFromContacts(billTo?.Contact);
|
|
170
170
|
const directPhone = firstValue(billTo?.Ph, billTo?.Phone, billTo?.Mobile);
|
|
@@ -237,7 +237,7 @@ function resolvePurchaseShipFromDetails(transactionData: any) {
|
|
|
237
237
|
transactionData?.SFromName,
|
|
238
238
|
transactionData?.ShipFromName
|
|
239
239
|
);
|
|
240
|
-
const gstin = firstValue(shipFrom?.GSTIN, shipFrom?.GSTNo);
|
|
240
|
+
const gstin = firstValue(shipFrom?.TaxId?.GSTIN, shipFrom?.TaxId?.GSTNo);
|
|
241
241
|
|
|
242
242
|
return {
|
|
243
243
|
name,
|
|
@@ -256,7 +256,7 @@ function resolveInsuranceDetails(transactionData: any) {
|
|
|
256
256
|
insurance?.Provider,
|
|
257
257
|
insurance?.InsName
|
|
258
258
|
);
|
|
259
|
-
const gstin = firstValue(insurance?.GSTIN, insurance?.GSTNo);
|
|
259
|
+
const gstin = firstValue(insurance?.TaxId?.GSTIN, insurance?.TaxId?.GSTNo);
|
|
260
260
|
return {
|
|
261
261
|
name,
|
|
262
262
|
addressLines: buildAddressLines(address),
|
|
@@ -113,25 +113,25 @@ export function getRenderableColumns(headerConfig: any[], sType: string = '') {
|
|
|
113
113
|
continue;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
if (isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
117
|
-
columns.push({
|
|
118
|
-
type: 'tax',
|
|
119
|
-
taxKind: 'rate',
|
|
120
|
-
dbField: 'GST',
|
|
121
|
-
width: header.width,
|
|
122
|
-
});
|
|
123
|
-
continue;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
127
|
-
columns.push({
|
|
128
|
-
type: 'tax',
|
|
129
|
-
taxKind: 'amount',
|
|
130
|
-
dbField: 'GST',
|
|
131
|
-
width: header.width,
|
|
132
|
-
});
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
116
|
+
if (isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
117
|
+
columns.push({
|
|
118
|
+
type: 'tax',
|
|
119
|
+
taxKind: 'rate',
|
|
120
|
+
dbField: 'GST',
|
|
121
|
+
width: header.width,
|
|
122
|
+
});
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
127
|
+
columns.push({
|
|
128
|
+
type: 'tax',
|
|
129
|
+
taxKind: 'amount',
|
|
130
|
+
dbField: 'GST',
|
|
131
|
+
width: header.width,
|
|
132
|
+
});
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
135
|
|
|
136
136
|
// --- Intra / CGST + SGST ---
|
|
137
137
|
if (!isInter && hasTaxGroup && isTaxPercentHeader(header)) {
|
|
@@ -170,25 +170,25 @@ export function getRenderableColumns(headerConfig: any[], sType: string = '') {
|
|
|
170
170
|
continue;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
-
if (!isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
174
|
-
columns.push({
|
|
175
|
-
type: 'tax',
|
|
176
|
-
taxKind: 'rate',
|
|
177
|
-
dbField: 'GST',
|
|
178
|
-
width: header.width,
|
|
179
|
-
});
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (!isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
184
|
-
columns.push({
|
|
185
|
-
type: 'tax',
|
|
186
|
-
taxKind: 'amount',
|
|
187
|
-
dbField: 'GST',
|
|
188
|
-
width: header.width,
|
|
189
|
-
});
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
173
|
+
if (!isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
174
|
+
columns.push({
|
|
175
|
+
type: 'tax',
|
|
176
|
+
taxKind: 'rate',
|
|
177
|
+
dbField: 'GST',
|
|
178
|
+
width: header.width,
|
|
179
|
+
});
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (!isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
184
|
+
columns.push({
|
|
185
|
+
type: 'tax',
|
|
186
|
+
taxKind: 'amount',
|
|
187
|
+
dbField: 'GST',
|
|
188
|
+
width: header.width,
|
|
189
|
+
});
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
192
|
|
|
193
193
|
columns.push({
|
|
194
194
|
type: 'normal',
|
|
@@ -207,16 +207,16 @@ export function buildHeaderRows(headerConfig: any[], sType: string = '') {
|
|
|
207
207
|
const hasDiscPercent = headerConfig.some((header: any) => header.text === 'Disc %');
|
|
208
208
|
const hasDiscAmount = headerConfig.some((header: any) => isDiscountAmountHeader(header.text));
|
|
209
209
|
const hasDiscGroup = hasDiscPercent && hasDiscAmount;
|
|
210
|
-
const hasGroupedHeaders = hasTaxGroup || hasDiscGroup;
|
|
211
|
-
|
|
212
|
-
if (!hasGroupedHeaders) {
|
|
213
|
-
const singleRow = headerConfig.map((header: any) => ({
|
|
214
|
-
text: getSingleTaxHeaderText(header),
|
|
215
|
-
alignment: header.alignment,
|
|
216
|
-
dbFields: header.dbFields,
|
|
217
|
-
stackFields: header.stackFields,
|
|
218
|
-
...getHeaderCellStyle()
|
|
219
|
-
}));
|
|
210
|
+
const hasGroupedHeaders = hasTaxGroup || hasDiscGroup;
|
|
211
|
+
|
|
212
|
+
if (!hasGroupedHeaders) {
|
|
213
|
+
const singleRow = headerConfig.map((header: any) => ({
|
|
214
|
+
text: getSingleTaxHeaderText(header),
|
|
215
|
+
alignment: header.alignment,
|
|
216
|
+
dbFields: header.dbFields,
|
|
217
|
+
stackFields: header.stackFields,
|
|
218
|
+
...getHeaderCellStyle()
|
|
219
|
+
}));
|
|
220
220
|
return [singleRow];
|
|
221
221
|
}
|
|
222
222
|
|
|
@@ -242,17 +242,17 @@ export function buildHeaderRows(headerConfig: any[], sType: string = '') {
|
|
|
242
242
|
continue;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
if (isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
246
|
-
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
247
|
-
subRow.push({});
|
|
248
|
-
continue;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
if (isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
252
|
-
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
253
|
-
subRow.push({});
|
|
254
|
-
continue;
|
|
255
|
-
}
|
|
245
|
+
if (isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
246
|
+
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
247
|
+
subRow.push({});
|
|
248
|
+
continue;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
252
|
+
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
253
|
+
subRow.push({});
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
256
|
|
|
257
257
|
// --- Intra / CGST + SGST ---
|
|
258
258
|
if (!isInter && hasTaxGroup && isTaxPercentHeader(header)) {
|
|
@@ -279,17 +279,17 @@ export function buildHeaderRows(headerConfig: any[], sType: string = '') {
|
|
|
279
279
|
continue;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
if (!isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
283
|
-
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
284
|
-
subRow.push({});
|
|
285
|
-
continue;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
if (!isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
289
|
-
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
290
|
-
subRow.push({});
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
282
|
+
if (!isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
|
|
283
|
+
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
284
|
+
subRow.push({});
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (!isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
|
|
289
|
+
topRow.push({ text: getSingleTaxHeaderText(header), rowSpan: 2, alignment: 'center', ...getHeaderCellStyle() });
|
|
290
|
+
subRow.push({});
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
293
|
|
|
294
294
|
if (hasDiscGroup && header.text === 'Disc %') {
|
|
295
295
|
topRow.push(
|
|
@@ -330,22 +330,22 @@ function isTaxPercentHeader(header: any) {
|
|
|
330
330
|
return normalizeHeaderText(header?.text) === 'TAX%';
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
function isTaxAmountHeader(header: any) {
|
|
334
|
-
return normalizeHeaderText(header?.text) === 'TAXAMOUNT';
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
function getSingleTaxHeaderText(header: any) {
|
|
338
|
-
if (isTaxPercentHeader(header)) {
|
|
339
|
-
return 'GST(%)';
|
|
340
|
-
}
|
|
341
|
-
if (isTaxAmountHeader(header)) {
|
|
342
|
-
return 'GST Amt';
|
|
343
|
-
}
|
|
344
|
-
return header.text;
|
|
345
|
-
}
|
|
333
|
+
function isTaxAmountHeader(header: any) {
|
|
334
|
+
return normalizeHeaderText(header?.text) === 'TAXAMOUNT';
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function getSingleTaxHeaderText(header: any) {
|
|
338
|
+
if (isTaxPercentHeader(header)) {
|
|
339
|
+
return 'GST(%)';
|
|
340
|
+
}
|
|
341
|
+
if (isTaxAmountHeader(header)) {
|
|
342
|
+
return 'GST Amt';
|
|
343
|
+
}
|
|
344
|
+
return header.text;
|
|
345
|
+
}
|
|
346
346
|
|
|
347
347
|
function isTaxHeaderConfig(header: any) {
|
|
348
|
-
const title = header?.
|
|
348
|
+
const title = header?.Title ?? header?.Tital ?? header?.CustTitle ?? header?.Tital ?? header?.text;
|
|
349
349
|
const normalizedTitle = normalizeHeaderText(title);
|
|
350
350
|
return normalizedTitle === 'TAX%' || normalizedTitle === 'TAXAMOUNT';
|
|
351
351
|
}
|