Skip to content

Commit 16cd227

Browse files
HOTFIX: add amountLeftToPay as default before using branch buyout percentage
1 parent ced7685 commit 16cd227

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/app/controllers/customer_items_controller.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ async function calculateBuyoutStatus(
123123
return {
124124
canBuyout: true,
125125
feedback: "",
126-
price: Math.ceil(item.price * branchBuyoutPercentage),
126+
price:
127+
customerItem.amountLeftToPay ||
128+
Math.ceil(item.price * branchBuyoutPercentage),
127129
} as const;
128130
}
129131

0 commit comments

Comments
 (0)