fix initial tax per item issue

This commit is contained in:
yashkanakiya
2023-08-25 09:33:30 +05:30
parent 05d5ce26fd
commit 27660c6bce
7 changed files with 81 additions and 8 deletions

View File

@ -135,6 +135,16 @@ export const useInvoiceStore = (useWindow = false) => {
.then((response) => {
Object.assign(this.newInvoice, response.data.data)
this.newInvoice.customer = response.data.data.customer
if (this.newInvoice.discount_per_item === 'NO') {
this.newInvoice.items.forEach((_i, index) => {
if (_i.discount_type === 'fixed')
this.newInvoice.items[index].discount = _i.discount / 100
})
}
else {
if (this.newInvoice.discount_type === 'fixed')
this.newInvoice.discount = this.newInvoice.discount / 100
}
resolve(response)
})
.catch((err) => {