mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
fix initial tax per item issue
This commit is contained in:
@ -138,6 +138,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, watch, onMounted } from 'vue'
|
||||
import { cloneDeep } from 'lodash'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import {
|
||||
@ -257,11 +258,23 @@ async function submitForm() {
|
||||
|
||||
isSaving.value = true
|
||||
|
||||
let data = {
|
||||
let data = cloneDeep({
|
||||
...estimateStore.newEstimate,
|
||||
sub_total: estimateStore.getSubTotal,
|
||||
total: estimateStore.getTotal,
|
||||
tax: estimateStore.getTotalTax,
|
||||
})
|
||||
if (data.discount_per_item === 'NO') {
|
||||
data.items.forEach((item, index) => {
|
||||
if (item.discount_type === 'fixed'){
|
||||
data.items[index].discount = Math.round(item.discount * 100)
|
||||
}
|
||||
})
|
||||
}
|
||||
else {
|
||||
if (data.discount_type === 'fixed'){
|
||||
data.discount = Math.round(data.discount * 100)
|
||||
}
|
||||
}
|
||||
|
||||
const action = isEdit.value
|
||||
|
||||
Reference in New Issue
Block a user