baki tuntut fix
This commit is contained in:
@@ -103,7 +103,9 @@ class AliranTunaiController extends Controller
|
||||
|
||||
$gadai_tebus = Http::get(config('api.url').'/api/gadaitebus/listharini/'.$auth_user['cawangan'],['tarikh' => $harini->toDateString()])->json();
|
||||
|
||||
return view('aliran_tunai.index',compact('cawangan_info','alirantunai','api_url','GT','denominasi','gadai_tebus'));
|
||||
$tuntutbaki = Http::get(config('api.url').'/api/TuntutBaki/'.$auth_user['cawangan'])->json();
|
||||
|
||||
return view('aliran_tunai.index',compact('cawangan_info','alirantunai','api_url','GT','denominasi','gadai_tebus','tuntutbaki'));
|
||||
}
|
||||
|
||||
public function alirantunaiGadai(Request $request){
|
||||
|
||||
@@ -55,7 +55,59 @@ class LelongController extends Controller
|
||||
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
|
||||
return view('print.resit_tuntutbaki', compact('cawangan_detail','api_url'));
|
||||
$lelong=Http::get(config('api.url').'/api/TuntutBaki/resit/' . $auth_user['cawangan'] . '/' . $norujukan)->json();
|
||||
|
||||
return view('print.resit_tuntutbaki', compact('cawangan_detail','api_url','lelong'));
|
||||
|
||||
}
|
||||
|
||||
public function transaksituntutbaki(Request $request){
|
||||
|
||||
$auth_user = Auth::user();
|
||||
|
||||
$tuntutbaki = Http::post(config('api.url') . '/api/Tuntutbakisimpan/' . $auth_user['cawangan'], [
|
||||
'batchno' => $request->batchno,
|
||||
'jenis' => $request->jenis,
|
||||
'norujukan' => $request->norujukan,
|
||||
'teller' => $request->teller,
|
||||
'bakipjm' => $request->bakipjm,
|
||||
'bakiupah' => $request->bakiupah,
|
||||
'cajlain' => $request->cajlain,
|
||||
'cajlelong' => $request->cajlelong,
|
||||
'jumlah' => $request->jumlah,
|
||||
'nowakil' => $request->nowakil,
|
||||
'hargajual' => $request->hargajual
|
||||
])->json();
|
||||
|
||||
$updatetuntutbaki = Http::put( config('api.url').'/api/tuntutbakiupdate/' . $auth_user['cawangan'] . '/' . $request->norujukan);
|
||||
|
||||
$getTunai2=Http::get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $request->teller])->json();
|
||||
|
||||
$keluar = $getTunai2['keluar'];
|
||||
$baki = $getTunai2['baki'];
|
||||
$masuk = $getTunai2['masuk'];
|
||||
$bakiawal = $getTunai2['bakiawal'];
|
||||
$pendahuluan = $getTunai2['tambah'];
|
||||
$serahan = $getTunai2['kurang'];
|
||||
|
||||
$bakiakhir = $baki;
|
||||
|
||||
$bakiakhir -= $request->jumlah;
|
||||
|
||||
|
||||
//masuk dalam tunai aliran
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => $request->teller,
|
||||
'keluar' => $keluar,
|
||||
'masuk' => $masuk,
|
||||
'bakiakhir' => $bakiakhir
|
||||
]);
|
||||
|
||||
if($updatetuntutbaki)
|
||||
{
|
||||
return response('Berjaya');
|
||||
}else{
|
||||
return response('Gagal');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,8 +134,8 @@
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Masa</th>
|
||||
<th>Debit</th>
|
||||
<th>Kredit</th>
|
||||
<th>Debit (RM)</th>
|
||||
<th>Kredit (RM)</th>
|
||||
<th>Nota</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -149,8 +149,8 @@
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Pinjaman</th>
|
||||
<th>Nilai Marhun</th>
|
||||
<th>Pinjaman (RM)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
<th>Jenis Transaksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -181,12 +181,30 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Masa</th>
|
||||
<th>Debit</th>
|
||||
<th>Kredit</th>
|
||||
<th>Nota</th>
|
||||
<th>Tarikh</th>
|
||||
<th>Caj Lelong (RM)</th>
|
||||
<th>Jumlah (RM)</th>
|
||||
<th>Jenis</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(is_object($tuntutbaki) || is_array($tuntutbaki))
|
||||
@foreach($tuntutbaki as $tb)
|
||||
<tr>
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td> {{ $tb['tarikh'] }} </td>
|
||||
<td> {{ $tb['cajlelong'] }} </td>
|
||||
<td> {{ $tb['jumlah'] }} </td>
|
||||
<td> @php if($tb['jenis'] == 'T'){
|
||||
echo '<h4><span class="badge badge-success">Baki Lelong</span></h4>';
|
||||
}else{
|
||||
echo '<h4><span class="badge badge-danger">Rugi Lelong</span></h4>';
|
||||
}
|
||||
@endphp </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
HARGA JUAL (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['hargajual'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="hargajual" value="{{ number_format($lelong['hargajual'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
PEMBIAYAAN (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['pinjaman'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="pembiayaan" value="{{ number_format($lelong['pinjaman'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
BATCH LELONG
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ $lelong['batchno'] }}" class="form-control" readonly/>
|
||||
<input type="text" id="batch" value="{{ $lelong['batchno'] }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
KEUNTUNGAN (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['bakiupah'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="keuntungan" value="{{ number_format($lelong['bakiupah'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
CAJ LELONG (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['cajlelong'],2) }}" class="form-control" readonly/>
|
||||
<input type="text" id="cajlelong" value="{{ number_format($lelong['cajlelong'],2) }}" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
JUMLAH (RM)
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" value="{{ number_format($lelong['baki'],2) }}" id="jumlah" class="form-control" readonly/>
|
||||
<input type="text" id="jumlah" value="{{ number_format($lelong['baki'],2) }}" id="jumlah" class="form-control" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -200,13 +200,58 @@
|
||||
function bayarantuntubaki()
|
||||
{
|
||||
let norujukan = $('#norujukan').val();
|
||||
let api = "{{ config('api.url') }}";
|
||||
let nowakil = 0;
|
||||
let jenis = '';
|
||||
|
||||
console.log(norujukan);
|
||||
if($("input[name='radlelong']:checked").val() == 'baki')
|
||||
{
|
||||
jenis = 'T';
|
||||
}else{
|
||||
jenis = 'B';
|
||||
}
|
||||
|
||||
|
||||
let batchno = $('#batch').val();let teller = "{{ Auth::user()->name }}";let bakipjm = $('#pembiayaan').val();let bakiupah = $('#keuntungan').val();
|
||||
let cajlain = 0.00; let cajlelong = $('#cajlelong').val();
|
||||
let jumlah = $('#jumlah').val();let hargajual = $('#hargajual').val();
|
||||
|
||||
|
||||
$.ajax({
|
||||
method: 'put',
|
||||
url: "{{ route('lelong.tuntutbaki') }}",
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
'batchno' : batchno,
|
||||
'jenis' : jenis,
|
||||
'norujukan' : norujukan,
|
||||
'teller' : teller,
|
||||
'bakipjm' : bakipjm,
|
||||
'bakiupah' : bakiupah,
|
||||
'cajlain' : cajlain,
|
||||
'cajlelong' : cajlelong,
|
||||
'jumlah' : jumlah,
|
||||
'nowakil' : nowakil,
|
||||
'hargajual' : hargajual
|
||||
},
|
||||
success:function(data){
|
||||
let urlroute = '{{ route("resit.tuntutbaki", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
Swal.fire(
|
||||
'Berjaya!',
|
||||
'Tuntut Baki Berjaya',
|
||||
'success'
|
||||
) .then(function() {
|
||||
window.open(urlroute, '_blank');
|
||||
window.location.replace("{{ route('customer_info') }}");
|
||||
})
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
let urlroute = '{{ route("resit.tuntutbaki", ":id") }}';
|
||||
urlroute = urlroute.replace(':id', norujukan);
|
||||
|
||||
window.open(urlroute, '_blank');
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
#details td, #details th {
|
||||
|
||||
padding: 20px;
|
||||
padding: 10px;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $cawangan_detail['alamat1'] }}</td>
|
||||
<td>No Resit : <span></span></td>
|
||||
<td>No Resit : <span>{{ $lelong['recno'] }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ $cawangan_detail['alamat2']}}</td>
|
||||
@@ -170,13 +170,12 @@
|
||||
<br>
|
||||
|
||||
|
||||
|
||||
<table id="scan">
|
||||
<tr>
|
||||
<td>Batch No Lelongan : <span></span></td>
|
||||
<td>Batch No Lelongan : <span>{{ $lelong['batchno'] }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tarikh Lelongan : <span></span></td>
|
||||
<td>Tarikh Lelongan : <span>{{ $lelong['t_lelong'] }}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
@@ -195,62 +194,62 @@
|
||||
<table id="details" style="width:70%;border:1px solid black;">
|
||||
<tr>
|
||||
<th>No Rujukan Surat Gadai</th>
|
||||
<th>012334</th>
|
||||
<td>{{ $lelong['norujukan'] }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Nama Pemilik</th>
|
||||
<th>Siti Aminah</th>
|
||||
<td>{{ $lelong['nama'] }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>No K/P</th>
|
||||
<th>892322232</th>
|
||||
<td>{{ $lelong['kpbaru'] }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Tarikh</th>
|
||||
<th>03-12-2020</th>
|
||||
<td>{{ $lelong['tarikh'] }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr style="border-top:1px solid black;">
|
||||
<th>Nama wakil</th>
|
||||
<th></th>
|
||||
<td></td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr style="border-bottom:1px solid black;">
|
||||
<th>No K/P</th>
|
||||
<th></th>
|
||||
<td></td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Harga Lelongan</th>
|
||||
<th>1,930.00</th>
|
||||
<td>RM {{ number_format($lelong['hargajual'],2) }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Pembiayaan</th>
|
||||
<th>1,200.00</th>
|
||||
<td>RM {{ number_format($lelong['pinjaman'],2) }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Baki Keuntungan</th>
|
||||
<th>198.00</th>
|
||||
<td>RM {{ number_format($lelong['bakiupah'],2) }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Caj Lelong</th>
|
||||
<th>57.90</th>
|
||||
<td>RM {{ number_format($lelong['cajlelong'],2) }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Lebihan Lelongan</th>
|
||||
<th>4474.10</th>
|
||||
<td>RM {{ number_format($lelong['jumlah'],2) }}</td>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Jumlah Bayaran</th>
|
||||
<th><b>RM 474.10</b></th>
|
||||
<td><b>RM {{ number_format($lelong['jumlah'],2) }}</b></td>
|
||||
<th></th>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -261,6 +260,8 @@
|
||||
<td>Nota: Pastikan No Kad Pengenalan Surat Akuan Gadaian dan Tandatangan. Sila ambil cop sekiranya surat gadai hilang/tidak dibawa manakala wakil diminta Tandatangan dan Cop Jari.</td>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<table id="sign">
|
||||
|
||||
@@ -151,6 +151,10 @@ Route::get('/getkelulu',['as'=>'teller.getkelulusan','uses'=>'GadaianController@
|
||||
Route::post('/createkelulu',['as'=>'teller.createkelulusan','uses'=>'GadaianController@createkelulusan'])->middleware('auth');
|
||||
Route::put('/updatekelulu',['as'=>'teller.updatekelulusan','uses'=>'GadaianController@updatekelulusan'])->middleware('auth','khazanah');
|
||||
|
||||
|
||||
//Tuntut Baki
|
||||
Route::put('/simpantuntutbaki',['as'=>'lelong.tuntutbaki','uses'=>'LelongController@transaksituntutbaki'])->middleware('auth','teller');
|
||||
|
||||
//Laporan Baru
|
||||
Route::get('/laporan/lelongan',['as'=>'laporan.lelongan','uses'=>'KhazanahController@laporanLelongan'])->middleware('auth','khazanah');
|
||||
Route::post('laporan/lelongan/cetak',['as'=>'lelongan.laporancetak','uses'=>'KhazanahController@cetaklaporanLelongan'])->middleware('auth','khazanah');
|
||||
|
||||
Reference in New Issue
Block a user