accounting-engine 0.1.15 → 0.1.16
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 +24 -23
package/package.json
CHANGED
|
@@ -235,15 +235,15 @@ 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
|
+
taxCode: item.code,
|
|
244
|
+
taxPercent: item.percent,
|
|
245
|
+
};
|
|
246
|
+
}),
|
|
247
247
|
});
|
|
248
248
|
isAddedAllStocks = true;
|
|
249
249
|
}
|
|
@@ -266,6 +266,7 @@ const normalizeInvoiceForAccounting = async (invoice, direction) => {
|
|
|
266
266
|
accounting_lines: accountingLines,
|
|
267
267
|
additional_document_reference: invoice.additional_document_reference,
|
|
268
268
|
payable_amount: invoice.payable_amount,
|
|
269
|
+
tax_inclusive: invoice.tax_inclusive,
|
|
269
270
|
};
|
|
270
271
|
return data;
|
|
271
272
|
};
|
|
@@ -306,22 +307,22 @@ const normalizeJSON = async (opts, data, dir) => {
|
|
|
306
307
|
// eslint-disable-next-line no-nested-ternary
|
|
307
308
|
item.type === 'taxable' && item.name
|
|
308
309
|
? [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
310
|
+
{
|
|
311
|
+
code: (dir === 'in' ? item.additional?.buyers_item_id : item.additional?.sellers_item_id) || null,
|
|
312
|
+
name: item.name,
|
|
313
|
+
quantity: item.quantity,
|
|
314
|
+
quantityPrice: item.price,
|
|
315
|
+
taxCode: item.taxCode,
|
|
316
|
+
taxPercent: item.taxPercent,
|
|
317
|
+
},
|
|
318
|
+
]
|
|
318
319
|
: Array.isArray(item.all_stocks)
|
|
319
320
|
? _.map(item.all_stocks, (stock) => {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
321
|
+
return {
|
|
322
|
+
...stock,
|
|
323
|
+
code: (dir === 'in' ? stock.additional?.buyers_item_id : stock.additional?.sellers_item_id) || null,
|
|
324
|
+
};
|
|
325
|
+
})
|
|
325
326
|
: [],
|
|
326
327
|
all_stocks: undefined,
|
|
327
328
|
});
|