shareneus 1.6.16 → 1.6.17

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.
@@ -86,11 +86,7 @@ function getRenderableColumns(headerConfig, sType = '') {
86
86
  taxKind: 'rate',
87
87
  dbField: 'IGST',
88
88
  width: getTaxSubWidth(header.width),
89
- });
90
- continue;
91
- }
92
- if (isInter && hasTaxGroup && isTaxAmountHeader(header)) {
93
- columns.push({
89
+ }, {
94
90
  type: 'tax',
95
91
  taxKind: 'amount',
96
92
  dbField: 'IGST',
@@ -98,17 +94,25 @@ function getRenderableColumns(headerConfig, sType = '') {
98
94
  });
99
95
  continue;
100
96
  }
101
- if (isInter && !hasTaxGroup && (isTaxPercentHeader(header) || isTaxAmountHeader(header))) {
97
+ // Tax Amt header is skipped for Inter when hasTaxGroup (IGST already handled by Tax%)
98
+ if (isInter && hasTaxGroup && isTaxAmountHeader(header)) {
99
+ continue;
100
+ }
101
+ if (isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
102
102
  columns.push({
103
103
  type: 'tax',
104
104
  taxKind: 'rate',
105
105
  dbField: 'IGST',
106
- width: getTaxSubWidth(header.width),
107
- }, {
106
+ width: header.width,
107
+ });
108
+ continue;
109
+ }
110
+ if (isInter && !hasTaxGroup && isTaxAmountHeader(header)) {
111
+ columns.push({
108
112
  type: 'tax',
109
113
  taxKind: 'amount',
110
114
  dbField: 'IGST',
111
- width: getTaxSubWidth(header.width),
115
+ width: header.width,
112
116
  });
113
117
  continue;
114
118
  }
@@ -194,6 +198,15 @@ function buildHeaderRows(headerConfig, sType = '') {
194
198
  const subRow = [];
195
199
  for (const header of headerConfig) {
196
200
  // --- Inter / IGST ---
201
+ if (isInter && hasTaxGroup && isTaxPercentHeader(header)) {
202
+ topRow.push(Object.assign({ text: 'IGST', colSpan: 2, alignment: 'center' }, getHeaderCellStyle()), {});
203
+ subRow.push(Object.assign({ text: '%', alignment: 'center' }, getHeaderCellStyle()), Object.assign({ text: 'Amt', alignment: 'center' }, getHeaderCellStyle()));
204
+ continue;
205
+ }
206
+ // Tax Amt header is skipped for Inter when hasTaxGroup (IGST already handled by Tax%)
207
+ if (isInter && hasTaxGroup && isTaxAmountHeader(header)) {
208
+ continue;
209
+ }
197
210
  if (isInter && !hasTaxGroup && isTaxPercentHeader(header)) {
198
211
  topRow.push(Object.assign({ text: 'IGST %', rowSpan: 2, alignment: 'center' }, getHeaderCellStyle()));
199
212
  subRow.push({});
@@ -204,11 +217,6 @@ function buildHeaderRows(headerConfig, sType = '') {
204
217
  subRow.push({});
205
218
  continue;
206
219
  }
207
- if (isInter && hasTaxGroup && (isTaxPercentHeader(header) || isTaxAmountHeader(header))) {
208
- topRow.push(Object.assign({ text: 'IGST', colSpan: 2, alignment: 'center' }, getHeaderCellStyle()), {});
209
- subRow.push(Object.assign({ text: '%', alignment: 'center' }, getHeaderCellStyle()), Object.assign({ text: 'Amt', alignment: 'center' }, getHeaderCellStyle()));
210
- continue;
211
- }
212
220
  // --- Intra / CGST + SGST ---
213
221
  if (!isInter && hasTaxGroup && isTaxPercentHeader(header)) {
214
222
  topRow.push(Object.assign({ text: 'CGST', colSpan: 2, alignment: 'center' }, getHeaderCellStyle()), {});
@@ -268,7 +268,7 @@ function buildFallbackSectionTotalRow(fallbackHeaderRow, label, totals, fixedTo)
268
268
  if (header.text === 'SGST' && header.taxKind === 'amount') {
269
269
  return buildTotalValueCell(formatAmount(totals.sgstAmount, fixedTo));
270
270
  }
271
- if (header.text === 'IGST Amt' && header.taxKind === 'amount') {
271
+ if (header.text === 'IGST Amt') {
272
272
  return buildTotalValueCell(formatAmount(totals.igstAmount, fixedTo));
273
273
  }
274
274
  if (header.text === 'Description') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.6.16",
3
+ "version": "1.6.17",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",