Merge pull request #25004 from ruchamahabal/fix-exchange-rate-in-salary-slip
fix(Payroll): Exchange Rate not getting set in Salary Slip
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index e8f27c3..12a81c7 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -829,10 +829,10 @@
party_account_currency = get_party_account_currency(party_type, party, self.company)
if (party_account_currency
- and (self.currency != party_account_currency
- and self.currency != self.company_currency)):
+ and party_account_currency != self.company_currency
+ and self.currency != party_account_currency):
frappe.throw(_("Accounting Entry for {0}: {1} can only be made in currency: {2}")
- .format(party_type, party, frappe.bold(party_account_currency), InvalidCurrency))
+ .format(party_type, party, party_account_currency), InvalidCurrency)
# Note: not validating with gle account because we don't have the account
# at quotation / sales order level and we shouldn't stop someone
@@ -898,7 +898,7 @@
date = self.get("due_date")
due_date = date or posting_date
- if self.company_currency == self.currency:
+ if party_account_currency == self.company_currency:
grand_total = self.get("base_rounded_total") or self.base_grand_total
else:
grand_total = self.get("rounded_total") or self.grand_total
@@ -959,7 +959,7 @@
for d in self.get("payment_schedule"):
total += flt(d.payment_amount)
- if self.company_currency == self.currency:
+ if party_account_currency == self.company_currency:
total = flt(total, self.precision("base_grand_total"))
grand_total = flt(self.get("base_rounded_total") or self.base_grand_total, self.precision('base_grand_total'))
else:
@@ -1394,7 +1394,7 @@
)
def get_new_child_item(item_row):
- child_doctype = "Sales Order Item" if parent_doctype == "Sales Order" else "Purchase Order Item"
+ child_doctype = "Sales Order Item" if parent_doctype == "Sales Order" else "Purchase Order Item"
return set_order_defaults(parent_doctype, parent_doctype_name, child_doctype, child_docname, item_row)
def validate_quantity(child_item, d):
diff --git a/erpnext/regional/report/gstr_1/gstr_1.py b/erpnext/regional/report/gstr_1/gstr_1.py
index 09b04ff..62faa30 100644
--- a/erpnext/regional/report/gstr_1/gstr_1.py
+++ b/erpnext/regional/report/gstr_1/gstr_1.py
@@ -78,7 +78,7 @@
place_of_supply = invoice_details.get("place_of_supply")
ecommerce_gstin = invoice_details.get("ecommerce_gstin")
- b2cs_output.setdefault((rate, place_of_supply, ecommerce_gstin, inv),{
+ b2cs_output.setdefault((rate, place_of_supply, ecommerce_gstin),{
"place_of_supply": "",
"ecommerce_gstin": "",
"rate": "",
@@ -90,7 +90,7 @@
"invoice_value": invoice_details.get("base_grand_total"),
})
- row = b2cs_output.get((rate, place_of_supply, ecommerce_gstin, inv))
+ row = b2cs_output.get((rate, place_of_supply, ecommerce_gstin))
row["place_of_supply"] = place_of_supply
row["ecommerce_gstin"] = ecommerce_gstin
row["rate"] = rate