fix(lease): recalculate un-invoiced schedules from first next start date - #91
Open
iamtalib13 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes schedule recalculation logic when updating
Days to Invoice in Advanceon Lease documents.Previously, updating advance days locked all existing rows and failed to update future periods unless
lease_end_datewas modified. This change preserves invoiced rows and dynamically regenerates only the unbilled periods up to the lease end date.Changes
Sales InvoiceorSales Order.last_invoiced_schedule.end_date + 1(orlease_start_dateif none).How to Test
Days to Invoice in Advance = 5.Sales Invoicefor Row 1.10and trigger schedule regeneration.27-Aug-2026); Rows 2–12 regenerate with the 10-day offset without touching the lease end date.