mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	fix initial tax per item issue
This commit is contained in:
		| @ -144,6 +144,16 @@ export const useEstimateStore = (useWindow = false) => { | ||||
|             .get(`/api/v1/estimates/${id}`) | ||||
|             .then((response) => { | ||||
|               Object.assign(this.newEstimate, response.data.data) | ||||
|               // if (this.newEstimate.discount_per_item === 'NO') { | ||||
|               //   this.newEstimate.items.forEach((_i, index) => { | ||||
|               //     if (_i.discount_type === 'fixed') | ||||
|               //       this.newEstimate.items[index].discount = _i.discount / 100 | ||||
|               //   }) | ||||
|               // } | ||||
|               // else { | ||||
|               //   if (this.newEstimate.discount_type === 'fixed') | ||||
|               //     this.newEstimate.discount = this.newEstimate.discount / 100 | ||||
|               // } | ||||
|               resolve(response) | ||||
|             }) | ||||
|             .catch((err) => { | ||||
|  | ||||
| @ -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) => { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user