fix(webstatement): optimize balance assignment in ProcessAccountDataJob
- Mengubah logika assignment nilai balance untuk memanfaatkan operator null coalescing (??). - Menghapus pengecekan eksplisit untuk `isset` pada `open_actual_bal` dan `open_cleared_bal`. - Menambahkan default value `0` jika data balance tidak tersedia. Signed-off-by: Daeng Deni Mardaeni <ddeni05@gmail.com>
This commit is contained in:
@@ -102,13 +102,8 @@
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Set the balances
|
// Set the balances
|
||||||
if (isset($data['open_actual_bal'])) {
|
$accountBalance->actual_balance = $data['open_actual_bal'] ?? 0;
|
||||||
$accountBalance->actual_balance = $data['open_actual_bal'];
|
$accountBalance->cleared_balance = $data['open_cleared_bal'] ?? 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($data['open_cleared_bal'])) {
|
|
||||||
$accountBalance->cleared_balance = $data['open_cleared_bal'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$accountBalance->save();
|
$accountBalance->save();
|
||||||
Log::info("Saved balance for account {$data['account_number']} for period $period");
|
Log::info("Saved balance for account {$data['account_number']} for period $period");
|
||||||
|
|||||||
Reference in New Issue
Block a user