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