refactor: use isClosed variable for shouldCountBill condition

This commit is contained in:
Firman Ramdhani
2026-10-01 14:43:20 +07:00
parent d932d9af1c
commit 5c9df31507
+1 -1
View File
@@ -506,7 +506,7 @@ function SubmissionRow({
useEffect(() => {
if (currentBalance !== undefined) {
let balanceBeforeThisOrder = currentBalance
const shouldCountBill = sub.bill != null && (sub.order.status === 'CLOSE' || sub.payment_status === 'LUNAS')
const shouldCountBill = sub.bill != null && (isClosed || sub.payment_status === 'LUNAS')
if (shouldCountBill) {
const diff = (sub.paid_amount || 0) - (sub.bill || 0)
balanceBeforeThisOrder -= diff