Skip to content

Conversation

@miljance
Copy link
Contributor

@miljance miljance commented Oct 22, 2025

Summary

  • Usage Data Billing now contains both Product ID and Product Name.
  • Introduced a setup field to control whether the Subscription Line Description or Product Name is printed on a Posted Sales Invoice for "Unit Cost Surcharge" scenario.
  • Updated Demo Data Creation to prevent duplicate Product Name values when fields are imported via Data Exchange Definition in Usage-Based Billing.

⚠️ Note: This pull request requires a technical code review. Please hold off on approval until the technical review is completed by @samra-singhammer.

Work Item(s)

Fixes #4485

@miljance miljance requested a review from a team as a code owner October 22, 2025 13:35
@github-actions github-actions bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels Oct 22, 2025
Copy link
Contributor

@samra-singhammer samra-singhammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Miljan, I've added couple of comments and questions. Please review them.


internal procedure CreateUsageDataBillingFromTempServiceCommitments(var TempServiceCommitment: Record "Subscription Line"; SupplierNo: Code[20]; UsageDataImportEntryNo: Integer; ServiceObjectNo: Code[20]; BillingPeriodStartDate: Date;
BillingPeriodEndDate: Date; UnitCost: Decimal; NewQuantity: Decimal; CostAmount: Decimal; UnitPrice: Decimal; NewAmount: Decimal; CurrencyCode: Code[10])
internal procedure CreateUsageDataBillingFromTempServiceCommitments(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it safe to extend the internal procedure with parameters?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally good question but in this instance this function is not referenced in any of the xxx Microsoft Apps. In this instance I would change the parameters before the new Connector other than Generic one is introduced.

CreateUsageDataBilling.CreateUsageDataBillingFromTempServiceCommitments(TempServiceCommitment, UsageDataImport."Supplier No.", UsageDataGenericImportGlobal."Usage Data Import Entry No.", UsageDataGenericImportGlobal."Subscription Header No.", UsageDataGenericImportGlobal."Billing Period Start Date",
UsageDataGenericImportGlobal."Billing Period End Date", UsageDataGenericImportGlobal.Cost, UsageDataGenericImportGlobal.Quantity,
UsageDataGenericImportGlobal."Cost Amount", UsageDataGenericImportGlobal.Price, UsageDataGenericImportGlobal.Amount, UsageDataGenericImportGlobal.GetCurrencyCode());
CreateUsageDataBilling.CreateUsageDataBillingFromTempServiceCommitments(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you agree that UsageDataGenericImportGlobal can be sent as a parameter instead of passing 10 of it's fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good observation. Would be nice, however this function should also be used by other connectors later on which might and will have different field names.

@miljance miljance requested a review from a team as a code owner October 23, 2025 13:24
@miljance miljance requested a review from pri-kise October 23, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Invoice details not accurate for usage data scenarios [SubscriptionBilling]

3 participants