{"title":"Codeunit 5950 Service-Calc. Discount, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5950-service-calc-discount/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":"codeunit","id":5950,"name":"Service-Calc. Discount","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5950-service-calc-discount/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5950-service-calc-discount/source/","path":"src/Layers/W1/BaseApp/Service/Document/ServiceCalcDiscount.Codeunit.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:92":{"name":"Customer Posting Group","url":"https://jonas-paprotka.de/ref/table/92-customer-posting-group/"},"table:5902":{"name":"Service Line","url":"https://jonas-paprotka.de/ref/table/5902-service-line/"},"table:290":{"name":"VAT Amount Line","url":"https://jonas-paprotka.de/ref/table/290-vat-amount-line/"},"table:5900":{"name":"Service Header","url":"https://jonas-paprotka.de/ref/table/5900-service-header/"},"table:19":{"name":"Cust. Invoice Disc.","url":"https://jonas-paprotka.de/ref/table/19-cust-invoice-disc/"},"table:4":{"name":"Currency","url":"https://jonas-paprotka.de/ref/table/4-currency/"},"codeunit:65":{"name":"Discount Notification Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/65-discount-notification-mgt/"}},"procs":[{"name":"OnRun","line":18,"kind":"trigger","steps":[[26,"call","CalculateInvoiceDiscount",3]]},{"name":"CalculateInvoiceDiscount","line":49,"kind":"procedure","access":"local","params":3,"steps":[[58,"event","OnBeforeCalcServDiscount",1],[66,"event","OnCalculateInvoiceDiscountOnBeforeIsServiceChargeUpdated",1],[68,"call","IsServiceChargeUpdated",1],[74,"ext","table",92,"GetServiceChargeAccount",0],[77,"validate",5902,"Unit Price"],[78,"write",5902,"Modify"],[87,"event","OnCalculateInvoiceDiscountOnAfterSetServiceLineFilters",0],[89,"ext","table",5902,"CalcVATAmountLines",5],[91,"ext","table",290,"GetTotalInvDiscBaseAmount",2],[94,"ext","table",290,"GetTotalLineAmount",2],[98,"write",5900,"Modify"],[107,"ext","table",19,"GetRecord",4],[109,"event","OnCalculateInvoiceDiscountOnBeforeApplyServiceCharge",0],[113,"ext","table",4,"Initialize",1],[115,"ext","table",5902,"SetServHeader",1],[119,"validate",5902,"Unit Price"],[125,"validate",5902,"Unit Price"],[126,"write",5902,"Modify"],[134,"ext","table",5902,"SetServHeader",1],[135,"call","GetNewServiceLineNoBias",1],[137,"validate",5902,"No."],[137,"ext","table",92,"GetServiceChargeAccount",0],[139,"validate",5902,"Quantity"],[140,"event","OnCalculateInvoiceDiscountOnAfterServiceLine2ValidateQuantity",0],[142,"validate",5902,"Unit Price"],[148,"validate",5902,"Unit Price"],[150,"event","OnCalculateInvoiceDiscountOnBeforeServiceLineInsert",0],[151,"write",5902,"Insert"],[153,"ext","table",5902,"CalcVATAmountLines",5],[158,"event","OnCalculateInvoiceDiscountOnBeforeServiceLine2Delete",1],[160,"write",5902,"Delete",1],[163,"event","OnCalculateInvoiceDiscountOnAfterApplyServiceCharge",0],[165,"call","CustInvDiscRecExists",1],[167,"ext","table",19,"GetRecord",4],[169,"ext","codeunit",65,"NotifyAboutMissingSetup",5],[176,"write",5900,"Modify"],[178,"ext","table",290,"SetInvoiceDiscountPercent",5],[183,"ext","table",5902,"SetServHeader",1],[184,"ext","table",5902,"UpdateVATOnLines",4],[190,"write",5900,"Modify"],[192,"ext","table",290,"SetInvoiceDiscountPercent",5],[197,"ext","table",5902,"SetServHeader",1],[198,"ext","table",5902,"UpdateVATOnLines",4],[201,"event","OnAfterCalcServDiscount",0]]},{"name":"CalculateWithServHeader","line":212,"kind":"procedure","params":3,"steps":[[216,"call","CalculateInvoiceDiscount",3]]},{"name":"CalculateIncDiscForHeader","line":219,"kind":"procedure","params":1,"steps":[[231,"call","CalculateInvoiceDiscount",3]]}]}