Merge pull request #38778 from s-aga-r/FIX-7327
fix: wrong currency in Stock Balance report
diff --git a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py
index ba946c3..d045d91 100644
--- a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py
+++ b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py
@@ -345,21 +345,16 @@
if filters.get("party"):
party = [filters.get("party")]
- query = query.where(
- ((gle.account.isin(tds_accounts) & gle.against.isin(party)))
- | ((gle.voucher_type == "Journal Entry") & (gle.party == filters.get("party")))
- | gle.party.isin(party)
+ jv_condition = gle.against.isin(party) | (
+ (gle.voucher_type == "Journal Entry") & (gle.party == filters.get("party"))
)
else:
party = frappe.get_all(filters.get("party_type"), pluck="name")
- query = query.where(
- ((gle.account.isin(tds_accounts) & gle.against.isin(party)))
- | (
- (gle.voucher_type == "Journal Entry")
- & ((gle.party_type == filters.get("party_type")) | (gle.party_type == ""))
- )
- | gle.party.isin(party)
+ jv_condition = gle.against.isin(party) | (
+ (gle.voucher_type == "Journal Entry")
+ & ((gle.party_type == filters.get("party_type")) | (gle.party_type == ""))
)
+ query = query.where((gle.account.isin(tds_accounts) & jv_condition) | gle.party.isin(party))
return query
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 6b59827..0f21c86 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -662,8 +662,10 @@
"total_amount": d.grand_total,
"outstanding_amount": d.outstanding_amount,
"allocated_amount": d.allocated_amount,
- "exchange_rate": d.exchange_rate if d.exchange_gain_loss else payment_entry.get_exchange_rate(),
- "exchange_gain_loss": d.exchange_gain_loss,
+ "exchange_rate": d.exchange_rate
+ if d.difference_amount is not None
+ else payment_entry.get_exchange_rate(),
+ "exchange_gain_loss": d.difference_amount,
"account": d.account,
}
diff --git a/erpnext/patches/v15_0/create_asset_depreciation_schedules_from_assets.py b/erpnext/patches/v15_0/create_asset_depreciation_schedules_from_assets.py
index 793497b..ddce997 100644
--- a/erpnext/patches/v15_0/create_asset_depreciation_schedules_from_assets.py
+++ b/erpnext/patches/v15_0/create_asset_depreciation_schedules_from_assets.py
@@ -3,6 +3,7 @@
def execute():
frappe.reload_doc("assets", "doctype", "Asset Depreciation Schedule")
+ frappe.reload_doc("assets", "doctype", "Asset Finance Book")
assets = get_details_of_draft_or_submitted_depreciable_assets()
@@ -86,6 +87,7 @@
afb.frequency_of_depreciation,
afb.rate_of_depreciation,
afb.expected_value_after_useful_life,
+ afb.daily_prorata_based,
afb.shift_based,
)
.where(asset.docstatus < 2)
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index 9673a70..d90b71a 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -199,9 +199,8 @@
get_item_data: function(frm, item, overwrite_warehouse=false) {
if (item && !item.item_code) { return; }
- frm.call({
+ frappe.call({
method: "erpnext.stock.get_item_details.get_item_details",
- child: item,
args: {
args: {
item_code: item.item_code,