fix interest

This commit is contained in:
2026-01-11 19:38:15 -03:00
parent 721a5b471d
commit 6fb00c24c1
5 changed files with 46 additions and 14 deletions

View File

@@ -85,7 +85,7 @@ export type CreditCard = z.infer<typeof creditCard>
export function Payment({}) {
const wizard = useWizard()
const { update, summary, ...state } = useWizardStore()
const { total } = summary()
const { subtotal, discount } = summary()
const { control, handleSubmit } = useForm<Schema>({
defaultValues: {
payment_method: state.payment_method,
@@ -156,7 +156,7 @@ export function Payment({}) {
/>
{paymentMethod === 'CREDIT_CARD' ? (
<CreditCard control={control} total={total} />
<CreditCard control={control} total={subtotal + discount} />
) : null}
<Separator />
@@ -367,7 +367,9 @@ export function CreditCard({
}
const value =
calcInterest(total, installment) / installment
installment > 1
? calcInterest(total, installment) / installment
: total
return (
<NativeSelectOption