Skip to content
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

Conversation

GursheenK
Copy link
Member

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.


Screenshot 2023-08-30 at 6 49 20 PM


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 is 30-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

@deepeshgarg007 deepeshgarg007 merged commit fc79af5 into frappe:version-14-hotfix Sep 5, 2023
10 checks passed
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))
@frappe-pr-bot
Copy link
Collaborator

🎉 This PR is included in version 14.38.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@deepeshgarg007
Copy link
Member

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Sep 10, 2023

backport version-13-hotfix

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Sep 10, 2023
deepeshgarg007 added a commit that referenced this pull request Sep 10, 2023
…-36953

fix: prorate factor for subscription plan (#36953)
mergify bot pushed a commit that referenced this pull request Sep 10, 2023
(cherry picked from commit fc79af5)
(cherry picked from commit 9a15ed8)
deepeshgarg007 added a commit that referenced this pull request Sep 10, 2023
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))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants