Repository navigation
fix(dashboard): payment_overdue matches the finance page - #1183
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
waritctd
force-pushed
the
fix/dashboard-payable-matches-finance
branch
from
October 28, 2026 18:46
f11c5ce to
b66ab2e
Compare
…usive payable, derived due date) The dashboard computed what a deal owes with its own SQL: pre-VAT quotation total, ACCEPTED only, no issued-remaining-invoice branch, and the stored due_date. It now calls TicketRepository.paymentOverduePredicate, the one rule the account list scope also uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
waritctd
force-pushed
the
fix/dashboard-payable-matches-finance
branch
from
October 28, 2026 18:52
b66ab2e to
00dc1a9
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The CEO/sales-manager dashboard's
payment_overduecount used its own SQL: pre-VAT quotationtotal_amount, ACCEPTED quotations only (a confirmed DEAL_DIRECT APPROVED quotation was ignored), no issued-remaining-invoice branch, and the storedticket.due_date. Paid amounts include VAT, so the count disagreed with the finance page.TicketRepository.paymentOverduePredicate(ticketIdRef)(new, public static) is the one overdue rule: derived due date (quotation terms + delivery, owner ruling 2026-09-30) before Bangkok today, notDEPOSIT_NOTICE_ISSUED, and VAT-inclusive payable (payableAmountSelect, incl. fix(sales): UI-walk P0s + SK-02/SK-07 (owner rulings 2026-10-28) #1182's answered-quotation + issued-documents branches) minus paid > 0.DashboardRepository.tickets()both call it. The dashboard's own payable/paid laterals are deleted.due_dateno longer counts.Test coverage (written first; 5/6 red before the fix, at the dashboard assertion)
DashboardPaymentOverdueMatchesFinanceIntegrationTest: each case asserts the dashboard count AND the finance summary'soverdue.due_datein the past, no quotation terms → 0DEPOSIT_NOTICE_ISSUED) long after delivery → 0DashboardRepositoryIntegrationTest: thepaymentOverdue == 1fixture is revised to a deal that is overdue under the finance rule.Not covered on purpose: scope variants (scope filter unchanged, covered elsewhere); EN-document VAT (covered in
FinancePayableVatAndDueIntegrationTest).Verification
Follow-up (pre-existing, not in this PR)
frontend/src/api/mockApi.js(~3835) still derives mock overdue from the storeddueDateand doesn't exclude unpaid deposits.🤖 Generated with Claude Code