mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 13:41:09 -04:00 
			
		
		
		
	fix pdf & installation issue
This commit is contained in:
		| @ -162,7 +162,7 @@ | ||||
|                   :options="billingCountries" | ||||
|                   :searchable="true" | ||||
|                   :show-labels="false" | ||||
|                   :allow-empty="false" | ||||
|                   :allow-empty="true" | ||||
|                   :tabindex="8" | ||||
|                   :placeholder="$t('general.select_country')" | ||||
|                   label="name" | ||||
| @ -265,7 +265,7 @@ | ||||
|                   :searchable="true" | ||||
|                   :show-labels="false" | ||||
|                   :tabindex="16" | ||||
|                   :allow-empty="false" | ||||
|                   :allow-empty="true" | ||||
|                   :placeholder="$t('general.select_country')" | ||||
|                   label="name" | ||||
|                   track-by="id" | ||||
| @ -411,6 +411,36 @@ export default { | ||||
|         return true | ||||
|       } | ||||
|       return false | ||||
|     }, | ||||
|     hasBillingAdd () { | ||||
|       let billing = this.billing | ||||
|       if ( | ||||
|         billing.name || | ||||
|         billing.country_id || | ||||
|         billing.state || | ||||
|         billing.city || | ||||
|         billing.phone || | ||||
|         billing.zip || | ||||
|         billing.address_street_1 || | ||||
|         billing.address_street_2) { | ||||
|         return true | ||||
|       } | ||||
|       return false | ||||
|     }, | ||||
|     hasShippingAdd () { | ||||
|       let shipping = this.shipping | ||||
|       if ( | ||||
|         shipping.name || | ||||
|         shipping.country_id || | ||||
|         shipping.state || | ||||
|         shipping.city || | ||||
|         shipping.phone || | ||||
|         shipping.zip || | ||||
|         shipping.address_street_1 || | ||||
|         shipping.address_street_2) { | ||||
|         return true | ||||
|       } | ||||
|       return false | ||||
|     } | ||||
|   }, | ||||
|   watch: { | ||||
| @ -418,12 +448,16 @@ export default { | ||||
|       if (newCountry) { | ||||
|         this.billing.country_id = newCountry.id | ||||
|         this.isDisabledBillingState = false | ||||
|       } else { | ||||
|         this.billing.country_id = null | ||||
|       } | ||||
|     }, | ||||
|     shipping_country (newCountry) { | ||||
|       if (newCountry) { | ||||
|         this.shipping.country_id = newCountry.id | ||||
|         return true | ||||
|       } else { | ||||
|         this.shipping.country_id = null | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
| @ -446,7 +480,14 @@ export default { | ||||
|     ]), | ||||
|     async loadCustomer () { | ||||
|       let { data: { customer, currencies, currency } } = await this.fetchCustomer(this.$route.params.id) | ||||
|       this.formData = customer | ||||
|  | ||||
|       this.formData.id = customer.id | ||||
|       this.formData.name = customer.name | ||||
|       this.formData.contact_name = customer.contact_name | ||||
|       this.formData.email = customer.email | ||||
|       this.formData.phone = customer.phone | ||||
|       this.formData.currency_id = customer.currency_id | ||||
|       this.formData.website = customer.website | ||||
|  | ||||
|       if (customer.billing_address) { | ||||
|         this.billing = customer.billing_address | ||||
| @ -495,7 +536,16 @@ export default { | ||||
|       if (this.$v.$invalid) { | ||||
|         return true | ||||
|       } | ||||
|       this.formData.addresses = [{...this.billing}, {...this.shipping}] | ||||
|       if (this.hasBillingAdd && this.hasShippingAdd) { | ||||
|         this.formData.addresses = [{...this.billing}, {...this.shipping}] | ||||
|       } else { | ||||
|         if (this.hasBillingAdd) { | ||||
|           this.formData.addresses = [{...this.billing}] | ||||
|         } | ||||
|         if (this.hasShippingAdd) { | ||||
|           this.formData.addresses = [{...this.shipping}] | ||||
|         } | ||||
|       } | ||||
|  | ||||
|       if (this.isEdit) { | ||||
|         if (this.currency) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user