[29.0] bug 643971 - Enhance vendor and customer checks in advance letters and update blocked status validation - #10950
Conversation
…ked status validation
Good Sense Reviewer - Round 1Recommendation: Request ChangesWhat this PR doesThis PR adds blocked customer and vendor checks before creating advance letters from sales and purchase orders. It also changes the customer advance-letter check so The new checks run before the reports copy fields into the advance-letter headers, so they target the right entry point. The narrowed customer rule also matches the intended invoicing behavior. The main gap is test coverage: the new report path is not covered, and existing sales blocked-status tests still describe the old Problem-solution fitFit: Strong The bug says blocked customer and vendor values can be used when creating advance letters from orders. The diff targets that path and also aligns the SuggestionsS1 (🔴 High): Add order-based blocked-party tests S2 (🟠 Moderate): Update stale Blocked Ship expectations Risk assessment and necessityRisk: This is in CZ advance payment creation and payment posting. An incorrect blocked-status rule can either create financial advance letters for blocked parties or block valid Necessity: The change is needed because report-based creation copies customer and vendor fields without relying on the advance-letter header field validation. The scope is small and focused, but the tests must be aligned before merge.
|
Good Sense Reviewer - Round 2Recommendation: Request ChangesWhat this PR doesThe PR adds blocked customer and vendor checks before creating advance letters from sales and purchase orders. It also narrows the customer advance-letter check so The new commit only changes tests. It updates the existing sales direct-create and payment-posting tests so the Status of previous suggestions
New observations (commits since round 1)None - the new commit only updates the stale sales test expectations. Risk assessment and necessityRisk: The affected path creates financial advance letters from sales and purchase orders. A wrong blocked-party rule can either create documents for blocked parties or block valid Necessity: The blocked checks are needed because order-based creation calls the report setup procedures before it creates the advance letter. The test update is also needed because
|
What & why
When creating advance letters from sales or purchase orders, the system did not validate whether the customer/vendor was blocked before proceeding. Additionally, the customer blocked-status check in
CheckBlockedCustOnAdvanceLettersCZZwas too broad — it rejected customers withBlocked = Ship, which is irrelevant for advance letters (invoicing). This change:SetSalesHeader/SetPurchHeader) so blocked entities are caught early.Blocked <> Blocked::" "toBlocked in [Blocked::All, Blocked::Invoice], allowing customers blocked only for shipping to still have advance letters created.Linked work
Fixes AB#643971
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Blocked = Ship— advance letter created successfully (previously errored).Blocked = All— correctly blocked with an error.Blocked = Invoice— correctly blocked with an error.Blocked = All) — correctly blocked with an error.Risk & compatibility
Blocked = Shipare now allowed to have advance letters created, whereas before they were blocked. This is intentional — theShipblock is not relevant to advance payment invoicing.SetPurchHeader/SetSalesHeadermay surface errors earlier in flows that previously failed later (or silently succeeded). No data migration or schema changes involved.