Skip to content

Commit

Permalink
Merge pull request #40584 from nabinhait/fixed-asset-register-currency
Browse files Browse the repository at this point in the history
fix: show currency symbol in base currency in fixed asset register report
  • Loading branch information
nabinhait authored Apr 2, 2024
2 parents 4c8dfb2 + 21a40a2 commit 5281553
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 11 deletions.
14 changes: 11 additions & 3 deletions erpnext/accounts/report/pos_register/pos_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ def get_pos_entries(filters, group_by_field):
order_by += f", p.{group_by_field}"
select_mop_field = ", p.base_paid_amount - p.change_amount as paid_amount "

# nosemgrep
return frappe.db.sql(
f"""
SELECT
p.posting_date, p.name as pos_invoice, p.pos_profile,
p.posting_date, p.name as pos_invoice, p.pos_profile, p.company,
p.owner, p.customer, p.is_return, p.base_grand_total as grand_total {select_mop_field}
FROM
`tabPOS Invoice` p {from_sales_invoice_payment}
Expand Down Expand Up @@ -201,14 +202,14 @@ def get_columns(filters):
"label": _("Grand Total"),
"fieldname": "grand_total",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 120,
},
{
"label": _("Paid Amount"),
"fieldname": "paid_amount",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 120,
},
{
Expand All @@ -218,6 +219,13 @@ def get_columns(filters):
"width": 150,
},
{"label": _("Is Return"), "fieldname": "is_return", "fieldtype": "Data", "width": 80},
{
"label": _("Company"),
"fieldname": "company",
"fieldtype": "Link",
"options": "Company",
"width": 120,
},
]

return columns
31 changes: 23 additions & 8 deletions erpnext/assets/report/fixed_asset_register/fixed_asset_register.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def get_data(filters):
"asset_category": asset.asset_category,
"purchase_date": asset.purchase_date,
"asset_value": asset_value,
"company": asset.company,
}
data.append(row)

Expand Down Expand Up @@ -369,30 +370,37 @@ def get_columns(filters):
"label": _("Gross Purchase Amount"),
"fieldname": "gross_purchase_amount",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 250,
},
{
"label": _("Opening Accumulated Depreciation"),
"fieldname": "opening_accumulated_depreciation",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 250,
},
{
"label": _("Depreciated Amount"),
"fieldname": "depreciated_amount",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 250,
},
{
"label": _("Asset Value"),
"fieldname": "asset_value",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 250,
},
{
"label": _("Company"),
"fieldname": "company",
"fieldtype": "Link",
"options": "Company",
"width": 120,
},
]

return [
Expand Down Expand Up @@ -423,28 +431,28 @@ def get_columns(filters):
"label": _("Gross Purchase Amount"),
"fieldname": "gross_purchase_amount",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 100,
},
{
"label": _("Asset Value"),
"fieldname": "asset_value",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 100,
},
{
"label": _("Opening Accumulated Depreciation"),
"fieldname": "opening_accumulated_depreciation",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 90,
},
{
"label": _("Depreciated Amount"),
"fieldname": "depreciated_amount",
"fieldtype": "Currency",
"options": "company:currency",
"options": "Company:company:default_currency",
"width": 100,
},
{
Expand All @@ -469,4 +477,11 @@ def get_columns(filters):
"options": "Location",
"width": 100,
},
{
"label": _("Company"),
"fieldname": "company",
"fieldtype": "Link",
"options": "Company",
"width": 120,
},
]

0 comments on commit 5281553

Please sign in to comment.