-- Cuts "Balance Sheet Vertical" (MREPORT -1399971488, live menus AC20087/88/89) and -- "Balance Sheet Horizontal" (MREPORT -1399975249, live menus AC20084/85/86) over from their GB4 -- legacy gb4/as/AccountsReports.svc/BalanceSheetVertical and .../BalanceSheetHorizontal endpoints -- to the new GB5-native AccountsSL.EndPoints.AccountReports.BSVerticalReport/BSHorizontalReport, -- and fixes the grouping/subtotal metadata so both the on-screen views and PDF/Excel export roll -- up correctly. Same GB4->GB5 cutover mechanism (SECONDURITEMPLATE, not URITEMPLATE — see -- MenuDAL.cs's "WebService GB5 Uri Template" region) and 0=on/1=off flag convention (verified in -- GB5Shared/Export/ReportExport.cs:1083 and ColumnAggregator.cs:147-148) already used for the -- P&L Vertical/Horizontal cutover this session — see those migrations' own header comments for the -- full mechanism writeup, not repeated here. -- -- Confirmed live, not assumed: -- - MREPORT.WEBSERVICEID -1399999946 (Vertical) / -1399999804 (Horizontal) already exist and are -- used by all 6 live menus; both URITEMPLATEs still point at the GB4 .svc endpoints. -- - AC20087/88/89's URIPARAMETERVALUE supplies {Type}; AC20084/85/86's supplies {GroupType} — the -- placeholder NAME genuinely differs between the two reports (not a typo carried over from -- P&L) — BSVerticalReport's query parameter is named Type, BSHorizontalReport's is GroupType, -- matching each exactly. -- - Vertical's 3 live views (-1399963722 Schedule/-1399963723 Group/-1399963734 Account) all -- carry the same 21 MREPORTVIEWFIELDS rows (AccountId/Code/Name, AccountGroupId/Code/Name, -- AccountScheduleId/Code/Name, ParentGroupId/Code/Name, Debit, Credit, BalanceSheetCredit, -- ReportType, ReportNature, Description, plus an unused Id/Code/Name generic triplet) — a -- verbatim match to BalanceSheetVerticalReportDTO.cs, confirmed via a live JOIN to -- MREPORTVSFIELDS. Only AC20087 (SECONDTEMPLATEID -> BalanceSheetVerticalComponent, already -- fixed this session) has a real, existing custom Angular component; AC20088/89's -- SECONDTEMPLATEID rows (BSGrpVerticalComponent/BSAccountVerticalComponent) point at files that -- do not exist in gb4.7mfe — a separate, pre-existing frontend gap NOT addressed here. Each -- menu also has a plain generic-Grid sibling view that works once this migration's flags land, -- independent of whether the custom component exists. -- - Horizontal's 3 live views (-1499999507 Account/-1499999508 Group/-1499999509 Schedule — these -- ARE the live DEFAULTREPORTVIEWID, REPORTVIEWTYPE=0, no custom component involved) carry 12 -- MREPORTVIEWFIELDS rows matching BalaceSheetHorizontalReportDTO.cs exactly (Liability/Asset -- AccountId/Code/Name/Amount/Type pairs + ReportType/AccountNature) — no separate Group/ -- Schedule-name columns, unlike P&L Horizontal's 18-field set. -- 1) GB5 cutover — Vertical. UPDATE MWEBSERVICE SET SECONDURITEMPLATE = 'http://{BaseURI}/as/AccountReports/BSVerticalReport?Type={Type}&FirstNumber={FirstNumber}&MaxResult={MaxResult}' WHERE WEBSERVICEID = -1399999946 AND (SECONDURITEMPLATE IS NULL OR SECONDURITEMPLATE = ''); GO -- 2) GB5 cutover — Horizontal. UPDATE MWEBSERVICE SET SECONDURITEMPLATE = 'http://{BaseURI}/as/AccountReports/BSHorizontalReport?GroupType={GroupType}&FirstNumber={FirstNumber}&MaxResult={MaxResult}' WHERE WEBSERVICEID = -1399999804 AND (SECONDURITEMPLATE IS NULL OR SECONDURITEMPLATE = ''); GO -- 3) Fix grouping flags — Vertical (0 = ON). UPDATE MREPORTVIEWFIELDS SET ISGROUPCOLUMN = 0 WHERE REPORTVIEWID IN (-1399963722, -1399963723, -1399963734) AND REPORTVSFIELDSID IN ( SELECT REPORTVSFIELDSID FROM MREPORTVSFIELDS WHERE REPORTID = -1399971488 AND FIELDNAME IN ('Description', 'AccountScheduleCode', 'AccountScheduleName', 'AccountGroupCode', 'AccountGroupName', 'ParentGroupCode', 'ParentGroupName', 'AccountCode', 'AccountName') ); GO -- 4) Fix subtotal/grand-total flags — Vertical. UPDATE MREPORTVIEWFIELDS SET ISSUBTOTAL = 0, ISGRANDTOTAL = 0 WHERE REPORTVIEWID IN (-1399963722, -1399963723, -1399963734) AND REPORTVSFIELDSID IN ( SELECT REPORTVSFIELDSID FROM MREPORTVSFIELDS WHERE REPORTID = -1399971488 AND FIELDNAME IN ('Debit', 'Credit', 'BalanceSheetCredit') ); GO -- 5) Fix grouping flags — Horizontal. UPDATE MREPORTVIEWFIELDS SET ISGROUPCOLUMN = 0 WHERE REPORTVIEWID IN (-1499999507, -1499999508, -1499999509) AND REPORTVSFIELDSID IN ( SELECT REPORTVSFIELDSID FROM MREPORTVSFIELDS WHERE REPORTID = -1399975249 AND FIELDNAME IN ('LiabilityAccountCode', 'LiabilityAccountName', 'AssetAccountCode', 'AssetAccountName') ); GO -- 6) Fix subtotal/grand-total flags — Horizontal. UPDATE MREPORTVIEWFIELDS SET ISSUBTOTAL = 0, ISGRANDTOTAL = 0 WHERE REPORTVIEWID IN (-1499999507, -1499999508, -1499999509) AND REPORTVSFIELDSID IN ( SELECT REPORTVSFIELDSID FROM MREPORTVSFIELDS WHERE REPORTID = -1399975249 AND FIELDNAME IN ('LiabilityAmount', 'AssetAmount') ); GO -- ============================================================================= -- END OF MIGRATION 20260904_BalanceSheet_GB5Cutover (SQL Server) -- =============================================================================