pangea-server 3.3.128 → 3.3.129

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.
@@ -141,7 +141,7 @@ class Arca {
141
141
  const month = String(localDate.getMonth() + 1).padStart(2, '0');
142
142
  const year = localDate.getFullYear();
143
143
  const issueDate = `${day}/${month}/${year}`;
144
- const caeDateStr = String(res.CAEFchVto);
144
+ const caeDateStr = String(res.CAEFchVto).replace(/-/g, '');
145
145
  const caeDueDate = `${caeDateStr.slice(6, 8)}/${caeDateStr.slice(4, 6)}/${caeDateStr.slice(0, 4)}`;
146
146
  const timestamp = localDate
147
147
  .toISOString()
@@ -151,7 +151,7 @@ class Arca {
151
151
  const fileName = `${timestamp}_${clientName}.pdf`;
152
152
  const pdfData = {
153
153
  file_name: fileName,
154
- send_to: pdf?.sendTo,
154
+ send_to: pdf?.sendTo || undefined,
155
155
  template: {
156
156
  name: 'invoice-c',
157
157
  params: {
@@ -159,8 +159,8 @@ class Arca {
159
159
  sales_point: pointOfSale,
160
160
  issue_date: issueDate,
161
161
  cae_due_date: caeDueDate,
162
- issuer_cuit: this.__cuit,
163
- cae: res.CAE,
162
+ issuer_cuit: Number(this.__cuit),
163
+ cae: Number(res.CAE),
164
164
  issuer_business_name: this.__issuer.businessName,
165
165
  issuer_address: this.__issuer.address,
166
166
  issuer_iva_condition: this.__issuer.ivaCondition,
@@ -169,7 +169,7 @@ class Arca {
169
169
  receiver_name: receiver.name || 'CONSUMIDOR FINAL',
170
170
  receiver_address: receiver.address || '-',
171
171
  receiver_document_type: documentTypeIds[receiver.documentType],
172
- receiver_document_number: receiver.documentType === '99_final_consumer' ? 0 : receiver.documentNumber || 0,
172
+ receiver_document_number: receiver.documentType === '99_final_consumer' ? 0 : Number(receiver.documentNumber) || 0,
173
173
  receiver_iva_condition: vatConditionReceiverDescriptions[receiver.vatCondition || '5_final_consumer'],
174
174
  sale_condition: 'Contado',
175
175
  currency_id: 'ARS',
@@ -185,13 +185,13 @@ class Arca {
185
185
  vat_amount: 0,
186
186
  tributes_amount: 0,
187
187
  total_amount: amount,
188
- billing_from: isConceptProducts ? '' : service.from.split('-').reverse().join('/'),
189
- billing_to: isConceptProducts ? '' : service.to.split('-').reverse().join('/'),
190
- payment_due_date: isConceptProducts ? '' : service.paymentDueDate.split('-').reverse().join('/'),
188
+ billing_from: isConceptProducts ? undefined : service.from.split('-').reverse().join('/'),
189
+ billing_to: isConceptProducts ? undefined : service.to.split('-').reverse().join('/'),
190
+ payment_due_date: isConceptProducts ? undefined : service.paymentDueDate.split('-').reverse().join('/'),
191
191
  net_amount_taxed: amount,
192
192
  net_amount_untaxed: 0,
193
193
  exempt_amount: 0,
194
- invoice_footer_note: pdf?.footerNote,
194
+ invoice_footer_note: pdf?.footerNote || undefined,
195
195
  },
196
196
  },
197
197
  };
@@ -200,7 +200,7 @@ class Arca {
200
200
  }
201
201
  catch (pdfErr) {
202
202
  (0, helpers_1.printDanger)('arca', 'Error creating PDF (voucher was created)');
203
- console.log(JSON.stringify(pdfErr.data || pdfErr, null, 2));
203
+ console.log(JSON.stringify(pdfErr, null, 2));
204
204
  }
205
205
  (0, helpers_1.printSuccess)('arca', 'Voucher created successfully');
206
206
  console.log('params:');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-server",
3
3
  "description": "",
4
- "version": "3.3.128",
4
+ "version": "3.3.129",
5
5
  "files": [
6
6
  "dist"
7
7
  ],