Merge branch 'pipi' into 'master'

change ui

See merge request online-sistem1/kaunter!35
This commit is contained in:
hafifie rahman
2021-01-10 02:33:09 +00:00
6 changed files with 62 additions and 16 deletions
@@ -83,6 +83,21 @@ class GadaianController extends Controller
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
return view('gadaian.edit',compact('customer_info','limit_pinjaman_semasa','cawangan_info','norujukan','api_url'));
}
public function editmarhun(Request $request){
$api_url = config('api.url');
$auth_user = Auth::user();
$gadaiannorujukan = Http::put(config('api.url') . '/api/gadai/edit/marhun/'. $auth_user['cawangan'] . '/' . $request->norujukan,[
"marhun" => $request->marhun
])->json();
return $gadaiannorujukan;
}
public function store(Request $request){
$auth_user = Auth::user();
+28 -2
View File
@@ -56,6 +56,7 @@
<th>Karat</th>
<th>Berat</th>
<th>Nota</th>
<th>Action</th>
</tr>
</thead>
</table>
@@ -137,7 +138,7 @@
<input type="text" name="kadarkeuntungan" id="kadarkeuntungan" value="" hidden>
<input type="text" name="kuantiti_marhun" id="kuantiti_marhun" value="" hidden>
<input type="text" name="total_nilai_marhun" id="total_nilai_marhun" value="" hidden>
<a href="{{ url()->previous() }}" class="float-right btn btn-danger mr-2">Batal</a>
<a href="{{ route('gadai.batal',['norujukan'=>$norujukan]) }}" class="float-right btn btn-danger mr-2">Batal</a>
<input type="submit" name="terima_gadai" id="terima_gadai" class="float-right btn btn-primary mr-2" value="Terima">
</div>
</div>
@@ -337,7 +338,8 @@
'RM ' + formatter.format(marhun_detail['n_marhun']),
marhun_detail['karat'],
formatter.format(marhun_detail['berat']),
marhun_detail['nota']
marhun_detail['nota'],
"<button onclick='deletemarhun(this)' class='btn btn-danger'><i class='fas fa-trash-alt'></i></button>"
]).draw();
counter = counter + 1;
});
@@ -379,6 +381,30 @@
});
}
function deletemarhun(e)
{
let marhun = $(e).closest('tr').children('td:eq(1)').text();
let norujuk = $('#norujukan').val();
$.ajax({
method: 'put',
url: '{{ route("gadai.editmarhun") }}',
data: {
"_token": "{{ csrf_token() }}",
"norujukan" : norujuk,
"marhun" : marhun
},
success:function(data)
{
console.log(data);
location.reload();
},error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
alert(xhr.responseText);
}
});
}
$('#pinjaman').on('input',function(){
var pinjaman = Number(this.value);
var nilaimarhun = Number($('#jumlah_nilai_marhun').val());
+1 -1
View File
@@ -69,7 +69,7 @@
$.ajax({
method:'put',
url: "{{ route('khazanah.updatekelulusan') }}",
url: "{{ route('operasi.updatekelulusan') }}",
data: {
"_token": "{{ csrf_token() }}",
"norujukan" : norujukan
+7 -8
View File
@@ -193,7 +193,7 @@
</div>
<div class="col-4">
@php
$maxgadai = ($gadai['nilaimarhun'] * 0.8) - $gadai['bakipjm'];
$maxgadai = ($gadai['nilaimarhun'] * 0.7) - $gadai['bakipjm'];
@endphp
<input type="text" id="tambahpinjamsebenar" placeholder="0.00" value="{{ $maxgadai }}" class="form-control" disabled/>
@@ -566,6 +566,7 @@ $("#sltjenistebus").change(function(){
$('span.spannar').show();
$("#bayaran").prop("disabled", false);
$("#perludibayar").prop("readonly", true);
$("#bayaran").val(0);
$('#divtambahpinjaman').hide();
@@ -625,11 +626,7 @@ $("#sltjenistebus").change(function(){
function bayarkey(e)
{
if($('#sltjenistebus').find(":selected").val() == 'A')
{
}
else if($('#sltjenistebus').find(":selected").val() == 'S')
if($('#sltjenistebus').find(":selected").val() == 'S')
{
let byr = $(e).val();
let total = 0;
@@ -920,8 +917,6 @@ function bayaransemua()
console.log("historygadaian:" + historygadaian + " " + "marhun:" + marhun + " " + "total_berat:" + total_berat + " " + "pinjaman:" + pinjaman + " ");
console.log("marhun_detail: " + marhun_detail + "kuantiti_marhun: " + kuantiti_marhun);
console.log(nowakil);
return;
var kadarupahbaru = 0;
@@ -971,12 +966,16 @@ function bayaransemua()
},
success:function(success_data){
var urlroute = '{{ route("resit.tebus", ":id") }}';
urlroute = urlroute.replace(':id', norujukan);
console.log(success_data);
Swal.fire(
'Good job!',
'You clicked the button!',
'success'
) .then(function() {
window.open(urlroute, '_blank');
window.location.replace("{{ url()->previous() }}");
})
},error: function (request, status, error) {
+10 -5
View File
@@ -429,12 +429,15 @@ hr.new5 {
<tr>
<td style="width:10px">(-) Bayaran Pelanggan</td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($penebusan['BakiPjm'],2) }} </td>
</tr>
<tr>
<td style="width:10px"><b>Baki Harga Jualan</b></td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($gadai['bakihargajualan'],2) }} </td>
</tr>
<tr>
<td style="width:10px">(-) Rebate</td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($penebusan['rebate'],2) }} </td>
</tr>
<tr>
<td style="width:10px"><b>Baki Harga Jualan</b></td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($gadai['bakihargajualan'],2) }} </td>
</tr>
<td style="width:10px"><b>Tebus Keseluruhan</b></td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format(($gadai['bakihargajualan'] - $penebusan['rebate']),2) }}</td>
</tr>
</table>
@@ -528,13 +531,15 @@ hr.new5 {
<tr>
<td style="width:10px">(-) Bayaran Pelanggan</td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($penebusan['BakiPjm'],2) }} </td>
</tr>
<tr>
<td style="width:10px">Baki Harga Jualan</b></td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($gadai['bakihargajualan'],2) }}</td>
</tr>
<tr>
<td style="width:10px">(-) Rebate</td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($penebusan['rebate'],2) }} </td>
</tr>
<tr>
<td style="width:10px"><b>Baki Harga Jualan</b></td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format($gadai['bakihargajualan'],2) }}</td>
</tr>
<td style="width:10px"><b>Tebus Keseluruhan</b></td><td style="width:5px"> </td><td style="width:10px">RM {{ number_format(($gadai['bakihargajualan'] - $penebusan['rebate']),2) }}</td>
</tr>
</table>
+1
View File
@@ -123,6 +123,7 @@ Route::put('/updatekelulusan',['as'=>'khazanah.updatekelulusan','uses'=>'Khazana
Route::post('/createpanjar',['as'=>'khazanah.createpanjar','uses'=>'KhazanahController@createkelulusan'])->middleware('auth','teller');
Route::get('/gadaian/edit/{norujukan}',['as'=>'gadaian.edit','uses'=>'GadaianController@edit'])->middleware('auth','teller');
Route::post('/gadai/edit/store',['as'=>'gadai.editstore','uses'=>'GadaianController@editstore'])->middleware('auth','teller');
Route::put('/gadai/edit/deletemarhun',['as'=>'gadai.editmarhun','uses'=>'GadaianController@editmarhun'])->middleware('auth','teller');
//Laporan Baru
Route::get('/laporan/lelongan',['as'=>'laporan.lelongan','uses'=>'KhazanahController@laporanLelongan'])->middleware('auth','khazanah');