fix data deposito
This commit is contained in:
38
Entities/VwDeposito.php
Normal file
38
Entities/VwDeposito.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Konfirmasibank\Entities;
|
||||
|
||||
use Spatie\Activitylog\LogOptions;
|
||||
use Spatie\Activitylog\Traits\LogsActivity;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class VwDeposito extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $primaryKey = 'cif';
|
||||
protected $connection = 'pgsql';
|
||||
protected $table = 'vw_deposito';
|
||||
|
||||
//public $incrementing = false;
|
||||
|
||||
protected $fillable = [
|
||||
"'cif',
|
||||
'no_rek'
|
||||
'kode_cabang',
|
||||
'nama_cabang',
|
||||
'suku_bunga',
|
||||
'jumlah_nominal'
|
||||
'jenis_rekening',
|
||||
'period',
|
||||
'jatuh_tempo',
|
||||
'kode_mata_uang',
|
||||
'tenor',
|
||||
'tgl_mulai'"
|
||||
];
|
||||
|
||||
}
|
@ -14,6 +14,7 @@ use Modules\Konfirmasibank\Entities\Loan;
|
||||
use Modules\Konfirmasibank\Entities\Letters;
|
||||
use Modules\Konfirmasibank\Entities\Company;
|
||||
use Modules\Konfirmasibank\Entities\Account;
|
||||
use Modules\Konfirmasibank\Entities\Vwdeposito;
|
||||
use Modules\Konfirmasibank\Entities\Category;
|
||||
use Modules\Konfirmasibank\Entities\LimitReference;
|
||||
use PDF;
|
||||
@ -477,6 +478,12 @@ class KonfirmasiBankController extends Controller
|
||||
->where('nama_cabang','like', '%'.$cabang.'%')
|
||||
->get();
|
||||
|
||||
$Depos =Loan::whereIn('no_rek',$arrAccount)
|
||||
->whereDate('periode',$startDateLoan )
|
||||
//->where('kode_status_lunas', '<>', 'EXPIRED')
|
||||
->where('nama_cabang','like', '%'.$cabang.'%')
|
||||
->get();
|
||||
|
||||
|
||||
|
||||
|
||||
@ -570,8 +577,8 @@ class KonfirmasiBankController extends Controller
|
||||
$listAccount = DPK::where('cif',$request['cusNo'])
|
||||
->whereIn('no_rek', $arrAccount)
|
||||
->whereDate('period', $dateCoreAccount )
|
||||
->where('nama_cabang','like', '%'.$cabang.'%')
|
||||
->orderBy('jenis_rekening', 'DESC')
|
||||
// ->where('nama_cabang','like', '%'.$cabang.'%')
|
||||
->orderBy('jatuh_tempo', 'DESC')
|
||||
->get();
|
||||
}
|
||||
}
|
||||
@ -579,6 +586,15 @@ class KonfirmasiBankController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
//listdeposito
|
||||
$listDepo = Vwdeposito::where('cif',$request['cusNo'])
|
||||
->whereDate('period', $dateCoreAccount )
|
||||
->where('nama_cabang','like', '%'.$cabang.'%')
|
||||
->orderBy('jenis_rekening', 'DESC')
|
||||
->get();
|
||||
|
||||
// dd($listDepo);
|
||||
|
||||
|
||||
|
||||
// try {
|
||||
@ -599,25 +615,41 @@ class KonfirmasiBankController extends Controller
|
||||
$DataAccounts[$key1]['TERM'] = '';
|
||||
}
|
||||
|
||||
if ($account->jenis_rekening == 'DEPOSITO') {
|
||||
$tanggalMulai = Carbon::parse($account->tgl_mulai);
|
||||
$tanggalJatuhTempo = Carbon::parse($account->jatuh_tempo);
|
||||
$selisihHari = $tanggalMulai->diffInMonths($tanggalJatuhTempo);
|
||||
$DataDepo[$key1]['ACCOUNT_NUMBER'] = $account->no_rek;
|
||||
$DataDepo[$key1]['BATCH_DATE'] = $account->period;
|
||||
$DataDepo[$key1]['CUSTOMER_NO'] = $account->cif;
|
||||
$DataDepo[$key1]['SHORT_NAME'] = $account->jenis_rekening; //$depo->SHORT_NAME;
|
||||
$DataDepo[$key1]['CURRENCY'] = $account->kode_mata_uang;
|
||||
$DataDepo[$key1]['PRODUCT'] = $account->jenis_rekening;
|
||||
$DataDepo[$key1]['COMPANY_NAME'] = $account->nama_cabang;
|
||||
$DataDepo[$key1]['WORKING_BALANCE'] = $account->jumlah_nominal != null ? number_format(abs($account->jumlah_nominal), 2, ',', '.') : 'NIHIL';
|
||||
$DataDepo[$key1]['MATURITY_DATE'] = Carbon::parse($account->jatuh_tempo)->format('d-m-Y');
|
||||
$DataDepo[$key1]['FIXED_RATE'] = $account->suku_bunga . ' %' ;
|
||||
$DataDepo[$key1]['TERM'] = $selisihHari . ' BLN';
|
||||
}
|
||||
// if ($account->jenis_rekening == 'DEPOSITO') {
|
||||
// $tanggalMulai = Carbon::parse($account->tgl_mulai);
|
||||
// $tanggalJatuhTempo = Carbon::parse($account->jatuh_tempo);
|
||||
// $selisihHari = $tanggalMulai->diffInMonths($tanggalJatuhTempo);
|
||||
// $DataDepo[$key1]['ACCOUNT_NUMBER'] = $account->no_rek;
|
||||
// $DataDepo[$key1]['BATCH_DATE'] = $account->period;
|
||||
// $DataDepo[$key1]['CUSTOMER_NO'] = $account->cif;
|
||||
// $DataDepo[$key1]['SHORT_NAME'] = $account->jenis_rekening; //$depo->SHORT_NAME;
|
||||
// $DataDepo[$key1]['CURRENCY'] = $account->kode_mata_uang;
|
||||
// $DataDepo[$key1]['PRODUCT'] = $account->jenis_rekening;
|
||||
// $DataDepo[$key1]['COMPANY_NAME'] = $account->nama_cabang;
|
||||
// $DataDepo[$key1]['WORKING_BALANCE'] = $account->jumlah_nominal != null ? number_format(abs($account->jumlah_nominal), 2, ',', '.') : 'NIHIL';
|
||||
// $DataDepo[$key1]['MATURITY_DATE'] = Carbon::parse($account->jatuh_tempo)->format('d-m-Y');
|
||||
// $DataDepo[$key1]['FIXED_RATE'] = $account->suku_bunga . ' %' ;
|
||||
// $DataDepo[$key1]['TERM'] = $selisihHari . ' BLN';
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
foreach ($listDepo as $key2 => $depo) {
|
||||
$DataDepo[$key2]['ACCOUNT_NUMBER'] = $depo->no_rek;
|
||||
$DataDepo[$key2]['BATCH_DATE'] = $depo->period;
|
||||
$DataDepo[$key2]['CUSTOMER_NO'] = $depo->cif;
|
||||
$DataDepo[$key2]['SHORT_NAME'] = $depo->jenis_rekening; //$depo->SHORT_NAME;
|
||||
$DataDepo[$key2]['CURRENCY'] = $depo->kode_mata_uang;
|
||||
$DataDepo[$key2]['PRODUCT'] = $depo->jenis_rekening;
|
||||
$DataDepo[$key2]['COMPANY_NAME'] = $depo->nama_cabang;
|
||||
$DataDepo[$key2]['WORKING_BALANCE'] = $depo->jumlah_nominal != null ? number_format(abs($depo->jumlah_nominal), 2, ',', '.') : 'NIHIL';
|
||||
$DataDepo[$key2]['MATURITY_DATE'] = Carbon::parse($depo->jatuh_tempo)->format('d-m-Y');
|
||||
$DataDepo[$key2]['FIXED_RATE'] = $depo->suku_bunga . ' %' ;
|
||||
$DataDepo[$key2]['TERM'] = $depo->tenor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$DataLoan = [];
|
||||
foreach ($Loans as $keyLon => $lon) {
|
||||
if ($lon->kode_status_lunas != 'EXPIRED') {
|
||||
@ -654,8 +686,6 @@ class KonfirmasiBankController extends Controller
|
||||
$letter = new Letters();
|
||||
$infoSuratNew = $letter->where('no_cif', $request['cusNo'])->orderBy('id', 'DESC')->first();
|
||||
|
||||
|
||||
|
||||
$data['DataAccounts'] = $DataAccounts ?? '';
|
||||
$data['DataLoan'] = $DataLoan ?? '';
|
||||
$data['DataDepo'] = $DataDepo ?? '';
|
||||
|
@ -172,10 +172,16 @@
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
@else
|
||||
<tr class="">
|
||||
<td class="space1" colspan="9" style="text-align: center;">NIHIL</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
|
||||
@if (count($data['DataDepo']) > 0)
|
||||
@php
|
||||
$no= count($data['DataAccounts']);
|
||||
$no= count($data['DataAccounts']) +1;
|
||||
@endphp
|
||||
@foreach ($data['DataDepo'] as $item)
|
||||
<tr class="space1">
|
||||
@ -209,11 +215,7 @@
|
||||
|
||||
@endif
|
||||
|
||||
@else
|
||||
<tr class="">
|
||||
<td class="space1" colspan="9" style="text-align: center;">NIHIL</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<!-- Add more rows here if needed -->
|
||||
</tbody>
|
||||
</table><br>
|
||||
|
Reference in New Issue
Block a user