Repository navigation
AR: the aging, the statement and the invoices agree - #153
Merged
Merged
Conversation
… is refused Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…h the documents Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
… on the seeded database Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
A payment received, an application, a credit memo application, a write off and both refunds on a day after the business day in the branch's time zone are refused in words. RestampDay lets the base seed put documents' days on its rows for invoices that are part paid or unpaid. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…documents' days A check the rule would date later is received on the seed's own day; an invoice dated after that day is left unpaid and never dated past it. The base seed restamps its subledger rows to the documents' days. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
… days Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…er dated after today Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…e, and the branch's own day rules Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…lance Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
… not come Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
The subledger writes a row when cash is applied, never on receipt. Each currency now carries the payments still unapplied as of the statement's last day, their sum and the net balance, which equals the aging's total that day. Contract, goldens, the page and the seeded sweep follow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…rvice The invoice day is now refused when it has not come, so a test that moves the order service's clock moves the account service's too. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
… and a future invoice day names invoiced_at Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…n its day is unread, the contract row names every moved value Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
… and the balance stays whole Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…e yard and the balance covers the account Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…ces stay whole; WithClockForTest Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…eption to net equals aging Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
… and the unapplied cash at other yards is named Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…plied cash at other yards is named Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…hours when UTC's day is ahead The core refuses money dated after the branch's own day; a leg that dated today by the UTC clock was refused between UTC's midnight and the branch's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Between UTC's midnight and the branch's, the UTC date is a day the AR core refuses, so the history's documents dated by it were not posted. The history now trades the default branch's calendar day, and its today check skips when the server's UTC day is ahead of it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
The seed's business day is its branches' calendar day. The harness seeded in the branches' own zone and pinned them to UTC afterwards, so between UTC's midnight and that zone's the seeded days and the server's day cut differed and clockwindow and gl_accounts_entries drifted. The seed now takes its branch zone from SEED_BRANCH_TIMEZONE (the production seed leaves it unset and keeps its zone) and the harness sets it to the server's zone. The goldens pass unchanged at an hour when UTC's date is ahead of the branch's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Signed-off-by: colton <colton@futurebuild.ai>
…atabase payment, pos and migration legs date by the branch's day; the account legs read it from the database, so a zone Go cannot load (a day behind UTC at every hour) is read as the core reads it; the legacy row's stamp is noon in the branch's zone; the dashboard leg's yards sit in the default branch's zone. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…d by grants with no yard chosen Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
…ed settings; the page names unapplied cash at other yards for any scoped caller SEED_NOW is set by tests and unset in production. Both seed runs of TestDemoImport read one instant. SEED_BRANCH_TIMEZONE and SEED_NOW are checked at start and refused in words. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: colton <colton@futurebuild.ai>
Signed-off-by: colton <colton@futurebuild.ai>
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.
Item 130, G1 walk notes N12 and N13.
Why. The base seed dated each paying check a fixed step after its invoice, so an invoice made late in the seed's span had a check from the future. The aging counts an application only on or before its as of day, so it showed that invoice open while the invoice read PAID, and the dashboard's Outstanding AR carried the same figure. The statement dated every row from the subledger row's stamp, which the base seed left at the moment it ran.
What changed
RestampDayin the AR core, stamps only).Red legs, each committed alone first
TestDemoImport/no money is dated after the seed's day and the aging agrees with the documentsTestDemoImport/the dashboard's Outstanding AR equals the aging summary's total(and the documents)TestARRefusesAPaymentReceivedOnADayToCome,TestARRefusesAnApplicationOnADayToComeTestARStatementDatesEachRowFromItsDocumentTestARAgingByCustomerPagesThroughItsCursorExisting tests that relied on a later day (three, listed for the reviewer):
TestARDiscountTakenAndReversed(late discount case now an invoice whose discount date has gone, applied today) and two POS payment tests that used a day far ahead as a stand in for any day (now a day in the past).Goldens moved (
clockwindow,gl_accounts_entries,reporting_reports), with a CONTRACT-CHANGES row. No wire shape changes.🤖 Generated with Claude Code