From 2b1fca6b2e6989f46a5865e2870f147653f738ca Mon Sep 17 00:00:00 2001 From: edmondlang Date: Fri, 5 Aug 2022 21:24:36 +0800 Subject: [PATCH] if company doesn't have billing address - hide generate invoice and show create billing address modal --- app/Http/Resources/AddressResource.php | 1 + .../AdminPaymentsBillingComponent.vue | 15 ++++- .../forms/BillingAddressFormComponent.vue | 66 +++++++++++++++++++ 3 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 resources/assets/vue/components/paymentsBilling/forms/BillingAddressFormComponent.vue diff --git a/app/Http/Resources/AddressResource.php b/app/Http/Resources/AddressResource.php index f86d5c29..a4df7e4f 100644 --- a/app/Http/Resources/AddressResource.php +++ b/app/Http/Resources/AddressResource.php @@ -41,6 +41,7 @@ class AddressResource extends JsonResource 'status' => (int) $this->status, 'contact' => new ContactResource($this->contacts->first()), 'remark' => new RemarkResource($this->remarks->first()), + 'type' => $this->type, $this->mergeWhen($this->relationLoaded('owner'), [ 'owner' => $this->when($this->owner instanceof Order, [ 'reference' => $this->owner->reference, diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index 4d9d28a2..a56c9f2d 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -51,9 +51,18 @@
-
-
-
Generate Invoice
+
+
+ +
+
Add Delivery Address
+ + + +
+
+
Generate Invoice
+
diff --git a/resources/assets/vue/components/paymentsBilling/forms/BillingAddressFormComponent.vue b/resources/assets/vue/components/paymentsBilling/forms/BillingAddressFormComponent.vue new file mode 100644 index 00000000..c21a88b4 --- /dev/null +++ b/resources/assets/vue/components/paymentsBilling/forms/BillingAddressFormComponent.vue @@ -0,0 +1,66 @@ + + \ No newline at end of file