Grab service charge from setting for calculate supplier transaction

This commit is contained in:
ahmedsophyudden
2022-02-28 22:40:16 +08:00
parent dd0b142238
commit af3ff46a20
12 changed files with 317 additions and 11 deletions
+1
View File
@@ -55,6 +55,7 @@ class CompanyResource extends JsonResource
'default' => new BankResource($this->banks->where('type', BankAccountType::EXTERNAL)->where('default', true)->first())
],
'segments' => SegmentResource::collection($this->segments),
'service_charges' => SegmentConstant::where('reference', SegmentConstants::SERVICE_CHARGE)->where('detail->id', $this->id)->first(),
'services' => (new FetchesCompanyServices())->getServices($this->servicesConfigurations()),
'currencies' => $this->when($this->business_type === BusinessType::CURRENCY_VENDOR, function(){
$segment = SegmentConstant::where('reference', SegmentConstants::SUPPLIER_CURRENCIES)->where('detail->id', $this->id)->first();