update migrations and create base migration. set discount and tax to sale invoices
This commit is contained in:
@@ -397,6 +397,11 @@ export class SharedSaleInvoiceCreateService {
|
||||
invoice_date: normalizedInvoiceDate,
|
||||
invoice_number: invoiceNumber,
|
||||
total_amount: data.total_amount,
|
||||
discount_amount: data.items.reduce(
|
||||
(prev, curr) => (prev += curr.discount_amount),
|
||||
0,
|
||||
),
|
||||
tax_amount: data.items.reduce((prev, curr) => (prev += curr.tax_amount), 0),
|
||||
code: this.generateInvoiceCode(businessId, complexId, posId, invoiceNumber),
|
||||
type,
|
||||
settlement_type,
|
||||
@@ -407,6 +412,8 @@ export class SharedSaleInvoiceCreateService {
|
||||
quantity: item.quantity,
|
||||
unit_price: item.unit_price,
|
||||
total_amount: item.total_amount,
|
||||
discount_amount: item.discount_amount,
|
||||
tax_amount: item.tax_amount,
|
||||
measure_unit_text: goodsById.get(item.good_id!)?.measure_unit.name || null,
|
||||
measure_unit_code: goodsById.get(item.good_id!)?.measure_unit.code || null,
|
||||
sku_code: goodsById.get(item.good_id!)?.sku.code || null,
|
||||
|
||||
Reference in New Issue
Block a user