-
Notifications
You must be signed in to change notification settings - Fork 436
[Subscription Billing] Remove internal modifiers and make enums extensible for partner extension support #8387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,9 +4,8 @@ using System.Environment.Configuration; | |||||||
|
|
||||||||
| codeunit 8020 "Personalization Data Mgmt." | ||||||||
| { | ||||||||
| Access = Internal; | ||||||||
|
|
||||||||
| internal procedure SetDataPagePersonalization(ObjectType: Option ,,,Report,,,XMLport,,Page; ObjectID: Text; ValueName: Code[40]; Value: Text) | ||||||||
| procedure SetDataPagePersonalization(ObjectType: Option ,,,Report,,,XMLport,,Page; ObjectID: Text; ValueName: Code[40]; Value: Text) | ||||||||
| var | ||||||||
| PageDataPersonalization: Record "Page Data Personalization"; | ||||||||
| BigText: BigText; | ||||||||
|
|
@@ -27,7 +26,7 @@ codeunit 8020 "Personalization Data Mgmt." | |||||||
| PageDataPersonalization.Modify(false); | ||||||||
| end; | ||||||||
|
|
||||||||
| internal procedure GetDataPagePersonalization(ObjectType: Option ,,,Report,,,XMLport,,Page; ObjectID: Text; ValueName: Code[40]; var Value: Text): Boolean | ||||||||
| procedure GetDataPagePersonalization(ObjectType: Option ,,,Report,,,XMLport,,Page; ObjectID: Text; ValueName: Code[40]; var Value: Text): Boolean | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. User personalization read API exposed to partnersMaking Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||
| var | ||||||||
| PageDataPersonalization: Record "Page Data Personalization"; | ||||||||
| BigText: BigText; | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ namespace Microsoft.SubscriptionBilling; | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| enum 8057 "Customer Rec. Billing Grouping" | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| Extensible = false; | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extensible enum breaks billing document creation
Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||||||||||||||||
| Extensible = true; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| value(0; "Contract") | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ namespace Microsoft.SubscriptionBilling; | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| enum 8058 "Vendor Rec. Billing Grouping" | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| Extensible = false; | ||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extensible enum breaks vendor billing creation
Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||||||||||||||||
| Extensible = true; | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| value(0; "Contract") | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ codeunit 8069 "Sales Subscription Line Mgmt." | |||||||
| AddSalesServiceCommitmentsForSalesLine(Rec, false); | ||||||||
| end; | ||||||||
|
|
||||||||
| internal procedure AddSalesServiceCommitmentsForSalesLine(var SalesLine: Record "Sales Line"; SkipAddAdditionalSalesServComm: Boolean) | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Subscription line attachment bypasses sales-line triggersMaking Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||
| procedure AddSalesServiceCommitmentsForSalesLine(var SalesLine: Record "Sales Line"; SkipAddAdditionalSalesServComm: Boolean) | ||||||||
| var | ||||||||
| ItemServCommitmentPackage: Record "Item Subscription Package"; | ||||||||
| SalesHeader: Record "Sales Header"; | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2247,14 +2247,14 @@ table 8057 "Subscription Header" | |||||||||||||||||
| OnAfterInsertFromItemNoAndCustomerContract(ServiceObject, CustomerContract); | ||||||||||||||||||
| end; | ||||||||||||||||||
|
|
||||||||||||||||||
| internal procedure SetUnitPriceAndUnitCostFromExtendContract(NewUnitPrice: Decimal; NewUnitCost: Decimal) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Public pricing override bypasses price calculationMaking Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||||||||||||
| procedure SetUnitPriceAndUnitCostFromExtendContract(NewUnitPrice: Decimal; NewUnitCost: Decimal) | ||||||||||||||||||
| begin | ||||||||||||||||||
| CalledFromExtendContract := true; | ||||||||||||||||||
| UnitPrice := NewUnitPrice; | ||||||||||||||||||
| UnitCost := NewUnitCost; | ||||||||||||||||||
| end; | ||||||||||||||||||
|
|
||||||||||||||||||
| internal procedure ResetCalledFromExtendContract() | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ResetCalledFromExtendContract lacks pairing contractExposing Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||||||||||||
| procedure ResetCalledFromExtendContract() | ||||||||||||||||||
| begin | ||||||||||||||||||
| CalledFromExtendContract := false; | ||||||||||||||||||
| UnitPrice := 0; | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,7 +10,6 @@ using Microsoft.Sales.Posting; | |||||||
|
|
||||||||
| codeunit 8028 "Usage Based Contr. Subscribers" | ||||||||
| { | ||||||||
| Access = Internal; | ||||||||
|
|
||||||||
| var | ||||||||
| UsageBasedDocTypeConv: Codeunit "Usage Based Doc. Type Conv."; | ||||||||
|
|
@@ -81,7 +80,7 @@ codeunit 8028 "Usage Based Contr. Subscribers" | |||||||
| exit(not UsageDataBilling.IsEmpty()); | ||||||||
| end; | ||||||||
|
|
||||||||
| internal procedure CreateContractInvoicesFromUsageDataImport(ServicePartner: Enum "Service Partner"; ContractNoFilter: Text; ContractLineFilter: Text; BillingRhytmFilter: Text) | ||||||||
| procedure CreateContractInvoicesFromUsageDataImport(ServicePartner: Enum "Service Partner"; ContractNoFilter: Text; ContractLineFilter: Text; BillingRhytmFilter: Text) | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Financial billing API exposed without permission guardRemoving Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||
| begin | ||||||||
| case ServicePartner of | ||||||||
| ServicePartner::Customer: | ||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,7 +2,7 @@ namespace Microsoft.SubscriptionBilling; | |||||||||||
|
|
||||||||||||
| enum 8008 "Usage Based Billing Doc. Type" | ||||||||||||
| { | ||||||||||||
| Extensible = false; | ||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extensible enum leaves cleanup logic with silent gapsDocument cleanup logic in Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||||||
| Extensible = true; | ||||||||||||
| value(0; None) | ||||||||||||
| { | ||||||||||||
| Caption = ' ', Locked = true; | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -295,7 +295,7 @@ table 8013 "Usage Data Import" | |||||||
| CreateCustomerInvoices(CustomerContractFilter, CustomerContractLineFilter); | ||||||||
| end; | ||||||||
|
|
||||||||
| internal procedure CollectVendorContractsAndCreateInvoices(var UsageDataImport: Record "Usage Data Import") | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Vendor invoice creation publicly callable without guardsMaking Recommendation:
Suggested change
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
||||||||
| procedure CollectVendorContractsAndCreateInvoices(var UsageDataImport: Record "Usage Data Import") | ||||||||
| var | ||||||||
| VendorContractFilter: Text; | ||||||||
| VendorContractLineFilter: Text; | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personalization write API exposed without InherentPermissions
Removing
Access = InternalmakesSetDataPagePersonalizationcallable by any partner extension. The method directly inserts or modifies rows in thePage Data Personalizationsystem table. Without an[InherentPermissions]annotation, there is no explicit permission contract for callers, and theObjectIDtext is parsed viaCopyStr+Evaluatewithout error handling—a non-numeric suffix causes a runtime error.Recommendation:
[InherentPermissions(PermissionObjectType::TableData, Database::"Page Data Personalization", 'IMD')]and wrap theEvaluate(ObjectNo, ObjectID)call in anif not Evaluate(...)guard to prevent unhandled runtime errors on malformed input.👍 useful · ❤️ especially valuable · 👎 wrong - reply with why