fix skit2

This commit is contained in:
MUHD HAFIFIE
2021-05-03 16:02:07 +08:00
parent 25e72272d2
commit 6da7c5b51f
2 changed files with 130 additions and 2 deletions
+12 -2
View File
@@ -12,6 +12,9 @@ use App\Customer;
use App\TuntutBaki;
use App\Panjar;
use App\Lelong;
use App\Advansur;
use App\Vault;
use App\Denominasi;
use Carbon\Carbon;
@@ -31,7 +34,8 @@ class LaporanController extends Controller
$total_gadai = Gadai::on($cawangan['mysql'])->where('t_gadai','=',$request->tarikh)->sum('pinjaman');
$total_tebus = Tebus::on($cawangan['mysql'])->where('t_tebus','=',$request->tarikh)->sum('pinjaman');
$total_ansuran = Transaction::on('mysql7')->whereRaw('DATE(created_at) = ?',[$request->tarikh])->where([['trans_type','=','A'],['kodcaw','=',$request->kodcaw]])->sum('duit_masuk');
$total_keuntungan = TransaksiKeuntungan::on('mysql7')->whereRaw('DATE(tarikh_bayaran) = ?',[$request->tarikh])->sum('keuntungan_sebenar');
$total_keuntungan = TransaksiKeuntungan::on('mysql7')->whereRaw('DATE(tarikh_bayaran) = ?',[$request->tarikh])->sum('bayaran_keuntungan');
$total_upah = Advansur::on($cawangan['mysql'])->where('tarikh','=',$request->tarikh)->sum('upahdibayar');
//b
$bilangan_gadai = Gadai::on($cawangan['mysql'])->where('t_gadai','=',$request->tarikh)->count();
@@ -40,6 +44,8 @@ class LaporanController extends Controller
$bilangan_customer_baru = Customer::on($cawangan['mysql'])->where('tarikhdaftar','=',$request->tarikh)->count();
//c
$petibesi_sistem = Vault::on($cawangan['mysql'])->where('tarikh','=', $request->tarikh)->sum('bakiakhir');
$petibesi_deno = Denominasi::on($cawangan['mysql'])->where('tarikh','=', $request->tarikh)->sum('txtjumlah');
//d
$panjar_harian = Panjar::on($cawangan['mysql'])->where('tarikh','=',$request->tarikh)->sum('bayaran');
@@ -111,7 +117,11 @@ class LaporanController extends Controller
'jumlah_lelong'=>$jumlah_lelong,
'baki_lelong'=>$baki_lelong,
'rugi_lelong'=>$rugi_lelong,
'total_keuntungan'=>$total_keuntungan
'total_keuntungan'=>$total_keuntungan,
'total_upah'=>$total_upah,
'petibesi_sistem'=>$petibesi_sistem,
'petibesi_deno'=>$petibesi_deno
]);
return response()->json($laporan_harian);