fix rebate in laporan and added imbang duga harian checkup
This commit is contained in:
@@ -959,4 +959,27 @@ class ImbangDugaService
|
||||
|
||||
return $this->transactionExecute($funcInsert);
|
||||
}
|
||||
|
||||
public function getImbangDugaBackupData($jenistally){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$this->kodcaw)->first();
|
||||
|
||||
$tagtallyValue = 0;
|
||||
if($jenistally == 'taktally'){
|
||||
$tagtallyValue = 0;
|
||||
}else if($jenistally == 'tally'){
|
||||
$tagtallyValue = 1;
|
||||
}
|
||||
|
||||
$response = imbangdugabackup::on($cawangan['mysql'])->whereDate('tarikh','=',$this->tarikh)
|
||||
->when($jenistally != 'semua', function ($query) use ($tagtallyValue) {
|
||||
return $query->where('tagtally', $tagtallyValue);
|
||||
})
|
||||
->firstOr(function () {
|
||||
return ['message' => 'No Data'];
|
||||
});
|
||||
|
||||
if(isset($response['message']) == false) $response = $response;
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user