Skip to content

Conversation

@miljance
Copy link
Contributor

@miljance miljance commented Jan 28, 2026

Summary

This PR addresses two reported issues in Subscription Billing related to incorrect or missing updates of subscription line dates (Subscription Line End Date / Service End Date, Term Until, and Cancellation Possible Until).

Fixed Issues

  1. Initial subscription dates not calculated correctly when Subsequent/Extension Term is defined
    When posting Ship and Invoice from a Sales Order containing a Subscription Item with both Initial Term and Subsequent Term filled, the Subscription Line Start Date updated correctly, but Service End Date and Term Until remained empty.
    The root cause was logic that skipped initial end-date calculations when a Subsequent/Extension Term existed.
    Changes introduce a new internal procedure CalculateInitialSubscriptionDates() in Subscription Line that always calculates both Service End Date (via CalculateInitialServiceEndDate()) and Term Until (via CalculateInitialTermUntilDate()). Calls in Sales Documents, Create Subscription Line, Post Sub. Contract Renewal, and Subscription Header now use this consolidated procedure, ensuring initial dates are set correctly regardless of Subsequent/Extension Term presence.

  2. Cancellation Possible Until and Term Until not recalculated when Service Start Date is modified
    On non-invoiced subscription lines (e.g., after "Extend Contract" or manual edit), changing Service Start Date did not automatically update Cancellation Possible Until or Term Until. The "Update Subscription Line Dates" action also failed to update these fields.
    The refactor ensures consistent date recalculation:

    • CalculateInitialTermUntilDate() now prioritizes existing Subscription Line End Date when set and always updates Cancellation Possible Until via UpdateCancellationPossibleUntil().
    • Consolidated initial date calculation improves reliability when start dates change before invoicing.

Additional Improvements

  • Simplified and standardized the Extension Term tooltip across multiple pages (e.g., Service Commitments, Planned Service Commitments, Customer Contract Lines) by removing outdated references to conditional end-date setting, reflecting the new always-calculate-initial behavior.
  • Added propagation of Renewal Term to Sub. Contr. Analysis Entry for better data consistency in contract analysis.

These changes improve reliability of automatic date calculations, reduce manual corrections, and align behavior with expected subscription lifecycle rules without affecting existing renewal logic for subsequent periods.

Technical code review from @samra-singhammer or @sit-zm required prior to approval by Microsoft.

Work Item(s)

Fixes #6132

@miljance miljance requested a review from a team as a code owner January 28, 2026 15:51
@github-actions github-actions bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork labels Jan 28, 2026
@JesperSchulz JesperSchulz added the Finance GitHub request for Finance area label Jan 29, 2026
@JesperSchulz JesperSchulz reopened this Jan 29, 2026
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 Finance GitHub request for Finance area From Fork Pull request is coming from a fork

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Subscription Line End Date and Term Until does not update automatically correct value

2 participants