[29.x] bug 640925 - Enhance draft and proforma invoice report layouts and upgrade tag definitions - #11246
Conversation
…initions - Added procedures to upgrade default report layouts for draft and proforma invoices. - Updated report layout definitions to include new fields and adjust existing ones for better alignment. - Improved VAT calculation logic in the Pro Forma invoice report extension.
…ity for invoice reports
Good Sense Reviewer - Round 1Recommendation: Request ChangesWhat this PR doesThis PR adds CZ RDLC layouts for draft and pro forma invoices, initializes them for new companies, and upgrades existing companies to use them when the current default was still unchanged. It also changes the pro forma invoice VAT recap calculation to use temporary sales lines from the posting codeunit before calculating and updating VAT amounts. Most of the change is targeted, but the upgrade guard does not fully protect existing layout choices. It only checks the tenant layout selection row, while older or custom selections can still live in Report Layout Selection, so the upgrade can replace a real custom report layout. Problem-solution fitFit: Partial The change matches the goal of enabling CZ-specific invoice layouts and improving the pro forma VAT recap. The fit is incomplete because the upgrade does not reliably skip companies that already selected a custom layout. SuggestionsS1 (🔴 High): Preserve custom report layout selections Risk assessment and necessityRisk: The main risk is upgrade data mutation in UpgradeApplicationCZL.Codeunit.al, which writes Report Layout Selection and Tenant Report Layout Selection for two sales reports. If the guard is wrong, existing invoice layout customizations can be lost or bypassed. The VAT recap change affects report output only and does not post entries, but it changes visible tax totals on pro forma invoices. Necessity: The change is useful and scoped to the Czech localization reports. It is needed to make the CZ layouts the default when no custom default exists, but it must preserve existing customer choices before it is safe to merge.
|
…or customized selections before setting defaults
Good Sense Reviewer - Round 2Recommendation: Request ChangesWhat this PR doesThis update adds CZ RDLC layouts for draft and pro forma sales invoices, sets them as defaults for new companies, and upgrades existing companies when the current default is still unchanged. It also recalculates the pro forma VAT recap from temporary sales lines and keeps only item lines, which matches the base report's item-only line dataitem. The new commit tries to protect custom default layouts before calling the default-setting helper. The protection is still incomplete because it only checks the tenant layout selection name. A custom layout can be stored in the report layout selection row without a tenant layout selection row, and the default-setting helper still changes that row. Status of previous suggestions
New observations (commits since round 1)None - the new commit only tries to address S1, and no separate new issue was found. Risk assessment and necessityRisk: The upgrade code writes Necessity: The change is needed to make the CZ layouts available and default them safely where no custom choice exists. The scope is reasonable, but preserving existing custom selections is required before merge.
|
What & why
Updates the Czech localization (CZL) Draft Invoice and Pro Forma Invoice report layouts and adds an upgrade procedure to automatically set the CZ-specific RDL layouts as default during upgrade. Fixes the VAT calculation logic in the Pro Forma Invoice report extension to use
SalesPost.GetSalesLineswith temporary records (filtering out non-Item line types and callingUpdateVATOnLines) instead of directly queryingSales Line, which ensures correct VAT amounts. Also adds aTotalLblcolumn to the Pro Forma Invoice layout and updates the RDL template to include new fields and improve alignment.Linked work
Fixes AB#640925
How I validated this
What I tested and the outcome
Publish.ps1; build succeeded with no new analyzer warnings.Risk & compatibility
Report Layout SelectionandTenant Report Layout Selectiontables. It only overrides the default layout when no custom selection has been made (the current selection is empty or matches the metadata default), so existing customizations are preserved.tabledatapermissions added for"Report Layout Selection"(im) and"Tenant Report Layout Selection"(im) in the upgrade codeunit.CalcVATAmountLinesCZLfilters out non-Item line types, which changes the VAT breakdown on the Pro Forma Invoice report — this is intentional to match the correct behavior.