diff --git a/.DS_Store b/.DS_Store
index f1757f2..6bde683 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/app/Http/Controllers/AliranTunaiController.php b/app/Http/Controllers/AliranTunaiController.php
index 15451aa..b11525c 100644
--- a/app/Http/Controllers/AliranTunaiController.php
+++ b/app/Http/Controllers/AliranTunaiController.php
@@ -446,7 +446,8 @@ class AliranTunaiController extends Controller
$gadaian = floatval($totalgadai);
if(strtoupper(Auth::user()->name) === 'LELONG'){
- $bakisemasa = $lelongan;
+ $penebusanbarcodescanned = floatval($lelongan);
+ $bakisemasa = floatval($lelongan) - floatval($totalserahan);
}else{
$bakisemasa = floatval($bakiawal) + floatval($totalpendahuluan) + floatval($penebusan) - (floatval($gadaian) + floatval($totalserahan)) - floatval($totaltuntutbaki);
}
diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php
index d9dca21..01f2679 100644
--- a/app/Http/Controllers/KhazanahController.php
+++ b/app/Http/Controllers/KhazanahController.php
@@ -1268,7 +1268,6 @@ class KhazanahController extends Controller
]);
return redirect()->route('khazanah.serahan');
-
}
public function kemaskiniPendahuluan(Request $request) //Daftar Pendahuluan kepada Kaunter
@@ -1430,9 +1429,6 @@ class KhazanahController extends Controller
$amount = $request->amt;
-// if($amount>$baki_awal){
-// return redirect()->route('khazanah.serahan')->with('message', 'Jumlah yang dipinta melebihi baki dalam peti besi!.');
-// }else{
$tarikh=$request->tarikh;
$kodlaluan=$request->teller;
@@ -1544,8 +1540,6 @@ class KhazanahController extends Controller
}
- // }
-
$GetLatestBakiTunai=Http::get( config('api.url').'/api/getLatestBaki/'.$auth_user['cawangan'])->json();
$sumBaki=$GetLatestBakiTunai;
@@ -2316,6 +2310,7 @@ class KhazanahController extends Controller
public function pendahuluanserahanHQ(Request $request)
{
+
$auth_user = Auth::user();
$gldetail = Http::post(config('api.url').'/api/gldetailkaunter/'. $auth_user['cawangan'],[
diff --git a/app/Http/Controllers/PenebusanController.php b/app/Http/Controllers/PenebusanController.php
index 3ec99ce..b505a4a 100644
--- a/app/Http/Controllers/PenebusanController.php
+++ b/app/Http/Controllers/PenebusanController.php
@@ -544,8 +544,12 @@ class PenebusanController extends Controller
'marhun' => $request->marhun,
'jenisbayarantebus' => $request->jenisbayarantebus,
'teller' => $request->teller
- ])->json();
+ ])->successful();
+ if(!$updatetebus)
+ {
+ return response('fail');
+ }
//////////////////////
/// MAKING NEW SAG////
@@ -566,7 +570,12 @@ class PenebusanController extends Controller
'nopelanggan' => $request->nopelanggan,
'nokp' => $request->noic,
'sirig' => $new_sirig
- ]);
+ ])->successful();
+
+ if(!$gadai)
+ {
+ return response('fail');
+ }
//////////////////////
@@ -596,7 +605,7 @@ class PenebusanController extends Controller
'upah12' => $keuntungan12bulan,
'hargajualan' => $hargajualan,
'kuantiti_marhun' => $request->kuantiti_marhun
- ])->json();
+ ])->successful();
$komuditi = Http::put(config('api.url').'/api/komuditi/transaksi',[
'unit_komuditi' => round($request->pinjaman, 2),
@@ -611,7 +620,7 @@ class PenebusanController extends Controller
$updatehistorygadaian = Http::put(config('api.url').'/api/gadai/updatehistory/'. $auth_user['cawangan'] .'/' . $norujukanbaru,[
'historygadaian' => $request->norujukan
- ])->json();
+ ])->successful();
///////////////////////////
/// MARHUN UPDATE TABLE////
@@ -648,7 +657,7 @@ class PenebusanController extends Controller
'berat_emas' => $array1['berat'],
'harga' => $array1['harga'],
'nilai_marhun' => $array1['n_marhun']
- ])->json();
+ ])->successful();
}
diff --git a/config/database.php b/config/database.php
index 66d8670..a159328 100644
--- a/config/database.php
+++ b/config/database.php
@@ -61,6 +61,7 @@ return [
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
+ 'unix_socket' => env('UNIX_SOCKET', '/Applications/MAMP/tmp/mysql/mysql.sock'),
],
'pgsql' => [
diff --git a/public/.DS_Store b/public/.DS_Store
index 1b9b696..58e9ba1 100644
Binary files a/public/.DS_Store and b/public/.DS_Store differ
diff --git a/resources/views/aliran_tunai/laporan/laporanserahan.blade.php b/resources/views/aliran_tunai/laporan/laporanserahan.blade.php
index bf4396d..1592ef3 100644
--- a/resources/views/aliran_tunai/laporan/laporanserahan.blade.php
+++ b/resources/views/aliran_tunai/laporan/laporanserahan.blade.php
@@ -520,7 +520,7 @@
CATATAN:
Serahan kepada peti besi ialah sebanyak RM
- Baki Tunai Semasa sebanyak RM
+ Baki Tunai Semasa sebanyak RM {{ number_format($totalsemua,2) }}
\ No newline at end of file
diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php
index e8aaece..429fb95 100644
--- a/resources/views/customers/info.blade.php
+++ b/resources/views/customers/info.blade.php
@@ -454,6 +454,12 @@
});
});
+ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
+ // here is the new selected tab id
+ var selectedTabId = e.target.id;
+
+ });
+
var tablegadai = $('#myTable').DataTable({
"scrollX": true
});
@@ -1494,14 +1500,154 @@
if($("input[name='options']:checked").val() == 'belum_tebus'){
let test1 = $('input[name="belum"]:checked').closest('tr').children('td:eq(2)').text();
let tarikhgadai2 = new Date(test1);tarikhgadai2.setHours(0, 0, 0, 0);
- if(+harini !== +tarikhgadai2){
- Swal.fire({
- icon: 'error',
- title: 'Amaran',
- text: 'Hapus Gadai Tidak Dibenarkan'
- });
- return false;
+
+ var id = $('.tab-content .active').attr('id');
+ if(id == "nav-tawarruq-tab") {
+ if(+harini !== +tarikhgadai2){
+ Swal.fire({
+ icon: 'error',
+ title: 'Amaran',
+ text: 'Hapus Gadai Tidak Dibenarkan'
+ });
+ return false;
+ }
}
+ else {
+ $.ajax({
+ method:'get',
+ url: api_url + '/api/upahlamatoday/' + kodcaw + '/' + hapusid,
+ success:function(data){
+ console.log(data);
+ if(data == 1){
+
+ const swalWithBootstrapButtons = Swal.mixin({
+ customClass: {
+ confirmButton: 'btn btn-success',
+ cancelButton: 'btn btn-danger'
+ },
+ buttonsStyling: false
+ });
+
+ swalWithBootstrapButtons.fire({
+ title: 'Dapatkan Pengesahan Khazanah',
+ text: "Hapus Upah Lama!",
+ icon: 'info',
+ showCancelButton: true,
+ confirmButtonText: 'Hantar',
+ cancelButtonText: 'Batal',
+ reverseButtons: true
+ }).then((result) => {
+ if(result.isConfirmed) {
+ Swal.fire({
+ title: 'Tunggu Pengesahan Daripada Khazanah.',
+ icon: 'info',
+ width: 600,
+ padding: '3em',
+ background: '#fffff',
+ showCancelButton: false,
+ showConfirmButton: false,
+ allowOutsideClick: false,
+ allowEscapeKey: false,
+ allowEnterKey: false
+ })
+
+ let mohon = "Hapus Upah Lama";
+ let id = hapusid;
+
+ $.ajax({
+ method:'post',
+ url: '{{ route("teller.createkelulusan") }}',
+ data: {
+ "_token": "{{ csrf_token() }}",
+ "norujukan" : id,
+ "mohon" : mohon
+ },
+ success:function(data){
+ },error: function(xhr, status, error) {
+ var err = eval("(" + xhr.responseText + ")");
+ alert(xhr.responseText);
+ }
+ });
+
+ let teller = "{{ Auth::user()->name }}";
+
+ var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
+ cluster: 'ap1',
+ encrypted: true
+ });
+
+ var channel = pusher.subscribe('notice-ubahhapus');
+ channel.bind('my-ubahhapus', function(data) {
+
+ if(data.norujukan == id && data.teller == teller)
+ {
+ if(data.kelulusan == 'lulus')
+ {
+
+ Swal.fire({
+ icon: 'success',
+ title: 'Telah Disahkan'
+ }).then(function(){
+
+ $.ajax({
+ method:'post',
+ url: api_url + '/api/removeupahlamatoday/' + kodcaw + '/' + id,
+ success:function(data){
+
+ if(data == 1)
+ {
+ swalWithBootstrapButtons.fire(
+ 'Hapus!',
+ 'Maklumat upah lama telah dihapuskan.',
+ 'success'
+ ).then(function(){
+ location.reload();
+ });
+ }else{
+ swalWithBootstrapButtons.fire(
+ 'Hapus!',
+ 'Maklumat Upah lama tidak berjaya untuk dihapuskan.',
+ 'error'
+ ).then(function(){
+ location.reload();
+ });
+ }
+
+
+ },error: function(xhr, status, error) {
+ var err = eval("(" + xhr.responseText + ")");
+ alert(xhr.responseText);
+ }
+ });
+ return true;
+ });
+ }
+ }
+ });
+ }
+ });
+
+
+ return false;
+ }
+ else{
+ Swal.fire({
+ icon: 'error',
+ title: 'Amaran',
+ text: 'Hapus Upah Tidak Dibenarkan'
+ });
+ return false;
+ }
+ },error: function(xhr, status, error) {
+ var err = eval("(" + xhr.responseText + ")");
+ alert(xhr.responseText);
+ }
+ });
+ }
+
+
+ return false;
+
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
diff --git a/resources/views/khazanah/pendahuluanserahanmain.blade.php b/resources/views/khazanah/pendahuluanserahanmain.blade.php
index 77aa83f..7995ee2 100644
--- a/resources/views/khazanah/pendahuluanserahanmain.blade.php
+++ b/resources/views/khazanah/pendahuluanserahanmain.blade.php
@@ -345,6 +345,8 @@
});
}
+ },error: function(jqXHR, textStatus, errorThrown) {
+ console.log(textStatus, errorThrown);
}
});
}
diff --git a/resources/views/lelongan/index.blade.php b/resources/views/lelongan/index.blade.php
index 1a98a03..b976010 100644
--- a/resources/views/lelongan/index.blade.php
+++ b/resources/views/lelongan/index.blade.php
@@ -328,8 +328,6 @@
cluster: 'ap1',
encrypted: true
});
-
- //let teller = "{{ Auth::user()->name }}";
var channel = pusher.subscribe('notice-ubahhapus');
channel.bind('my-ubahhapus', function(data) {
diff --git a/resources/views/penebusan/index.blade.php b/resources/views/penebusan/index.blade.php
index ee5e4a0..6533ed5 100644
--- a/resources/views/penebusan/index.blade.php
+++ b/resources/views/penebusan/index.blade.php
@@ -2428,6 +2428,17 @@
function wakilfunction(e)
{
let wakil = $('#wakiltxt').val();
+ console.log(wakil);
+ if(wakil === null || wakil === '')
+ {
+ Swal.fire(
+ 'Amaran!',
+ 'Sila masukkan nilai di dalam kotak wakil!',
+ 'error'
+ )
+
+ return false;
+ }
var patternregex = /\s+|[-,\/]/g;
@@ -2499,7 +2510,16 @@
let nota = $('#notawakil').val();
let nokp = $('#nokpwakil').val();
-
+ if(nowakil === null || nowakil === '')
+ {
+ Swal.fire(
+ 'Amaran!',
+ 'Sila tunggu no wakil untuk proses dahulu sebelum tekan terima!',
+ 'error'
+ )
+ return false;
+ }
+
$.ajax({
method:'POST',
url: "{{ route('wakil.create') }}",
diff --git a/resources/views/print/laporan_lejer_am.blade.php b/resources/views/print/laporan_lejer_am.blade.php
index 1eb2fd6..34c6f05 100644
--- a/resources/views/print/laporan_lejer_am.blade.php
+++ b/resources/views/print/laporan_lejer_am.blade.php
@@ -313,135 +313,6 @@
-
-
-
-
-
-
-
- | TARIKH DARI | {{$tarikh_mula}} |
- HINGGA | {{$tarikh_akhir}} |
-
-
-
-
-
-
-
-
- | KOD GL | KETERANGAN | DEBIT | KREDIT | JUMLAH |
-
- @foreach($data as $index=>$var)
-
-
- | {{ $var['glcode']}} | {{$var['descpt']}} | {{$var['total_debit']}} | {{$var['total_kredit']}} |
-
- @if($var['totalharini'] >0 )
- {{
-
- $var['totalharini']
- }}
-
-
-
- |
- @else
-
-
-
- ( {{ number_format(abs($var['totalharini']),2)}} )
-
-
-
- |
-
- @endif
-
-
- @endforeach
-
-
- | JUMLAH: | @foreach($debit as $db=>$vr) {{ number_format($vr['totalDebit'],2)}} @endforeach
-
- | @foreach($kredit as $db=>$vr) {{ number_format($vr['totalKredit'],2)}} @endforeach |
-
-
-
- @foreach($kredit as $db=>$vr)
- @foreach($debit as $db2=>$vr2)
-
- {{ number_format($vr['totalKredit'] -$vr2['totalDebit'] ,2) }}
- @endforeach
- @endforeach
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- | | DISEMAK | | DISAHKAN | |
-
-
-
- | |
- |
-
- |
-
- |
-
-
-
-
-
- | |
- |
-
- |
-
- |
-
-
-
-
-
-
diff --git a/resources/views/print/resitansuran.blade.php b/resources/views/print/resitansuran.blade.php
index 6bda936..a1d4c9e 100644
--- a/resources/views/print/resitansuran.blade.php
+++ b/resources/views/print/resitansuran.blade.php
@@ -394,11 +394,11 @@ hr.new5 {
- | Nama Wakil | : | | | | | |
+ Nama Wakil | : @php if(sizeof($wakil) != 0){ echo $wakil['nama'];} else echo ''; @endphp | | | | | |
- | No K/P Wakil | : | | | | | |
+ No K/P Wakil | : @php if(sizeof($wakil) != 0) echo $wakil['nokp']; else echo ''; @endphp | | | | | |
diff --git a/routes/web.php b/routes/web.php
index c597df3..38c387e 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -68,7 +68,7 @@ Route::get('/daftar_marhun',['as'=>'daftar_marhun','uses'=>'MarhunController@ind
Route::get('/penebusan/{norujukan}',['as'=>'penebusan','uses' => 'PenebusanController@index'])->middleware('auth','teller');
Route::get('/lelongan/{norujukan}',['as'=>'lelongan','uses' => 'LelongController@index'])->middleware('auth','teller');
Route::get('/aliran_tunai','AliranTunaiController@index')->middleware('auth','teller');
-Route::get('/aliran_tunai/laporanserahan}',['as'=>'laporan.serahanteller','uses' => 'AliranTunaiController@LaporanSerahan'])->middleware('auth','teller');
+Route::get('/aliran_tunai/laporanserahan',['as'=>'laporan.serahanteller','uses' => 'AliranTunaiController@LaporanSerahan'])->middleware('auth','teller');
Route::put('/aliran_tunai/Gadaian',['as'=>'alirantunai.gadai','uses' => 'AliranTunaiController@alirantunaiGadai'])->middleware('auth','teller');
Route::put('/aliran_tunai/Tebusan',['as'=>'alirantunai.tebus','uses' => 'AliranTunaiController@alirantunaiTebus'])->middleware('auth','teller');
Route::put('/aliran_tunai/advansur',['as'=>'alirantunai.advansur','uses' => 'AliranTunaiController@alirantunaiUpahBknTawarruq'])->middleware('auth','teller');
@@ -126,7 +126,7 @@ Route::post('laporan/tebus/cetak',['as'=>'tebus.laporancetak','uses'=>'KhazanahC
Route::get('/khazanah/pelanggan',['as'=>'khazanah.pelanggan','uses'=>'KhazanahController@index'])->middleware('auth','khazanah');
Route::get('/khazanah/customer_info',['as'=>'khazanah.customer_info','uses'=>'KhazanahController@info'])->middleware('auth','khazanah');
Route::get('/khazanah/searchpelanggan',['as'=>'khazanah.searchpelanggan','uses'=>'KhazanahController@search'])->middleware('auth','khazanah');
-Route::get('/khazanah/pendahuluanserahanHQ',['as'=>'khazanah.pendahuluanserahanHQ','uses'=>'KhazanahController@pendahuluanserahanHQ'])->middleware('auth','khazanah');
+Route::post('/khazanah/pendahuluanserahanHQ',['as'=>'khazanah.pendahuluanserahanHQ','uses'=>'KhazanahController@pendahuluanserahanHQ'])->middleware('auth','khazanah');
Route::get('/penebusankhazanah/{norujukan}',['as'=>'penebusan.khazanah','uses' => 'PenebusanController@PenebusanKhazanah'])->middleware('auth','khazanah');
Route::post('/kakitangan/harian',['as'=>'kakitangan.harian','uses'=>'KakitanganController@kakitanganHarian'])->middleware('auth','khazanah');
diff --git a/tests/Feature/DenominasiTest.php b/tests/Feature/DenominasiTest.php
new file mode 100644
index 0000000..6e93fe6
--- /dev/null
+++ b/tests/Feature/DenominasiTest.php
@@ -0,0 +1,23 @@
+actingAs($user);
+ $response = $this->get('/');
+
+ $response->assertStatus(200);
+ }
+}