mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	add changes in tax per item calculation
This commit is contained in:
		| @ -264,7 +264,7 @@ async function submitForm() { | ||||
|     total: estimateStore.getTotal, | ||||
|     tax: estimateStore.getTotalTax, | ||||
|   }) | ||||
|   if (data.discount_per_item === 'NO') { | ||||
|   if (data.discount_per_item === 'YES') { | ||||
|     data.items.forEach((item, index) => { | ||||
|       if (item.discount_type === 'fixed'){ | ||||
|         data.items[index].discount = Math.round(item.discount * 100) | ||||
| @ -277,6 +277,13 @@ async function submitForm() { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   if ( | ||||
|     !estimateStore.newEstimate.tax_per_item === 'YES' | ||||
|     && data.taxes.length | ||||
|   ){ | ||||
|     data.tax_type_ids = data.taxes.map(_t => _t.tax_type_id) | ||||
|   } | ||||
|  | ||||
|   const action = isEdit.value | ||||
|     ? estimateStore.updateEstimate | ||||
|     : estimateStore.addEstimate | ||||
|  | ||||
		Reference in New Issue
	
	Block a user