fix(taxes): correct compound tax document flows (#754)

This commit is contained in:
Darko Gjorgjijoski
2026-08-14 00:42:01 +02:00
committed by GitHub
parent 13aa087faf
commit 93dd7df48a
22 changed files with 701 additions and 57 deletions
@@ -181,6 +181,7 @@
:store-prop="storeProp"
:discount="discount"
@update="updateTax"
@tax-type-created="onTaxTypeCreated"
/>
</td>
</tr>
@@ -225,6 +226,7 @@ interface Emits {
(e: 'update', data: Record<string, unknown>): void
(e: 'remove', index: number): void
(e: 'itemValidate', valid: boolean): void
(e: 'taxTypeCreated', taxType: TaxType): void
}
const props = withDefaults(defineProps<Props>(), {
@@ -391,6 +393,10 @@ function updateTax(data: { index: number; item: DocumentTax }): void {
syncItemToStore()
}
function onTaxTypeCreated(taxType: TaxType): void {
emit('taxTypeCreated', taxType)
}
function setDiscount(): void {
const newValue = formData.value.items[props.index].discount
const absoluteSubtotal = Math.abs(subtotal.value)