update query export surat
This commit is contained in:
@ -111,6 +111,7 @@ class Account extends Model
|
||||
->select('ARRANGEMENT_ID','PRODUCT_LINE','CO_CODE','START_DATE','CURRENCY','PRODUCT','LINKED_APPL_ID')
|
||||
// ->join('STG_DB.ACCOUNT AS AC', 'AA.LINKED_APPL_ID', '=', 'AC.ACCOUNT_NUMBER')
|
||||
->where('CUSTOMER',$cus_no)
|
||||
// ->whereIn(DB::raw("LINKED_APPL_ID"),$arr)
|
||||
->where('ARR_STATUS' , 'CURRENT')
|
||||
// ->orderBy('TERM','DESC');
|
||||
->where('BATCH_DATE', $dateCore)
|
||||
@ -207,4 +208,4 @@ class Account extends Model
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -352,72 +352,18 @@
|
||||
$data = [];
|
||||
$DataAccounts = [];
|
||||
$DataPinjaman = [];
|
||||
|
||||
// dd($listAccount);
|
||||
$GetCustomer = $Account->getCustomer($request['cusNo'])->first();
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore )->get();
|
||||
|
||||
// $Arrangement = $Account->getPinjaman($request['cusNo'],$startDate)->get();
|
||||
$listAccount = $Account->getAccount($request['cusNo'], $arrAccount, $dateCore )->get();
|
||||
$Arrangement = $Account->getPinjaman($request['cusNo'], $startDate)->get();
|
||||
foreach ($listAccount as $key1 => $account) {
|
||||
$Arrangement = $Account->getPinjaman($request['cusNo'],$startDate)->get();
|
||||
$months = '';
|
||||
$PRODUCTFIXED_RATE = '' ;
|
||||
$MATURITY_DATE ='';
|
||||
$PRODUCT = '' ;
|
||||
$ARRANGEMENT_ID ='' ;
|
||||
if($Arrangement){
|
||||
foreach ($Arrangement as $key2 => $pinjaman) {
|
||||
$MaturityDate = $Account->getMaturityDate($pinjaman->ARRANGEMENT_ID, $startDate )->first();
|
||||
$TermAmount = $Account->getTermAmount($pinjaman->ARRANGEMENT_ID,$startDate)->first();
|
||||
$FixedRate = $Account->getFixedRate($pinjaman->ARRANGEMENT_ID,$startDate)->first();
|
||||
$balance = $Account->getSingleAccount($pinjaman->LINKED_APPL_ID,$startDate)->first();
|
||||
$StringTerm = $TermAmount->TERM;
|
||||
// Panjang string
|
||||
$panjang_string = strlen($StringTerm);
|
||||
// Panjang bagian yang ingin dihapus dari kanan
|
||||
$panjang_hapus = 1;
|
||||
// Menghapus bagian dari kanan string
|
||||
$string_baru = substr($StringTerm, 0, $panjang_string - $panjang_hapus);
|
||||
$Term1 = substr($TermAmount->TERM, -1);
|
||||
if($TermAmount){
|
||||
if( $Term1 == 'Y'){
|
||||
$monthsInYear = 12;
|
||||
$months = intval( $string_baru) * $monthsInYear . 'D';
|
||||
$PRODUCTFIXED_RATE = $FixedRate ? $FixedRate->FIXED_RATE : '';
|
||||
$PRODUCT = $pinjaman->PRODUCT ;
|
||||
$MATURITY_DATE = $MaturityDate ? $MaturityDate->MATURITY_DATE : '';
|
||||
$ARRANGEMENT_ID = $pinjaman->ARRANGEMENT_ID ;
|
||||
// $term = $days;
|
||||
}elseif($Term1 == 'M') {
|
||||
$averageDaysInMonth = 30.44;
|
||||
$months = intval($string_baru) / $averageDaysInMonth . 'D';
|
||||
// return $days;
|
||||
}else{
|
||||
$months = $TermAmount->TERM;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$DataPinjaman[$key2]['ARRANGEMENT_ID'] = $pinjaman->ARRANGEMENT_ID;
|
||||
$DataPinjaman[$key2]['START_DATE'] = $pinjaman->START_DATE;
|
||||
$DataPinjaman[$key2]['CURRENCY'] = $pinjaman->CURRENCY;
|
||||
$DataPinjaman[$key2]['PRODUCT'] = $pinjaman->PRODUCT;
|
||||
$DataPinjaman[$key2]['WORKING_BALANCE'] = $balance->WORKING_BALANCE != null ? number_format( $balance->WORKING_BALANCE, 2, ',', '.') : 'NIHIL';
|
||||
$DataPinjaman[$key2]['TERM'] = $months ;
|
||||
$DataPinjaman[$key2]['FIXED_RATE'] = $FixedRate ? $FixedRate->FIXED_RATE : '';
|
||||
$DataPinjaman[$key2]['MATURITY_DATE'] = $MaturityDate ? $MaturityDate->MATURITY_DATE : '' ;
|
||||
$DataPinjaman[$key2]['ACCOUNT_NUMBER'] = $pinjaman->LINKED_APPL_ID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$DataAccounts[$key1]['ACCOUNT_NUMBER'] = $account->ACCOUNT_NUMBER;
|
||||
$DataAccounts[$key1]['OPENING_DATE'] = $account->OPENING_DATE;
|
||||
$DataAccounts[$key1]['BATCH_DATE'] = $account->BATCH_DATE;
|
||||
$DataAccounts[$key1]['CUSTOMER_NO'] = $account->CUSTOMER_NO;
|
||||
$DataAccounts[$key1]['SHORT_NAME'] = $account->SHORT_NAME;
|
||||
$DataAccounts[$key1]['CURRENCY'] = $account->CURRENCY;
|
||||
$DataAccounts[$key1]['PRODUCT'] = $PRODUCT;
|
||||
$DataAccounts[$key1]['PRODUCT'] = $account->SHORT_TITLE;
|
||||
$DataAccounts[$key1]['COMPANY_NAME'] = $account->COMPANY_NAME;
|
||||
$DataAccounts[$key1]['WORKING_BALANCE'] = $account->WORKING_BALANCE != null ? number_format($account->WORKING_BALANCE, 2, ',', '.') : 'NIHIL';
|
||||
$DataAccounts[$key1]['MATURITY_DATE'] = '';
|
||||
@ -427,6 +373,26 @@
|
||||
|
||||
}
|
||||
|
||||
foreach ($Arrangement as $key2 => $pinjaman) {
|
||||
$MaturityDate = $Account->getMaturityDate($pinjaman->ARRANGEMENT_ID, $startDate )->first();
|
||||
$TermAmount = $Account->getTermAmount($pinjaman->ARRANGEMENT_ID,$startDate)->first();
|
||||
$FixedRate = $Account->getFixedRate($pinjaman->ARRANGEMENT_ID,$startDate)->first();
|
||||
$balance = $Account->getSingleAccount($pinjaman->LINKED_APPL_ID,$startDate)->first();
|
||||
|
||||
|
||||
$DataPinjaman[$key2]['ARRANGEMENT_ID'] = $pinjaman->ARRANGEMENT_ID;
|
||||
$DataPinjaman[$key2]['START_DATE'] = $pinjaman->START_DATE;
|
||||
$DataPinjaman[$key2]['CURRENCY'] = $pinjaman->CURRENCY;
|
||||
$DataPinjaman[$key2]['PRODUCT'] = $pinjaman->PRODUCT_LINE;
|
||||
$DataPinjaman[$key2]['WORKING_BALANCE'] = $balance->WORKING_BALANCE != null ? number_format( $balance->WORKING_BALANCE, 2, ',', '.') : 'NIHIL';
|
||||
$DataPinjaman[$key2]['TERM'] = $TermAmount ? $TermAmount->TERM : '' ;
|
||||
$DataPinjaman[$key2]['FIXED_RATE'] = $FixedRate ? $FixedRate->FIXED_RATE : '';
|
||||
$DataPinjaman[$key2]['MATURITY_DATE'] = $MaturityDate ? $MaturityDate->MATURITY_DATE : '' ;
|
||||
$DataPinjaman[$key2]['ACCOUNT_NUMBER'] = $pinjaman->LINKED_APPL_ID;
|
||||
}
|
||||
|
||||
// dd( $DataPinjaman);
|
||||
|
||||
|
||||
$ListLimits = $Account->getLimit($request['cusNo'],$request['startDate2'])->get();
|
||||
$fasilitas = Fasilitas::where('nomor_cif',$request['cusNo'] )->where('status',1)->get();
|
||||
@ -434,18 +400,20 @@
|
||||
$signer = Signer::where('id', $request['signerId'])->where('status',1)->get();
|
||||
$currentDate = Carbon::now();
|
||||
$tanggalIndonesia = $currentDate->locale('id')->isoFormat('D MMMM YYYY');
|
||||
$today = $currentDate->format("d-m-Y");
|
||||
$letter = new Letters;
|
||||
$infoSuratNew = $letter->where('no_cif',$request['cusNo'])->orderBy('id','DESC')->first();
|
||||
$infoSuratOld = $letter->where('no_cif',$request['cusNo'])->orderBy('id','ASC')->first();
|
||||
|
||||
$data['DataAccounts'] = $DataAccounts;
|
||||
$data['DataPinjaman'] = $DataPinjaman;
|
||||
|
||||
$data['DataLimit'] = $ListLimits;
|
||||
$data['DataFasilitas'] = $fasilitas;
|
||||
$data['DataSigner'] = $signer;
|
||||
$data['DataLimit'] = $ListLimits;
|
||||
$data['DataFasilitas']= $fasilitas;
|
||||
$data['DataSigner'] = $signer;
|
||||
$data['DataCustomer'] = $GetCustomer ?? '';
|
||||
$data['localDate'] = $tanggalIndonesia;
|
||||
$data['localDate'] = $tanggalIndonesia;
|
||||
$data['today'] = $today;
|
||||
$data['batchDate'] = $startDate->format('d-m-Y');
|
||||
$data['infoSuratOld'] = $infoSuratOld;
|
||||
$data['infoSuratNew'] = $infoSuratNew;
|
||||
|
||||
@ -653,7 +621,8 @@
|
||||
} catch (Exception $e) {
|
||||
echo json_encode(['status' => 'error', 'message' => ' Signer deleted failed.']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -96,7 +96,7 @@
|
||||
|
||||
<ul class="no-bullets">
|
||||
<li>Nomor : {{$data['infoSuratOld']['no_surat']}}</li>
|
||||
<li>Tanggal : {{ Carbon\Carbon::parse($data['infoSuratOld']['tgl_surat'])->format('d-m-Y') }}</li>
|
||||
<li>Tanggal : {{ $data['today'] }}</li>
|
||||
</ul><br>
|
||||
<ul class="no-bullets">
|
||||
<li>Kepada Yth</li>
|
||||
@ -112,7 +112,7 @@
|
||||
</ul><br>
|
||||
<ul class="no-bullets">
|
||||
<li>SIMPANAN NASABAH YANG BERSANGKUTAN PADA BANK</li>
|
||||
<li>POSISI : {{ Carbon\Carbon::parse($data['infoSuratNew']['tgl_req_surat'])->format('d-m-Y') }} </li>
|
||||
<li>POSISI : {{ $data['batchDate'] }} </li>
|
||||
</ul>
|
||||
|
||||
<table style="width:100%;" class="space1" >
|
||||
@ -159,7 +159,7 @@
|
||||
|
||||
<ul class="no-bullets">
|
||||
<li>PINJAMAN YANG DIBERIKAN OLEH BANK KEPADA NASABAH</li>
|
||||
<li>POSISI : {{ Carbon\Carbon::parse($data['infoSuratNew']['tgl_req_surat'])->format('d-m-Y') }} </li>
|
||||
<li>POSISI : {{ $data['batchDate'] }} </li>
|
||||
</ul>
|
||||
<table class="space1" style="width:100%;">
|
||||
<thead style="background-color: dimgrey">
|
||||
@ -204,7 +204,7 @@
|
||||
|
||||
<ul class="no-bullets">
|
||||
<li>FASILITAS LAIN YANG DITERIMA OLEH NASABAH</li>
|
||||
<li>POSISI : {{ Carbon\Carbon::parse($data['infoSuratNew']['tgl_req_surat'])->format('d-m-Y') }} </li>
|
||||
<li>POSISI : {{ $data['batchDate'] }} </li>
|
||||
</ul>
|
||||
<table class="space1" style="width:100%;">
|
||||
<thead style="background-color: dimgrey">
|
||||
|
@ -6,9 +6,12 @@
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- CDN untuk jQuery Validation -->
|
||||
<script src="{{ asset('assets/js/jquery.validate.min.js') }}"></script>
|
||||
{{-- <script src="{{ asset('assets/js/jquery.validate.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/mammoth.browser.min.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/mammoth.browser.js') }}"></script>
|
||||
<script src="{{ asset('assets/js/mammoth.browser.js') }}"></script> --}}
|
||||
<!-- Bootstrap CSS -->
|
||||
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}" />
|
||||
<style>
|
||||
@ -64,7 +67,7 @@
|
||||
<div class="row mb-3">
|
||||
<label for="colFormLabelSm" class="col-sm-2 col-form-label col-form-label-sm">Tanggal <span style="color:red">*</span></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="date" class="form-control form-control-sm" min="{{$data['pastYear']}}" max="{{$data['currentYear']}}" name="startDate" clear id="startDate" placeholder="Tanggal Mulai">
|
||||
<input type="text" class="form-control form-control-sm datepicker" min="{{$data['pastYear']}}" max="{{$data['currentYear']}}" name="startDate" clear id="startDate" placeholder="DD/MM/YYYY" onfocus="this.type='date'" onblur="this.type='text'">
|
||||
</div>
|
||||
{{-- <div class="col-sm-1">
|
||||
<label for="colFormLabelSm" class="col-form-label col-form-label-sm">S/D</label>
|
||||
@ -106,7 +109,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="fasilitas" method="get" action="{{ route($route[0].'.fasilitas') }}">
|
||||
<form class="fasilitas" method="get" action="{{ route($route[0].'.fasilitas') }}" >
|
||||
@csrf
|
||||
<input type="hidden" style="margin-bottom: 5px" name="cus_no_fasilitas" id="cus_no_fasilitas" />
|
||||
<input type="hidden" style="margin-bottom: 5px" name="startDateFasilitas" id="startDateFasilitas" />
|
||||
@ -117,7 +120,7 @@
|
||||
Fasilitas
|
||||
</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ route($route[0].'.export') }}" target="_blank">
|
||||
<form method="POST" action="{{ route($route[0].'.export') }}" target="_blank">
|
||||
@csrf
|
||||
<input type="hidden" style="margin-bottom: 5px" name="cusNo" id="cusNo" />
|
||||
<input type="hidden" style="margin-bottom: 5px" name="accNo" id="accNo" />
|
||||
@ -250,14 +253,14 @@
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">No Req Surat</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="form-control form-control-sm " name="no_req_surat" placeholder="Nomor Permintaan Surat" value ="" required>
|
||||
<input type="text" class="form-control form-control-sm " name="no_req_surat" placeholder="No Permintaan Surat" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-4 col-form-label">Tgl Req Surat</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="date" class="form-control form-control-sm " name="tgl_req_surat" placeholder="Tanggal Permintaan Surat" required>
|
||||
<input type="text" class="form-control form-control-sm datepicker" name="tgl_req_surat" placeholder="DD/MM/YYYY" onfocus="this.type='date'" onblur="this.type='text'" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
@ -337,6 +340,8 @@
|
||||
return; // Stop form submission
|
||||
}
|
||||
|
||||
|
||||
|
||||
$('.row-none').hide();
|
||||
$('.mycheck').show();
|
||||
$('.firstrow').remove();
|
||||
|
@ -275,14 +275,14 @@
|
||||
<label for="inputName" class="col-sm-3 col-form-label">Start Date</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="date" class="form-control form-control-sm" id="startDate" name="start_date_edit"
|
||||
placeholder="Start Date">
|
||||
placeholder="DD/MM/YYYY" onfocus="this.type='date'" onblur="this.type='text'">>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="inputName" class="col-sm-3 col-form-label">End Date</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="date" class="form-control form-control-sm " id="dueDatae" name="due_date_edit"
|
||||
placeholder="Due Date">
|
||||
placeholder="DD/MM/YYYY" onfocus="this.type='date'" onblur="this.type='text'">>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
Reference in New Issue
Block a user