{"title":"Page 161 Purchase Statistics, extension points 29","url":"https://jonas-paprotka.de/ref/page/161-purchase-statistics/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-10-05","object":{"type":"page","id":161,"name":"Purchase Statistics","app":"Base Application","url":"https://jonas-paprotka.de/ref/page/161-purchase-statistics/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/page/161-purchase-statistics/source/","path":"src/Layers/W1/BaseApp/Purchases/Document/PurchaseStatistics.Page.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"table:38":{"name":"Purchase Header","url":"https://jonas-paprotka.de/ref/table/38-purchase-header/"},"codeunit:66":{"name":"Purch - Calc Disc. By Type","url":"https://jonas-paprotka.de/ref/codeunit/66-purch-calc-disc-by-type/"},"table:290":{"name":"VAT Amount Line","url":"https://jonas-paprotka.de/ref/table/290-vat-amount-line/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"},"codeunit:90":{"name":"Purch.-Post","url":"https://jonas-paprotka.de/ref/codeunit/90-purch-post/"}},"procs":[{"name":"InvDiscountAmount.OnValidate","line":47,"kind":"trigger","steps":[[49,"call","UpdateInvDiscAmount",0]]},{"name":"TotalAmount1.OnValidate","line":61,"kind":"trigger","steps":[[63,"call","UpdateTotalAmount",0]]},{"name":"Vend..OnAfterGetRecord","line":168,"kind":"trigger","steps":[[172,"call","GetVATSpecification",0],[181,"call","CalculateTotals",0]]},{"name":"OnOpenPage","line":184,"kind":"trigger","steps":[[186,"ext","table",38,"PrepareOpeningDocumentStatistics",0],[190,"call","VendInvDiscRecExists",1],[194,"event","OnOpenPageOnBeforeSetEditable",0],[196,"call","SetVATSpecification",0]]},{"name":"OnClosePage","line":199,"kind":"trigger","steps":[[203,"ext","codeunit",66,"ResetRecalculateInvoiceDisc",1]]},{"name":"OnQueryClosePage","line":206,"kind":"trigger","steps":[[208,"call","GetVATSpecification",0],[209,"ext","table",290,"GetAnyLineModified",0],[210,"call","UpdateVATOnPurchLines",0]]},{"name":"UpdateHeaderInfo","line":243,"kind":"procedure","access":"local","params":0,"steps":[[248,"ext","table",290,"GetTotalInvDiscAmount",0],[251,"ext","table",290,"GetTotalVATAmount",0],[253,"ext","table",290,"GetTotalAmountInclVAT",0],[272,"ext","table",330,"ExchangeAmtFCYToLCY",4],[276,"event","OnAfterUpdateHeaderInfo",0]]},{"name":"GetVATSpecification","line":279,"kind":"procedure","access":"local","params":0,"steps":[[282,"ext","table",290,"GetAnyLineModified",0],[283,"call","UpdateHeaderInfo",0]]},{"name":"UpdateTotalAmount","line":294,"kind":"procedure","access":"protected","params":0,"steps":[[298,"call","CheckAllowInvDisc",0],[301,"call","UpdateInvDiscAmount",0],[306,"call","UpdateInvDiscAmount",0]]},{"name":"UpdateInvDiscAmount","line":309,"kind":"procedure","access":"protected","params":0,"steps":[[313,"call","CheckAllowInvDisc",0],[314,"ext","table",290,"GetTotalInvDiscBaseAmount",2],[324,"ext","table",290,"SetInvoiceDiscountAmount",4],[327,"call","UpdateHeaderInfo",0],[331,"write",38,"Modify"],[332,"call","UpdateVATOnPurchLines",0]]},{"name":"UpdateVATOnPurchLines","line":343,"kind":"procedure","params":0,"steps":[[347,"call","GetVATSpecification",0],[348,"ext","table",290,"GetAnyLineModified",0],[349,"ext","table",39,"UpdateVATOnLines",4],[350,"ext","table",39,"UpdateVATOnLines",4]]},{"name":"CalculateTotals","line":369,"kind":"procedure","access":"local","params":0,"steps":[[379,"ext","codeunit",90,"GetPurchLines",3],[381,"ext","codeunit",90,"SumPurchLinesTemp",7],[384,"event","OnCalculateTotalsOnAfterPurchPostSumPurchLinesTemp",0],[400,"ext","table",39,"CalcVATAmountLines",4],[401,"write",290,"ModifyAll"],[402,"call","SetVATSpecification",0],[404,"event","OnAfterCalculateTotals",0]]}]}