-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
fix: prorate factor for subscription plan #36953
Merged
deepeshgarg007
merged 1 commit into
frappe:version-14-hotfix
from
GursheenK:subscription-plan-invoice-totals
Sep 5, 2023
Merged
fix: prorate factor for subscription plan #36953
deepeshgarg007
merged 1 commit into
frappe:version-14-hotfix
from
GursheenK:subscription-plan-invoice-totals
Sep 5, 2023
Conversation
This file contains 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
GursheenK
requested review from
deepeshgarg007 and
ruthra-kumar
as code owners
September 5, 2023 05:49
frappe-pr-bot
pushed a commit
that referenced
this pull request
Sep 6, 2023
# [14.38.0](v14.37.1...v14.38.0) (2023-09-06) ### Bug Fixes * account payable currency and value ([#36859](#36859)) ([98c2640](98c2640)) * added ignore_user_permissions to parent field of tree doctypes ([451cc7b](451cc7b)) * added validation for unique serial numbers in pos invoice ([#36302](#36302)) ([1192736](1192736)) * allow payment_account of loan repayment to be edited ([#36948](#36948)) ([09e2f24](09e2f24)) * ask for asset related accounts only when needed (backport [#36960](#36960)) ([#36971](#36971)) ([58163d5](58163d5)) * calcuate received/paid amount on rate change in PE ([0a63266](0a63266)) * deduplicate gain/loss JE creation for journals as payment ([9168b3b](9168b3b)) * difference amount in UI should not be calculated ([9bc2b41](9bc2b41)) * fetch discount amount for gle in base currency ([a8b5880](a8b5880)) * ignore mandatory fields while saving WO (backport [#36954](#36954)) ([#36970](#36970)) ([c125dea](c125dea)) * index error on Receivable report based on payment terms ([#36963](#36963)) ([e3d64fc](e3d64fc)) * invalid gain/loss JE created on base currency Expense Claim ([068f1b5](068f1b5)) * only show "Unreconcile" if reconciled ([61752ac](61752ac)) * prorate factor for subscription plan ([#36953](#36953)) ([fc79af5](fc79af5)) * reduce threshold for bg job fn ([5a226a8](5a226a8)) * remove withholding category from common fields ([18f8f7f](18f8f7f)) * Set the default filter in All Trends Report ([132957f](132957f)) * Set the default filter in All Trends Report ([420536c](420536c)) * when create doc from item dashboard default uom (buying or selling) is not correctly selected (backport [#36892](#36892)) ([#36928](#36928)) ([5c8bee0](5c8bee0)) ### Features * **RFQ:** optionally send document print ([#36363](#36363)) ([345c608](345c608))
🎉 This PR is included in version 14.38.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
@Mergifyio backport version-13-hotfix |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Sep 10, 2023
(cherry picked from commit fc79af5)
deepeshgarg007
added a commit
that referenced
this pull request
Sep 10, 2023
…-36953 fix: prorate factor for subscription plan (#36953)
deepeshgarg007
added a commit
that referenced
this pull request
Sep 10, 2023
fix: prorate factor for subscription plan (#36953)
frappe-pr-bot
pushed a commit
that referenced
this pull request
Sep 10, 2023
## [13.52.14](v13.52.13...v13.52.14) (2023-09-10) ### Bug Fixes * prorate factor for subscription plan ([#36953](#36953)) ([d7f09f8](d7f09f8))
frappe-pr-bot
pushed a commit
that referenced
this pull request
Sep 12, 2023
## [13.52.15](v13.52.14...v13.52.15) (2023-09-12) ### Bug Fixes * prorate factor for subscription plan ([#36953](#36953)) ([9a15ed8](9a15ed8))
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Problem
On creation of a Subscription for a Subscription Plan which determines the price based on the Monthly Rate, the resulting Invoices have incorrect total amounts.
Solution
If a Subscription Plan is created with a Monthly Rate of ₹3950 and a Billing Interval of 3 months.
Suppose the start date of current invoice's period for the Subscription is
08-04-2023
and the end date of current invoice's period is30-06-2023
.The prorate factor is now calculated by considering the total number of days in the current month ie. 30 days instead of just the
datediff
between the start and end dates which gives 29 days.Since,
Cost for 1 day = ₹3950 / 30 = ₹131.66
Total Days to be skipped = 7 days
Total Cost for the month of April should be : 3950 - 131.66 * 7 = ₹3028.34
Old Total for 3 month Invoice (considering 29 days) = ₹11060.00
New Total for 3 month Invoice (considering 30 days) = ₹10928.33
no-docs