mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-21 05:59:18 +00:00
fix: faster range calculation on process period closing voucher
(cherry picked from commit ee33574a6d)
This commit is contained in:
@@ -69,8 +69,8 @@ class ProcessPeriodClosingVoucher(Document):
|
|||||||
pcv = frappe.get_doc("Period Closing Voucher", self.parent_pcv)
|
pcv = frappe.get_doc("Period Closing Voucher", self.parent_pcv)
|
||||||
if pcv.is_first_period_closing_voucher():
|
if pcv.is_first_period_closing_voucher():
|
||||||
gl = qb.DocType("GL Entry")
|
gl = qb.DocType("GL Entry")
|
||||||
min = qb.from_(gl).select(Min(gl.posting_date)).where(gl.company.eq(pcv.company)).run()[0][0]
|
min = qb.from_(gl).select(Min(gl.posting_date)).run()[0][0]
|
||||||
max = qb.from_(gl).select(Max(gl.posting_date)).where(gl.company.eq(pcv.company)).run()[0][0]
|
max = qb.from_(gl).select(Max(gl.posting_date)).run()[0][0]
|
||||||
|
|
||||||
dates = self.get_dates(get_datetime(min), get_datetime(max))
|
dates = self.get_dates(get_datetime(min), get_datetime(max))
|
||||||
for x in dates:
|
for x in dates:
|
||||||
|
|||||||
Reference in New Issue
Block a user