mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-30 17:42:32 +02:00
fix: consider user permission while populating the data
(cherry picked from commit 074dc6d7dd)
This commit is contained in:
@@ -377,6 +377,8 @@ class ReceivablePayableReport:
|
|||||||
self.data.append(self.total_row_map.get("Total", {}))
|
self.data.append(self.total_row_map.get("Total", {}))
|
||||||
|
|
||||||
def append_row(self, row):
|
def append_row(self, row):
|
||||||
|
if row.voucher_no not in self.invoice_details.keys():
|
||||||
|
return
|
||||||
self.allocate_future_payments(row)
|
self.allocate_future_payments(row)
|
||||||
self.set_invoice_details(row)
|
self.set_invoice_details(row)
|
||||||
self.set_party_details(row)
|
self.set_party_details(row)
|
||||||
@@ -449,16 +451,14 @@ class ReceivablePayableReport:
|
|||||||
self.invoice_details = frappe._dict()
|
self.invoice_details = frappe._dict()
|
||||||
if self.account_type == "Receivable":
|
if self.account_type == "Receivable":
|
||||||
# nosemgrep
|
# nosemgrep
|
||||||
si_list = frappe.db.sql(
|
si_list = frappe.get_list(
|
||||||
"""
|
"Sales Invoice",
|
||||||
select name, due_date, po_no
|
filters={
|
||||||
from `tabSales Invoice`
|
"posting_date": ("<=", self.filters.report_date),
|
||||||
where posting_date <= %s
|
"company": self.filters.company,
|
||||||
and company = %s
|
"docstatus": 1,
|
||||||
and docstatus = 1
|
},
|
||||||
""",
|
fields=["name", "due_date", "po_no"],
|
||||||
(self.filters.report_date, self.filters.company),
|
|
||||||
as_dict=1,
|
|
||||||
)
|
)
|
||||||
for d in si_list:
|
for d in si_list:
|
||||||
self.invoice_details.setdefault(d.name, d)
|
self.invoice_details.setdefault(d.name, d)
|
||||||
@@ -481,33 +481,29 @@ class ReceivablePayableReport:
|
|||||||
|
|
||||||
if self.account_type == "Payable":
|
if self.account_type == "Payable":
|
||||||
# nosemgrep
|
# nosemgrep
|
||||||
for pi in frappe.db.sql(
|
invoices = frappe.get_list(
|
||||||
"""
|
"Purchase Invoice",
|
||||||
select name, due_date, bill_no, bill_date
|
filters={
|
||||||
from `tabPurchase Invoice`
|
"posting_date": ("<=", self.filters.report_date),
|
||||||
where
|
"company": self.filters.company,
|
||||||
posting_date <= %s
|
"docstatus": 1,
|
||||||
and company = %s
|
},
|
||||||
and docstatus = 1
|
fields=["name", "due_date", "bill_no", "bill_date"],
|
||||||
""",
|
)
|
||||||
(self.filters.report_date, self.filters.company),
|
|
||||||
as_dict=1,
|
for pi in invoices:
|
||||||
):
|
|
||||||
self.invoice_details.setdefault(pi.name, pi)
|
self.invoice_details.setdefault(pi.name, pi)
|
||||||
|
|
||||||
# Invoices booked via Journal Entries
|
# Invoices booked via Journal Entries
|
||||||
# nosemgrep
|
# nosemgrep
|
||||||
journal_entries = frappe.db.sql(
|
journal_entries = frappe.get_list(
|
||||||
"""
|
"Journal Entry",
|
||||||
select name, due_date, bill_no, bill_date
|
filters={
|
||||||
from `tabJournal Entry`
|
"posting_date": ("<=", self.filters.report_date),
|
||||||
where
|
"company": self.filters.company,
|
||||||
posting_date <= %s
|
"docstatus": 1,
|
||||||
and company = %s
|
},
|
||||||
and docstatus = 1
|
fields=["name", "due_date", "bill_no", "bill_date"],
|
||||||
""",
|
|
||||||
(self.filters.report_date, self.filters.company),
|
|
||||||
as_dict=1,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
for je in journal_entries:
|
for je in journal_entries:
|
||||||
|
|||||||
Reference in New Issue
Block a user