Merge branch 'lapfix' of https://gitlab.com/online-sistem1/kaunter into lapfix

This commit is contained in:
MUHD HAFIFIE
2021-10-27 11:52:56 +08:00
10 changed files with 171 additions and 33 deletions
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class GadaiNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['gadai-notify'];
}
public function broadcastAs()
{
return 'trigger-gadai';
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class KeuntunganNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['keuntungan-notify'];
}
public function broadcastAs()
{
return 'trigger-keuntungan';
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class PetibesiNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['petibesi-notify'];
}
public function broadcastAs()
{
return 'trigger-petibesi';
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class TebusNotify implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $response;
public $cawangan;
public function __construct($response,$cawangan)
{
$this->response = $response;
$this->cawangan = $cawangan;
}
public function broadcastOn()
{
return ['tebus-notify'];
}
public function broadcastAs()
{
return 'trigger-tebus';
}
}
@@ -5,6 +5,8 @@ namespace App\Http\Controllers;
//Events //Events
use App\Events\StatusLiked; use App\Events\StatusLiked;
use App\Events\NotifikasiPembayaran; use App\Events\NotifikasiPembayaran;
use App\Events\Dashboard\GadaiNotify;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Services\CustomerService; use App\Services\CustomerService;
@@ -184,6 +186,8 @@ class GadaianController extends Controller
$this->AliranTunaiController->alirantunaiGadai($request,$auth_user['name']); $this->AliranTunaiController->alirantunaiGadai($request,$auth_user['name']);
event(new GadaiNotify('lulus',$auth_user['cawangan']));
$request->session()->forget('page_reload'); $request->session()->forget('page_reload');
$request->session()->forget('norujukan'); $request->session()->forget('norujukan');
return redirect()->route('customer_info'); return redirect()->route('customer_info');
@@ -223,6 +227,8 @@ class GadaianController extends Controller
'norujukan' => $request->norujukan_gadai 'norujukan' => $request->norujukan_gadai
])->json(); ])->json();
event(new GadaiNotify('lulus',$auth_user['cawangan']));
$request->session()->forget('page_reload'); $request->session()->forget('page_reload');
$request->session()->forget('norujukan'); $request->session()->forget('norujukan');
return redirect()->route('customer_info'); return redirect()->route('customer_info');
+5 -5
View File
@@ -3323,16 +3323,16 @@ class KhazanahController extends Controller
$current = new Carbon(); $current = new Carbon();
$tarikh_cetak = $current->toDateString(); $tarikh_cetak = $current->toDateString();
if($request->datedenominasi == null){ if($request->dateaudit == null){
$date = $current->toDateString(); $date = $current->toDateString();
}else{ }else{
$split_date = explode('-', $request->datedenominasi); $split_date = explode('-', $request->dateaudit);
$date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; $date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
} }
$denominasi = Http::get(config('api.url'). '/api/DenominasiLaporan/' . $auth_user['cawangan'],['tarikh' => $date])->json(); $audittrail = Http::get(config('api.url'). '/api/laporanAuditTrail/',['tarikh' => $date,'kodcaw' => Auth::user()->cawangan])->json();
if(!$denominasi) if(!$audittrail)
{ {
return redirect()->back()->with('errormessage', 'Tiada data pada tarikh tersebut.'); return redirect()->back()->with('errormessage', 'Tiada data pada tarikh tersebut.');
} }
@@ -3340,7 +3340,7 @@ class KhazanahController extends Controller
$cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); $cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0]; $cawangan_detail=$cawangan[0];
return view('print.laporan_audittrail', compact('denominasi','cawangan_detail','tarikh_cetak','date','api_url')); return view('print.laporan_audittrail', compact('audittrail','cawangan_detail','tarikh_cetak','date','api_url'));
} }
@@ -2,6 +2,10 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
//Events
use App\Events\Dashboard\TebusNotify;
use App\Events\Dashboard\KeuntunganNotify;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Auth;
@@ -63,6 +67,8 @@ class PenebusanController extends Controller
if($updatetebus) if($updatetebus)
{ {
return response('success'); return response('success');
event(new TebusNotify('lulus',$auth_user['cawangan']));
}else{ }else{
return response('fail'); return response('fail');
} }
@@ -82,18 +82,14 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-8 mx-auto"> <div class="col-md-5 mx-auto">
<form action="{{ route('audittrail.laporancetak') }}" method="post"> <form action="{{ route('audittrail.laporancetak') }}" method="post">
@csrf @csrf
<div class="input-group mb-3"> <div class="input-group mb-3">
<div class="input-group-prepend"> <div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Mula</span> <span class="input-group-text" id="basic-addon1">Mula</span>
</div> </div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datemula" name="datemula"> <input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="dateaudit" name="dateaudit">
<div class="input-group-prepend ml-2">
<span class="input-group-text" id="basic-addon1">Hingga</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datehingga" name="datehingga">
<input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak"> <input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak">
</div> </div>
@@ -117,15 +113,7 @@
var today = new Date(); var today = new Date();
var dateObject = ''; var dateObject = '';
$('#datemula').datepicker({ $('#dateaudit').datepicker({
maxViewMode:1,
format: 'dd-mm-yyyy',
autoclose:true,
endDate: "today",
maxDate: today
});
$('#datehingga').datepicker({
maxViewMode:1, maxViewMode:1,
format: 'dd-mm-yyyy', format: 'dd-mm-yyyy',
autoclose:true, autoclose:true,
@@ -172,7 +172,7 @@
<table id="scan"> <table id="scan">
<tr> <tr>
<th colspan ="5"><b>LAPORAN SENARAI HARGA EMAS</b></th> <th colspan ="5"><b>LAPORAN AUDIT TRAIL</b></th>
<th> </th> <th> </th>
<th> </th> <th> </th>
<th></th> <th></th>
@@ -193,18 +193,18 @@
<td> </td> <td> </td>
</tr> </tr>
<tr> <tr>
<td style="width:20px"> <b>MULA:</b></td> <td style="width:20px"> <b>TARIKH:</b></td>
<td>@php <td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $mula_date); $myDateTime = DateTime::createFromFormat('Y-m-d', $date);
$formattedweddingdate = $myDateTime->format('d-m-Y'); $formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate); echo($formattedweddingdate);
@endphp</td> @endphp</td>
<td style="width:20px"> <b>HINGGA:</b></td> {{-- <td style="width:20px"> <b>HINGGA:</b></td>
<td>@php <td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $hingga_date); $myDateTime = DateTime::createFromFormat('Y-m-d', $hingga_date);
$formattedweddingdate = $myDateTime->format('d-m-Y'); $formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate); echo($formattedweddingdate);
@endphp</td> @endphp</td> --}}
<td> </td> <td> </td>
<td> </td> <td> </td>
<td> </td> <td> </td>
@@ -219,12 +219,13 @@
<tr> <tr>
<th>Bil</th> <th>Bil</th>
<th>Tarikh</th> <th>Tarikh</th>
<th>Masa</th>
<th>Teller</th> <th>Teller</th>
<th>Pelulus</th> <th>Pelulus</th>
<th>Act</th> <th>Act</th>
<th>Transaksi</th> {{-- <th>Transaksi</th> --}}
<th>Norujukan</th> <th>Norujukan</th>
<th>Ping Lama</th> <th>Pinj. Lama</th>
<th>Pinjaman</th> <th>Pinjaman</th>
<th>Upah</th> <th>Upah</th>
<th>Nota</th> <th>Nota</th>
@@ -232,13 +233,22 @@
<th>Norujukan Asal</th> <th>Norujukan Asal</th>
</tr> </tr>
@php $counter = 1; $totalamaun = 0; $jenis = ''; @endphp @php $counter = 1; $totalamaun = 0; $jenis = ''; @endphp
@foreach($petibesi as $index=>$item) @foreach($audittrail as $index=>$item)
<tr> <tr>
<td>{{ $counter }}</td> <td>{{ $counter }}</td>
<td>{{ $item['t_efektif'] }}</td> <td>{{ $item['tarikh'] }}</td>
<td>{{ $item['m_efektif'] }}</td> <td>{{ $item['masa'] }}</td>
<td>{{ $item['karat'] }}</td> <td>{{ $item['users'] }}</td>
<td>{{ number_format($item['harga'],2) }}</td> <td>{{ $item['pelulus'] }}</td>
<td>{{ $item['actions'] }}</td>
<td>{{ $item['norujukan'] }}</td>
<td>{{ number_format($item['oldpinjaman'],2) }}</td>
<td>{{ number_format($item['newpinjaman'],2) }}</td>
<td>{{ number_format($item['newupah'],2) }}</td>
<td>{{ $item['nota'] }}</td>
<td>{{ $item['nokp'] }}</td>
<td>{{ $item['norujukanasal'] }}</td>
{{-- <td>{{ number_format($item['harga'],2) }}</td> --}}
</tr> </tr>
@php $counter++;@endphp @php $counter++;@endphp
@endforeach @endforeach
+1 -1
View File
@@ -222,7 +222,7 @@ Route::post('/laporan/senaraipetibesi/cetak', ['as'=>'senaraipetibesi.cetaklapor
Route::get('laporan/hargaemas/',['as'=>'laporan.hargaemas','uses'=>'KhazanahController@laporanhargaemas'])->middleware('auth','khazanah'); Route::get('laporan/hargaemas/',['as'=>'laporan.hargaemas','uses'=>'KhazanahController@laporanhargaemas'])->middleware('auth','khazanah');
Route::post('laporan/hargaemas/cetak',['as'=>'hargaemas.laporancetak','uses'=>'KhazanahController@cetakLaporanhargaemas'])->middleware('auth','khazanah'); Route::post('laporan/hargaemas/cetak',['as'=>'hargaemas.laporancetak','uses'=>'KhazanahController@cetakLaporanhargaemas'])->middleware('auth','khazanah');
Route::get('laporan/audittrail/',['as'=>'laporan.audittrail','uses'=>'KhazanahController@laporanAuditTrail'])->middleware('auth','khazanah'); Route::get('laporan/audittrail/',['as'=>'laporan.audittrail','uses'=>'KhazanahController@laporanAuditTrail'])->middleware('auth','khazanah');
Route::get('laporan/audittrail/cetak',['as'=>'audittrail.laporancetak','uses'=>'KhazanahController@cetakLaporanAuditTrail'])->middleware('auth','khazanah'); Route::post('laporan/audittrail/cetak',['as'=>'audittrail.laporancetak','uses'=>'KhazanahController@cetakLaporanAuditTrail'])->middleware('auth','khazanah');
// Route::get('/laporan/agingbulanan', [ 'as'=>'laporan.agingbulanan', 'uses'=>'KhazanahController@laporanAging_Bulanan'])->middleware('auth','khazanah'); // Route::get('/laporan/agingbulanan', [ 'as'=>'laporan.agingbulanan', 'uses'=>'KhazanahController@laporanAging_Bulanan'])->middleware('auth','khazanah');
// Route::post('/laporan/agingbulanan/cetak', ['as'=>'agingbulan.cetaklaporan', 'uses'=>'KhazanahController@cetaklaporang_Aging'])->middleware('auth','khazanah'); // Route::post('/laporan/agingbulanan/cetak', ['as'=>'agingbulan.cetaklaporan', 'uses'=>'KhazanahController@cetaklaporang_Aging'])->middleware('auth','khazanah');