mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
Merge pull request #48926 from pps190/fix-report-currency
fix: provide missing `company` in report records that require reference to `Company:company:default_currency`
This commit is contained in:
@@ -46,6 +46,7 @@ def get_ordered_to_be_billed_data(args, filters=None):
|
|||||||
child_doctype.item_name,
|
child_doctype.item_name,
|
||||||
child_doctype.description,
|
child_doctype.description,
|
||||||
project_field,
|
project_field,
|
||||||
|
doctype.company,
|
||||||
)
|
)
|
||||||
.where(
|
.where(
|
||||||
(doctype.docstatus == 1)
|
(doctype.docstatus == 1)
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class PaymentLedger:
|
|||||||
against_voucher_no=ple.against_voucher_no,
|
against_voucher_no=ple.against_voucher_no,
|
||||||
amount=ple.amount,
|
amount=ple.amount,
|
||||||
currency=ple.account_currency,
|
currency=ple.account_currency,
|
||||||
|
company=ple.company,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.filters.include_account_currency:
|
if self.filters.include_account_currency:
|
||||||
@@ -77,6 +78,7 @@ class PaymentLedger:
|
|||||||
against_voucher_no="Outstanding:",
|
against_voucher_no="Outstanding:",
|
||||||
amount=total,
|
amount=total,
|
||||||
currency=voucher_data[0].currency,
|
currency=voucher_data[0].currency,
|
||||||
|
company=voucher_data[0].company,
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.filters.include_account_currency:
|
if self.filters.include_account_currency:
|
||||||
@@ -85,7 +87,12 @@ class PaymentLedger:
|
|||||||
voucher_data.append(entry)
|
voucher_data.append(entry)
|
||||||
|
|
||||||
# empty row
|
# empty row
|
||||||
voucher_data.append(frappe._dict())
|
voucher_data.append(
|
||||||
|
frappe._dict(
|
||||||
|
currency=voucher_data[0].currency,
|
||||||
|
company=voucher_data[0].company,
|
||||||
|
)
|
||||||
|
)
|
||||||
self.data.extend(voucher_data)
|
self.data.extend(voucher_data)
|
||||||
|
|
||||||
def build_conditions(self):
|
def build_conditions(self):
|
||||||
@@ -130,7 +137,6 @@ class PaymentLedger:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_columns(self):
|
def get_columns(self):
|
||||||
company_currency = frappe.get_cached_value("Company", self.filters.get("company"), "default_currency")
|
|
||||||
options = None
|
options = None
|
||||||
self.columns.append(
|
self.columns.append(
|
||||||
dict(
|
dict(
|
||||||
@@ -195,7 +201,7 @@ class PaymentLedger:
|
|||||||
label=_("Amount"),
|
label=_("Amount"),
|
||||||
fieldname="amount",
|
fieldname="amount",
|
||||||
fieldtype="Currency",
|
fieldtype="Currency",
|
||||||
options=company_currency,
|
options="Company:company:default_currency",
|
||||||
width="100",
|
width="100",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user