mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-30 09:53:58 +00:00
Grab service charge from setting for calculate supplier transaction
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\SegmentConstants;
|
||||
|
||||
use App\Classes\Modules\SegmentConstants\ControllersLogic\CreateSegmentConstantLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CreateSegmentConstantController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param CreateSegmentConstantLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function create(Request $request, CreateSegmentConstantLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\SegmentConstants;
|
||||
|
||||
use App\Classes\Modules\SegmentConstants\ControllersLogic\FetchSegmentConstantLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class FetchSegmentConstantController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param FetchSegmentConstantLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function fetch(Request $request, FetchSegmentConstantLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\SegmentConstants;
|
||||
|
||||
use App\Classes\Modules\SegmentConstants\ControllersLogic\UpdateSegmentConstantLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateSegmentConstantController
|
||||
{
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateSegmentConstantLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function update(Request $request, UpdateSegmentConstantLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user