Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-26 08:30:14 +00:00
co-authored by renee-png
parent 8c39b539fa
commit c9db366d7d
+10 -9
View File
@@ -57,7 +57,7 @@ import {
BUCKET_LABEL,
computeBucketBalances,
num,
withRunningBalance,
withAllocations,
} from "@/lib/ledger";
import {
DndContext,
@@ -533,7 +533,7 @@ export function CollectionDetail({
[entries, opening],
);
const withRunning = useMemo(
() => withRunningBalance(entries as any, opening),
() => withAllocations(entries as any, opening),
[entries, opening],
);
@@ -972,13 +972,13 @@ export function CollectionDetail({
<th className="text-left px-2 py-2 font-medium">Date</th>
<th className="text-left px-2 py-2 font-medium">Description</th>
<th className="text-left px-2 py-2 font-medium">Account</th>
<th className="text-right px-1 py-2 font-medium">Assess&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium text-destructive">Bank&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Int&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Late&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Admin&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Legal&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Viol&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Int&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium text-destructive">Bank&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Assess&nbsp;($)</th>
<th className="text-right px-1 py-2 font-medium">Pay&nbsp;(AR)</th>
<th className="text-right px-3 py-2 font-medium">Balance</th>
<th className="px-2 py-2"></th>
@@ -1000,8 +1000,9 @@ export function CollectionDetail({
<td className="px-2 py-2 text-muted-foreground whitespace-nowrap">{formatDate(collection.opened_at)}</td>
<td className="px-2 py-2 text-muted-foreground italic">Opening balance</td>
<td className="px-2 py-2 text-muted-foreground">opening</td>
<td colSpan={6} className="px-1 py-2 text-right font-mono text-muted-foreground">0.00</td>
<td className="px-1 py-2 text-right font-mono">{opening > 0 ? opening.toFixed(2) : "0.00"}</td>
<td colSpan={7} className="px-1 py-2 text-right font-mono text-muted-foreground">0.00</td>
<td className="px-1 py-2 text-right font-mono text-muted-foreground">0.00</td>
<td className="px-3 py-2 text-right font-mono font-semibold">{formatCurrency(opening)}</td>
<td></td>
</tr>
@@ -1019,13 +1020,13 @@ export function CollectionDetail({
))}
<tr className="border-t bg-muted/30 font-medium">
<td colSpan={4} className="px-2 py-2 text-right text-muted-foreground uppercase text-[11px] tracking-wider">Totals:</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.assess)}</td>
<td className="px-1 py-2 text-right font-mono text-destructive">{formatCurrency(totals.bank)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.interest)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.late)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.admin)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.legal)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.viol)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.interest)}</td>
<td className="px-1 py-2 text-right font-mono text-destructive">{formatCurrency(totals.bank)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.assess)}</td>
<td className="px-1 py-2 text-right font-mono">{formatCurrency(totals.payment)}</td>
<td className="px-3 py-2 text-right font-mono">{formatCurrency(computed.total)}</td>
<td></td>