{"title":"Codeunit 8062 Billing Proposal, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/8062-billing-proposal/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-22","object":{"type":"codeunit","id":8062,"name":"Billing Proposal","app":"Subscription Billing","url":"https://jonas-paprotka.de/ref/codeunit/8062-billing-proposal/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/8062-billing-proposal/source/","path":"src/Apps/W1/Subscription Billing/App/Billing/Codeunits/BillingProposal.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:8061":{"name":"Billing Line","url":"https://jonas-paprotka.de/ref/table/8061-billing-line/"},"table:8060":{"name":"Billing Template","url":"https://jonas-paprotka.de/ref/table/8060-billing-template/"},"page:9302":{"name":"Sales Credit Memos","url":"https://jonas-paprotka.de/ref/page/9302-sales-credit-memos/"},"page:9309":{"name":"Purchase Credit Memos","url":"https://jonas-paprotka.de/ref/page/9309-purchase-credit-memos/"},"table:8022":{"name":"Contract Billing Err. Log","url":"https://jonas-paprotka.de/ref/table/8022-contract-billing-err-log/"},"table:8006":{"name":"Usage Data Billing","url":"https://jonas-paprotka.de/ref/table/8006-usage-data-billing/"},"table:8059":{"name":"Subscription Line","url":"https://jonas-paprotka.de/ref/table/8059-subscription-line/"},"table:4":{"name":"Currency","url":"https://jonas-paprotka.de/ref/table/4-currency/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"table:8052":{"name":"Customer Subscription Contract","url":"https://jonas-paprotka.de/ref/table/8052-customer-subscription-contract/"},"table:91":{"name":"User Setup","url":"https://jonas-paprotka.de/ref/table/91-user-setup/"},"page:8001":{"name":"Create Billing Document","url":"https://jonas-paprotka.de/ref/page/8001-create-billing-document/"},"codeunit:8060":{"name":"Create Billing Documents","url":"https://jonas-paprotka.de/ref/codeunit/8060-create-billing-documents/"},"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"},"table:38":{"name":"Purchase Header","url":"https://jonas-paprotka.de/ref/table/38-purchase-header/"},"codeunit:27":{"name":"Confirm Management","url":"https://jonas-paprotka.de/ref/codeunit/27-confirm-management/"},"table:8062":{"name":"Cust. Sub. Contract Line","url":"https://jonas-paprotka.de/ref/table/8062-cust-sub-contract-line/"},"table:8065":{"name":"Vend. Sub. Contract Line","url":"https://jonas-paprotka.de/ref/table/8065-vend-sub-contract-line/"},"table:36":{"name":"Sales Header","url":"https://jonas-paprotka.de/ref/table/36-sales-header/"}},"procs":[{"name":"InitTempTable","line":36,"kind":"procedure","params":2,"steps":[[46,"write",8061,"DeleteAll"],[48,"call","SetKeysForGrouping",3],[51,"call","UpdateGroupingLine",3],[54,"write",8061,"Insert"],[61,"write",8061,"Insert"],[65,"event","OnAfterInitTempTable",0]]},{"name":"RefreshGroupsInTempTable","line":75,"kind":"procedure","access":"internal","params":3,"steps":[[87,"call","SmallestTempBillingLineEntryNo",1],[89,"call","DeleteTempRowsForGroup",3],[90,"call","RebuildTempRowsForGroup",5]]},{"name":"DeleteTempRowsForGroup","line":106,"kind":"procedure","access":"local","params":3,"steps":[[115,"write",8061,"DeleteAll"]]},{"name":"RebuildTempRowsForGroup","line":119,"kind":"procedure","access":"local","params":5,"steps":[[125,"call","SetKeysForGrouping",3],[134,"call","UpdateGroupingLine",3],[137,"write",8061,"Insert"],[144,"write",8061,"Insert"]]},{"name":"UpdateGroupingLine","line":168,"kind":"procedure","access":"local","params":3,"steps":[[170,"call","GroupingLineShouldBeInserted",2],[178,"call","GetServiceAmount",2],[182,"write",8061,"Insert"],[187,"write",8061,"Modify"],[191,"write",8061,"Modify"]]},{"name":"CreateBillingProposal","line":237,"kind":"procedure","params":4,"steps":[[252,"call","DeleteUpdateRequiredBillingLines",1],[255,"ext","table",8060,"ReadFilter",1],[257,"event","OnCreateBillingProposalBeforeApplyFilterToContract",0],[269,"call","ProcessContractServiceCommitments",7],[285,"call","ProcessContractServiceCommitments",7],[302,"run","page",9302],[310,"run","page",9309]]},{"name":"ProcessContractServiceCommitments","line":317,"kind":"procedure","access":"local","params":7,"steps":[[331,"event","OnBeforeProcessContractSubscriptionLines",0],[334,"call","ProcessServiceCommitment",6],[336,"event","OnAfterProcessContractSubscriptionLines",0],[337,"ext","table",8060,"IsPartnerCustomer",0],[338,"call","RecalculateHarmonizedBillingFieldsBasedOnNextBillingDate",2]]},{"name":"ProcessServiceCommitment","line":341,"kind":"procedure","access":"local","params":6,"steps":[[350,"call","FilterBillingLinesOnServiceCommitment",2],[361,"ext","table",8022,"InsertLogFromSubscriptionLine",3],[370,"ext","table",8022,"InsertLogFromSubscriptionLine",3],[381,"ext","table",8006,"FilterOnServiceCommitment",1],[383,"event","OnProcessSubscriptionLineOnAfterFilterUsageDataBilling",0],[387,"event","OnCheckSkipSubscriptionLineOnElse",0],[390,"call","CalculateBillingPeriod",5],[391,"ext","table",8061,"InitNewBillingLine",0],[392,"call","UpdateBillingLine",5]]},{"name":"DeleteUpdateRequiredBillingLines","line":402,"kind":"procedure","access":"local","params":1,"steps":[[410,"call","DeleteBillingLinesForServiceObject",1]]},{"name":"UpdateBillingLine","line":415,"kind":"procedure","access":"local","params":5,"steps":[[425,"call","CalculateNextBillingToDateForServiceCommitment",2],[431,"call","UpdateBillingLineFromServiceCommitment",2],[432,"call","CalculateBillingLineUnitAmountsAndServiceAmount",2],[434,"ext","table",8061,"RebillingUsageDataExist",0],[436,"event","OnBeforeInsertBillingLineUpdateBillingLine",0],[437,"write",8061,"Insert"],[438,"write",8061,"Modify"],[440,"call","UpdateUsageDataBillingLineNoWhenBillingProposalIsCreated",2],[441,"event","OnBeforeUpdateNextBillingDateInUpdateBillingLine",0],[442,"ext","table",8059,"UpdateNextBillingDate",1],[443,"write",8059,"Modify"],[445,"ext","table",8059,"CalculateNextToDate",2],[447,"ext","table",8059,"GetSupplierChargeEndDateIfRebillingMetadataExist",1],[454,"call","CalculateNextBillingToDateForServiceCommitment",2],[462,"ext","table",8061,"InitNewBillingLine",0]]},{"name":"SetBillingLineUnitPriceAndServiceAmountsFromUsageDataBilling","line":467,"kind":"procedure","access":"local","params":2,"steps":[[474,"ext","table",8059,"IsUsageBasedBillingValid",0],[476,"ext","table",8059,"IsUsageDataBillingFound",3],[502,"ext","table",4,"Initialize",1],[504,"ext","table",330,"ExchangeAmtFCYToLCY",4]]},{"name":"CalculateBillingLineUnitAmountsAndServiceAmount","line":508,"kind":"procedure","access":"local","params":2,"steps":[[514,"event","OnBeforeCalculateBillingLineUnitAmountsAndServiceAmount",1],[517,"call","SetBillingLineUnitPriceAndServiceAmountsFromUsageDataBilling",2],[520,"ext","table",4,"Initialize",1],[522,"ext","table",8059,"UnitPriceAndCostForPeriod",7]]},{"name":"UpdateBillingLineFromServiceCommitment","line":531,"kind":"procedure","access":"local","params":2,"steps":[[567,"ext","table",8061,"GetSign",0],[568,"event","OnAfterUpdateBillingLineFromSubscriptionLine",0]]},{"name":"UpdateUsageDataBillingLineNoWhenBillingProposalIsCreated","line":571,"kind":"procedure","access":"local","params":2,"steps":[[575,"ext","table",8059,"IsUsageBasedBillingValid",0],[579,"ext","table",8059,"SetUsageDataBillingFilters",3],[580,"write",8006,"ModifyAll"]]},{"name":"CalculateBillingPeriod","line":583,"kind":"procedure","access":"local","params":5,"steps":[[608,"call","CalculateNextBillingToDateForServiceCommitment",2],[615,"call","CalculateNextBillingToDateForServiceCommitment",2]]},{"name":"CalculateNextBillingToDateForServiceCommitment","line":619,"kind":"procedure","params":2,"steps":[[626,"ext","table",8059,"CalculateNextToDate",2],[629,"ext","table",8059,"GetSupplierChargeEndDateIfRebillingMetadataExist",1],[633,"ext","table",8059,"GetUsageDataChargeEndDateCrossingPeriodEnd",2],[636,"ext","table",8059,"GetUsageDataChargeEndDateCrossingPeriodEnd",2],[638,"ext","table",8059,"IsPartnerCustomer",0],[640,"ext","table",8052,"IsContractTypeSetAsHarmonizedBilling",0],[641,"call","HarmonizeNextBillingTo",2],[644,"event","OnAfterCalculateNextBillingToDateForSubscriptionLine",0]]},{"name":"DisplayErrorIfNotAuthorizedToClearProposalOrDeleteDocuments","line":647,"kind":"procedure","params":0,"steps":[[655,"ext","table",91,"AutoContractBillingAllowed",0]]},{"name":"DeleteBillingProposal","line":659,"kind":"procedure","access":"internal","params":1,"steps":[[669,"call","DisplayErrorIfNotAuthorizedToClearProposalOrDeleteDocuments",0],[690,"write",8061,"Delete",1],[702,"write",8061,"Delete",1]]},{"name":"DeleteBillingLines","line":709,"kind":"procedure","access":"internal","params":1,"steps":[[720,"write",8061,"Delete",1]]},{"name":"DeleteBillingLinesForServiceObject","line":725,"kind":"procedure","access":"local","params":1,"steps":[[735,"write",8061,"Delete",1]]},{"name":"RecalculateHarmonizedBillingFieldsBasedOnNextBillingDate","line":755,"kind":"procedure","access":"local","params":2,"steps":[[759,"call","BillingLinesForCustomerContractCreated",2],[764,"ext","table",8052,"RecalculateHarmonizedBillingFieldsBasedOnNextBillingDate",1]]},{"name":"UpdateBillingToDate","line":767,"kind":"procedure","access":"internal","params":2,"steps":[[779,"event","OnAfterSubscriptionLineGetInUpdateBillingToDate",0],[782,"ext","table",8059,"UpdateNextBillingDate",1],[783,"call","CalculateBillingPeriod",5],[784,"call","UpdateBillingLine",5]]},{"name":"CreateBillingProposalFromContract","line":790,"kind":"procedure","access":"internal","params":3,"steps":[[795,"event","OnBeforeCreateBillingProposalFromContract",1],[798,"call","BillingProposalCanBeCreatedForContract",2],[800,"ext","page",8001,"SetContractData",3]]},{"name":"ErrorIfBillingLinesForAllContractLinesExist","line":804,"kind":"procedure","access":"local","params":2,"steps":[[810,"call","CheckIfBillingLineForCustomerContractLineDoesNotExist",1],[812,"call","CheckIfBillingLineForVendorContractLineDoesNotExist",1]]},{"name":"CheckIfBillingLineWithUnpostedDocumentExists","line":819,"kind":"procedure","access":"local","params":4,"steps":[[821,"ext","table",8061,"FilterBillingLineOnContract",2]]},{"name":"CreateBillingProposalForContract","line":827,"kind":"procedure","access":"internal","params":6,"steps":[[831,"call","CreateTempBillingTemplate",2],[832,"call","ProcessContractServiceCommitments",7]]},{"name":"CreateBillingProposalForPurchaseHeader","line":835,"kind":"procedure","params":4,"steps":[[839,"call","CreateBillingProposalForPurchaseLine",5]]},{"name":"CreateBillingProposalForPurchaseLine","line":842,"kind":"procedure","params":5,"steps":[[848,"call","CreateTempBillingTemplate",2],[851,"call","ProcessServiceCommitment",6],[853,"call","SyncPurchaseLineAndBillingLine",2],[856,"write",8059,"Modify"],[859,"call","AddRecurringBillingFlagToExistingPurchaseHeader",2]]},{"name":"CreatePurchaseLines","line":862,"kind":"procedure","params":1,"steps":[[870,"ext","codeunit",8060,"SetPurchaseHeaderFromExistingPurchaseDocument",2],[871,"ext","codeunit",8060,"SetSkipRequestPageSelection",1],[872,"ext","codeunit",8060,"SetHideProcessingFinishedMessage",0],[873,"run","codeunit",8060]]},{"name":"SyncPurchaseLineAndBillingLine","line":876,"kind":"procedure","access":"local","params":2,"steps":[[880,"ext","table",8061,"GetBillingDocumentTypeFromPurchaseDocumentType",1],[883,"write",8061,"Modify"],[887,"write",39,"Modify"]]},{"name":"AddRecurringBillingFlagToExistingPurchaseHeader","line":890,"kind":"procedure","access":"local","params":2,"steps":[[895,"ext","table",38,"SetRecurringBilling",0]]},{"name":"BillingProposalCanBeCreatedForContract","line":898,"kind":"procedure","access":"local","params":2,"steps":[[903,"call","CheckIfBillingLineWithUnpostedDocumentExists",4],[904,"ext","codeunit",27,"GetResponse",2],[904,"call","GetCreditMemoExistsForBillingLineQst",1],[906,"ext","table",8061,"OpenDocumentCard",0],[910,"call","CheckIfBillingLineWithUnpostedDocumentExists",4],[911,"ext","codeunit",27,"GetResponse",2],[911,"call","GetBillingLineWithUnpostedInvoiceExistsQst",1],[913,"ext","table",8061,"OpenDocumentCard",0],[917,"call","ErrorIfBillingLinesForAllContractLinesExist",2],[918,"call","CheckIfBillingLineForContractExists",2],[919,"ext","codeunit",27,"GetResponse",2]]},{"name":"CreateTempBillingTemplate","line":924,"kind":"procedure","access":"local","params":2,"steps":[[928,"write",8060,"Insert"]]},{"name":"CreateBillingDocument","line":931,"kind":"procedure","params":6,"steps":[[939,"ext","codeunit",8060,"SetBillingGroupingPerContract",1],[940,"ext","codeunit",8060,"SetDocumentDataFromRequestPage",4],[941,"ext","codeunit",8060,"SetSkipRequestPageSelection",1],[942,"run","codeunit",8060],[945,"call","FindBillingLineAndOpenDocumentCard",1]]},{"name":"FindBillingLineAndOpenDocumentCard","line":949,"kind":"procedure","access":"local","params":1,"steps":[[956,"ext","table",8061,"OpenDocumentCard",0]]},{"name":"CheckIfBillingLineForCustomerContractLineDoesNotExist","line":979,"kind":"procedure","access":"local","params":1,"steps":[[985,"ext","table",8062,"FilterOnServiceObjectContractLineType",0],[988,"ext","table",8061,"FilterBillingLineOnContractLine",3]]},{"name":"CheckIfBillingLineForVendorContractLineDoesNotExist","line":994,"kind":"procedure","access":"local","params":1,"steps":[[1000,"ext","table",8065,"FilterOnServiceObjectContractLineType",0],[1003,"ext","table",8061,"FilterBillingLineOnContractLine",3]]},{"name":"CheckIfBillingLineForContractExists","line":1009,"kind":"procedure","access":"local","params":2,"steps":[[1013,"ext","table",8061,"FilterBillingLineOnContract",2]]},{"name":"DeleteBillingDocuments","line":1017,"kind":"procedure","access":"internal","params":1,"steps":[[1029,"call","DisplayErrorIfNotAuthorizedToClearProposalOrDeleteDocuments",0]]},{"name":"DeleteBillingDocuments","line":1094,"kind":"procedure","access":"local","params":1,"steps":[[1101,"ext","table",8061,"GetSalesDocumentTypeFromBillingDocumentType",0],[1102,"write",36,"Delete",1],[1104,"ext","table",8061,"GetPurchaseDocumentTypeFromBillingDocumentType",0],[1105,"write",38,"Delete",1]]}]}