mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
refactor: trx currency dr and cr for tax rows and item rows
(cherry picked from commit 4cd3f3531c)
This commit is contained in:
@@ -1047,7 +1047,10 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"account": item.expense_account,
|
"account": item.expense_account,
|
||||||
"against": self.supplier,
|
"against": self.supplier,
|
||||||
"debit": warehouse_debit_amount,
|
"debit": warehouse_debit_amount,
|
||||||
"debit_in_transaction_currency": item.net_amount,
|
"debit_in_transaction_currency": flt(
|
||||||
|
warehouse_debit_amount / self.conversion_rate,
|
||||||
|
item.precision("net_amount"),
|
||||||
|
),
|
||||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||||
"cost_center": item.cost_center,
|
"cost_center": item.cost_center,
|
||||||
"project": item.project or self.project,
|
"project": item.project or self.project,
|
||||||
@@ -1195,8 +1198,10 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"account": stock_rbnb,
|
"account": stock_rbnb,
|
||||||
"against": self.supplier,
|
"against": self.supplier,
|
||||||
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
|
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
|
||||||
"debit_in_transaction_currency": item.item_tax_amount
|
"debit_in_transaction_currency": flt(
|
||||||
/ self.conversion_rate,
|
item.item_tax_amount / self.conversion_rate,
|
||||||
|
item.precision("item_tax_amount"),
|
||||||
|
),
|
||||||
"remarks": self.remarks or _("Accounting Entry for Stock"),
|
"remarks": self.remarks or _("Accounting Entry for Stock"),
|
||||||
"cost_center": self.cost_center,
|
"cost_center": self.cost_center,
|
||||||
"project": item.project or self.project,
|
"project": item.project or self.project,
|
||||||
@@ -1393,6 +1398,10 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"cost_center": tax.cost_center,
|
"cost_center": tax.cost_center,
|
||||||
"against": self.supplier,
|
"against": self.supplier,
|
||||||
"credit": applicable_amount,
|
"credit": applicable_amount,
|
||||||
|
"credit_in_transaction_currency": flt(
|
||||||
|
applicable_amount / self.conversion_rate,
|
||||||
|
frappe.get_precision("Purchase Invoice Item", "item_tax_amount"),
|
||||||
|
),
|
||||||
"remarks": self.remarks or _("Accounting Entry for Stock"),
|
"remarks": self.remarks or _("Accounting Entry for Stock"),
|
||||||
},
|
},
|
||||||
item=tax,
|
item=tax,
|
||||||
@@ -1411,6 +1420,10 @@ class PurchaseInvoice(BuyingController):
|
|||||||
"cost_center": tax.cost_center,
|
"cost_center": tax.cost_center,
|
||||||
"against": self.supplier,
|
"against": self.supplier,
|
||||||
"credit": valuation_tax[tax.name],
|
"credit": valuation_tax[tax.name],
|
||||||
|
"credit_in_transaction_currency": flt(
|
||||||
|
valuation_tax[tax.name] / self.conversion_rate,
|
||||||
|
frappe.get_precision("Purchase Invoice Item", "item_tax_amount"),
|
||||||
|
),
|
||||||
"remarks": self.remarks or _("Accounting Entry for Stock"),
|
"remarks": self.remarks or _("Accounting Entry for Stock"),
|
||||||
},
|
},
|
||||||
item=tax,
|
item=tax,
|
||||||
|
|||||||
Reference in New Issue
Block a user