Enable datepicker, new route for laporan aliran tunai teller
This commit is contained in:
@@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\User;
|
||||
use App\Cawangan;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Services\CustomerService;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
|
||||
class AliranTunaiController extends Controller
|
||||
@@ -599,7 +601,7 @@ class AliranTunaiController extends Controller
|
||||
return response($updateTunai);
|
||||
}
|
||||
|
||||
public function LaporanAliranTunai($teller)
|
||||
public function LaporanAliranTunai($teller, Request $request)
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
@@ -611,8 +613,6 @@ class AliranTunaiController extends Controller
|
||||
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
|
||||
$alirantunai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => $auth_user['name']])->json();
|
||||
@@ -621,11 +621,66 @@ class AliranTunaiController extends Controller
|
||||
|
||||
$teller = $auth_user['name'];
|
||||
|
||||
$lelong = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/lelong/harini/'.$auth_user['cawangan'])->json();
|
||||
|
||||
$bakiLelong = Http::withOptions(['verify' =>config('app.api_verify')])->get(config('api.url') . '/api/lelong/bakilelongbyteller'.$auth_user['cawangan'])->json();
|
||||
$bakiLelong = Http::withOptions(['verify' =>config('app.api_verify')])->get(config('api.url') . '/api/lelong/bakilelongbyteller/'.$auth_user['cawangan'],[
|
||||
'tarikh' => $request->datetimepicker1
|
||||
])->json();
|
||||
|
||||
return view('aliran_tunai.laporan.laporanalirantunai',compact('tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail','addtunai','alirantunai','teller'));
|
||||
return view('aliran_tunai.laporan.laporanalirantunai',compact('tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail','addtunai','alirantunai','teller', 'bakiLelong'));
|
||||
}
|
||||
|
||||
public function laporanAliranTunaiTeller()
|
||||
{
|
||||
$auth_user = Auth::user();
|
||||
$api_url = config('api.url');
|
||||
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
return view('khazanah.laporan.alirantunai', compact('api_url', 'cawangan_info'));
|
||||
}
|
||||
|
||||
public function cetakLaporanAliranTunaiTeller(Request $request)
|
||||
{
|
||||
$api_url = config('api_url');
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
if($request->datetimepicker1 == null){
|
||||
$tarikh = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-',$request->datetimepicker1);
|
||||
$tarikh = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
}
|
||||
|
||||
$cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
$addtunai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getAddTunai/' . $auth_user['cawangan'] . '/kodlaluan/',['kodlaluan' => $auth_user['name']])->json();
|
||||
|
||||
$teller = $auth_user['name'];
|
||||
|
||||
$bakiLelong = Http::withOptions(['verify' =>config('app.api_verify')])->get(config('api.url') . '/api/lelong/bakilelongbyteller/'.$auth_user['cawangan'],[
|
||||
'tarikh' => $tarikh_cetak
|
||||
])->json();
|
||||
|
||||
$tunai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getTunaiByTarikh/',[
|
||||
'kodlaluan' => $auth_user['name'],
|
||||
'kodcaw' => $auth_user['cawangan'],
|
||||
'tarikh' => $tarikh
|
||||
])->json();
|
||||
|
||||
if(!$tunai)
|
||||
{
|
||||
return redirect()->back()->with('errormessage', 'Tiada data pada tarikh tersebut.');
|
||||
}
|
||||
|
||||
$jumlahTambah = $tunai['tambah'] + $tunai['masuk'] + $bakiLelong['rugi_lelong'];
|
||||
$jumlahTolak = $tunai['kurang'] + $tunai['keluar'] + $bakiLelong['baki_lelong'];
|
||||
|
||||
return view('aliran_tunai.laporan.laporanalirantunai',compact('tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail','addtunai','tunai','teller', 'bakiLelong', 'jumlahTambah', 'jumlahTolak'));
|
||||
}
|
||||
|
||||
public function LaporanTunaiTeller(Request $request){
|
||||
|
||||
@@ -558,15 +558,12 @@
|
||||
|
||||
function cetaklaporanalirantunai()
|
||||
{
|
||||
let teller = "{{ Auth::user()->name }}";
|
||||
|
||||
let urlroute = '{{ route("laporan.alirantunai", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', teller);
|
||||
|
||||
window.open(urlroute, '_blank');
|
||||
|
||||
let urlroute = '{{ route("laporan.alirantunai") }}';
|
||||
|
||||
window.location.href = urlroute;
|
||||
}
|
||||
|
||||
|
||||
function cetakserahankeseluruhan()
|
||||
{
|
||||
let urlroute = '{{ route("laporan.serahanteller") }}';
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:10px"> <b>TARIKH</b></td>
|
||||
<td>{{ $alirantunai['tarikh'] }}</td>
|
||||
<td><b>{{ $tunai['tarikh'] }}</b></td>
|
||||
<td style="width:50px">
|
||||
</td>
|
||||
<td> </td>
|
||||
@@ -194,76 +194,64 @@
|
||||
<tr>
|
||||
<td>Baki Awal</td>
|
||||
<td>:</td>
|
||||
<td>RM {{ number_format($alirantunai['bakiawal'],2) }}</td>
|
||||
<td>RM {{ number_format($tunai['bakiawal'],2) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>TAMBAH</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pendahuluan Kepada Teller</td>
|
||||
<td>Pendahuluan</td>
|
||||
<td>:</td>
|
||||
<td>RM {{ number_format($alirantunai['tambah'],2) }}</td>
|
||||
<td>RM {{ number_format($tunai['tambah'],2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pen. Pembiayaan / Keuntungan</td>
|
||||
<td>:</td>
|
||||
<td>RM {{ number_format($alirantunai['masuk'],2) }}</td>
|
||||
<td>RM {{ number_format($tunai['masuk'],2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kerugian Baki Lelong</td>
|
||||
<td>:</td>
|
||||
{{-- <td>RM {{ number_format($petibesi['totpanjar'],2) }}</td> --}}
|
||||
<td>RM {{ number_format($bakiLelong['rugi_lelong'],2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jumlah</td>
|
||||
<td>:</td>
|
||||
{{-- <td>RM {{ number_format($petibesi['totpanjar'],2) }}</td> --}}
|
||||
<td>RM {{ number_format($jumlahTambah,2) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>TOLAK</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Serahan Daripada Teller</td>
|
||||
<td>Serahan</td>
|
||||
<td>:</td>
|
||||
{{-- <td>RM {{ number_format($petibesi['masuk'],2) }}</td> --}}
|
||||
<td>RM {{ number_format($tunai['kurang'],2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pembiayaan</td>
|
||||
<td>:</td>
|
||||
<td>RM {{ number_format($alirantunai['keluar'],2) }}</td>
|
||||
<td>RM {{ number_format($tunai['keluar'],2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Baki Lelong</td>
|
||||
<td>:</td>
|
||||
{{-- <td>RM {{ number_format($petibesi['pendahuluan'],2) }}</td> --}}
|
||||
<td>RM {{ number_format($bakiLelong['baki_lelong'],2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jumlah</td>
|
||||
<td>:</td>
|
||||
{{-- <td>RM {{ number_format($petibesi['pendahuluan'],2) }}</td> --}}
|
||||
<td>RM {{ number_format($jumlahTolak,2) }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>BAKI AKHIR</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Baki Akhir</td>
|
||||
<td>:</td>
|
||||
{{-- <td>RM {{ number_format($petibesi['bakiakhir'],2) }}</td> --}}
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Baki Akhir Teller</td>
|
||||
<td>:</td>
|
||||
<td>RM 0.00</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th>Baki Dibawa Kedepan </th>
|
||||
<th>:</th>
|
||||
{{-- <th>RM {{ number_format($petibesi['bakieod'],2) }}</th> --}}
|
||||
<td>RM {{ number_format($tunai['bakiawal'] +$jumlahTambah + $jumlahTolak,2) }}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Aliran Tunai</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
@if(session()->has('errormessage'))
|
||||
<div class="alert alert-danger">
|
||||
{{ session()->get('errormessage') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card-body text-center">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-2">
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-5">
|
||||
<form action="{{ route('alirantunai.laporancetak') }}" method="post">
|
||||
@csrf
|
||||
<div class="input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text" id="basic-addon1">Tarikh</span>
|
||||
</div>
|
||||
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetimepicker1" name="datetimepicker1" aria-describedby="basic-addon1">
|
||||
<input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var api_url = "<?php echo $api_url ?>";
|
||||
var kodcaw = "<?php echo $cawangan_info['kodcaw'] ?>";
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#datetimepicker1').datepicker({
|
||||
format: 'dd-mm-yyyy'
|
||||
});
|
||||
});
|
||||
|
||||
var tablecustomers = $('#myTable').DataTable({
|
||||
"ordering": false
|
||||
});
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@@ -112,6 +112,10 @@ Route::get('/firstwakil',['as'=>'wakil.first','uses'=>'PenebusanController@getfi
|
||||
Route::get('/history',['as'=>'gadai.history','uses'=>'GadaianController@history'])->middleware('auth','teller');
|
||||
Route::get('/history/khazanah',['as'=>'gadai.history.khazanah','uses'=>'GadaianController@history'])->middleware('auth','khazanah');
|
||||
|
||||
//Laporan Aliran Tunai Teller
|
||||
Route::get('/laporan/alirantunai', ['as' => 'laporan.alirantunai', 'uses'=> 'AliranTunaiController@laporanAliranTunaiTeller'])->middleware('auth','teller');
|
||||
Route::post('laporan/alirantunai/cetak', ['as' => 'alirantunai.laporancetak', 'uses' => 'AliranTunaiController@cetakLaporanAliranTunaiTeller'])->middleware('auth', 'teller');
|
||||
|
||||
//Kemaskini Upah
|
||||
Route::get('/kemaskiniupah',['as'=>'kemaskini.upah','uses'=>'AliranTunaiController@kemaskiniupah'])->middleware('auth','teller');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user