diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index 16bb871..5483f24 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -801,4 +801,33 @@ class AkaunController extends Controller return view('audit.index'); } + + public function CetakSenarai(Request $request) + { + + $tarikhasal = $request->mula; + $jenistebus = $request->jenis; + + $tarikh = explode("-",$request->mula); + + $month = $tarikh[0]; + $year = $tarikh[1]; + + $laporan = Http::get(config('api.url').'/admin/audit/keuntungansebenar',[ + 'kodcaw' => $request->kodcaw, + 'year' => $year, + 'month' => $month, + 'jenistebus' => $request->jenis, + ])->json(); + + $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'. $request->kodcaw)->json(); + $cawangan_detail=$cawangan[0]; + + if($jenistebus == 'L') + { + return view('audit.cetakanexcelelong', compact('laporan','cawangan_detail','tarikhasal','jenistebus')); + }else{ + return view('audit.cetakanexcel', compact('laporan','cawangan_detail','tarikhasal','jenistebus')); + } + } } diff --git a/resources/js/Audit/Audit.vue b/resources/js/Audit/Audit.vue index 88b2f84..f758e41 100644 --- a/resources/js/Audit/Audit.vue +++ b/resources/js/Audit/Audit.vue @@ -5,8 +5,8 @@ - - + + diff --git a/resources/js/Audit/KeuntunganSebenar.vue b/resources/js/Audit/KeuntunganSebenar.vue index 0aee87d..e039311 100644 --- a/resources/js/Audit/KeuntunganSebenar.vue +++ b/resources/js/Audit/KeuntunganSebenar.vue @@ -14,15 +14,38 @@
- -
- + +
+ +
Bulan - - +
+ +
+
+ + +
+ +
+ + +
+ +
+ + +
+
+ + +
+ + +
@@ -40,6 +63,7 @@ export default { data() { return { mula: null, + selected: 'T', config: { wrap: false, // set wrap to true only when using 'input-group' maxDate: 'today', @@ -53,6 +77,17 @@ export default { }, } }, + methods:{ + generate: function () { + + if(this.mula !== null) + { + let urldirect = window.route('audit.cetak'); + window.open(urldirect + '?kodcaw=' + this.$kodcaw + '&&jenis=' + this.selected + '&&mula=' + this.mula, '_blank'); + } + + }, + }, } diff --git a/resources/views/audit/cetakanexcel.blade.php b/resources/views/audit/cetakanexcel.blade.php new file mode 100644 index 0000000..e2ec015 --- /dev/null +++ b/resources/views/audit/cetakanexcel.blade.php @@ -0,0 +1,262 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
Senarai Keuntungan Sebenar Tarikh Cetak: + {{ $tarikhasal }} +
+ +
+ + + + + + + + + + + @php $counter = 1;$totalpinjaman = 0;$totalbaki = 0; @endphp + @foreach($laporan as $index=>$item) + @php + if($jenistebus === 'T') + $totalbaki += $item['keuntungan_rebet']; + else + $totalbaki += $item['bayaran_keuntungan']; + @endphp + + + + + + + + + + @php $counter++; @endphp + @endforeach + + + + @if($jenistebus === 'T') + + + @else + + + @endif + +
BilNo ICNorujukanBayaran KeuntunganKeuntungan RebetCawangantrans_type
{{ $counter }}{{ $item['nokp'] }}{{ $item['norujukan'] }}{{ $item['bayaran_keuntungan'] }}{{ $item['keuntungan_rebet'] }}{{ $item['kodcaw'] }}{{ $item['trans_type'] }}
Jumlah{{ $totalbaki }}{{ $totalbaki }}
+ +
+
+ + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
+ + + + + + diff --git a/resources/views/audit/cetakanexcelelong.blade.php b/resources/views/audit/cetakanexcelelong.blade.php new file mode 100644 index 0000000..b933798 --- /dev/null +++ b/resources/views/audit/cetakanexcelelong.blade.php @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
Senarai Keuntungan Sebenar Tarikh Cetak: + {{ $tarikhasal }} +
+ +
+ + + + + + + + @php $counter = 1;$totalbaki = 0; @endphp + @foreach($laporan as $index=>$item) + @php + $totalbaki += $item['bakiupah']; + @endphp + + + + + + + @php $counter++; @endphp + @endforeach + + + + + + +
BilNorujukanTarikh LelongBaki Upah
{{ $counter }}{{ $item['norujukan'] }}{{ $item['t_lelong'] }}{{ $item['bakiupah'] }}
Jumlah{{ $totalbaki }}
+ +
+
+ + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
+ + + + + + diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 3268026..1569251 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -135,7 +135,7 @@ @auth - roles }} route={{ (Route::is('home') || Route::is('akaun.home')) ? 'ada' : 'tiada' }} akaun={{ (Route::is('akaun.home') ? 'yes' : 'no')}}> + roles }} route={{ (Route::is('home') || Route::is('akaun.home') || Route::is('audit.index')) ? 'ada' : 'tiada' }} akaun={{ ((Route::is('akaun.home') || Route::is('audit.index')) ? 'yes' : 'no')}}> @endauth diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index aac9658..732bef4 100644 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -206,6 +206,17 @@ @elseif(Auth::user()->roles == 'akaun') + +
  • +
    + + + + Audit +
    +
  • +
    +
  • diff --git a/routes/web.php b/routes/web.php index a2e78ca..03be85d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -116,6 +116,8 @@ Route::get('/wtd/cetakan', ['as'=>'wtd.cetak','uses'=>'App\Http\Controllers\WTDC //Audit Route::get('/audit',['as'=>'audit.index','uses'=>'App\Http\Controllers\AkaunController@AuditGenerator']); +Route::get('/audit/cetakan', ['as'=>'audit.cetak','uses'=>'App\Http\Controllers\AkaunController@CetakSenarai']); + Route::get('{any}', function () {