accounting-engine 0.1.15 → 0.1.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.
- package/package.json +1 -1
- package/src/services/engine.service.js +27 -23
package/package.json
CHANGED
|
@@ -235,15 +235,16 @@ const normalizeInvoiceForAccounting = async (invoice, direction) => {
|
|
|
235
235
|
all_stocks: isAddedAllStocks
|
|
236
236
|
? []
|
|
237
237
|
: _.map(invoice.lines, (line) => {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
238
|
+
return {
|
|
239
|
+
code: null,
|
|
240
|
+
name: line.name,
|
|
241
|
+
quantity: line.quantity,
|
|
242
|
+
quantityPrice: line.price,
|
|
243
|
+
unit: line.quantity_unit,
|
|
244
|
+
taxCode: item.code,
|
|
245
|
+
taxPercent: item.percent,
|
|
246
|
+
};
|
|
247
|
+
}),
|
|
247
248
|
});
|
|
248
249
|
isAddedAllStocks = true;
|
|
249
250
|
}
|
|
@@ -266,6 +267,7 @@ const normalizeInvoiceForAccounting = async (invoice, direction) => {
|
|
|
266
267
|
accounting_lines: accountingLines,
|
|
267
268
|
additional_document_reference: invoice.additional_document_reference,
|
|
268
269
|
payable_amount: invoice.payable_amount,
|
|
270
|
+
tax_inclusive: invoice.tax_inclusive,
|
|
269
271
|
};
|
|
270
272
|
return data;
|
|
271
273
|
};
|
|
@@ -295,6 +297,7 @@ const normalizeJSON = async (opts, data, dir) => {
|
|
|
295
297
|
name: item.name,
|
|
296
298
|
quantity: item.quantity,
|
|
297
299
|
quantityPrice: item.price,
|
|
300
|
+
unit: item.quantity_unit,
|
|
298
301
|
taxCode: item.taxCode,
|
|
299
302
|
taxPercent: item.taxPercent,
|
|
300
303
|
});
|
|
@@ -306,22 +309,23 @@ const normalizeJSON = async (opts, data, dir) => {
|
|
|
306
309
|
// eslint-disable-next-line no-nested-ternary
|
|
307
310
|
item.type === 'taxable' && item.name
|
|
308
311
|
? [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
312
|
+
{
|
|
313
|
+
code: (dir === 'in' ? item.additional?.buyers_item_id : item.additional?.sellers_item_id) || null,
|
|
314
|
+
name: item.name,
|
|
315
|
+
quantity: item.quantity,
|
|
316
|
+
quantityPrice: item.price,
|
|
317
|
+
unit: item.quantity_unit,
|
|
318
|
+
taxCode: item.taxCode,
|
|
319
|
+
taxPercent: item.taxPercent,
|
|
320
|
+
},
|
|
321
|
+
]
|
|
318
322
|
: Array.isArray(item.all_stocks)
|
|
319
323
|
? _.map(item.all_stocks, (stock) => {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
324
|
+
return {
|
|
325
|
+
...stock,
|
|
326
|
+
code: (dir === 'in' ? stock.additional?.buyers_item_id : stock.additional?.sellers_item_id) || null,
|
|
327
|
+
};
|
|
328
|
+
})
|
|
325
329
|
: [],
|
|
326
330
|
all_stocks: undefined,
|
|
327
331
|
});
|