[29.0] bug 640925 - Enhance draft and proforma invoice report layouts and upgrade tag definitions - #11247
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 updates Czech draft invoice and pro forma invoice report layouts, sets the Czech RDL layouts as defaults during install and upgrade, and changes the pro forma VAT calculation to build temporary sales lines before calculating the VAT recap. The feature goal is clear, but two changed paths are not safe yet. The upgrade can still replace an existing custom report layout selection, and the VAT calculation keeps a filter active after deleting non-item temporary lines, so it can calculate VAT on an empty filtered set instead of the remaining item lines. Problem-solution fitFit: Partial The requested behavior is valid and the scope matches the Czech report layout work. The implementation only partially fits because the upgrade does not fully protect existing custom layout choices, and the new VAT flow can hide the item lines it needs to calculate. SuggestionsS1 (🔴 High): Do not replace custom layout selections S2 (🔴 High): Clear the line filter before VAT calculation Risk assessment and necessityRisk: The upgrade touches report layout defaults and can affect existing customer report customizations. The pro forma VAT change touches displayed VAT amounts, so an incorrect filter can produce a wrong VAT breakdown on Czech pro forma invoices. Necessity: The feature is needed to make the Czech layouts and VAT recap work as intended. The scope is reasonable, but the two changed code paths must preserve custom selections and calculate from the remaining temporary item lines.
|
…or customized selections before setting defaults
Good Sense Reviewer - Round 2Recommendation: Request ChangesWhat this PR doesThe new commit adds a shared check before setting the Czech Draft Invoice and Pro Forma Invoice layouts as defaults during install and upgrade. The broader change still updates the Czech report layouts and changes the pro forma VAT recap calculation. The latest change does not fully fix the layout-selection risk because the check still ignores the selected layout type and custom layout code. The VAT calculation path is unchanged, so it can still calculate the VAT recap while the temporary sales lines are filtered to non-item lines. Status of previous suggestions
New observations (commits since round 1)None - no new issue was found beyond the previous suggestions. Risk assessment and necessityRisk: The upgrade and install paths still touch default report layout selection and can affect existing custom report defaults. The VAT change still touches displayed VAT amounts on Czech pro forma invoices, so a filtered temporary record can produce a wrong or empty VAT recap. Necessity: The feature remains useful and the scope is reasonable for making the Czech layouts and VAT recap work as intended. The remaining fixes are needed so the change preserves custom layout choices and calculates VAT from the intended item lines.
|
Good Sense Reviewer - Round 3Recommendation: Request ChangesWhat this PR doesThe latest commit rewrites the Czech pro forma VAT calculation so it copies item sales lines into a temporary The VAT-filter problem from the previous round is fixed because the calculation now runs on an unfiltered temporary item-line set. The default-layout guard is still not safe enough: it only checks the tenant layout name, so a custom selection stored in Status of previous suggestions
New observations (commits since round 2)None - the latest code change only addressed the previous VAT calculation finding. Risk assessment and necessityRisk: The remaining risk is in install and upgrade. Existing company-level custom report layout choices can be overwritten for the affected sales reports. The VAT recap path is financially visible, but the latest item-line temporary record change removes the previous filtered-record risk. No BaseApp event publisher dependency was found for this change. Necessity: The feature is needed so the Czech report layouts and VAT recap work as intended. The scope is reasonable, but the default-layout change must preserve custom report layout selections before it is safe to 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.