diff --git a/app/Http/Controllers/WTDController.php b/app/Http/Controllers/WTDController.php index dad8625..ba55b9e 100644 --- a/app/Http/Controllers/WTDController.php +++ b/app/Http/Controllers/WTDController.php @@ -20,4 +20,24 @@ class WTDController extends Controller return view('wtd.index'); } + + public function CetakSenarai(Request $request) + { + // $norujukan = $request->norujukan; + + $norujukan = json_decode($request->norujukan); + + $tuntutbaki = Http::get(config('api.url').'/admin/wtd/senarai',['norujukan' => $norujukan,'kodcaw' => $request->cawangan])->json(); + + $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'. $request->cawangan)->json(); + $cawangan_detail=$cawangan[0]; + + $current = Carbon::now(); + $tarikh_cetak = $current->toDateString(); + + // $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + // $tarikhcetakan = $myDateTime->format('d-m-Y'); + + return view('wtd.cetakan', compact('tuntutbaki','cawangan_detail','tarikh_cetak')); + } } diff --git a/resources/js/WTD/Rekod.vue b/resources/js/WTD/Rekod.vue new file mode 100644 index 0000000..d1653f9 --- /dev/null +++ b/resources/js/WTD/Rekod.vue @@ -0,0 +1,48 @@ + + + diff --git a/resources/js/WTD/SelectWTD.vue b/resources/js/WTD/SelectWTD.vue new file mode 100644 index 0000000..c7c48ea --- /dev/null +++ b/resources/js/WTD/SelectWTD.vue @@ -0,0 +1,115 @@ + + + diff --git a/resources/js/WTD/SenaraiBakiLelong.vue b/resources/js/WTD/SenaraiBakiLelong.vue index b33b963..0fddbb1 100644 --- a/resources/js/WTD/SenaraiBakiLelong.vue +++ b/resources/js/WTD/SenaraiBakiLelong.vue @@ -7,11 +7,12 @@

JUMLAH = RM {{ this.totalbaki }}

- + + Batchno: {{ this.batchno }}
- +
@@ -20,8 +21,8 @@
- - + Bil +
@@ -42,7 +43,8 @@
- + {{ i+1 }} +
@@ -77,7 +79,10 @@ export default { arraybakilelong: [], selectedNorujukan: [], allSelected: false, - boolblocksag: false + boolblocksag: false, + cawangan: 'KB2', + batchno: 0, + blockseterusnya:false, } }, props: ['bakilelong'], @@ -135,7 +140,8 @@ export default { showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', - confirmButtonText: 'Yes' + confirmButtonText: 'Yes', + allowOutsideClick: false, }).then((result) => { if (result.isConfirmed) { @@ -144,7 +150,9 @@ export default { norujukan: ref.selectedNorujukan }).then(response => { - if (response.data === 'success') { + if (response.data.status === 'success') { + this.batchno = response.data.batchno; + this.$swal( 'Berjaya!', 'Berjaya block senarai SAG!', @@ -163,36 +171,65 @@ export default { let cawangan = 'KB2'; let ref = this; - await this.$swal({ - title: 'Cetak WTD', - html: - '', - text: "cetak wtd ini?", - showCloseButton: true, - showCancelButton: true, - focusConfirm: false, - confirmButtonText: - 'Ya', - cancelButtonText: - 'Tidak', - }).then((result) => { - if (result.isConfirmed) { + if (this.selectedNorujukan.length > 0) { + await this.$swal({ + icon: 'info', + title: 'Cetak WTD', + html: "Sila tekan Cetak untuk mencetak senarai SAG yang ingin dituntut,Sila tekan Ya untuk block SAG!", + showCloseButton: true, + showCancelButton: true, + showDenyButton: true, + // focusConfirm: false, + confirmButtonText: 'Ya', + cancelButtonText: 'Tidak', + denyButtonText: `Cetak`, + confirmButtonColor: '#2ecc71', + denyButtonColor: '#f39c12', + cancelButtonColor: '#e74c3c', + allowOutsideClick: false, + }).then((result) => { + if (result.isConfirmed) { - this.blockwtd(); + this.blockwtd(); - } - }) + } else if (result.isDenied) { + // Swal.fire('Changes are not saved', '', 'info') + this.cetaksenarai(); + } + + }) + + }else{ + this.$swal( + 'Amaran!', + 'Sila pilih norujukan terlebih dahulu!', + 'warning' + ) + } }, proseswtd: function () { - this.axios.post(ref.$hostname + '/admin/wtd/process', { - kodcaw: cawangan, - norujukan: ref.selectedNorujukan - + this.axios.post(this.$hostname + '/admin/wtd/process', { + kodcaw: this.cawangan, + batch: this.batchno }).then(response => { + if (response.data == 'success') { + this.$swal( + 'Berjaya!', + 'Berjaya Simpan Wang Tak Dituntut!', + 'success' + ) + + this.blockseterusnya = true; + this.boolblocksag = false; + } }); + }, + cetaksenarai: function () { + let urldirect = window.route('wtd.cetak'); + let noruj = JSON.stringify(this.selectedNorujukan); + window.open(urldirect + '?cawangan=' + this.cawangan + '&&norujukan=' + noruj, '_blank'); } } } diff --git a/resources/js/WTD/selection.vue b/resources/js/WTD/selection.vue new file mode 100644 index 0000000..70c1c51 --- /dev/null +++ b/resources/js/WTD/selection.vue @@ -0,0 +1,13 @@ + diff --git a/resources/js/routes.js b/resources/js/routes.js index 3277cb8..3033967 100644 --- a/resources/js/routes.js +++ b/resources/js/routes.js @@ -31,6 +31,11 @@ import RekodMohon from './Permohonan/RekodMohon' import WtdPage from './WTD/wtd' +import Wtdselect from './WTD/selection' +import WtdRekod from './WTD/Rekod' +import WtdSpecific from './WTD/SelectWTD' + + @@ -67,7 +72,12 @@ export default new VueRouter({ { name: 'permohonanstatus',path: '/permohonan/status/:mohonid', component: StatusMohon }, { path: '/permohonan/rekod', component: RekodMohon }, - { path: '/wtd', component: WtdPage }, + { path: '/wtd', component: Wtdselect }, + { path: '/wtd/tambah', component: WtdPage }, + { path: '/wtd/rekod', component: WtdRekod }, + { name: '/selectwtd',path: '/wtd/select/:batchno', component: WtdSpecific }, + + ], mode: 'history' diff --git a/resources/views/wtd/cetakan.blade.php b/resources/views/wtd/cetakan.blade.php new file mode 100644 index 0000000..c2f18c6 --- /dev/null +++ b/resources/views/wtd/cetakan.blade.php @@ -0,0 +1,237 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Senarai SAG Tarikh Cetak: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) + @endphp +
+ +
+ + + + + + + + + @php $counter = 1;$totalpinjaman = 0;$totalbaki = 0; @endphp + @foreach($tuntutbaki as $index=>$item) + @php $totalpinjaman += $item['pinjaman'];$totalbaki += $item['baki']; @endphp + + + + + + + + @php $counter++; @endphp + @endforeach + + + + + + +
BilNorujukanTarikh LelongPembiayaanBaki
{{ $counter }}{{$item['norujukan']}}@php + + $myDateTime = DateTime::createFromFormat('Y-m-d', $item['t_lelong']); + $lelongdate = $myDateTime->format('d-m-Y'); + + echo($lelongdate); + + @endphp{{ number_format($item['pinjaman'],2) }}{{ number_format($item['baki'],2) }}
Jumlah{{ number_format($totalpinjaman,2) }}{{ number_format($totalbaki,2) }}
+ +
+
+ + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
diff --git a/routes/web.php b/routes/web.php index 6f7d319..21a157a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -112,6 +112,7 @@ Route::get('/permohonan/cetakanpenuh',['as'=>'permohonan.cetakanpenuh','uses'=>' //WTD Route::get('/wtd',['as'=>'wtd.index','uses'=>'App\Http\Controllers\WTDController@index']); +Route::get('/wtd/cetakan', ['as'=>'wtd.cetak','uses'=>'App\Http\Controllers\WTDController@CetakSenarai']); Route::get('{any}', function () {