mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 11:44:11 +00:00
fix(subscription): include days before
(cherry picked from commit 9164162a9e)
This commit is contained in:
@@ -490,11 +490,18 @@ class Subscription(Document):
|
|||||||
if prorate is None:
|
if prorate is None:
|
||||||
prorate = False
|
prorate = False
|
||||||
|
|
||||||
|
prorate_factor = 1
|
||||||
if prorate:
|
if prorate:
|
||||||
prorate_factor = get_prorata_factor(
|
prorate_factor = get_prorata_factor(
|
||||||
self.current_invoice_end,
|
self.current_invoice_end,
|
||||||
self.current_invoice_start,
|
self.current_invoice_start,
|
||||||
cint(self.generate_invoice_at == "Beginning of the current subscription period"),
|
cint(
|
||||||
|
self.generate_invoice_at
|
||||||
|
in [
|
||||||
|
"Beginning of the current subscription period",
|
||||||
|
"Days before the current subscription period",
|
||||||
|
]
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
items = []
|
items = []
|
||||||
@@ -511,20 +518,6 @@ class Subscription(Document):
|
|||||||
|
|
||||||
deferred = frappe.db.get_value("Item", item_code, deferred_field)
|
deferred = frappe.db.get_value("Item", item_code, deferred_field)
|
||||||
|
|
||||||
if not prorate:
|
|
||||||
item = {
|
|
||||||
"item_code": item_code,
|
|
||||||
"qty": plan.qty,
|
|
||||||
"rate": get_plan_rate(
|
|
||||||
plan.plan,
|
|
||||||
plan.qty,
|
|
||||||
party,
|
|
||||||
self.current_invoice_start,
|
|
||||||
self.current_invoice_end,
|
|
||||||
),
|
|
||||||
"cost_center": plan_doc.cost_center,
|
|
||||||
}
|
|
||||||
else:
|
|
||||||
item = {
|
item = {
|
||||||
"item_code": item_code,
|
"item_code": item_code,
|
||||||
"qty": plan.qty,
|
"qty": plan.qty,
|
||||||
|
|||||||
Reference in New Issue
Block a user