added tagsyarikat in bayaranhistory and marhundetails
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use Illuminate\Http\Client\Pool;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
@@ -14,9 +15,13 @@ class BayaranHistoryService
|
||||
$this->norujukan = $norujukan;
|
||||
}
|
||||
|
||||
public function getBayaranHistory()
|
||||
public function getBayaranHistory($tagsyarikat)
|
||||
{
|
||||
$bayaranHistory = Http::arrahn()->get('/api/transaction/'. $this->norujukan)->json();
|
||||
$CallableHttp = $tagsyarikat == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$bayaranHistory = $CallableHttp->get('/api/transaction/'. $this->norujukan)->json();
|
||||
|
||||
$formatBayaranHistoryData = function ($x) {
|
||||
if (sizeof($x) === 0) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\CompanyStatus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
class MarhunService
|
||||
@@ -12,14 +13,18 @@ class MarhunService
|
||||
$this->norujukan = $norujukan;
|
||||
}
|
||||
|
||||
public function getMarhunDetails()
|
||||
public function getMarhunDetails($tagsyarikat)
|
||||
{
|
||||
$getMarhunDetails = function ($x) {
|
||||
return Http::arrahn()->get('/api/marhun/' . $x)->json();
|
||||
$CallableHttp = $tagsyarikat == CompanyStatus::COM_PKB
|
||||
? Http::arrahn()
|
||||
: Http::arrahn_koop();
|
||||
|
||||
$getMarhunDetails = function ($x) use($CallableHttp) {
|
||||
return $CallableHttp->get('/api/marhun/' . $x)->json();
|
||||
};
|
||||
|
||||
$getMarhunTypeFullName = function ($code) {
|
||||
return Http::arrahn()->get('/api/jemas/nama_marhun', ['marhun' => $code['marhun']])->json()['descpt'];
|
||||
$getMarhunTypeFullName = function ($code) use($CallableHttp) {
|
||||
return $CallableHttp->get('/api/jemas/nama_marhun', ['marhun' => $code['marhun']])->json()['descpt'];
|
||||
};
|
||||
|
||||
$formatMarhunDetailData = function ($x) use($getMarhunTypeFullName) {
|
||||
|
||||
@@ -128,9 +128,9 @@ class PembiayaanService
|
||||
|
||||
$gadaianDetails = $attachCawanganName($gadaianDetails);
|
||||
|
||||
$marhunDetails = MarhunService::from($norujukan)->getMarhunDetails();
|
||||
$marhunDetails = MarhunService::from($norujukan)->getMarhunDetails($tagsyarikat);
|
||||
|
||||
$bayaranHistoryDetails = BayaranHistoryService::from($norujukan)->getBayaranHistory();
|
||||
$bayaranHistoryDetails = BayaranHistoryService::from($norujukan)->getBayaranHistory($tagsyarikat);
|
||||
|
||||
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user