diff --git a/app/Http/Resources/AddressResource.php b/app/Http/Resources/AddressResource.php index a4df7e4f..cfcd8389 100644 --- a/app/Http/Resources/AddressResource.php +++ b/app/Http/Resources/AddressResource.php @@ -21,11 +21,11 @@ class AddressResource extends JsonResource $centerPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::CENTER_POSTCODE)->get(); $centerPostcodeConstant = $centerPostcodeConstantObject->isEmpty() ? [] : (array)$centerPostcodeConstantObject->first()->value; - $postcodeArea = in_array($this->postcode, $centerPostcodeConstant) ? 'CENTER_POSTCODE' : ''; + $postcodeArea = in_array($this->postcode, $centerPostcodeConstant) ? 'CENTER_POSTCODE' : null; $outstationPostcodeConstantObject = SegmentConstant::where('reference', SegmentConstants::OUTSTATION_POSTCODE)->get(); $outstationPostcodeConstant = $outstationPostcodeConstantObject->isEmpty() ? [] : (array)$outstationPostcodeConstantObject->first()->value; - in_array($this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : ''; + in_array($this->postcode, $outstationPostcodeConstant) ? $postcodeArea = 'OUTSTATION_POSTCODE' : null; return [ 'id' => $this->id, @@ -34,6 +34,7 @@ class AddressResource extends JsonResource 'street_two' => $this->street_two, 'district' => $this->district, 'state' => $this->state, + 'postcode' => $this->postcode, 'post_code' => $this->postcode, 'post_code_area' => $postcodeArea, 'country' => $this->country, diff --git a/app/Http/Resources/CompanyModuleResource.php b/app/Http/Resources/CompanyModuleResource.php index 51c651f7..13f4eb6a 100644 --- a/app/Http/Resources/CompanyModuleResource.php +++ b/app/Http/Resources/CompanyModuleResource.php @@ -3,6 +3,7 @@ namespace App\Http\Resources; use App\Classes\Modules\Companies\Services\FetchesCompanyServices; +use App\Classes\ValueObjects\Constants\AddressType; use App\Classes\ValueObjects\Constants\BankAccountType; use App\Classes\ValueObjects\Constants\BusinessType; use App\Classes\ValueObjects\Constants\DocumentType; @@ -41,6 +42,7 @@ class CompanyModuleResource extends JsonResource 'name' => $this->name, 'reference' => $this->reference, 'address' => new AddressResource($defaultAddress), + 'billingAddress' => new AddressResource($this->addresses()->where('type', AddressType::BILLING)->first()), 'company' => new CompanyResource($this->whenLoaded('company')), 'remarks' => RemarkResource::collection($this->remarks), 'marking' => $marking, diff --git a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue index a56c9f2d..806a8ff8 100644 --- a/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/elements/AdminPaymentsBillingComponent.vue @@ -51,18 +51,24 @@
-
-
- -
-
Add Delivery Address
+
+
+
+
Add Billing Address
- +
-
-
Generate Invoice
+
+
Define Location
+ + +
+
Generate Invoice
+
+
+
diff --git a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue index a822b542..840c2009 100644 --- a/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue +++ b/resources/assets/vue/components/paymentsBilling/sections/AdminPaymentsBillingSectionComponent.vue @@ -102,7 +102,7 @@
- +