mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-04 06:11:05 +00:00
fix(taxes): correct compound tax document flows (#754)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user