diff --git a/apps/Frontend/src/components/payments/payments-recent-table.tsx b/apps/Frontend/src/components/payments/payments-recent-table.tsx index d8541cdd..1fc43ac8 100755 --- a/apps/Frontend/src/components/payments/payments-recent-table.tsx +++ b/apps/Frontend/src/components/payments/payments-recent-table.tsx @@ -724,6 +724,19 @@ export default function PaymentsRecentTable({ const val = e.target.value as PaymentStatus; if (val === "PAID") { handlePayAbsoluteFullDue(payment.id); + } else if (payment.status === "PAID") { + // revert the full payment amount, then set the new status + fullPaymentMutation.mutate( + { paymentId: payment.id, type: "revert" }, + { + onSuccess: () => { + updatePaymentStatusMutation.mutate({ + paymentId: payment.id, + status: val, + }); + }, + } + ); } else { updatePaymentStatusMutation.mutate({ paymentId: payment.id,