Skip to content

Commit

Permalink
refactor: remove common method
Browse files Browse the repository at this point in the history
  • Loading branch information
ruthra-kumar committed Feb 21, 2025
1 parent 4fcafad commit 4fd1f4c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions erpnext/controllers/accounts_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,22 +1118,6 @@ def get_gl_dict(self, args, account_currency=None, item=None):
gl_dict, account_currency, self.get("conversion_rate"), self.company_currency
)

# Update details in transaction currency
gl_dict.update(
{
"transaction_currency": self.get("currency") or self.company_currency,
"transaction_exchange_rate": item.get("exchange_rate", 1)
if self.doctype == "Journal Entry" and item
else self.get("conversion_rate", 1),
"debit_in_transaction_currency": self.get_value_in_transaction_currency(
account_currency, gl_dict, "debit"
),
"credit_in_transaction_currency": self.get_value_in_transaction_currency(
account_currency, gl_dict, "credit"
),
}
)

if not args.get("against_voucher_type") and self.get("against_voucher_type"):
gl_dict.update({"against_voucher_type": self.get("against_voucher_type")})

Expand Down Expand Up @@ -1171,12 +1155,6 @@ def get_voucher_subtype(self):

return self.doctype

def get_value_in_transaction_currency(self, account_currency, gl_dict, field):
if account_currency == self.get("currency"):
return gl_dict.get(field + "_in_account_currency")
else:
return flt(gl_dict.get(field, 0) / self.get("conversion_rate", 1))

def validate_zero_qty_for_return_invoices_with_stock(self):
rows = []
for item in self.items:
Expand Down

0 comments on commit 4fd1f4c

Please sign in to comment.