Skip to content

Commit

Permalink
fix: the purchase receipt trends and delivery note trends report (bac…
Browse files Browse the repository at this point in the history
…kport #43585) (#43587)

* fix: fix the purchase receipt trends and delivery note trends report

(cherry picked from commit 2e9dda1)

* fix: trends date filter issue --formatter

(cherry picked from commit b3e4463)

---------

Co-authored-by: Vishv-silveroak <108357657+Vishv-024@users.noreply.github.com>
Co-authored-by: Nihantra C. Patel <141945075+Nihantra-Patel@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 9, 2024
1 parent 83ce3dd commit 355ba2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/controllers/trends.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def get_data(filters, conditions):
"Delivery Note",
]:
posting_date = "t1.posting_date"
if filters.period_based_on:
if filters.period_based_on and conditions.get("trans") in ["Sales Invoice", "Purchase Invoice"]:
posting_date = "t1." + filters.period_based_on

if conditions["based_on_select"] in ["t1.project,", "t2.project,"]:
Expand Down Expand Up @@ -224,7 +224,7 @@ def period_wise_columns_query(filters, trans):

if trans in ["Purchase Receipt", "Delivery Note", "Purchase Invoice", "Sales Invoice"]:
trans_date = "posting_date"
if filters.period_based_on:
if filters.period_based_on and trans in ["Purchase Invoice", "Sales Invoice"]:
trans_date = filters.period_based_on
else:
trans_date = "transaction_date"
Expand Down

0 comments on commit 355ba2f

Please sign in to comment.