{"title":"Codeunit 3311 PA Billing, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/3311-pa-billing/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":3311,"name":"PA Billing","app":"Payables Agent","url":"https://jonas-paprotka.de/ref/codeunit/3311-pa-billing/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/3311-pa-billing/source/","path":"src/Apps/W1/PayablesAgent/app/Billling/PABilling.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":{"codeunit:3303":{"name":"Payables Agent","url":"https://jonas-paprotka.de/ref/codeunit/3303-payables-agent/"},"codeunit:4312":{"name":"Agent Session","url":"https://jonas-paprotka.de/ref/codeunit/4312-agent-session/"},"codeunit:7785":{"name":"Copilot Quota","url":"https://jonas-paprotka.de/ref/codeunit/7785-copilot-quota/"},"codeunit:10":{"name":"Type Helper","url":"https://jonas-paprotka.de/ref/codeunit/10-type-helper/"}},"procs":[{"name":"LogPurchaseDocumentDraftLinesProcessed","line":25,"kind":"procedure","access":"local","params":2,"steps":[[34,"ext","codeunit",3303,"GetCustomDimensions",0],[35,"ext","codeunit",3303,"GetCurrentSessionsEDocument",0],[42,"ext","codeunit",3303,"GetCurrentSessionsEDocument",0],[47,"ext","codeunit",4312,"GetCurrentSessionAgentTaskId",0],[49,"call","VerifyNumberOfLinesExtracted",2],[50,"call","IncrementNoLinesDocumentsDailyCount",0],[51,"call","GetAllowedNumberOfDocumentsWithoutLinesPerDay",0],[57,"ext","codeunit",3303,"GetCustomDimensions",0],[58,"call","GetLinesRange",1],[62,"call","LogPurchaseDocumentDraftCreated",3],[63,"call","LogLinesExpense",4]]},{"name":"LogPurchaseDocumentDraftCreated","line":86,"kind":"procedure","access":"local","params":3,"steps":[[102,"ext","codeunit",3303,"GetCustomDimensions",0],[107,"ext","codeunit",3303,"GetCustomDimensions",0],[109,"call","LogPATrackingRecord",6]]},{"name":"LogLinesExpense","line":112,"kind":"procedure","access":"local","params":4,"steps":[[118,"call","LogPATrackingRecord",6]]},{"name":"VerifyNumberOfLinesExtracted","line":121,"kind":"procedure","access":"local","params":2,"steps":[[130,"ext","codeunit",3303,"GetCustomDimensions",0]]},{"name":"LogPATrackingRecord","line":137,"kind":"procedure","access":"local","params":6,"steps":[[156,"call","GetUniqueID",4],[157,"ext","codeunit",3303,"GetCustomDimensions",0],[158,"ext","codeunit",7785,"IsAgentUserAIConsumptionLogged",1],[164,"call","UpdateTotalAmountDailyCount",1],[165,"call","GetMaximumNumberOfChargeableAutonomousActionsPerDay",0],[171,"ext","codeunit",3303,"GetCustomDimensions",0],[176,"ext","codeunit",7785,"LogAgentUserAIConsumption",8]]},{"name":"IncrementNoLinesDocumentsDailyCount","line":187,"kind":"procedure","access":"local","params":0,"steps":[[194,"call","GetTodayUsageJsonObject",0]]},{"name":"UpdateTotalAmountDailyCount","line":202,"kind":"procedure","access":"local","params":1,"steps":[[209,"call","GetTodayUsageJsonObject",0]]},{"name":"GetTodayUsageJsonObject","line":217,"kind":"procedure","access":"local","params":0,"steps":[[222,"call","InitializeTodayUsageJsonText",0],[227,"call","GetCurrentUTCDateText",0],[230,"call","InitializeTodayUsageJsonText",0]]},{"name":"GetCurrentUTCDateText","line":233,"kind":"procedure","access":"local","params":0,"steps":[[237,"ext","codeunit",10,"GetCurrUTCDateTime",0]]},{"name":"InitializeTodayUsageJsonText","line":250,"kind":"procedure","access":"local","params":0,"steps":[[252,"call","GetCurrentUTCDateText",0]]}]}