edit billing address in payment and billing

This commit is contained in:
edmondlang
2022-09-29 20:53:00 +08:00
parent b01e2022dc
commit 97a568322c
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -4,6 +4,7 @@ namespace App\Http\Resources;
use App\Classes\Modules\Companies\Services\FetchesCompanyServices;
use App\Classes\ValueObjects\Constants\AddressType;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use App\Classes\ValueObjects\Constants\BankAccountType;
use App\Classes\ValueObjects\Constants\BusinessType;
use App\Classes\ValueObjects\Constants\DocumentType;
@@ -42,7 +43,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()),
'billingAddress' => new AddressResource($this->addresses()->where('type', AddressType::BILLING)->where('status', ApprovalStatus::APPROVED)->first()),
'company' => new CompanyResource($this->whenLoaded('company')),
'remarks' => RemarkResource::collection($this->remarks),
'marking' => $marking,