Skip to content

[main] bug 643971 - Implement checks for blocked customers and vendors in advance letters#9719

Open
DavidHolusa wants to merge 1 commit into
mainfrom
bugs/643971-main-BlockedCustAndVendInAdvances
Open

[main] bug 643971 - Implement checks for blocked customers and vendors in advance letters#9719
DavidHolusa wants to merge 1 commit into
mainfrom
bugs/643971-main-BlockedCustAndVendInAdvances

Conversation

@DavidHolusa

@DavidHolusa DavidHolusa commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What & why

Add blocked vendor/customer validation to advance letter headers and posting. When a vendor or customer is blocked (All, Payment for vendors; All, Ship, Invoice for customers) or privacy-blocked, the system now raises an error when:

Setting the vendor/customer on a purchase/sales advance letter header (validation).
Posting an advance letter payment (post restrictions check).
This aligns advance letter behavior with standard purchase/sales document blocking and prevents users from creating or posting advance letters for blocked parties.

Linked work

Fixes AB#643971

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

App changes (4 files):

CustomerCZZ.TableExt.al — added CheckBlockedCustOnAdvanceLettersCZZ(Transaction) that checks Privacy Blocked and Blocked <> " ".
VendorCZZ.TableExt.al — added CheckBlockedVendOnAdvanceLettersCZZ(Transaction) with the same logic for vendors.
SalesAdvLetterHeaderCZZ.Table.al — calls the customer check on "Bill-to Customer No." validation (Transaction=false) and in CheckSalesAdvanceLetterPostRestrictions (Transaction=true).
PurchAdvLetterHeaderCZZ.Table.al — calls the vendor check on "Pay-to Vendor No." validation (Transaction=false) and in CheckPurchaseAdvanceLetterPostRestrictions (Transaction=true).
Test changes (2 files, 14 new tests):

Purchase Advance Payments (codeunit 148108) — 6 tests:

CreatePurchAdvLetterWithVendorBlockedAll — error on validation with Blocked::All
CreatePurchAdvLetterWithVendorBlockedPayment — error on validation with Blocked::Payment
CreatePurchAdvLetterWithPrivacyBlockedVendor — error on validation with Privacy Blocked
PostPaymentPurchAdvLetterWithVendorBlockedAll — error on posting with Blocked::All
PostPaymentPurchAdvLetterWithVendorBlockedPayment — error on posting with Blocked::Payment
PostPaymentPurchAdvLetterWithPrivacyBlockedVendor — error on posting with Privacy Blocked

Sales Advance Payments (codeunit 148109) — 8 tests:

CreateSalesAdvLetterWithCustomerBlockedAll — error on validation with Blocked::All
CreateSalesAdvLetterWithCustomerBlockedShip — error on validation with Blocked::Ship
CreateSalesAdvLetterWithCustomerBlockedInvoice — error on validation with Blocked::Invoice
CreateSalesAdvLetterWithPrivacyBlockedCustomer — error on validation with Privacy Blocked
PostPaymentSalesAdvLetterWithCustomerBlockedAll — error on posting with Blocked::All
PostPaymentSalesAdvLetterWithCustomerBlockedShip — error on posting with Blocked::Ship
PostPaymentSalesAdvLetterWithCustomerBlockedInvoice — error on posting with Blocked::Invoice
PostPaymentSalesAdvLetterWithPrivacyBlockedCustomer — error on posting with Privacy Blocked

All tests verify the exact error message text. Helper functions CreateBlockedVendor/CreateBlockedCustomer and shared base procedures reduce duplication.

Risk & compatibility

This is a stricter validation — advance letters previously allowed blocked vendors/customers. Existing advance letters with blocked parties will fail on subsequent payment posting, which is the intended behavior matching standard document blocking.

@DavidHolusa
DavidHolusa requested a review from a team July 24, 2026 15:43
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 24, 2026
@github-actions github-actions Bot added the Finance GitHub request for Finance area label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants