shareneus 1.6.92 → 1.6.94

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.
@@ -33,7 +33,7 @@ function buildInvoiceTotalsAndNotesSection(invoiceData, availableWidth, PrintCon
33
33
  canvas: [
34
34
  { type: 'line', x1: 0, y1: 0, x2: Math.max(1, availableWidth), y2: 0, lineWidth: 1, lineColor: '#1f2937' }
35
35
  ],
36
- margin: [0, 10, 0, 10]
36
+ margin: [0, 5, 0, 5]
37
37
  };
38
38
  const topColumns = {
39
39
  columns: buildTopSectionColumns(taxSummary, sType, showBankDetails, bankDetails, totals),
@@ -169,9 +169,10 @@ function buildPostTotalsInfoSection(data) {
169
169
  };
170
170
  }
171
171
  function buildSignatureSection(PrintConfig, invoiceData, availableWidth) {
172
- var _a, _b, _c, _d;
172
+ var _a, _b, _c, _d, _e;
173
173
  const headerData = (0, pdf_header_footer_section_1.normalizeHeaderData)((_a = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerData) !== null && _a !== void 0 ? _a : {});
174
- const companyName = (0, pdf_shared_utils_1.firstValue)((_b = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _b === void 0 ? void 0 : _b.cName, (_c = invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.Entity) === null || _c === void 0 ? void 0 : _c.CName, (_d = invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.Entity) === null || _d === void 0 ? void 0 : _d.Name, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.CName);
174
+ const isPoSPrint = isTruthy((_b = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.IsPoSPrint) !== null && _b !== void 0 ? _b : PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.isPoSPrint);
175
+ const companyName = (0, pdf_shared_utils_1.firstValue)((_c = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _c === void 0 ? void 0 : _c.cName, (_d = invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.Entity) === null || _d === void 0 ? void 0 : _d.CName, (_e = invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.Entity) === null || _e === void 0 ? void 0 : _e.Name, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.CName);
175
176
  const withPass = !!((PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.withPass) || (invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.withPass) || (invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.WithPass));
176
177
  const signatureRows = [
177
178
  {
@@ -179,20 +180,22 @@ function buildSignatureSection(PrintConfig, invoiceData, availableWidth) {
179
180
  { width: '*', text: '' },
180
181
  { width: '*', text: `For ${companyName || ''}`.trim(), fontSize: 9, bold: true, color: '#111827', alignment: 'right' }
181
182
  ],
182
- margin: [0, 8, 0, 0]
183
- },
184
- {
183
+ margin: [0, 4, 0, 0]
184
+ }
185
+ ];
186
+ if (!isPoSPrint) {
187
+ signatureRows.push({
185
188
  text: '',
186
189
  margin: [0, 10, 0, 0]
187
- },
188
- {
190
+ });
191
+ signatureRows.push({
189
192
  columns: [
190
193
  { width: '*', text: 'Customer Signature', fontSize: 9, color: '#111827', alignment: 'left' },
191
194
  { width: '*', text: 'Authorised Signatory', fontSize: 9, color: '#111827', alignment: 'right' }
192
195
  ],
193
196
  margin: [0, 0, 0, 0]
194
- }
195
- ];
197
+ });
198
+ }
196
199
  if (!withPass) {
197
200
  return signatureRows;
198
201
  }
@@ -210,7 +213,7 @@ function buildGatePassSection(companyName, invoiceData, availableWidth) {
210
213
  canvas: [
211
214
  { type: 'line', x1: 0, y1: 0, x2: Math.max(1, availableWidth), y2: 0, lineWidth: 1, lineColor: '#1f2937' }
212
215
  ],
213
- margin: [0, 10, 0, 10]
216
+ margin: [0, 5, 0, 5]
214
217
  };
215
218
  return [
216
219
  {
@@ -531,7 +534,6 @@ function resolveTotals(invoiceData, totalTax, printConfigData = {}) {
531
534
  ? itemsDiscount + servicesDiscount + overallDiscount
532
535
  : (0, pdf_table_section_1.readNumericValue)(invoiceData, ['Disc', 'Discount', 'TotDisc']);
533
536
  const roundOff = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['Round', 'RoundOff']);
534
- console.log('invoiceData', invoiceData);
535
537
  const taxFromInvoice = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['TotalTax', 'TaxTotal', 'TaxAmt', 'GSTTotal', 'CustItemITax']);
536
538
  const totalTaxValue = taxFromInvoice !== 0 ? taxFromInvoice : totalTax;
537
539
  const returnTotal = (0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.RetTotal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.6.92",
3
+ "version": "1.6.94",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",