diff --git a/Entities/Arrangement.php b/Entities/Arrangement.php new file mode 100644 index 0000000..00d0664 --- /dev/null +++ b/Entities/Arrangement.php @@ -0,0 +1,52 @@ +hasMany('Modules\Konfirmasibank\Entities\Account'); + // } + +// public function accounts(): belongsTo +// { +// return $this->belongsTo('Modules\Konfirmasibank\Entities\Account', 'ACCOUNT_NUMBER'); +// } + + + + public function account(): BelongsTo + { + return $this->belongsTo(Account::class, 'ACCOUNT_NUMBER'); + } + + +} \ No newline at end of file diff --git a/Entities/ViewAccount.php b/Entities/ViewAccount.php index 61c90f9..3eb2522 100644 --- a/Entities/ViewAccount.php +++ b/Entities/ViewAccount.php @@ -39,7 +39,7 @@ class ViewAccount extends Model ]; public function getSearchAccount($cif ,$arrAccount, $kodecabang, $startDate){ - // dd($cif ,$arrAccount, $kodecabang, $startDate); + // dd($cif ,$arrAccount, $kodecabang, $startDate); $uppercaseKodeCabang = Str::upper($kodecabang); $data = []; diff --git a/Http/Controllers/KonfirmasiBankController.php b/Http/Controllers/KonfirmasiBankController.php index e354ff0..b7bbbe6 100644 --- a/Http/Controllers/KonfirmasiBankController.php +++ b/Http/Controllers/KonfirmasiBankController.php @@ -19,8 +19,16 @@ use Dompdf\Dompdf; use Dompdf\Options; use Carbon\Carbon; + use PhpOffice\PhpWord\PhpWord; + use PhpOffice\PhpWord\IOFactory; + use PhpOffice\PhpWord\Element\Table; + use PhpOffice\PhpWord\SimpleType\TblWidth; + use PhpOffice\PhpWord\Element\Section; + use Response; + use Exception; use Illuminate\Support\Facades\View; use Illuminate\Support\Facades\Validator; + use Illuminate\Support\Facades\Storage; use Modules\Konfirmasibank\Http\Requests\Fasilitas\StoreFasilitasRequest; class KonfirmasiBankController extends Controller { @@ -53,13 +61,15 @@ $pastYear = $today->subYear(3)->format('Y'); $signer = Signer::where('status',1)->get(); + $company = Company::all(); $data['currentYear'] = $currentYear; $data['pastYear'] = $pastYear; $data['signer'] = $signer; + $data['company'] = $company; // dd($data); - return view('konfirmasibank::pages.index',compact('data')); + return view('konfirmasibank::pages.index',compact('data','request')); } @@ -77,7 +87,7 @@ $Account = new ViewAccount; $arrAccount = []; $startDate = Carbon::parse($request->startDate); - $dateCore = $startDate->subDays(2)->format('m/d/Y'); + $dateCore = $startDate->subDays(2)->format('m/d/Y'); $Accounts = $Account->getSearchAccount($request->cif,$arrAccount,$request->kodecabang, $dateCore)->get(); @@ -136,9 +146,10 @@ $AAID= ''; foreach ($listAccount as $key1 => $account) { //$Arrangement = $ViewAccount->getAAaccount($account->CUSTOMER_NO,$account->ACCOUNT_NUMBER); - // $Arrangement = $ViewAccount->getAAaccount($request['cus_no'] , $account->ACCOUNT_NUMBER)->first(); + $Arrangement = $ViewAccount->getAAaccount($request['cus_no'] , $account->ACCOUNT_NUMBER)->first(); $DataAccounts[$key1]['ACCOUNT_NUMBER'] = $account->ACCOUNT_NUMBER; + $DataAccounts[$key1]['OPENING_DATE'] = $account->OPENING_DATE; $DataAccounts[$key1]['CUSTOMER_NO'] = $account->CUSTOMER_NO; $DataAccounts[$key1]['SHORT_NAME'] = $account->SHORT_NAME; $DataAccounts[$key1]['CURRENCY'] = $account->CURRENCY; @@ -192,10 +203,178 @@ // Keluarkan file PDF ke browser $dompdf->stream('"Konfirmasi_bank_"'.$data['DataCustomer']->SHORT_NAME.'"'. $currentDate.'".pdf"'); - return response()->download($pdf); + return response()->download($dompdf); } + public function exportWord2(Request $request){ + + if (is_null($this->user) || !$this->user->can('konfirmasibank.report')) { + abort(403, 'Sorry !! You are Unauthorized to view any master data !'); + } + + + $arrAccount = explode("," , $request['acc_no']); + $startDate = Carbon::parse($request['startDate']); + $dateCore = $startDate->subDays(2); + + + $ViewAccount = new ViewAccount; + $data = []; + $DataAccounts = []; + $DataPinjaman = []; + $DataLimit = []; + $DataAA = []; + + $listAccount = $ViewAccount->getAccount($request['cus_no'],$arrAccount,$request['kode_cabang'], $dateCore)->get(); + + $GetCustomer = $ViewAccount->getCustomer($request['cus_no'])->first(); + + // dd( $Arrangement); + + $MaturityDate = ''; + $product = ''; + $AAID= ''; + foreach ($listAccount as $key1 => $account) { + //$Arrangement = $ViewAccount->getAAaccount($account->CUSTOMER_NO,$account->ACCOUNT_NUMBER); + $Arrangement = $ViewAccount->getAAaccount($request['cus_no'] , $account->ACCOUNT_NUMBER)->first(); + + + $DataAccounts[$key1]['ACCOUNT_NUMBER'] = $account->ACCOUNT_NUMBER; + $DataAccounts[$key1]['COMPANY_NAME'] = $account->COMPANY_NAME; + $DataAccounts[$key1]['SHORT_NAME'] = $account->SHORT_NAME; + // $DataAccounts[$key1]['CUSTOMER_NO'] = $account->CUSTOMER_NO; + $DataAccounts[$key1]['CURRENCY'] = $account->CURRENCY; + // $DataAccounts[$key1]['PRODUCT'] = $Arrangement->PRODUCT ?? 'NIHIL'; + $DataAccounts[$key1]['WORKING_BALANCE'] = $account->WORKING_BALANCE; + // $DataAccounts[$key1]['ARRANGEMENT_ID'] = $Arrangement->ARRANGEMENT_ID ?? 'NIHIL'; + $DataAccounts[$key1]['TERM'] = $Arrangement->TERM ?? 'NIHIL'; + $DataAccounts[$key1]['FIXED_RATE'] = $Arrangement->FIXED_RATE ?? 'NIHIL'; + $DataAccounts[$key1]['OPENING_DATE'] = $account->OPENING_DATE; + $DataAccounts[$key1]['MATURITY_DATE'] = $Arrangement->MATURITY_DATE ?? 'NIHIL' ; + + } + + $ListPinjaman =$ViewAccount->getPinjaman($request['cus_no'],$arrAccount , $dateCore )->get(); + foreach ($ListPinjaman as $key2 => $pinjaman) { + //$Arrangement = $ViewAccount->getAAaccount($request['cus_no'] , $account->ACCOUNT_NUMBER)->first(); + + $DataPinjaman[$key2]['JENIS_PINJAMAN'] = $pinjaman->PRODUCT_LINE; + $DataPinjaman[$key2]['TGL_REALISASI'] = $pinjaman->START_DATE; + $DataPinjaman[$key2]['SALDO'] = $pinjaman->WORKING_BALANCE; + $DataPinjaman[$key2]['JANGKA_WAKTU'] = $pinjaman->TERM ?? 'NIHIL'; + $DataPinjaman[$key2]['FIXED_RATE'] = $pinjaman->FIXED_RATE ?? 'NIHIL'; + $DataPinjaman[$key2]['MATURITY_DATE'] = $pinjaman->MATURITY_DATE ?? 'NIHIL' ; + $DataPinjaman[$key2]['KET'] = ''; + + } + + + // $ListLimits = $Viewpinjaman->getLimit($request['cus_no'],$request['periode']); + // $fasilitas = Fasilitas::where('nomor_cif',$request['cus_no'] )->where('status',1)->get(); + + $signer = Signer::where('id', $request['signer'])->where('status',1)->first(); + $currentDate = Carbon::now(); + $tanggalIndonesia = $currentDate->locale('id')->isoFormat('D MMMM YYYY'); + + + //You can get xml code of your table and insert it insite template + + //Create table + $document_with_table = new PhpWord(); + $section = $document_with_table->addSection(); + $table = $section->addTable(array('borderSize' => 12, 'fontSize' =>10, 'borderColor' => 'green', 'width' => 11200, 'unit' => TblWidth::TWIP)); + + //Add Tablle 1 + // Add header row with custom styling Table1 + $headerRow = $table->addRow(); + $headerRow->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Rekening'); + $headerRow->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Cabang'); + $headerRow->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Jenis Rekening'); + $headerRow->addCell(1000, ['bgColor' => 'CCCCCC'])->addText('Mata Uang'); + $headerRow->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Saldo'); + $headerRow->addCell(1000, ['bgColor' => 'CCCCCC'])->addText('Jangka Waktu'); + $headerRow->addCell(1000, ['bgColor' => 'CCCCCC'])->addText('Suku Bunga'); + $headerRow->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Tgl Realisasi'); + $headerRow->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Jatuh Tempo'); + // Add a row to the table + + + // Add data rows dynamically + foreach ($DataAccounts as $key => $rowData) { + $dataRow = $table->addRow(); + foreach ($rowData as $cellData) { + $dataRow->addCell()->addText($cellData); + } + } + + + // Membuat tabel kedua + $section->addTextBreak(1); + + + // // $section->addText(""); + // $table2 = $section->addTable(array('borderSize' => 12, 'fontSize' =>10, 'borderColor' => 'green', 'width' => 11200, 'unit' => TblWidth::TWIP)); + // $headerRow2 = $table2->addRow(); + // $headerRow2->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Rekening'); + // $headerRow2->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Cabang'); + // $headerRow2->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Jenis Rekening'); + // $headerRow2->addCell(1000, ['bgColor' => 'CCCCCC'])->addText('Mata Uang'); + // $headerRow2->addCell(2000, ['bgColor' => 'CCCCCC'])->addText('Saldo'); + // $headerRow2->addCell(1000, ['bgColor' => 'CCCCCC'])->addText('Jangka Waktu'); + // $headerRow2->addCell(1000, ['bgColor' => 'CCCCCC'])->addText('Suku Bunga'); + + // foreach ($DataPinjaman as $key2 => $rowData2) { + // $dataRow2 = $table2->addRow(); + // foreach ($rowData2 as $cellData2) { + // $dataRow2->addCell()->addText($cellData2); + // } + // } + + // Set border properties for the entire table + $table->getStyle()->setBorderSize(1); // Set border size in pt + $table->getStyle()->setBorderColor('000000'); // Set border color (black) + + // Alternatively, you can set border properties for individual cells + foreach ($table->getRows() as $row) { + foreach ($row->getCells() as $cell) { + $cell->getStyle()->setBorderSize(1); + $cell->getStyle()->setBorderColor('000000'); + } + } + + + // Create writer to convert document to xml + $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($document_with_table, 'Word2007'); + + // Get all document xml code + $fullxml = $objWriter->getWriterPart('Document')->write(); + + // Get only table xml code + $tablexml = preg_replace('/^[\s\S]*().*/', '$1', $fullxml); + + //Open template with ${table} + $template_document = new \PhpOffice\PhpWord\TemplateProcessor('konfirmasibank_template.docx'); + + // Replace mark by xml code of table + $template_document->setValues([ + 'table1'=> $tablexml, + 'street'=> $GetCustomer->ADDRESS, + 'address'=> $GetCustomer->STREET, + 'customerName'=> $GetCustomer->SHORT_NAME, + 'customerNo'=> $GetCustomer->CUSTOMER_NO, + 'director'=> $signer->deputy_director_name, + 'executiveOfficer'=> $signer->executive_officer_name, + 'date' => $tanggalIndonesia + ]); + + $template_document->saveAs("Konfirmasibank_".$currentDate->format('YmdHis').".docx"); + + return json_encode(['status' => 'success', 'message' => ' Download Surat successfully .']); + + } + + public function signer(Request $request){ if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) { abort(403, 'Sorry !! You are Unauthorized to view any master data !'); @@ -211,6 +390,184 @@ } + public function exportWord(Request $request){ + //ob_start(); + $currentDate = Carbon::now(); + $arrAccount = explode("," , $request['acc_no']); + $startDate = Carbon::parse($request['startDate']); + $dateCore = $startDate->subDays(2); + + + $ViewAccount = new ViewAccount; + $data = []; + $DataAccounts = []; + $DataPinjaman = []; + $DataLimit = []; + $DataAA = []; + + $listAccount = $ViewAccount->getAccount($request['cus_no'],$arrAccount,$request['kode_cabang'], $dateCore)->get(); + + $GetCustomer = $ViewAccount->getCustomer($request['cus_no'])->first(); + + // dd( $Arrangement); + + $MaturityDate = ''; + $product = ''; + $AAID= ''; + foreach ($listAccount as $key1 => $account) { + //$Arrangement = $ViewAccount->getAAaccount($account->CUSTOMER_NO,$account->ACCOUNT_NUMBER); + $Arrangement = $ViewAccount->getAAaccount($request['cus_no'] , $account->ACCOUNT_NUMBER)->first(); + $DataAccounts[$key1]['SHORT_NAME'] = $account->SHORT_NAME; + $DataAccounts[$key1]['OPENING_DATE'] = $account->OPENING_DATE; + $DataAccounts[$key1]['WORKING_BALANCE'] = $account->WORKING_BALANCE; + $DataAccounts[$key1]['TERM'] = $Arrangement->TERM ?? 'NIHIL'; + $DataAccounts[$key1]['FIXED_RATE'] = $Arrangement->FIXED_RATE ?? 'NIHIL'; + $DataAccounts[$key1]['MATURITY_DATE'] = $Arrangement->MATURITY_DATE ?? 'NIHIL' ; + } + + $ListPinjaman =$ViewAccount->getPinjaman($request['cus_no'],$arrAccount , $dateCore )->get(); + foreach ($ListPinjaman as $key2 => $pinjaman) { + //$Arrangement = $ViewAccount->getAAaccount($request['cus_no'] , $account->ACCOUNT_NUMBER)->first(); + $DataPinjaman[$key2]['JENIS_PINJAMAN'] = $pinjaman->PRODUCT_LINE; + $DataPinjaman[$key2]['TGL_REALISASI'] = $pinjaman->START_DATE; + $DataPinjaman[$key2]['SALDO'] = $pinjaman->WORKING_BALANCE; + $DataPinjaman[$key2]['JANGKA_WAKTU'] = $pinjaman->TERM ?? 'NIHIL'; + $DataPinjaman[$key2]['FIXED_RATE'] = $pinjaman->FIXED_RATE ?? 'NIHIL'; + $DataPinjaman[$key2]['MATURITY_DATE'] = $pinjaman->MATURITY_DATE ?? 'NIHIL' ; + $DataPinjaman[$key2]['KET'] = ''; + + } + + $signer = Signer::where('id', $request['signer'])->where('status',1)->first(); + $currentDate = Carbon::now(); + $tanggalIndonesia = $currentDate->locale('id')->isoFormat('D MMMM YYYY'); + $GetCustomer = $ViewAccount->getCustomer($request['cus_no'])->first(); + + $phpWord = new \PhpOffice\PhpWord\PhpWord(); + $section = $phpWord->addSection(array('marginLeft' => 600, 'marginRight' => 600, 'marginTop' => 2500, 'marginBottom' => 600) ); + $header = array('size' => 10, 'bold' => false); + + + $styleTable = array('borderSize' => 2, 'borderColor' => '00000'); + $styleFirstRow = array('bgColor' => 'CCCCCC','cellMargin' => 0, 'spaceBefore' => 0,'spaceAfter' => 0,'spacing' => 0); + $styleCell = array('valign' => 'center','spaceBefore' => 0,'spaceAfter' => 0,'spacing' => 0, 'bgColor' => 'CCCCCC'); + $styleCellBTLR = array('valign' => 'center', 'textDirection' => \PhpOffice\PhpWord\Style\Cell::TEXT_DIR_BTLR); + $fontStyle = array('align' => 'center', 'size' => 10, ); + + $section->addText(htmlspecialchars('NOMOR : --------------------------'), $fontStyle); + $section->addText(htmlspecialchars('TANGGAL : --------------------------'), $fontStyle); + $section->addTextBreak(1); + $section->addText(htmlspecialchars($GetCustomer->STREET), $fontStyle); + $section->addText(htmlspecialchars($GetCustomer->ADDRESS), $fontStyle); + $section->addText(htmlspecialchars('Sesuai dengan surat saudara Nomor --------------------------- tanggal ----------------------- dengan ini kami sampaikan data – data nasabah sesuai permintaan saudara sebagai berikut :'), $fontStyle); + + $section->addText(htmlspecialchars('NAMA NASABAH : '.$GetCustomer->SHORT_NAME.''), $fontStyle); + $section->addText(htmlspecialchars('NOMOR CIF : '.$GetCustomer->CUSTOMER_NO.''), $fontStyle); + $section->addTextBreak(1); + + // $phpWord->addTableStyle('Fancy Table', $styleTable, $styleFirstRow); + $section->addText(htmlspecialchars('SIMPANAN NASABAH YANG BERSANGKUTAN PADA BANK'), $header); + $section->addText(htmlspecialchars("{$tanggalIndonesia}"), $header); + $table = $section->addTable(array('borderSize' => 6, 'fontSize' =>10, 'borderColor' => 'black', 'width' => 10500, 'unit' => TblWidth::TWIP)); + $table->addRow(300); + $table->addCell(600, $styleCell)->addText(htmlspecialchars("NO"), $fontStyle, array('align' => 'center','spaceAfter'=>0)); + $table->addCell(2000, $styleCell)->addText(htmlspecialchars('JENIS REKENING'), $fontStyle,array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1500, $styleCell)->addText(htmlspecialchars('TGL REALISASI'), $fontStyle,array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1000, $styleCell)->addText(htmlspecialchars('SALDO'), $fontStyle,array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1500, $styleCell)->addText(htmlspecialchars('JANGKA WAKTU'), $fontStyle,array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1000, $styleCell)->addText(htmlspecialchars('SUKU BUNGA'), $fontStyle,array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1500, $styleCell)->addText(htmlspecialchars('TGL JT TEMPO'), $fontStyle,array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1000, $styleCell)->addText(htmlspecialchars('KET'), $fontStyle,array('align' => 'center','spaceAfter'=>0)); + $no = 1; + foreach ($DataAccounts as $key1 => $value1) { + $rupiah = $this->convertToRupiah($value1['WORKING_BALANCE']); + $table->addRow(); + $table->addCell(600)->addText(htmlspecialchars($no++), $fontStyle, array('align' => 'center','spaceAfter'=>0)); + $table->addCell(2000)->addText(htmlspecialchars(" {$value1['SHORT_NAME']}"), array('align' => 'left','spaceAfter'=>0)); + $table->addCell(1500)->addText(htmlspecialchars(" {$value1['OPENING_DATE']}"), array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1000)->addText(htmlspecialchars(" {$rupiah}"), array('align' => 'left','spaceAfter'=>0)); + $table->addCell(1500)->addText(htmlspecialchars(" {$value1['TERM']}"), array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1000)->addText(htmlspecialchars(" {$value1['FIXED_RATE']}"), array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1500)->addText(htmlspecialchars(" {$value1['MATURITY_DATE']}"), array('align' => 'center','spaceAfter'=>0)); + $table->addCell(1000)->addText(htmlspecialchars(""), array('align' => 'center','spaceAfter'=>0)); + } + + // 3. Table Pinjaman + $section->addTextBreak(1); + $section->addText(htmlspecialchars('PINJAMAN YANG DIBERIKAN BANK KEPADA NASABAH'), $header); + $section->addText(htmlspecialchars("{$tanggalIndonesia}"), $header); + $table2 = $section->addTable(array('borderSize' => 6, 'fontSize' =>10, 'borderColor' => 'black', 'width' => 10500, 'unit' => TblWidth::TWIP)); + $table2->addRow(300); + $table2->addCell(600, $styleCell)->addText(htmlspecialchars("NO"), $fontStyle, array('align' => 'center','spaceAfter'=>0)); + $table2->addCell(2000, $styleCell)->addText(htmlspecialchars('JENIS REKENING'), $fontStyle, array('align' => 'center')); + $table2->addCell(1500, $styleCell)->addText(htmlspecialchars('TGL REALISASI'), $fontStyle, array('align' => 'center')); + $table2->addCell(1000, $styleCell)->addText(htmlspecialchars('SALDO'), $fontStyle, array('align' => 'center')); + $table2->addCell(1500, $styleCell)->addText(htmlspecialchars('JANGKA WAKTU'), $fontStyle, array('align' => 'center')); + $table2->addCell(1000, $styleCell)->addText(htmlspecialchars('SUKU BUNGA'), $fontStyle, array('align' => 'center')); + $table2->addCell(1500, $styleCell)->addText(htmlspecialchars('TGL JT TEMPO'), $fontStyle, array('align' => 'center')); + $table2->addCell(1000, $styleCell)->addText(htmlspecialchars('KET'), $fontStyle, array('align' => 'center')); + $no = 1; + foreach ($DataPinjaman as $key2 => $value2) { + $rupiah = $this->convertToRupiah($value2['SALDO']); + $table2->addRow(); + $table2->addCell(600)->addText(htmlspecialchars($no++), $fontStyle, array('align' => 'center')); + $table2->addCell(1500)->addText(htmlspecialchars(" {$value2['JENIS_PINJAMAN']}"), array('align' => 'center')); + $table2->addCell(1000)->addText(htmlspecialchars(" {$value2['TGL_REALISASI']}"), array('align' => 'center')); + $table2->addCell(1500)->addText(htmlspecialchars(" {$rupiah}"), array('align' => 'right')); + $table2->addCell(1000)->addText(htmlspecialchars(" {$value2['JANGKA_WAKTU']}"), array('align' => 'center')); + $table2->addCell(1500)->addText(htmlspecialchars(" {$value2['FIXED_RATE']}"), array('align' => 'center')); + $table2->addCell(1500)->addText(htmlspecialchars(" {$value2['MATURITY_DATE']}"), array('align' => 'center')); + $table2->addCell(1000)->addText(htmlspecialchars("")); + } + //Table Signature + $section->addTextBreak(1); + $section->addText(htmlspecialchars('Demikian data ini kami sampaikan agar dapat digunakan sebagaimana mestinya'), $header); + + $signatureStyle = array('size'=>10, 'align' =>'center' ); + $table3 = $section->addTable(array('width' => 2000, 'unit' => 'pct', 'align' => 'left')); + + $table3->addRow(1000); + $table3->addCell(2000)->addText(htmlspecialchars('')); + $table3->addCell(2000)->addText(htmlspecialchars(''), $signatureStyle); + $table3->addRow(); + $table3->addCell(2000)->addText(htmlspecialchars('Frangky'), array('marginLeft' => 600,'size'=>10, )); + $table3->addCell(2000)->addText(htmlspecialchars('Sifera Officer'), $signatureStyle); + $table3->addRow(); + $table3->addCell(2000)->addText(htmlspecialchars('Director'), array('marginLeft' => 600,'size'=>10, )); + $table3->addCell(2000)->addText(htmlspecialchars('Executive Officer'), $signatureStyle); + + + $filename = 'KonfirmasiBank_'.$currentDate->format('YmdHis').'.docx'; + + // Create writer to convert document to xml + + $objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007'); + $objWriter->save($filename); + + header('Content-Description: File Transfer'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename='.$filename); + header('Content-Transfer-Encoding: binary'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + header('Content-Length: ' . filesize($filename)); + flush(); + readfile($filename); + unlink($filename); // deletes the temporary file + + + $objWriter->save($filename); + + } + + + public function convertToRupiah($amount) + { + $formattedAmount = number_format($amount, 0, ',', '.'); + return $formattedAmount; + } + public function postSigner(Request $request){ if (is_null($this->user) || !$this->user->can('konfirmasibank.create')) { @@ -522,7 +879,8 @@ $signer = Signer::findOrFail($request->id); - try { + + try { $signer->status = 0; $signer->save(); echo json_encode(['status' => 'success', 'message' => ' Signer deleted successfully.']); diff --git a/Resources/views/exportPdf.blade.php b/Resources/views/exportPdf.blade.php index bbc1823..e4e6e42 100644 --- a/Resources/views/exportPdf.blade.php +++ b/Resources/views/exportPdf.blade.php @@ -79,11 +79,11 @@
-

Nomor   : 577/SUBDIT.OPS/VIII/2023

-

Tanggal : {{ strtoupper($data['localDate']) }}


+

Nomor   : ______________________

+

Tanggal : ______________________


Kepada Yth

-

{{$data['DataCustomer']->SHORT_NAME}}

+

____________________

{{$data['DataCustomer']->STREET }}, {{str_replace(']','',$data['DataCustomer']->ADDRESS)}}

Sesuai dengan surat saudara Nomor 150/KB-SENTRA1/II/2023 tanggal {{ strtoupper($data['localDate']) }} dengan ini kami sampaikan data – data nasabah sesuai permintaan saudara sebagai berikut :

@@ -92,7 +92,7 @@

Nama Nasabah : {{$data['DataCustomer']->SHORT_NAME}}

Nomor CIF        : {{$data['DataCustomer']->CUSTOMER_NO}}


-

SIMPAMAN NASABAH YANG BERSANGKUTAN PADA BANK

+

SIMPANAN NASABAH YANG BERSANGKUTAN PADA BANK

POSISI {{ strtoupper($data['localDate']) }}

@@ -105,6 +105,7 @@ + @@ -121,6 +122,7 @@ + @@ -147,6 +149,7 @@ + @@ -164,6 +167,7 @@ + {{-- @@ -184,7 +188,7 @@
Saldo Jangka Waktu Suku BungaTgl Realisasi Tgl Jatuh Tempo
{{ $val['WORKING_BALANCE'] }} {{ $val['TERM'] }} {{ $val['FIXED_RATE'] }}{{ $val['OPENING_DATE'] }} {{ $val['MATURITY_DATE'] }}
Saldo Jangka Waktu Suku BungaTgl Realisasi Tgl Jatuh Tempo
{{ $pinjaman->WORKING_BALANCE }} {{ $pinjaman->TERM }} {{ $pinjaman->FIXED_RATE }}{{ $pinjaman->START_DATE }} {{ $pinjaman->MATURITY_DATE }}{{ $i++ }} {{ $pinjaman['PRODUCT_LINE'] }}

-

FASILITAS LAIN YANG DITERIMA OLEH NASABAH

+ {{--

FASILITAS LAIN YANG DITERIMA OLEH NASABAH

POSISI {{ strtoupper($data['localDate']) }}

@@ -197,6 +201,7 @@ + @@ -218,6 +223,7 @@ + @endforeach @@ -249,7 +255,7 @@ @endif -
Saldo Jangka Waktu Suku BungaTgl Realisasi Tgl Jatuh Tempo
{{ $limit->AVAIL_AMT }} {{ $term }} D {{ $limit->LIMIT_PERCENTAGE }}{{ $approvalDate->format('d-m-Y') }} {{ $expiryDate->format('d-m-Y')}}


+

--}}

Demikian data ini kami sampaikan agar dapat digunakan sebagaimana mestinya



diff --git a/Resources/views/pages/index.blade.php b/Resources/views/pages/index.blade.php index 8f439c9..884d4f6 100644 --- a/Resources/views/pages/index.blade.php +++ b/Resources/views/pages/index.blade.php @@ -7,6 +7,9 @@ + + +