1.added page that shows margin mutu harga emas.
2. change in gadaian page that have static 75% and 80% max pinjam turn to manipulate value of max pinjam based on mutu emas
This commit is contained in:
@@ -317,4 +317,25 @@ class OperasiController extends Controller
|
||||
$auth_user = Auth::user();
|
||||
event(new KomoditiNotify('lulus',$auth_user['cawangan']));
|
||||
}
|
||||
|
||||
public function marginmutu()
|
||||
{
|
||||
$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();
|
||||
|
||||
// Get MaxMutuEmas data from API
|
||||
$maxmutuemas = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/maxmutuemas')->json();
|
||||
|
||||
return view('operasi.marginmutu', compact('cawangan_info', 'api_url', 'maxmutuemas'));
|
||||
}
|
||||
|
||||
public function editMarginMutu()
|
||||
{
|
||||
$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('operasi.edit_marginmutu', compact('cawangan_info', 'api_url'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -567,6 +567,7 @@
|
||||
total_berat = 0;
|
||||
total_kuantiti = 0;
|
||||
var marhun_details = '';
|
||||
var array_mutu = [];
|
||||
tablemarhun.clear().draw();
|
||||
$.each(data,function(index,marhun){
|
||||
$.each(marhun,function(index,marhun_detail){
|
||||
@@ -576,6 +577,7 @@
|
||||
jumlah_nilai_marhun += Number(marhun_detail['n_marhun']);
|
||||
status_tag_permata = marhun_detail['tag_permata'] == 1 ? 'Ada' : '';
|
||||
total_kuantiti += Number(marhun_detail['bil']);
|
||||
array_mutu.push([marhun_detail['karat'], marhun_detail['n_marhun']]);
|
||||
tablemarhun.row.add([
|
||||
counter,
|
||||
marhun_detail['recno'],
|
||||
@@ -659,6 +661,10 @@
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
url: api_url + '/api/maxpinjaman',
|
||||
data: {
|
||||
'mutu': array_mutu,
|
||||
'total_nilai_marhun': total_nilai_marhun,
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
$.each(data,function(index,pinjaman){
|
||||
|
||||
@@ -534,12 +534,14 @@
|
||||
var jumlah_nilai_marhun = 0;
|
||||
var pinjaman_pelulus = 0;
|
||||
var pinjaman_teller = 0;
|
||||
|
||||
function marhuntable(data) {
|
||||
var counter = 1;
|
||||
total_nilai_marhun = 0;
|
||||
total_berat = 0;
|
||||
total_kuantiti = 0;
|
||||
var marhun_details = '';
|
||||
var array_mutu = [];
|
||||
jumlah_nilai_marhun = 0;
|
||||
tablemarhun.clear().draw();
|
||||
$.each(data, function(index, marhun) {
|
||||
@@ -550,6 +552,7 @@
|
||||
jumlah_nilai_marhun += Number(marhun_detail['n_marhun']);
|
||||
status_tag_permata = marhun_detail['tag_permata'] == 1 ? 'Ada' : '';
|
||||
total_kuantiti += Number(marhun_detail['bil']);
|
||||
array_mutu.push([marhun_detail['karat'], marhun_detail['n_marhun']]);
|
||||
tablemarhun.row.add([
|
||||
counter,
|
||||
marhun_detail['recno'],
|
||||
@@ -603,6 +606,10 @@
|
||||
$.ajax({
|
||||
method: 'GET',
|
||||
url: api_url + '/api/maxpinjaman',
|
||||
data: {
|
||||
'mutu': array_mutu,
|
||||
'total_nilai_marhun': total_nilai_marhun,
|
||||
},
|
||||
success: function(data) {
|
||||
$.each(data, function(index, pinjaman) {
|
||||
if (pinjaman['user_type'] == 'teller') {
|
||||
@@ -862,6 +869,7 @@
|
||||
var beratpermata = $('#beratpermata').val();
|
||||
var kuantiti = $('#kuantiti').val();
|
||||
|
||||
|
||||
if(kuantiti > 10)
|
||||
{
|
||||
$("#tambah_marhun").prop('disabled', false);
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
@extends('layouts.app_operasi')
|
||||
@section('content')
|
||||
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ url('/') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ url('operasi/parameter') }}">Parameter</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ url('operasi/marginmutu') }}">Margin Mutu Emas</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Edit Margin Mutu</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<div class="card-body">
|
||||
<h4 class="text-center mb-4">Edit Margin Mutu Emas</h4>
|
||||
|
||||
<form id="editMarginForm">
|
||||
@csrf
|
||||
<input type="hidden" id="recno" name="recno">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="karat">Karat</label>
|
||||
<input type="text" class="form-control" id="karat" name="karat" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="keterangan">Keterangan</label>
|
||||
<input type="text" class="form-control" id="keterangan" name="keterangan" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="teller">Teller (%)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="teller" name="teller" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="pc">PC (%)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="pc" name="pc" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="operasi">Operasi (%)</label>
|
||||
<input type="number" step="0.01" class="form-control" id="operasi" name="operasi" required>
|
||||
</div>
|
||||
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
<a href="{{ route('operasi.marginmutu') }}" class="btn btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Get data from URL parameters
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
$('#recno').val(urlParams.get('recno'));
|
||||
$('#karat').val(urlParams.get('karat'));
|
||||
$('#keterangan').val(urlParams.get('keterangan'));
|
||||
$('#teller').val(urlParams.get('teller'));
|
||||
$('#pc').val(urlParams.get('pc'));
|
||||
$('#operasi').val(urlParams.get('operasi'));
|
||||
|
||||
$('#editMarginForm').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const formData = {
|
||||
recno: $('#recno').val(),
|
||||
karat: $('#karat').val(),
|
||||
keterangan: $('#keterangan').val(),
|
||||
teller: $('#teller').val(),
|
||||
pc: $('#pc').val(),
|
||||
operasi: $('#operasi').val(),
|
||||
_token: $('input[name="_token"]').val()
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '{{ config("api.url") }}/api/maxmutuemas/update',
|
||||
type: 'POST',
|
||||
data: formData,
|
||||
success: function(response) {
|
||||
if(response.status === 'success') {
|
||||
Swal.fire({
|
||||
title: 'Berjaya!',
|
||||
text: 'Data berhasil diupdate!',
|
||||
icon: 'success',
|
||||
confirmButtonText: 'OK'
|
||||
}).then((result) => {
|
||||
window.location.href = '{{ route("operasi.marginmutu") }}';
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: response.message,
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
Swal.fire({
|
||||
title: 'Error!',
|
||||
text: 'Error updating data: ' + xhr.responseText,
|
||||
icon: 'error',
|
||||
confirmButtonText: 'OK'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -0,0 +1,64 @@
|
||||
@extends('layouts.app_operasi')
|
||||
@section('content')
|
||||
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb pb-3">
|
||||
<li class="breadcrumb-item"><a href="{{ url('/') }}">Home</a></li>
|
||||
<li class="breadcrumb-item"><a href="{{ url('operasi/parameter') }}">Parameter</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">Margin Mutu Emas</li>
|
||||
</ol>
|
||||
</nav>
|
||||
<div class="card-body text-center">
|
||||
|
||||
<div class="mt-3">
|
||||
|
||||
<table class='table table-striped table-hover' id='table-marginmutu' style="width:100%;">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Karat</th>
|
||||
<th>Keterangan</th>
|
||||
<th>Teller (%)</th>
|
||||
<th>PC (%)</th>
|
||||
<th>Operasi (%)</th>
|
||||
<th>Tarikh Update</th>
|
||||
<th>Tindakan</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($maxmutuemas as $index=>$mme)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $mme['karat'] }}</td>
|
||||
<td>{{ $mme['keterangan'] }}</td>
|
||||
<td>{{ $mme['teller'] }}%</td>
|
||||
<td>{{ $mme['pc'] }}%</td>
|
||||
<td>{{ $mme['operasi'] }}%</td>
|
||||
<td>{{ \Carbon\Carbon::parse($mme['tarikhupdate'])->format('d/m/Y') }}</td>
|
||||
<td>
|
||||
<a href="{{ route('operasi.marginmutu.edit') }}?recno={{ $mme['recno'] }}&karat={{ $mme['karat'] }}&keterangan={{ $mme['keterangan'] }}&teller={{ $mme['teller'] }}&pc={{ $mme['pc'] }}&operasi={{ $mme['operasi'] }}"
|
||||
class="btn btn-sm btn-warning">Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var table_marginmutu = $('#table-marginmutu').DataTable({
|
||||
"pageLength": 25,
|
||||
"order": [[ 0, "asc" ]]
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="card-body text-center">
|
||||
<a href="{{ route('operasi.hargaemas') }}" class="btn btn-info btn-lg">Harga Emas</a>
|
||||
<a href="{{ route('operasi.margin') }}" class="btn btn-info btn-lg">Margin Pembiayaan</a>
|
||||
<a href="#" class="btn btn-info btn-lg">Contoh 2</a>
|
||||
<a href="{{ route('operasi.marginmutu') }}" class="btn btn-info btn-lg">Margin Mutu Emas</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -360,6 +360,8 @@ Route::post('operasi/kakitangan/edit/store',['as'=>'operasi.kakitangan.edit.stor
|
||||
|
||||
|
||||
Route::get('/operasi/margin',['as'=>'operasi.margin','uses'=>'OperasiController@margin'])->middleware('auth','operasi');
|
||||
Route::get('/operasi/marginmutu',['as'=>'operasi.marginmutu','uses'=>'OperasiController@marginmutu'])->middleware('auth','operasi');
|
||||
Route::get('/operasi/marginmutu/edit',['as'=>'operasi.marginmutu.edit','uses'=>'OperasiController@editMarginMutu'])->middleware('auth','operasi');
|
||||
|
||||
Route::get('/komoditi',['as'=>'komuditi','uses'=>'KomuditiController@index']);
|
||||
Route::get('/komoditi/rekod',['as'=>'rekod.komoditi','uses'=>'KomuditiController@rekodKomoditi']);
|
||||
|
||||
Reference in New Issue
Block a user