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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accounting-engine",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Bu paket, verilen faturanın, belirtilen kurallar çerçevesinde muhasebeleştirilmesini kolaylaştırmak adına oluşturulmuştur.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -235,15 +235,16 @@ const normalizeInvoiceForAccounting = async (invoice, direction) => {
235
235
  all_stocks: isAddedAllStocks
236
236
  ? []
237
237
  : _.map(invoice.lines, (line) => {
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
- }),
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
- code: (dir === 'in' ? item.additional?.buyers_item_id : item.additional?.sellers_item_id) || null,
311
- name: item.name,
312
- quantity: item.quantity,
313
- quantityPrice: item.price,
314
- taxCode: item.taxCode,
315
- taxPercent: item.taxPercent,
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
- return {
321
- ...stock,
322
- code: (dir === 'in' ? stock.additional?.buyers_item_id : stock.additional?.sellers_item_id) || null,
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
  });