latest
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
@php
|
||||
$gadai_session = Http::get($api_url . '/api/check/sag',['kodcaw'=>$cawangan_info['kodcaw'],'norujukan'=>$norujukan,'nokp'=>$customer_info['kpbaru']])->json();
|
||||
@endphp
|
||||
|
||||
@if($gadai_session != null)
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
@@ -14,7 +19,7 @@
|
||||
No Rujukan
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control" name="norujukan" id="norujukan" readonly value="{{ $norujukan }}">
|
||||
<input type="text" class="form-control" name="norujukan" id="norujukan" readonly value="{{ $gadai_session['norujukan'] }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -224,6 +229,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@php
|
||||
$gadai_transaction = Http::get($api_url . '/api/gadai/'. $cawangan_info['kodcaw'] . '/' . $current->toDateString())->json();
|
||||
if($gadai_transaction){
|
||||
$new_sirig = $gadai_transaction['sirig'] + 1;
|
||||
}else{
|
||||
$new_sirig = 1;
|
||||
}
|
||||
$curent_year = substr($current->year,2,2);
|
||||
$curent_month = sprintf("%02d", $current->month);
|
||||
$current_day = sprintf("%02d", $current->day);
|
||||
$new_transaction = sprintf("%04d",$new_sirig);
|
||||
$norujukan_baru = strtoupper($cawangan_info['kodcaw']) . $curent_year . $curent_month . $current_day . '-' .$new_transaction;
|
||||
$gadai_baru = Http::post($api_url .'/api/gadai/'.$cawangan_info['kodcaw'],[
|
||||
'norujukan' => $norujukan_baru,
|
||||
'nopelanggan' => $customer_info['nopelanggan'],
|
||||
'nokp' => $customer_info['kpbaru'],
|
||||
'sirig' => $new_sirig
|
||||
]);
|
||||
header("Refresh:0");
|
||||
@endphp
|
||||
@endif
|
||||
<script>
|
||||
var api_url = "<?php echo $api_url ?>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user