Done overall reports for gadaian, penebusan, ansuran
This commit is contained in:
@@ -7,6 +7,17 @@ use Illuminate\Support\Facades\DB;
|
|||||||
class Helper
|
class Helper
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public static function getOnlineArrahnConnection()
|
||||||
|
{
|
||||||
|
|
||||||
|
$online_arrahn_connection = array_filter(config('database.connections'), function ($connection) {
|
||||||
|
if ($connection['database'] === 'online_arrahn') {
|
||||||
|
return $connection;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return array_keys($online_arrahn_connection)[0];
|
||||||
|
}
|
||||||
public static function formatNumber($amount)
|
public static function formatNumber($amount)
|
||||||
{
|
{
|
||||||
$formattedAmount = number_format($amount, 2, '.', ',');
|
$formattedAmount = number_format($amount, 2, '.', ',');
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
|
use App\Cawangan;
|
||||||
|
use App\Helper;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Services\Reports\AnsuranService as ReportAnsuranService;
|
||||||
|
use App\Transaction;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AnsuranController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getLaporanCawangan(string $kod_cawangan, Request $request)
|
||||||
|
{
|
||||||
|
$reportAnsuranService = new ReportAnsuranService($kod_cawangan, $request);
|
||||||
|
return $reportAnsuranService->getCawanganReport();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSummaryLaporanAnsuran(Request $request)
|
||||||
|
{
|
||||||
|
$online_array_db_connection = Helper::getOnlineArrahnConnection();
|
||||||
|
|
||||||
|
$ansuran_query = Transaction::on($online_array_db_connection)
|
||||||
|
->leftJoin('transaksi_keuntungan', function ($join) {
|
||||||
|
$join->on('transaction.norujukan', '=', 'transaksi_keuntungan.norujukan');
|
||||||
|
$join->on('transaction.created_at', '=', 'transaksi_keuntungan.tarikh_bayaran');
|
||||||
|
})
|
||||||
|
->where('transaction.trans_type', '=', 'A')
|
||||||
|
->whereDate('transaction.created_at', '>=', date($request->startDate))
|
||||||
|
->whereDate('transaction.created_at', '<=', date($request->endDate))
|
||||||
|
->selectRaw('
|
||||||
|
count(transaction.norujukan) as bilangan_ansuran,
|
||||||
|
sum(transaksi_keuntungan.bayaran_pembiayaan) as bayaran_pembiayaan,
|
||||||
|
sum(transaksi_keuntungan.bayaran_keuntungan) as bayaran_kos_keuntungan,
|
||||||
|
sum(transaction.duit_masuk) as jumlah_bayaran
|
||||||
|
');
|
||||||
|
|
||||||
|
$summary_ansuran = (clone $ansuran_query)->get()->toArray()[0];
|
||||||
|
|
||||||
|
$summary_ansuran_by_cawangan = (clone $ansuran_query)
|
||||||
|
->addSelect('transaction.kodcaw as kod_cawangan')
|
||||||
|
->groupBy('transaction.kodcaw')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$cawangan_available = Cawangan::on($online_array_db_connection)->select('kodcaw', 'details_caw')->get()->toArray();
|
||||||
|
$kodcaw_array = array_column($cawangan_available, 'kodcaw');
|
||||||
|
$cawangan_detail_array = array_column($cawangan_available, 'details_caw');
|
||||||
|
$kod_caw_with_cawangan_detail_array = array_combine($kodcaw_array, $cawangan_detail_array);
|
||||||
|
|
||||||
|
$summary_ansuran_by_cawangan = $summary_ansuran_by_cawangan->map(function ($ansuran_cawangan) use ($kod_caw_with_cawangan_detail_array) {
|
||||||
|
$ansuran_cawangan->cawangan_detail = $kod_caw_with_cawangan_detail_array[$ansuran_cawangan['kod_cawangan']];
|
||||||
|
return $ansuran_cawangan;
|
||||||
|
});
|
||||||
|
|
||||||
|
$response = [
|
||||||
|
'summary_ansuran_by_cawangan' => $summary_ansuran_by_cawangan,
|
||||||
|
'summary_ansuran' => $summary_ansuran,
|
||||||
|
];
|
||||||
|
|
||||||
|
return json_encode($response);
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-2
@@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
use App\Cawangan;
|
use App\Cawangan;
|
||||||
use App\Gadai;
|
use App\Gadai;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -10,7 +11,7 @@ use App\Services\Reports\GadaianService as ReportGadaianService;
|
|||||||
use App\Helper;
|
use App\Helper;
|
||||||
|
|
||||||
|
|
||||||
class ReportGadaiController extends Controller
|
class GadaianController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function getLaporanCawangan(string $kod_cawangan, Request $request)
|
public function getLaporanCawangan(string $kod_cawangan, Request $request)
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
|
use App\Cawangan;
|
||||||
|
use App\Helper;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Services\Reports\PenebusanService as ReportPenebusanService;
|
||||||
|
use App\Tebus;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class PenebusanController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
public function getLaporanCawangan(string $kod_cawangan, Request $request)
|
||||||
|
{
|
||||||
|
$reportGadaianService = new ReportPenebusanService($kod_cawangan, $request);
|
||||||
|
return $reportGadaianService->getCawanganReport();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getSummaryLaporanTebus(Request $request)
|
||||||
|
{
|
||||||
|
|
||||||
|
$active_cawangan_db_connection = Helper::getActiveCawanganDbConnection();
|
||||||
|
|
||||||
|
$active_cawangan_db_name = array_map(function ($db_connection) {
|
||||||
|
return config('database.connections' . '.' . $db_connection . '.' . 'database');
|
||||||
|
}, $active_cawangan_db_connection);
|
||||||
|
|
||||||
|
$active_cawangan_detail = Cawangan::select('kodcaw', 'details_caw')->whereIn('db_name', $active_cawangan_db_name)->get()->toArray();
|
||||||
|
|
||||||
|
$summary_penebusan_data = array_map(function ($db_connection) use ($request) {
|
||||||
|
$penebusan = Tebus::on($db_connection)
|
||||||
|
->join('gadai', 'tebus.norujukan', '=', 'gadai.norujukan')
|
||||||
|
->where('gadai.upah12', '!=', null)
|
||||||
|
->where('tebus.t_tebus', '>=', $request->startDate)
|
||||||
|
->where('tebus.t_tebus', '<=', $request->endDate)
|
||||||
|
->select(DB::raw('
|
||||||
|
count(tebus.norujukan) as bilangan_tebus,
|
||||||
|
sum(gadai.berat) as berat,
|
||||||
|
sum(gadai.bakipjm) as nilai_pinjaman,
|
||||||
|
sum(tebus.pinjaman) as baki_pinjaman,
|
||||||
|
sum(tebus.nilaimarhun) as nilai_marhun,
|
||||||
|
sum(tebus.bakiupah) as keuntungan_asal,
|
||||||
|
sum(tebus.bakipjm - gadai.bakipjm) as keuntungan_rebet,
|
||||||
|
sum(gadai.bakipjm) + sum(tebus.bakipjm - gadai.bakipjm) as bayaran_penebusan
|
||||||
|
'))
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return $penebusan->toArray();
|
||||||
|
}, $active_cawangan_db_connection);
|
||||||
|
|
||||||
|
$response = array_map(function ($cawangan_detail, $summary_penebusan_data) {
|
||||||
|
return array_merge($cawangan_detail, $summary_penebusan_data[0]);
|
||||||
|
}, $active_cawangan_detail, $summary_penebusan_data);
|
||||||
|
|
||||||
|
return json_encode($response);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,191 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Reports;
|
||||||
|
|
||||||
|
use App\Cawangan;
|
||||||
|
use App\CawanganDetail;
|
||||||
|
use App\Customer;
|
||||||
|
use App\Gadai;
|
||||||
|
use App\Helper;
|
||||||
|
use App\Transaction;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class AnsuranService
|
||||||
|
{
|
||||||
|
|
||||||
|
public $kod_cawangan;
|
||||||
|
public $startDate;
|
||||||
|
public $endDate;
|
||||||
|
|
||||||
|
public function __construct($kod_cawangan, Request $request)
|
||||||
|
{
|
||||||
|
$this->kod_cawangan = $kod_cawangan;
|
||||||
|
$this->startDate = $request->startDate;
|
||||||
|
$this->endDate = $request->endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCawanganReport()
|
||||||
|
{
|
||||||
|
$online_array_db_connection = Helper::getOnlineArrahnConnection();
|
||||||
|
$cawangan_connection = Cawangan::where('kodcaw', $this->kod_cawangan)->first()->mysql;
|
||||||
|
|
||||||
|
$query_total_ansuran = Transaction::on($online_array_db_connection)
|
||||||
|
->where('transaction.kodcaw', $this->kod_cawangan)
|
||||||
|
->leftJoin('transaksi_keuntungan', function ($join) {
|
||||||
|
$join->on('transaction.norujukan', '=', 'transaksi_keuntungan.norujukan');
|
||||||
|
$join->on('transaction.created_at', '=', 'transaksi_keuntungan.tarikh_bayaran');
|
||||||
|
})
|
||||||
|
->where('transaction.trans_type', '=', 'A')
|
||||||
|
->whereDate('transaction.created_at', '>=', date($this->startDate))
|
||||||
|
->whereDate('transaction.created_at', '<=', date($this->endDate));
|
||||||
|
|
||||||
|
$total_ansuran = $this->getTotalAnsuran($query_total_ansuran);
|
||||||
|
$total_summary_ansuran_teller = $this->getTotalSummaryAnsuranGroupByTeller($query_total_ansuran);
|
||||||
|
$total_summary_ansuran = $this->getTotalSummaryAnsuran($query_total_ansuran);
|
||||||
|
$gadaian_ansuran = $this->getGadaianAnsuran($cawangan_connection, $total_ansuran->pluck('norujukan'));
|
||||||
|
$customer_info = $this->getCustomerInfo($gadaian_ansuran);
|
||||||
|
$cawangan_detail = $this->getCawanganDetail($cawangan_connection);
|
||||||
|
|
||||||
|
$total_ansuran = $total_ansuran->zip($gadaian_ansuran, $customer_info)->map(function ($data) {
|
||||||
|
[$ansuran, $gadaian_ansuran, $customer_info] = $data;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'norujukan' => $ansuran->norujukan,
|
||||||
|
'nama' => $customer_info['nama'],
|
||||||
|
'no_kp' => $gadaian_ansuran->nokp,
|
||||||
|
'teller' => $ansuran->teller,
|
||||||
|
'bayaran_pembiayaan' => $ansuran->bayaran_pembiayaan,
|
||||||
|
'bayaran_keuntungan' => $ansuran->bayaran_kos_keuntungan,
|
||||||
|
'jumlah_ansuran' => $ansuran->jumlah_bayaran,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
$total_ansuran = $total_ansuran->groupBy('teller');
|
||||||
|
|
||||||
|
$ansuran_tellers = $total_ansuran->keys();
|
||||||
|
|
||||||
|
$total_ansuran = $total_ansuran
|
||||||
|
->zip($total_summary_ansuran_teller)
|
||||||
|
->map(function ($data) {
|
||||||
|
|
||||||
|
[$ansuran, $summary] = $data;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'ansuran' => $ansuran,
|
||||||
|
'summary_ansuran_teller' => $summary,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
$total_ansuran = $ansuran_tellers->combine($total_ansuran);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'query' => [
|
||||||
|
'startDate' => Helper::formatDate($this->startDate),
|
||||||
|
'endDate' => Helper::formatDate($this->endDate),
|
||||||
|
],
|
||||||
|
'cawangan_detail' => $cawangan_detail,
|
||||||
|
'total_ansuran' => $total_ansuran,
|
||||||
|
'summary_ansuran' => $total_summary_ansuran,
|
||||||
|
];
|
||||||
|
|
||||||
|
ray($data);
|
||||||
|
return json_encode($data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getTotalAnsuran($query_total_ansuran)
|
||||||
|
{
|
||||||
|
$total_ansuran = (clone $query_total_ansuran)
|
||||||
|
->selectRaw('
|
||||||
|
transaction.norujukan as norujukan,
|
||||||
|
transaksi_keuntungan.bayaran_pembiayaan as bayaran_pembiayaan,
|
||||||
|
transaksi_keuntungan.bayaran_keuntungan as bayaran_kos_keuntungan,
|
||||||
|
transaction.duit_masuk as jumlah_bayaran,
|
||||||
|
teller
|
||||||
|
');
|
||||||
|
|
||||||
|
return $total_ansuran->get();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCawanganDetail($cawangan_connection)
|
||||||
|
{
|
||||||
|
$cawangan_detail = CawanganDetail::on($cawangan_connection)->get()
|
||||||
|
->map(function ($detail) {
|
||||||
|
return [
|
||||||
|
'nama' => $detail['namacaw'],
|
||||||
|
'code' => $detail['kodcaw'] . ' Ar-Rahn ' . $detail['cawangan'],
|
||||||
|
'alamat' => $detail['alamat1'],
|
||||||
|
'waktu_operasi' => $detail['alamat4'],
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
return $cawangan_detail[0];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getTotalSummaryAnsuran(Builder $query_total_ansuran)
|
||||||
|
{
|
||||||
|
|
||||||
|
$total_ansuran = (clone $query_total_ansuran)
|
||||||
|
->selectRaw('
|
||||||
|
count(transaction.norujukan) as sum_norujukan,
|
||||||
|
sum(transaksi_keuntungan.bayaran_pembiayaan) as sum_bayaran_pembiayaan,
|
||||||
|
sum(transaksi_keuntungan.bayaran_keuntungan) as sum_bayaran_kos_keuntungan,
|
||||||
|
sum(transaction.duit_masuk) as sum_jumlah_bayaran,
|
||||||
|
teller
|
||||||
|
');
|
||||||
|
|
||||||
|
return $total_ansuran->get()->toArray()[0];
|
||||||
|
}
|
||||||
|
private function getTotalSummaryAnsuranGroupByTeller(Builder $query_total_ansuran)
|
||||||
|
{
|
||||||
|
|
||||||
|
$total_summary_ansuran_groupByTeller = (clone $query_total_ansuran)
|
||||||
|
->selectRaw('
|
||||||
|
count(transaction.norujukan) as sum_norujukan,
|
||||||
|
sum(transaksi_keuntungan.bayaran_pembiayaan) as sum_bayaran_pembiayaan,
|
||||||
|
sum(transaksi_keuntungan.bayaran_keuntungan) as sum_bayaran_kos_keuntungan,
|
||||||
|
sum(transaction.duit_masuk) as sum_jumlah_bayaran,
|
||||||
|
teller
|
||||||
|
')
|
||||||
|
->groupBy('transaction.teller')
|
||||||
|
->get()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
return $total_summary_ansuran_groupByTeller;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCustomerInfo($total_ansuran)
|
||||||
|
{
|
||||||
|
|
||||||
|
$extract_nokp = $total_ansuran->pluck('nokp');
|
||||||
|
|
||||||
|
$customer_info = Customer::on('mysql7')
|
||||||
|
->select(['nama', 'alamat1', 'kpbaru', 'kplama'])
|
||||||
|
->where(function ($query) use ($extract_nokp) {
|
||||||
|
$query->whereIn('kpbaru', $extract_nokp)
|
||||||
|
->orWhereIn('kplama', $extract_nokp);
|
||||||
|
})
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$customer_info = collect($extract_nokp)->map(function ($nokp) use ($customer_info) {
|
||||||
|
return $customer_info->where('kpbaru', $nokp)->first() ?? $customer_info->where('kplama', $nokp)->first();
|
||||||
|
})->toArray();
|
||||||
|
|
||||||
|
return $customer_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getGadaianAnsuran($cawangan_connection, $list_norujukan)
|
||||||
|
{
|
||||||
|
|
||||||
|
$gadaian_ansuran = Gadai::on($cawangan_connection)
|
||||||
|
->whereIn('norujukan', $list_norujukan)
|
||||||
|
->select('norujukan', 'nokp', 'teller')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return $gadaian_ansuran;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,199 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Reports;
|
||||||
|
|
||||||
|
use App\Cawangan;
|
||||||
|
use App\CawanganDetail;
|
||||||
|
use App\Customer;
|
||||||
|
use App\Helper;
|
||||||
|
use App\Tebus;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class PenebusanService
|
||||||
|
{
|
||||||
|
|
||||||
|
public $kod_cawangan;
|
||||||
|
public $startDate;
|
||||||
|
public $endDate;
|
||||||
|
|
||||||
|
public function __construct($kod_cawangan, Request $request)
|
||||||
|
{
|
||||||
|
$this->kod_cawangan = $kod_cawangan;
|
||||||
|
$this->startDate = $request->startDate;
|
||||||
|
$this->endDate = $request->endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCawanganReport()
|
||||||
|
{
|
||||||
|
$cawangan_connection = Cawangan::where('kodcaw', $this->kod_cawangan)->first()->mysql;
|
||||||
|
|
||||||
|
$query_total_penebusan = Tebus::on($cawangan_connection);
|
||||||
|
|
||||||
|
$query_total_penebusan->join('gadai', 'tebus.norujukan', '=', 'gadai.norujukan');
|
||||||
|
|
||||||
|
$query_total_penebusan->where('gadai.upah12', '!=', null);
|
||||||
|
$query_total_penebusan->when(!empty($this->startDate) and !empty($this->endDate), function ($q) {
|
||||||
|
return $q->where('t_tebus', '>=', $this->startDate)
|
||||||
|
->where('t_tebus', '<=', $this->endDate);
|
||||||
|
});
|
||||||
|
|
||||||
|
$total_penebusan = $this->getTotalPenebusan($query_total_penebusan);
|
||||||
|
$total_summary_penebusan_teller = $this->getTotalSummaryPenebusanGroupByTeller($query_total_penebusan);
|
||||||
|
$total_summary_penebusan = $this->getTotalSummaryPenebusan($query_total_penebusan);
|
||||||
|
$customer_info = $this->getCustomerInfo($total_penebusan);
|
||||||
|
$cawangan_detail = $this->getCawanganDetail($cawangan_connection);
|
||||||
|
|
||||||
|
$total_penebusan = $total_penebusan->zip($customer_info)->map(function ($data) {
|
||||||
|
|
||||||
|
[$tebus, $customer_info] = $data;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'no_rujukan' => $tebus['norujukan'],
|
||||||
|
'nama' => $customer_info['nama'],
|
||||||
|
'no_kp' => $tebus['nokp'],
|
||||||
|
'tarikh_gadai' => $tebus['t_gadai'],
|
||||||
|
'jbg' => $tebus['jbg'],
|
||||||
|
'nilai_pinjaman' => $tebus['nilai_pinjaman'],
|
||||||
|
'baki_pinjaman' => $tebus['baki_pinjaman'],
|
||||||
|
'kos_keuntungan' => $tebus['kos_keuntungan'],
|
||||||
|
'kos_keuntungan_rebet' => $tebus['kos_keuntungan_rebet'],
|
||||||
|
'bayaran_penebusan' => $tebus['bayaran_penebusan'],
|
||||||
|
'nilai_marhun' => $tebus['nilai_marhun'],
|
||||||
|
'jenis_tebus' => $tebus['jenis_tebus'],
|
||||||
|
'teller' => $tebus['teller'],
|
||||||
|
];
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$total_penebusan = $total_penebusan->groupBy('teller');
|
||||||
|
|
||||||
|
$penebusan_tellers = $total_penebusan->keys();
|
||||||
|
|
||||||
|
$total_penebusan = $total_penebusan
|
||||||
|
->zip($total_summary_penebusan_teller)
|
||||||
|
->map(function ($data) {
|
||||||
|
|
||||||
|
[$penebusan, $summary] = $data;
|
||||||
|
|
||||||
|
return [
|
||||||
|
'penebusan' => $penebusan,
|
||||||
|
'summary_penebusan_teller' => $summary,
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
$total_penebusan = $penebusan_tellers->combine($total_penebusan);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'query' => [
|
||||||
|
'startDate' => Helper::formatDate($this->startDate),
|
||||||
|
'endDate' => Helper::formatDate($this->endDate),
|
||||||
|
],
|
||||||
|
'cawangan_detail' => $cawangan_detail,
|
||||||
|
'penebusan' => $total_penebusan,
|
||||||
|
'summary_penebusan' => $total_summary_penebusan,
|
||||||
|
];
|
||||||
|
|
||||||
|
return json_encode($data);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCawanganDetail($cawangan_connection)
|
||||||
|
{
|
||||||
|
$cawangan_detail = CawanganDetail::on($cawangan_connection)->get()
|
||||||
|
->map(function ($detail) {
|
||||||
|
return [
|
||||||
|
'nama' => $detail['namacaw'],
|
||||||
|
'code' => $detail['kodcaw'] . ' Ar-Rahn ' . $detail['cawangan'],
|
||||||
|
'alamat' => $detail['alamat1'],
|
||||||
|
'waktu_operasi' => $detail['alamat4'],
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
return $cawangan_detail[0];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getTotalSummaryPenebusan(Builder $query_total_penebusan)
|
||||||
|
{
|
||||||
|
|
||||||
|
$total_summary_penebusan = (clone $query_total_penebusan)
|
||||||
|
->select(
|
||||||
|
DB::raw('sum(gadai.bakipjm) as nilai_pinjaman'),
|
||||||
|
DB::raw('sum(tebus.pinjaman) as baki_pinjaman'),
|
||||||
|
DB::raw('sum(tebus.bakiupah) as kos_keuntungan'),
|
||||||
|
DB::raw('sum(tebus.bakipjm - gadai.bakipjm) as kos_keuntungan_rebet'),
|
||||||
|
DB::raw('sum(gadai.bakipjm) + sum(tebus.bakipjm - gadai.bakipjm) as bayaran_penebusan'),
|
||||||
|
DB::raw('sum(tebus.nilaimarhun) as nilai_marhun'),
|
||||||
|
)
|
||||||
|
->get()
|
||||||
|
->toArray();
|
||||||
|
|
||||||
|
return $total_summary_penebusan[0];
|
||||||
|
}
|
||||||
|
private function getTotalSummaryPenebusanGroupByTeller(Builder $query_total_penebusan)
|
||||||
|
{
|
||||||
|
|
||||||
|
$total_summary_penebusan_groupByTeller = (clone $query_total_penebusan)
|
||||||
|
->select(
|
||||||
|
DB::raw('sum(gadai.bakipjm) as nilai_pinjaman'),
|
||||||
|
DB::raw('sum(tebus.pinjaman) as baki_pinjaman'),
|
||||||
|
DB::raw('sum(tebus.bakiupah) as kos_keuntungan'),
|
||||||
|
DB::raw('sum(tebus.bakipjm - gadai.bakipjm) as kos_keuntungan_rebet'),
|
||||||
|
DB::raw('sum(gadai.bakipjm) + sum(tebus.bakipjm - gadai.bakipjm) as bayaran_penebusan'),
|
||||||
|
DB::raw('sum(tebus.nilaimarhun) as nilai_marhun'),
|
||||||
|
'tebus.teller',
|
||||||
|
)
|
||||||
|
->groupBy('tebus.teller')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return $total_summary_penebusan_groupByTeller;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getTotalPenebusan(Builder $query_total_penebusan)
|
||||||
|
{
|
||||||
|
|
||||||
|
$total_penebusan = (clone $query_total_penebusan)
|
||||||
|
->select(
|
||||||
|
'tebus.norujukan',
|
||||||
|
'gadai.nokp',
|
||||||
|
'gadai.t_gadai',
|
||||||
|
'gadai.jbg',
|
||||||
|
'gadai.bakipjm as nilai_pinjaman',
|
||||||
|
'tebus.pinjaman as baki_pinjaman',
|
||||||
|
'tebus.bakiupah as kos_keuntungan',
|
||||||
|
DB::raw('(tebus.bakipjm - gadai.bakipjm) as kos_keuntungan_rebet'),
|
||||||
|
DB::raw('gadai.bakipjm + (tebus.bakipjm - gadai.bakipjm) as bayaran_penebusan'),
|
||||||
|
'tebus.nilaimarhun as nilai_marhun',
|
||||||
|
'tebus.jenistebus as jenis_tebus',
|
||||||
|
'tebus.teller',
|
||||||
|
)
|
||||||
|
->orderBy('tebus.teller')
|
||||||
|
->orderBy('gadai.sirig')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return $total_penebusan;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getCustomerInfo($total_penebusan)
|
||||||
|
{
|
||||||
|
|
||||||
|
$extract_nokp = $total_penebusan->pluck('nokp');
|
||||||
|
|
||||||
|
$customer_info = Customer::on('mysql7')
|
||||||
|
->select(['nama', 'alamat1', 'kpbaru', 'kplama'])
|
||||||
|
->where(function ($query) use ($extract_nokp) {
|
||||||
|
$query->whereIn('kpbaru', $extract_nokp)
|
||||||
|
->orWhereIn('kplama', $extract_nokp);
|
||||||
|
})
|
||||||
|
->get();
|
||||||
|
|
||||||
|
$customer_info = collect($extract_nokp)->map(function ($nokp) use ($customer_info) {
|
||||||
|
return $customer_info->where('kpbaru', $nokp)->first() ?? $customer_info->where('kplama', $nokp)->first();
|
||||||
|
})->toArray();
|
||||||
|
|
||||||
|
return $customer_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+2
-4
@@ -9,7 +9,8 @@
|
|||||||
"auth0/auth0-php": "^7.4",
|
"auth0/auth0-php": "^7.4",
|
||||||
"laravel/lumen-framework": "^7.0",
|
"laravel/lumen-framework": "^7.0",
|
||||||
"laravel/tinker": "^2.8",
|
"laravel/tinker": "^2.8",
|
||||||
"rap2hpoutre/laravel-log-viewer": "^1.7"
|
"rap2hpoutre/laravel-log-viewer": "^1.7",
|
||||||
|
"spatie/laravel-ray": "^1.33"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fzaninotto/faker": "^1.9.1",
|
"fzaninotto/faker": "^1.9.1",
|
||||||
@@ -17,9 +18,6 @@
|
|||||||
"phpunit/phpunit": "^8.5"
|
"phpunit/phpunit": "^8.5"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files":[
|
|
||||||
"app/helpers.php"
|
|
||||||
],
|
|
||||||
"classmap": [
|
"classmap": [
|
||||||
"database/seeds",
|
"database/seeds",
|
||||||
"database/factories"
|
"database/factories"
|
||||||
|
|||||||
Generated
+677
-1
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "9002d37085a4ef790b6e9f7269b8f058",
|
"content-hash": "17aa13bd1f3c89969c4cdcce223e8172",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "auth0/auth0-php",
|
"name": "auth0/auth0-php",
|
||||||
@@ -2714,6 +2714,59 @@
|
|||||||
],
|
],
|
||||||
"time": "2021-12-04T23:24:31+00:00"
|
"time": "2021-12-04T23:24:31+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "pimple/pimple",
|
||||||
|
"version": "v3.5.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/silexphp/Pimple.git",
|
||||||
|
"reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed",
|
||||||
|
"reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2.5",
|
||||||
|
"psr/container": "^1.1 || ^2.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/phpunit-bridge": "^5.4@dev"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "3.4.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-0": {
|
||||||
|
"Pimple": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Pimple, a simple Dependency Injection Container",
|
||||||
|
"homepage": "https://pimple.symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"container",
|
||||||
|
"dependency injection"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/silexphp/Pimple/tree/v3.5.0"
|
||||||
|
},
|
||||||
|
"time": "2021-10-28T11:13:42+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/container",
|
"name": "psr/container",
|
||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
@@ -3382,6 +3435,279 @@
|
|||||||
},
|
},
|
||||||
"time": "2020-09-08T12:21:27+00:00"
|
"time": "2020-09-08T12:21:27+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "spatie/backtrace",
|
||||||
|
"version": "1.5.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/spatie/backtrace.git",
|
||||||
|
"reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/spatie/backtrace/zipball/483f76a82964a0431aa836b6ed0edde0c248e3ab",
|
||||||
|
"reference": "483f76a82964a0431aa836b6ed0edde0c248e3ab",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.3|^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"phpunit/phpunit": "^9.3",
|
||||||
|
"spatie/phpunit-snapshot-assertions": "^4.2",
|
||||||
|
"symfony/var-dumper": "^5.1"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Spatie\\Backtrace\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Freek Van de Herten",
|
||||||
|
"email": "freek@spatie.be",
|
||||||
|
"homepage": "https://spatie.be",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A better backtrace",
|
||||||
|
"homepage": "https://github.com/spatie/backtrace",
|
||||||
|
"keywords": [
|
||||||
|
"Backtrace",
|
||||||
|
"spatie"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/spatie/backtrace/tree/1.5.3"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/sponsors/spatie",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://spatie.be/open-source/support-us",
|
||||||
|
"type": "other"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-06-28T12:59:17+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spatie/laravel-ray",
|
||||||
|
"version": "1.33.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/spatie/laravel-ray.git",
|
||||||
|
"reference": "5028ae44a09451b26eb44490e3471998650788e3"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/spatie/laravel-ray/zipball/5028ae44a09451b26eb44490e3471998650788e3",
|
||||||
|
"reference": "5028ae44a09451b26eb44490e3471998650788e3",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"illuminate/contracts": "^7.20|^8.19|^9.0|^10.0",
|
||||||
|
"illuminate/database": "^7.20|^8.19|^9.0|^10.0",
|
||||||
|
"illuminate/queue": "^7.20|^8.19|^9.0|^10.0",
|
||||||
|
"illuminate/support": "^7.20|^8.19|^9.0|^10.0",
|
||||||
|
"php": "^7.4|^8.0",
|
||||||
|
"spatie/backtrace": "^1.0",
|
||||||
|
"spatie/ray": "^1.37",
|
||||||
|
"symfony/stopwatch": "4.2|^5.1|^6.0",
|
||||||
|
"zbateson/mail-mime-parser": "^1.3.1|^2.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"guzzlehttp/guzzle": "^7.3",
|
||||||
|
"laravel/framework": "^7.20|^8.19|^9.0|^10.0",
|
||||||
|
"orchestra/testbench-core": "^5.0|^6.0|^7.0|^8.0",
|
||||||
|
"pestphp/pest": "^1.22",
|
||||||
|
"phpstan/phpstan": "^0.12.93",
|
||||||
|
"phpunit/phpunit": "^9.3",
|
||||||
|
"spatie/pest-plugin-snapshots": "^1.1"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "1.29.x-dev"
|
||||||
|
},
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"Spatie\\LaravelRay\\RayServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Spatie\\LaravelRay\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Freek Van der Herten",
|
||||||
|
"email": "freek@spatie.be",
|
||||||
|
"homepage": "https://spatie.be",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Easily debug Laravel apps",
|
||||||
|
"homepage": "https://github.com/spatie/laravel-ray",
|
||||||
|
"keywords": [
|
||||||
|
"laravel-ray",
|
||||||
|
"spatie"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/spatie/laravel-ray/issues",
|
||||||
|
"source": "https://github.com/spatie/laravel-ray/tree/1.33.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/sponsors/spatie",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://spatie.be/open-source/support-us",
|
||||||
|
"type": "other"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-09-04T10:16:53+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spatie/macroable",
|
||||||
|
"version": "1.0.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/spatie/macroable.git",
|
||||||
|
"reference": "7a99549fc001c925714b329220dea680c04bfa48"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/spatie/macroable/zipball/7a99549fc001c925714b329220dea680c04bfa48",
|
||||||
|
"reference": "7a99549fc001c925714b329220dea680c04bfa48",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2|^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^8.0|^9.3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Spatie\\Macroable\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Freek Van der Herten",
|
||||||
|
"email": "freek@spatie.be",
|
||||||
|
"homepage": "https://spatie.be",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A trait to dynamically add methods to a class",
|
||||||
|
"homepage": "https://github.com/spatie/macroable",
|
||||||
|
"keywords": [
|
||||||
|
"macroable",
|
||||||
|
"spatie"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/spatie/macroable/issues",
|
||||||
|
"source": "https://github.com/spatie/macroable/tree/1.0.1"
|
||||||
|
},
|
||||||
|
"time": "2020-11-03T10:15:05+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spatie/ray",
|
||||||
|
"version": "1.40.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/spatie/ray.git",
|
||||||
|
"reference": "8e6547ff47aae2e4f615a5dcea1e5e4911b1dc9f"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/spatie/ray/zipball/8e6547ff47aae2e4f615a5dcea1e5e4911b1dc9f",
|
||||||
|
"reference": "8e6547ff47aae2e4f615a5dcea1e5e4911b1dc9f",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-curl": "*",
|
||||||
|
"ext-json": "*",
|
||||||
|
"php": "^7.3|^8.0",
|
||||||
|
"ramsey/uuid": "^3.0|^4.1",
|
||||||
|
"spatie/backtrace": "^1.1",
|
||||||
|
"spatie/macroable": "^1.0|^2.0",
|
||||||
|
"symfony/stopwatch": "^4.0|^5.1|^6.0",
|
||||||
|
"symfony/var-dumper": "^4.2|^5.1|^6.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"illuminate/support": "6.x|^8.18|^9.0",
|
||||||
|
"nesbot/carbon": "^2.63",
|
||||||
|
"pestphp/pest": "^1.22",
|
||||||
|
"phpstan/phpstan": "^1.10",
|
||||||
|
"phpunit/phpunit": "^9.5",
|
||||||
|
"spatie/phpunit-snapshot-assertions": "^4.2",
|
||||||
|
"spatie/test-time": "^1.2"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"src/helpers.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Spatie\\Ray\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Freek Van der Herten",
|
||||||
|
"email": "freek@spatie.be",
|
||||||
|
"homepage": "https://spatie.be",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Debug with Ray to fix problems faster",
|
||||||
|
"homepage": "https://github.com/spatie/ray",
|
||||||
|
"keywords": [
|
||||||
|
"ray",
|
||||||
|
"spatie"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/spatie/ray/issues",
|
||||||
|
"source": "https://github.com/spatie/ray/tree/1.40.1"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/sponsors/spatie",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://spatie.be/open-source/support-us",
|
||||||
|
"type": "other"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-11-20T08:20:15+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/console",
|
"name": "symfony/console",
|
||||||
"version": "v5.4.9",
|
"version": "v5.4.9",
|
||||||
@@ -4196,6 +4522,89 @@
|
|||||||
],
|
],
|
||||||
"time": "2021-10-20T20:35:02+00:00"
|
"time": "2021-10-20T20:35:02+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/polyfill-iconv",
|
||||||
|
"version": "v1.28.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/polyfill-iconv.git",
|
||||||
|
"reference": "6de50471469b8c9afc38164452ab2b6170ee71c1"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/6de50471469b8c9afc38164452ab2b6170ee71c1",
|
||||||
|
"reference": "6de50471469b8c9afc38164452ab2b6170ee71c1",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"ext-iconv": "*"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-iconv": "For best performance"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "1.28-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/polyfill",
|
||||||
|
"url": "https://github.com/symfony/polyfill"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"bootstrap.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Iconv\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony polyfill for the Iconv extension",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"compatibility",
|
||||||
|
"iconv",
|
||||||
|
"polyfill",
|
||||||
|
"portable",
|
||||||
|
"shim"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/polyfill-iconv/tree/v1.28.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-01-26T09:26:14+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-grapheme",
|
"name": "symfony/polyfill-intl-grapheme",
|
||||||
"version": "v1.25.0",
|
"version": "v1.25.0",
|
||||||
@@ -4993,6 +5402,68 @@
|
|||||||
],
|
],
|
||||||
"time": "2022-03-13T20:07:29+00:00"
|
"time": "2022-03-13T20:07:29+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/stopwatch",
|
||||||
|
"version": "v5.4.21",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/stopwatch.git",
|
||||||
|
"reference": "f83692cd869a6f2391691d40a01e8acb89e76fee"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/stopwatch/zipball/f83692cd869a6f2391691d40a01e8acb89e76fee",
|
||||||
|
"reference": "f83692cd869a6f2391691d40a01e8acb89e76fee",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2.5",
|
||||||
|
"symfony/service-contracts": "^1|^2|^3"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Stopwatch\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Provides a way to profile code",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/stopwatch/tree/v5.4.21"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-02-14T08:03:56+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/string",
|
"name": "symfony/string",
|
||||||
"version": "v5.4.9",
|
"version": "v5.4.9",
|
||||||
@@ -5494,6 +5965,211 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-24T18:55:24+00:00"
|
"time": "2022-01-24T18:55:24+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "zbateson/mail-mime-parser",
|
||||||
|
"version": "2.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/zbateson/mail-mime-parser.git",
|
||||||
|
"reference": "20b3e48eb799537683780bc8782fbbe9bc25934a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/zbateson/mail-mime-parser/zipball/20b3e48eb799537683780bc8782fbbe9bc25934a",
|
||||||
|
"reference": "20b3e48eb799537683780bc8782fbbe9bc25934a",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"guzzlehttp/psr7": "^1.7.0|^2.0",
|
||||||
|
"php": ">=7.1",
|
||||||
|
"pimple/pimple": "^3.0",
|
||||||
|
"zbateson/mb-wrapper": "^1.0.1",
|
||||||
|
"zbateson/stream-decorators": "^1.0.6"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "*",
|
||||||
|
"mikey179/vfsstream": "^1.6.0",
|
||||||
|
"phpstan/phpstan": "*",
|
||||||
|
"phpunit/phpunit": "<10"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-iconv": "For best support/performance",
|
||||||
|
"ext-mbstring": "For best support/performance"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"ZBateson\\MailMimeParser\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-2-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Zaahid Bateson"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Contributors",
|
||||||
|
"homepage": "https://github.com/zbateson/mail-mime-parser/graphs/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "MIME email message parser",
|
||||||
|
"homepage": "https://mail-mime-parser.org",
|
||||||
|
"keywords": [
|
||||||
|
"MimeMailParser",
|
||||||
|
"email",
|
||||||
|
"mail",
|
||||||
|
"mailparse",
|
||||||
|
"mime",
|
||||||
|
"mimeparse",
|
||||||
|
"parser",
|
||||||
|
"php-imap"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"docs": "https://mail-mime-parser.org/#usage-guide",
|
||||||
|
"issues": "https://github.com/zbateson/mail-mime-parser/issues",
|
||||||
|
"source": "https://github.com/zbateson/mail-mime-parser"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/zbateson",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-02-14T22:58:03+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "zbateson/mb-wrapper",
|
||||||
|
"version": "1.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/zbateson/mb-wrapper.git",
|
||||||
|
"reference": "faf35dddfacfc5d4d5f9210143eafd7a7fe74334"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/zbateson/mb-wrapper/zipball/faf35dddfacfc5d4d5f9210143eafd7a7fe74334",
|
||||||
|
"reference": "faf35dddfacfc5d4d5f9210143eafd7a7fe74334",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1",
|
||||||
|
"symfony/polyfill-iconv": "^1.9",
|
||||||
|
"symfony/polyfill-mbstring": "^1.9"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "*",
|
||||||
|
"phpstan/phpstan": "*",
|
||||||
|
"phpunit/phpunit": "<=9.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-iconv": "For best support/performance",
|
||||||
|
"ext-mbstring": "For best support/performance"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"ZBateson\\MbWrapper\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-2-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Zaahid Bateson"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation",
|
||||||
|
"keywords": [
|
||||||
|
"charset",
|
||||||
|
"encoding",
|
||||||
|
"http",
|
||||||
|
"iconv",
|
||||||
|
"mail",
|
||||||
|
"mb",
|
||||||
|
"mb_convert_encoding",
|
||||||
|
"mbstring",
|
||||||
|
"mime",
|
||||||
|
"multibyte",
|
||||||
|
"string"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/zbateson/mb-wrapper/issues",
|
||||||
|
"source": "https://github.com/zbateson/mb-wrapper/tree/1.2.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/zbateson",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-01-11T23:05:44+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "zbateson/stream-decorators",
|
||||||
|
"version": "1.0.8",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/zbateson/stream-decorators.git",
|
||||||
|
"reference": "0c2816e16a67d00c60680d8d4539ec555fb43d11"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/zbateson/stream-decorators/zipball/0c2816e16a67d00c60680d8d4539ec555fb43d11",
|
||||||
|
"reference": "0c2816e16a67d00c60680d8d4539ec555fb43d11",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"guzzlehttp/psr7": "^1.7.0|^2.0",
|
||||||
|
"php": ">=5.4",
|
||||||
|
"zbateson/mb-wrapper": "^1.0.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"sanmai/phpunit-legacy-adapter": "^6.3 || ^8"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"ZBateson\\StreamDecorators\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"BSD-2-Clause"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Zaahid Bateson"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP psr7 stream decorators for mime message part streams",
|
||||||
|
"keywords": [
|
||||||
|
"base64",
|
||||||
|
"charset",
|
||||||
|
"decorators",
|
||||||
|
"mail",
|
||||||
|
"mime",
|
||||||
|
"psr7",
|
||||||
|
"quoted-printable",
|
||||||
|
"stream",
|
||||||
|
"uuencode"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/zbateson/stream-decorators/issues",
|
||||||
|
"source": "https://github.com/zbateson/stream-decorators/tree/1.0.8"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/zbateson",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2022-12-30T20:50:33+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
|
|||||||
+9
-3
@@ -1,6 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$router->group(['prefix'=>'api'], function () use ($router){
|
$router->group(['prefix'=>'api/reports'], function () use ($router){
|
||||||
$router->get('gadailaporanOverallSummary', ['uses' => 'ReportGadaiController@getSummaryLaporanGadai']);
|
$router->group(['namespace' => 'Reports'], function() use($router){
|
||||||
$router->get('gadailaporan/{kod_cawangan}', ['uses' => 'ReportGadaiController@getLaporanCawangan']);
|
$router->get('gadaian', ['uses' => 'GadaianController@getSummaryLaporanGadai']);
|
||||||
|
$router->get('gadaian/{kod_cawangan}', ['uses' => 'GadaianController@getLaporanCawangan']);
|
||||||
|
$router->get('penebusan', ['uses' => 'PenebusanController@getSummaryLaporanTebus']);
|
||||||
|
$router->get('penebusan/{kod_cawangan}', ['uses' => 'PenebusanController@getLaporanCawangan']);
|
||||||
|
$router->get('ansuran', ['uses' => 'AnsuranController@getSummaryLaporanAnsuran']);
|
||||||
|
$router->get('ansuran/{kod_cawangan}', ['uses' => 'AnsuranController@getLaporanCawangan']);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Cawangan;
|
||||||
|
use App\Helper;
|
||||||
|
use App\Tebus;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
|
$active_cawangan_db_connection = Helper::getActiveCawanganDbConnection();
|
||||||
|
|
||||||
|
$request->startDate = Carbon::now();
|
||||||
|
$request->endDate = Carbon::now();
|
||||||
|
|
||||||
|
|
||||||
|
$active_cawangan_db_name = array_map(function ($db_connection) {
|
||||||
|
return config('database.connections' . '.' . $db_connection . '.' . 'database');
|
||||||
|
}, $active_cawangan_db_connection);
|
||||||
|
|
||||||
|
$active_cawangan_detail = Cawangan::select('kodcaw', 'details_caw')->whereIn('db_name', $active_cawangan_db_name)->get()->toArray();
|
||||||
|
|
||||||
|
$summary_penebusan_data = array_map(function ($db_connection) use ($tarikh) {
|
||||||
|
$penebusan = Tebus::on($db_connection)
|
||||||
|
->join('gadai', 'tebus.norujukan', '=', 'gadai.norujukan')
|
||||||
|
->where('gadai.upah12', '!=', null)
|
||||||
|
->where('tebus.t_tebus', '>=', $request->startDate)
|
||||||
|
->where('tebus.t_tebus', '<=', $request->endDate)
|
||||||
|
->select(DB::raw('
|
||||||
|
count(tebus.norujukan) as bilangan_tebus,
|
||||||
|
sum(gadai.berat) as berat,
|
||||||
|
sum(gadai.bakipjm) as nilai_pinjaman,
|
||||||
|
sum(tebus.pinjaman) as baki_pinjaman,
|
||||||
|
sum(tebus.nilaimarhun) as nilai_marhun,
|
||||||
|
sum(tebus.bakiupah) as keuntungan_asal,
|
||||||
|
sum(tebus.bakipjm - gadai.bakipjm) as keuntungan_rebet,
|
||||||
|
sum(gadai.bakipjm) + sum(tebus.bakipjm - gadai.bakipjm) as bayaran_penebusan
|
||||||
|
'))
|
||||||
|
->get();
|
||||||
|
|
||||||
|
|
||||||
|
return $penebusan->toArray();
|
||||||
|
}, $active_cawangan_db_connection);
|
||||||
|
|
||||||
|
$response = array_map(function ($cawangan_detail, $summary_penebusan_data) {
|
||||||
|
return array_merge($cawangan_detail, $summary_penebusan_data[0]);
|
||||||
|
}, $active_cawangan_detail, $summary_penebusan_data);
|
||||||
|
|
||||||
|
return json_encode($response);
|
||||||
Reference in New Issue
Block a user