fix latest issues

This commit is contained in:
hafifierahman
2023-01-10 11:01:38 +08:00
parent a1f0a5e77c
commit 239cb1e343
3 changed files with 285 additions and 14 deletions
+30 -14
View File
@@ -1731,7 +1731,7 @@ class TebusController extends Controller
$upahlelong = Lelong::on($cawangan['mysql'])
->where([['t_jual','<=',$request->tarikh],['t_jual','>','2022-07-24']])
->whereYear('t_jual','=',$current->year)
->whereYear('t_jual','=',$tarikhyear->year)
->sum('bakiupah');
@@ -2026,6 +2026,11 @@ class TebusController extends Controller
if($year_generate == 2022 && $intmonth_sebelum > 4)
{
$result_audit_backdate = $this->StokAuditGenerateTerakru($month_sebelum,$cawangan,$year_generate);
}else if($year_generate > 2022 && $intmonth_sekarang == 1){
$previousYear = Carbon::now()->subYears(1);
$result_audit_backdate = $this->StokAuditGenerateTerakru('12',$cawangan,$previousYear->year);
}else{
$result_audit_backdate = $this->StokAuditGenerateTerakru($month_sebelum,$cawangan,$year_generate);
}
$get_norujukan = Gadai::on($cawangan['mysql'])
@@ -2060,26 +2065,36 @@ class TebusController extends Controller
$total = $sum_keun_tebus + $sum_keun_ansuran;
$calculate_month = (int)$month_sekarang - $latest_month_akrunet->bulan;
if(!$determine_past->isToday()){
$calculate_month = (int)$month_sekarang - $latest_month_akrunet->bulan;
if($calculate_month > 1){
return 'ERR_MONTH_SEBELUM';
}else if($calculate_month == 1){
$jumlahakru = AkruNet::on($cawangan['mysql'])
->sum('jumlah');
}else if($calculate_month < 0){
$jumlahakru = AkruNet::on($cawangan['mysql'])
->where('bulan','<=',$intmonth_sekarang)
->sum('jumlah');
if($calculate_month > 1){
return 'ERR_MONTH_SEBELUM';
}else if($calculate_month == 1){
$jumlahakru = AkruNet::on($cawangan['mysql'])
->sum('jumlah');
}else if($calculate_month < 0){
$jumlahakru = AkruNet::on($cawangan['mysql'])
->where('bulan','<=',$intmonth_sekarang)
->sum('jumlah');
return response()->json($jumlahakru);
}else if($calculate_month == 0)
{
$jumlahakru = AkruNet::on($cawangan['mysql'])
->where('bulan','<',$intmonth_sekarang)
->sum('jumlah');
}
}else{
$calculate_month = 0;
return response()->json($jumlahakru);
}else if($calculate_month == 0)
{
$jumlahakru = AkruNet::on($cawangan['mysql'])
->where('bulan','<',$intmonth_sekarang)
->where('tahun', $current->year)
->sum('jumlah');
}
if($determine_past->isToday())
{
$audit_now = Gadai::on($cawangan['mysql'])
@@ -2105,6 +2120,7 @@ class TebusController extends Controller
if($calculate_month <= 1){
$available_akru = AkruNet::on($cawangan['mysql'])
->where('bulan', (int)$month_sekarang)
->where('tahun', $current->year)
->get()->toArray();
if(sizeof($available_akru) == 0)