mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-18 04:29:18 +00:00
Compare commits
128 Commits
mergify/bp
...
v15.54.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ce8299bc8 | ||
|
|
84b03485d6 | ||
|
|
d0b14f1907 | ||
|
|
cd1803a74d | ||
|
|
a1cf27ec17 | ||
|
|
61880a311a | ||
|
|
2d290b153d | ||
|
|
cacb720556 | ||
|
|
3bdd4ce116 | ||
|
|
c479998cd6 | ||
|
|
501e388186 | ||
|
|
af45ec0d6d | ||
|
|
3015628519 | ||
|
|
8b6eea6349 | ||
|
|
81c29e8f8c | ||
|
|
04758d3de3 | ||
|
|
615b0c40a3 | ||
|
|
231abab321 | ||
|
|
fff3b1e84e | ||
|
|
5299a1032b | ||
|
|
1e5fbc0a48 | ||
|
|
5c47c35a0f | ||
|
|
7c8b34fd8f | ||
|
|
83320c97fa | ||
|
|
b004865240 | ||
|
|
525780645a | ||
|
|
12bf31df87 | ||
|
|
041335f318 | ||
|
|
bb553c27ab | ||
|
|
528107e224 | ||
|
|
86b917b04c | ||
|
|
171f966421 | ||
|
|
3f76a413f8 | ||
|
|
bcd02df6fd | ||
|
|
7a71c24d5c | ||
|
|
9186f13458 | ||
|
|
8eddc09bba | ||
|
|
d9c1b58fc3 | ||
|
|
f93d1a2633 | ||
|
|
9e824fc4fe | ||
|
|
b6b47d6683 | ||
|
|
1d818e1510 | ||
|
|
16e8a00f45 | ||
|
|
2bb79c34c3 | ||
|
|
ce90d427e8 | ||
|
|
0eb4556c83 | ||
|
|
b0c9fbe9fc | ||
|
|
0758192c53 | ||
|
|
d2cb659220 | ||
|
|
d0dbfa1cbd | ||
|
|
e8fd2eeaa2 | ||
|
|
8c57e9f8c8 | ||
|
|
5f62fc5a99 | ||
|
|
13bebe71b0 | ||
|
|
b1161f446f | ||
|
|
b8485e1d28 | ||
|
|
fea51b7086 | ||
|
|
49192d90d0 | ||
|
|
32bfc2f555 | ||
|
|
c5cd0fcd29 | ||
|
|
cae8cee398 | ||
|
|
de09da31bc | ||
|
|
fd427ad2ef | ||
|
|
2f60f235a8 | ||
|
|
1c10e4e92f | ||
|
|
c90d33acc3 | ||
|
|
ccaf0d4b85 | ||
|
|
d955986342 | ||
|
|
c127cbac57 | ||
|
|
c6bc5f5d7d | ||
|
|
4573408866 | ||
|
|
94aefcc62d | ||
|
|
9fc1c3550f | ||
|
|
4542a759ae | ||
|
|
42f7ee905c | ||
|
|
89f7834517 | ||
|
|
da8a712249 | ||
|
|
5d04501454 | ||
|
|
b9fcc786fa | ||
|
|
15da04d7de | ||
|
|
d1fee96f75 | ||
|
|
5e13dcfe55 | ||
|
|
74650217c1 | ||
|
|
47ab3c5dbe | ||
|
|
b6f5208e29 | ||
|
|
b75c7364d6 | ||
|
|
85c2d32de6 | ||
|
|
120bccdad3 | ||
|
|
47a622d0cb | ||
|
|
23b846ef39 | ||
|
|
625ff4b276 | ||
|
|
da11589b74 | ||
|
|
7344e46717 | ||
|
|
d6614f2848 | ||
|
|
ac18c56a0b | ||
|
|
246f4373b5 | ||
|
|
430c4825c0 | ||
|
|
5d7a3b5979 | ||
|
|
6a869139a6 | ||
|
|
e240ff4f6c | ||
|
|
08e58e13ac | ||
|
|
c513c7f73d | ||
|
|
bc0be5a00a | ||
|
|
807694206b | ||
|
|
c3d1e122be | ||
|
|
d5fed84182 | ||
|
|
7f96aee06f | ||
|
|
a5a219cd6e | ||
|
|
005df08656 | ||
|
|
059cb6d8b3 | ||
|
|
bb75adb59c | ||
|
|
3a5959e023 | ||
|
|
140b62a1e3 | ||
|
|
f25d65ecc4 | ||
|
|
763951af27 | ||
|
|
139a56b8a4 | ||
|
|
b718ca4489 | ||
|
|
1900cebf52 | ||
|
|
f7d860daf1 | ||
|
|
640c13a5f3 | ||
|
|
a79d2946a1 | ||
|
|
9aed428939 | ||
|
|
cd497743f4 | ||
|
|
8eb8cc5d3c | ||
|
|
375b48699f | ||
|
|
bc601f36c9 | ||
|
|
6e01a9b84d | ||
|
|
911ec37d13 |
@@ -4,7 +4,7 @@ import inspect
|
||||
import frappe
|
||||
from frappe.utils.user import is_website_user
|
||||
|
||||
__version__ = "15.45.4"
|
||||
__version__ = "15.54.2"
|
||||
|
||||
|
||||
def get_default_company(user=None):
|
||||
|
||||
@@ -279,7 +279,8 @@
|
||||
{
|
||||
"fieldname": "transaction_exchange_rate",
|
||||
"fieldtype": "Float",
|
||||
"label": "Transaction Exchange Rate"
|
||||
"label": "Transaction Exchange Rate",
|
||||
"precision": "9"
|
||||
},
|
||||
{
|
||||
"fieldname": "debit_in_transaction_currency",
|
||||
@@ -357,7 +358,7 @@
|
||||
"idx": 1,
|
||||
"in_create": 1,
|
||||
"links": [],
|
||||
"modified": "2024-08-22 13:03:39.997475",
|
||||
"modified": "2025-02-21 14:36:49.431166",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "GL Entry",
|
||||
|
||||
@@ -1059,14 +1059,15 @@ class JournalEntry(AccountsController):
|
||||
gl_map = []
|
||||
|
||||
company_currency = erpnext.get_company_currency(self.company)
|
||||
self.transaction_currency = company_currency
|
||||
self.transaction_exchange_rate = 1
|
||||
if self.multi_currency:
|
||||
for row in self.get("accounts"):
|
||||
if row.account_currency != company_currency:
|
||||
self.currency = row.account_currency
|
||||
self.conversion_rate = row.exchange_rate
|
||||
# Journal assumes the first foreign currency as transaction currency
|
||||
self.transaction_currency = row.account_currency
|
||||
self.transaction_exchange_rate = row.exchange_rate
|
||||
break
|
||||
else:
|
||||
self.currency = company_currency
|
||||
|
||||
for d in self.get("accounts"):
|
||||
if d.debit or d.credit or (self.voucher_type == "Exchange Gain Or Loss"):
|
||||
@@ -1091,6 +1092,18 @@ class JournalEntry(AccountsController):
|
||||
"credit_in_account_currency": flt(
|
||||
d.credit_in_account_currency, d.precision("credit_in_account_currency")
|
||||
),
|
||||
"transaction_currency": self.transaction_currency,
|
||||
"transaction_exchange_rate": self.transaction_exchange_rate,
|
||||
"debit_in_transaction_currency": flt(
|
||||
d.debit_in_account_currency, d.precision("debit_in_account_currency")
|
||||
)
|
||||
if self.transaction_currency == d.account_currency
|
||||
else flt(d.debit, d.precision("debit")) / self.transaction_exchange_rate,
|
||||
"credit_in_transaction_currency": flt(
|
||||
d.credit_in_account_currency, d.precision("credit_in_account_currency")
|
||||
)
|
||||
if self.transaction_currency == d.account_currency
|
||||
else flt(d.credit, d.precision("credit")) / self.transaction_exchange_rate,
|
||||
"against_voucher_type": d.reference_type,
|
||||
"against_voucher": d.reference_name,
|
||||
"remarks": remarks,
|
||||
|
||||
@@ -575,7 +575,7 @@ class TestJournalEntry(unittest.TestCase):
|
||||
order_by="account",
|
||||
)
|
||||
expected = [
|
||||
{"account": "_Test Bank - _TC", "transaction_exchange_rate": 1.0},
|
||||
{"account": "_Test Bank - _TC", "transaction_exchange_rate": 85.0},
|
||||
{"account": "_Test Receivable USD - _TC", "transaction_exchange_rate": 85.0},
|
||||
]
|
||||
self.assertEqual(expected, actual)
|
||||
|
||||
@@ -1217,15 +1217,22 @@ class PaymentEntry(AccountsController):
|
||||
|
||||
self.set("remarks", "\n".join(remarks))
|
||||
|
||||
def set_transaction_currency_and_rate(self):
|
||||
company_currency = erpnext.get_company_currency(self.company)
|
||||
self.transaction_currency = company_currency
|
||||
self.transaction_exchange_rate = 1
|
||||
|
||||
if self.paid_from_account_currency != company_currency:
|
||||
self.transaction_currency = self.paid_from_account_currency
|
||||
self.transaction_exchange_rate = self.source_exchange_rate
|
||||
elif self.paid_to_account_currency != company_currency:
|
||||
self.transaction_currency = self.paid_to_account_currency
|
||||
self.transaction_exchange_rate = self.target_exchange_rate
|
||||
|
||||
def build_gl_map(self):
|
||||
if self.payment_type in ("Receive", "Pay") and not self.get("party_account_field"):
|
||||
self.setup_party_account_field()
|
||||
|
||||
company_currency = erpnext.get_company_currency(self.company)
|
||||
if self.paid_from_account_currency != company_currency:
|
||||
self.currency = self.paid_from_account_currency
|
||||
elif self.paid_to_account_currency != company_currency:
|
||||
self.currency = self.paid_to_account_currency
|
||||
self.set_transaction_currency_and_rate()
|
||||
|
||||
gl_entries = []
|
||||
self.add_party_gl_entries(gl_entries)
|
||||
@@ -1304,6 +1311,9 @@ class PaymentEntry(AccountsController):
|
||||
"cost_center": cost_center,
|
||||
dr_or_cr + "_in_account_currency": d.allocated_amount,
|
||||
dr_or_cr: allocated_amount_in_company_currency,
|
||||
dr_or_cr + "_in_transaction_currency": d.allocated_amount
|
||||
if self.transaction_currency == self.party_account_currency
|
||||
else allocated_amount_in_company_currency / self.transaction_exchange_rate,
|
||||
},
|
||||
item=self,
|
||||
)
|
||||
@@ -1348,6 +1358,9 @@ class PaymentEntry(AccountsController):
|
||||
"account_currency": self.party_account_currency,
|
||||
"cost_center": self.cost_center,
|
||||
dr_or_cr + "_in_account_currency": self.unallocated_amount,
|
||||
dr_or_cr + "_in_transaction_currency": self.unallocated_amount
|
||||
if self.party_account_currency == self.transaction_currency
|
||||
else base_unallocated_amount / self.transaction_exchange_rate,
|
||||
dr_or_cr: base_unallocated_amount,
|
||||
},
|
||||
item=self,
|
||||
@@ -1365,6 +1378,7 @@ class PaymentEntry(AccountsController):
|
||||
def make_advance_gl_entries(
|
||||
self, entry: object | dict = None, cancel: bool = 0, update_outstanding: str = "Yes"
|
||||
):
|
||||
self.set_transaction_currency_and_rate()
|
||||
gl_entries = []
|
||||
self.add_advance_gl_entries(gl_entries, entry)
|
||||
|
||||
@@ -1444,9 +1458,16 @@ class PaymentEntry(AccountsController):
|
||||
frappe.db.set_value("Payment Entry Reference", invoice.name, "reconcile_effect_on", posting_date)
|
||||
|
||||
dr_or_cr, account = self.get_dr_and_account_for_advances(invoice)
|
||||
base_allocated_amount = self.calculate_base_allocated_amount_for_reference(invoice)
|
||||
args_dict["account"] = account
|
||||
args_dict[dr_or_cr] = self.calculate_base_allocated_amount_for_reference(invoice)
|
||||
args_dict[dr_or_cr] = base_allocated_amount
|
||||
args_dict[dr_or_cr + "_in_account_currency"] = invoice.allocated_amount
|
||||
args_dict[dr_or_cr + "_in_transaction_currency"] = (
|
||||
invoice.allocated_amount
|
||||
if self.party_account_currency == self.transaction_currency
|
||||
else base_allocated_amount / self.transaction_exchange_rate
|
||||
)
|
||||
|
||||
args_dict.update(
|
||||
{
|
||||
"against_voucher_type": invoice.reference_doctype,
|
||||
@@ -1464,8 +1485,13 @@ class PaymentEntry(AccountsController):
|
||||
args_dict[dr_or_cr + "_in_account_currency"] = 0
|
||||
dr_or_cr = "debit" if dr_or_cr == "credit" else "credit"
|
||||
args_dict["account"] = self.party_account
|
||||
args_dict[dr_or_cr] = self.calculate_base_allocated_amount_for_reference(invoice)
|
||||
args_dict[dr_or_cr] = base_allocated_amount
|
||||
args_dict[dr_or_cr + "_in_account_currency"] = invoice.allocated_amount
|
||||
args_dict[dr_or_cr + "_in_transaction_currency"] = (
|
||||
invoice.allocated_amount
|
||||
if self.party_account_currency == self.transaction_currency
|
||||
else base_allocated_amount / self.transaction_exchange_rate
|
||||
)
|
||||
args_dict.update(
|
||||
{
|
||||
"against_voucher_type": "Payment Entry",
|
||||
@@ -1487,6 +1513,9 @@ class PaymentEntry(AccountsController):
|
||||
"account_currency": self.paid_from_account_currency,
|
||||
"against": self.party if self.payment_type == "Pay" else self.paid_to,
|
||||
"credit_in_account_currency": self.paid_amount,
|
||||
"credit_in_transaction_currency": self.paid_amount
|
||||
if self.paid_from_account_currency == self.transaction_currency
|
||||
else self.base_paid_amount / self.transaction_exchange_rate,
|
||||
"credit": self.base_paid_amount,
|
||||
"cost_center": self.cost_center,
|
||||
"post_net_value": True,
|
||||
@@ -1502,6 +1531,9 @@ class PaymentEntry(AccountsController):
|
||||
"account_currency": self.paid_to_account_currency,
|
||||
"against": self.party if self.payment_type == "Receive" else self.paid_from,
|
||||
"debit_in_account_currency": self.received_amount,
|
||||
"debit_in_transaction_currency": self.received_amount
|
||||
if self.paid_to_account_currency == self.transaction_currency
|
||||
else self.base_received_amount / self.transaction_exchange_rate,
|
||||
"debit": self.base_received_amount,
|
||||
"cost_center": self.cost_center,
|
||||
},
|
||||
@@ -1537,6 +1569,8 @@ class PaymentEntry(AccountsController):
|
||||
dr_or_cr + "_in_account_currency": base_tax_amount
|
||||
if account_currency == self.company_currency
|
||||
else d.tax_amount,
|
||||
dr_or_cr + "_in_transaction_currency": base_tax_amount
|
||||
/ self.transaction_exchange_rate,
|
||||
"cost_center": d.cost_center,
|
||||
"post_net_value": True,
|
||||
},
|
||||
@@ -1562,6 +1596,8 @@ class PaymentEntry(AccountsController):
|
||||
rev_dr_or_cr + "_in_account_currency": base_tax_amount
|
||||
if account_currency == self.company_currency
|
||||
else d.tax_amount,
|
||||
rev_dr_or_cr + "_in_transaction_currency": base_tax_amount
|
||||
/ self.transaction_exchange_rate,
|
||||
"cost_center": self.cost_center,
|
||||
"post_net_value": True,
|
||||
},
|
||||
@@ -1584,6 +1620,7 @@ class PaymentEntry(AccountsController):
|
||||
"account_currency": account_currency,
|
||||
"against": self.party or self.paid_from,
|
||||
"debit_in_account_currency": d.amount,
|
||||
"debit_in_transaction_currency": d.amount / self.transaction_exchange_rate,
|
||||
"debit": d.amount,
|
||||
"cost_center": d.cost_center,
|
||||
},
|
||||
|
||||
@@ -173,4 +173,4 @@
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -871,6 +871,7 @@ class PurchaseInvoice(BuyingController):
|
||||
self.make_payment_gl_entries(gl_entries)
|
||||
self.make_write_off_gl_entry(gl_entries)
|
||||
self.make_gle_for_rounding_adjustment(gl_entries)
|
||||
self.set_transaction_currency_and_rate_in_gl_map(gl_entries)
|
||||
return gl_entries
|
||||
|
||||
def check_asset_cwip_enabled(self):
|
||||
@@ -916,6 +917,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"credit_in_account_currency": base_grand_total
|
||||
if self.party_account_currency == self.company_currency
|
||||
else grand_total,
|
||||
"credit_in_transaction_currency": grand_total,
|
||||
"against_voucher": against_voucher,
|
||||
"against_voucher_type": self.doctype,
|
||||
"project": self.project,
|
||||
@@ -951,7 +953,7 @@ class PurchaseInvoice(BuyingController):
|
||||
valuation_tax_accounts = [
|
||||
d.account_head
|
||||
for d in self.get("taxes")
|
||||
if d.category in ("Valuation", "Total and Valuation")
|
||||
if d.category in ("Valuation", "Valuation and Total")
|
||||
and flt(d.base_tax_amount_after_discount_amount)
|
||||
]
|
||||
|
||||
@@ -991,6 +993,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"project": item.project or self.project,
|
||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||
"debit": warehouse_debit_amount,
|
||||
"debit_in_transaction_currency": item.net_amount,
|
||||
},
|
||||
warehouse_account[item.warehouse]["account_currency"],
|
||||
item=item,
|
||||
@@ -1011,6 +1014,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"project": item.project or self.project,
|
||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||
"debit": -1 * flt(credit_amount, item.precision("base_net_amount")),
|
||||
"debit_in_transaction_currency": item.net_amount,
|
||||
},
|
||||
warehouse_account[item.from_warehouse]["account_currency"],
|
||||
item=item,
|
||||
@@ -1025,6 +1029,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"account": item.expense_account,
|
||||
"against": self.supplier,
|
||||
"debit": flt(item.base_net_amount, item.precision("base_net_amount")),
|
||||
"debit_in_transaction_currency": item.net_amount,
|
||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||
"cost_center": item.cost_center,
|
||||
"project": item.project,
|
||||
@@ -1042,6 +1047,10 @@ class PurchaseInvoice(BuyingController):
|
||||
"account": item.expense_account,
|
||||
"against": self.supplier,
|
||||
"debit": warehouse_debit_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"),
|
||||
"cost_center": item.cost_center,
|
||||
"project": item.project or self.project,
|
||||
@@ -1054,7 +1063,9 @@ class PurchaseInvoice(BuyingController):
|
||||
# Amount added through landed-cost-voucher
|
||||
if landed_cost_entries:
|
||||
if (item.item_code, item.name) in landed_cost_entries:
|
||||
for account, amount in landed_cost_entries[(item.item_code, item.name)].items():
|
||||
for account, base_amount in landed_cost_entries[
|
||||
(item.item_code, item.name)
|
||||
].items():
|
||||
gl_entries.append(
|
||||
self.get_gl_dict(
|
||||
{
|
||||
@@ -1062,8 +1073,9 @@ class PurchaseInvoice(BuyingController):
|
||||
"against": item.expense_account,
|
||||
"cost_center": item.cost_center,
|
||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||
"credit": flt(amount["base_amount"]),
|
||||
"credit_in_account_currency": flt(amount["amount"]),
|
||||
"credit": flt(base_amount["base_amount"]),
|
||||
"credit_in_account_currency": flt(base_amount["amount"]),
|
||||
"credit_in_transaction_currency": item.net_amount,
|
||||
"project": item.project or self.project,
|
||||
},
|
||||
item=item,
|
||||
@@ -1086,6 +1098,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"project": item.project or self.project,
|
||||
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),
|
||||
"credit": flt(item.rm_supp_cost),
|
||||
"credit_in_transaction_currency": item.net_amount,
|
||||
},
|
||||
warehouse_account[self.supplier_warehouse]["account_currency"],
|
||||
item=item,
|
||||
@@ -1099,7 +1112,7 @@ class PurchaseInvoice(BuyingController):
|
||||
else item.deferred_expense_account
|
||||
)
|
||||
|
||||
dummy, amount = self.get_amount_and_base_amount(item, None)
|
||||
amount, base_amount = self.get_amount_and_base_amount(item, None)
|
||||
|
||||
if provisional_accounting_for_non_stock_items:
|
||||
self.make_provisional_gl_entry(gl_entries, item)
|
||||
@@ -1110,7 +1123,8 @@ class PurchaseInvoice(BuyingController):
|
||||
{
|
||||
"account": expense_account,
|
||||
"against": self.supplier,
|
||||
"debit": amount,
|
||||
"debit": base_amount,
|
||||
"debit_in_transaction_currency": amount,
|
||||
"cost_center": item.cost_center,
|
||||
"project": item.project or self.project,
|
||||
},
|
||||
@@ -1184,6 +1198,10 @@ class PurchaseInvoice(BuyingController):
|
||||
"account": stock_rbnb,
|
||||
"against": self.supplier,
|
||||
"debit": flt(item.item_tax_amount, item.precision("item_tax_amount")),
|
||||
"debit_in_transaction_currency": flt(
|
||||
item.item_tax_amount / self.conversion_rate,
|
||||
item.precision("item_tax_amount"),
|
||||
),
|
||||
"remarks": self.remarks or _("Accounting Entry for Stock"),
|
||||
"cost_center": self.cost_center,
|
||||
"project": item.project or self.project,
|
||||
@@ -1299,6 +1317,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"account": cost_of_goods_sold_account,
|
||||
"against": item.expense_account,
|
||||
"debit": stock_adjustment_amt,
|
||||
"debit_in_transaction_currency": item.net_amount,
|
||||
"remarks": self.get("remarks") or _("Stock Adjustment"),
|
||||
"cost_center": item.cost_center,
|
||||
"project": item.project or self.project,
|
||||
@@ -1332,6 +1351,7 @@ class PurchaseInvoice(BuyingController):
|
||||
dr_or_cr + "_in_account_currency": base_amount
|
||||
if account_currency == self.company_currency
|
||||
else amount,
|
||||
dr_or_cr + "_in_transaction_currency": amount,
|
||||
"cost_center": tax.cost_center,
|
||||
},
|
||||
account_currency,
|
||||
@@ -1378,6 +1398,10 @@ class PurchaseInvoice(BuyingController):
|
||||
"cost_center": tax.cost_center,
|
||||
"against": self.supplier,
|
||||
"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"),
|
||||
},
|
||||
item=tax,
|
||||
@@ -1396,6 +1420,10 @@ class PurchaseInvoice(BuyingController):
|
||||
"cost_center": tax.cost_center,
|
||||
"against": self.supplier,
|
||||
"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"),
|
||||
},
|
||||
item=tax,
|
||||
@@ -1411,6 +1439,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"account": self.unrealized_profit_loss_account,
|
||||
"against": self.supplier,
|
||||
"credit": flt(self.total_taxes_and_charges),
|
||||
"credit_in_transaction_currency": flt(self.total_taxes_and_charges),
|
||||
"credit_in_account_currency": flt(self.base_total_taxes_and_charges),
|
||||
"cost_center": self.cost_center,
|
||||
},
|
||||
@@ -1460,6 +1489,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"debit_in_account_currency": self.base_paid_amount
|
||||
if self.party_account_currency == self.company_currency
|
||||
else self.paid_amount,
|
||||
"debit_in_transaction_currency": self.paid_amount,
|
||||
"against_voucher": self.return_against
|
||||
if cint(self.is_return) and self.return_against
|
||||
else self.name,
|
||||
@@ -1481,6 +1511,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"credit_in_account_currency": self.base_paid_amount
|
||||
if bank_account_currency == self.company_currency
|
||||
else self.paid_amount,
|
||||
"credit_in_transaction_currency": self.paid_amount,
|
||||
"cost_center": self.cost_center,
|
||||
},
|
||||
bank_account_currency,
|
||||
@@ -1505,6 +1536,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"debit_in_account_currency": self.base_write_off_amount
|
||||
if self.party_account_currency == self.company_currency
|
||||
else self.write_off_amount,
|
||||
"debit_in_transaction_currency": self.write_off_amount,
|
||||
"against_voucher": self.return_against
|
||||
if cint(self.is_return) and self.return_against
|
||||
else self.name,
|
||||
@@ -1525,6 +1557,7 @@ class PurchaseInvoice(BuyingController):
|
||||
"credit_in_account_currency": self.base_write_off_amount
|
||||
if write_off_account_currency == self.company_currency
|
||||
else self.write_off_amount,
|
||||
"credit_in_transaction_currency": self.write_off_amount,
|
||||
"cost_center": self.cost_center or self.write_off_cost_center,
|
||||
},
|
||||
item=self,
|
||||
|
||||
@@ -2639,6 +2639,36 @@ class TestPurchaseInvoice(FrappeTestCase, StockTestMixin):
|
||||
"Buying Settings", "bill_for_rejected_quantity_in_purchase_invoice", original_value
|
||||
)
|
||||
|
||||
def test_trx_currency_debit_credit_for_high_precision(self):
|
||||
exc_rate = 0.737517516
|
||||
pi = make_purchase_invoice(
|
||||
currency="USD", conversion_rate=exc_rate, qty=1, rate=2000, do_not_save=True
|
||||
)
|
||||
pi.supplier = "_Test Supplier USD"
|
||||
pi.save().submit()
|
||||
|
||||
expected = (
|
||||
("_Test Account Cost for Goods Sold - _TC", 1475.04, 0.0, 2000.0, 0.0, "USD", exc_rate),
|
||||
("_Test Payable USD - _TC", 0.0, 1475.04, 0.0, 2000.0, "USD", exc_rate),
|
||||
)
|
||||
|
||||
actual = frappe.db.get_all(
|
||||
"GL Entry",
|
||||
filters={"voucher_no": pi.name},
|
||||
fields=[
|
||||
"account",
|
||||
"debit",
|
||||
"credit",
|
||||
"debit_in_transaction_currency",
|
||||
"credit_in_transaction_currency",
|
||||
"transaction_currency",
|
||||
"transaction_exchange_rate",
|
||||
],
|
||||
order_by="account",
|
||||
as_list=1,
|
||||
)
|
||||
self.assertEqual(actual, expected)
|
||||
|
||||
|
||||
def set_advance_flag(company, flag, default_account):
|
||||
frappe.db.set_value(
|
||||
|
||||
@@ -1241,6 +1241,7 @@ class SalesInvoice(SellingController):
|
||||
self.make_write_off_gl_entry(gl_entries)
|
||||
self.make_gle_for_rounding_adjustment(gl_entries)
|
||||
|
||||
self.set_transaction_currency_and_rate_in_gl_map(gl_entries)
|
||||
return gl_entries
|
||||
|
||||
def make_customer_gl_entry(self, gl_entries):
|
||||
@@ -1274,6 +1275,7 @@ class SalesInvoice(SellingController):
|
||||
"debit_in_account_currency": base_grand_total
|
||||
if self.party_account_currency == self.company_currency
|
||||
else grand_total,
|
||||
"debit_in_transaction_currency": grand_total,
|
||||
"against_voucher": against_voucher,
|
||||
"against_voucher_type": self.doctype,
|
||||
"cost_center": self.cost_center,
|
||||
@@ -1305,6 +1307,9 @@ class SalesInvoice(SellingController):
|
||||
if account_currency == self.company_currency
|
||||
else flt(amount, tax.precision("tax_amount_after_discount_amount"))
|
||||
),
|
||||
"credit_in_transaction_currency": flt(
|
||||
amount, tax.precision("tax_amount_after_discount_amount")
|
||||
),
|
||||
"cost_center": tax.cost_center,
|
||||
},
|
||||
account_currency,
|
||||
@@ -1322,6 +1327,7 @@ class SalesInvoice(SellingController):
|
||||
"against": self.customer,
|
||||
"debit": flt(self.total_taxes_and_charges),
|
||||
"debit_in_account_currency": flt(self.base_total_taxes_and_charges),
|
||||
"debit_in_transaction_currency": flt(self.total_taxes_and_charges),
|
||||
"cost_center": self.cost_center,
|
||||
},
|
||||
account_currency,
|
||||
@@ -1420,6 +1426,7 @@ class SalesInvoice(SellingController):
|
||||
if account_currency == self.company_currency
|
||||
else flt(amount, item.precision("net_amount"))
|
||||
),
|
||||
"credit_in_transaction_currency": flt(amount, item.precision("net_amount")),
|
||||
"cost_center": item.cost_center,
|
||||
"project": item.project or self.project,
|
||||
},
|
||||
@@ -1471,6 +1478,7 @@ class SalesInvoice(SellingController):
|
||||
+ cstr(self.loyalty_redemption_account)
|
||||
+ " for the Loyalty Program",
|
||||
"credit": self.loyalty_amount,
|
||||
"credit_in_transaction_currency": self.loyalty_amount,
|
||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||
"against_voucher_type": self.doctype,
|
||||
"cost_center": self.cost_center,
|
||||
@@ -1485,6 +1493,7 @@ class SalesInvoice(SellingController):
|
||||
"cost_center": self.cost_center or self.loyalty_redemption_cost_center,
|
||||
"against": self.customer,
|
||||
"debit": self.loyalty_amount,
|
||||
"debit_in_transaction_currency": self.loyalty_amount,
|
||||
"remark": "Loyalty Points redeemed by the customer",
|
||||
},
|
||||
item=self,
|
||||
@@ -1518,6 +1527,7 @@ class SalesInvoice(SellingController):
|
||||
"credit_in_account_currency": payment_mode.base_amount
|
||||
if self.party_account_currency == self.company_currency
|
||||
else payment_mode.amount,
|
||||
"credit_in_transaction_currency": payment_mode.amount,
|
||||
"against_voucher": against_voucher,
|
||||
"against_voucher_type": self.doctype,
|
||||
"cost_center": self.cost_center,
|
||||
@@ -1537,6 +1547,7 @@ class SalesInvoice(SellingController):
|
||||
"debit_in_account_currency": payment_mode.base_amount
|
||||
if payment_mode_account_currency == self.company_currency
|
||||
else payment_mode.amount,
|
||||
"debit_in_transaction_currency": payment_mode.amount,
|
||||
"cost_center": self.cost_center,
|
||||
},
|
||||
payment_mode_account_currency,
|
||||
@@ -1561,6 +1572,7 @@ class SalesInvoice(SellingController):
|
||||
"debit_in_account_currency": flt(self.base_change_amount)
|
||||
if self.party_account_currency == self.company_currency
|
||||
else flt(self.change_amount),
|
||||
"debit_in_transaction_currency": flt(self.change_amount),
|
||||
"against_voucher": self.return_against
|
||||
if cint(self.is_return) and self.return_against
|
||||
else self.name,
|
||||
@@ -1579,6 +1591,7 @@ class SalesInvoice(SellingController):
|
||||
"account": self.account_for_change_amount,
|
||||
"against": self.customer,
|
||||
"credit": self.base_change_amount,
|
||||
"credit_in_transaction_currency": self.change_amount,
|
||||
"cost_center": self.cost_center,
|
||||
},
|
||||
item=self,
|
||||
@@ -1610,6 +1623,9 @@ class SalesInvoice(SellingController):
|
||||
if self.party_account_currency == self.company_currency
|
||||
else flt(self.write_off_amount, self.precision("write_off_amount"))
|
||||
),
|
||||
"credit_in_transaction_currency": flt(
|
||||
self.write_off_amount, self.precision("write_off_amount")
|
||||
),
|
||||
"against_voucher": self.return_against if cint(self.is_return) else self.name,
|
||||
"against_voucher_type": self.doctype,
|
||||
"cost_center": self.cost_center,
|
||||
@@ -1630,6 +1646,9 @@ class SalesInvoice(SellingController):
|
||||
if write_off_account_currency == self.company_currency
|
||||
else flt(self.write_off_amount, self.precision("write_off_amount"))
|
||||
),
|
||||
"debit_in_transaction_currency": flt(
|
||||
self.write_off_amount, self.precision("write_off_amount")
|
||||
),
|
||||
"cost_center": self.cost_center or self.write_off_cost_center or default_cost_center,
|
||||
},
|
||||
write_off_account_currency,
|
||||
@@ -1674,6 +1693,9 @@ class SalesInvoice(SellingController):
|
||||
"credit_in_account_currency": flt(
|
||||
self.rounding_adjustment, self.precision("rounding_adjustment")
|
||||
),
|
||||
"credit_in_transaction_currency": flt(
|
||||
self.rounding_adjustment, self.precision("rounding_adjustment")
|
||||
),
|
||||
"credit": flt(
|
||||
self.base_rounding_adjustment, self.precision("base_rounding_adjustment")
|
||||
),
|
||||
|
||||
@@ -519,7 +519,7 @@ class TestTaxWithholdingCategory(FrappeTestCase):
|
||||
payment = get_payment_entry(order.doctype, order.name)
|
||||
payment.apply_tax_withholding_amount = 1
|
||||
payment.tax_withholding_category = "Cumulative Threshold TDS"
|
||||
payment.submit()
|
||||
payment.save().submit()
|
||||
self.assertEqual(payment.taxes[0].tax_amount, 4000)
|
||||
|
||||
def test_multi_category_single_supplier(self):
|
||||
|
||||
@@ -430,7 +430,7 @@ def process_debit_credit_difference(gl_map):
|
||||
voucher_no = gl_map[0].voucher_no
|
||||
allowance = get_debit_credit_allowance(voucher_type, precision)
|
||||
|
||||
debit_credit_diff = get_debit_credit_difference(gl_map, precision)
|
||||
debit_credit_diff, trx_cur_debit_credit_diff = get_debit_credit_difference(gl_map, precision)
|
||||
|
||||
if abs(debit_credit_diff) > allowance:
|
||||
if not (
|
||||
@@ -441,9 +441,9 @@ def process_debit_credit_difference(gl_map):
|
||||
raise_debit_credit_not_equal_error(debit_credit_diff, voucher_type, voucher_no)
|
||||
|
||||
elif abs(debit_credit_diff) >= (1.0 / (10**precision)):
|
||||
make_round_off_gle(gl_map, debit_credit_diff, precision)
|
||||
make_round_off_gle(gl_map, debit_credit_diff, trx_cur_debit_credit_diff, precision)
|
||||
|
||||
debit_credit_diff = get_debit_credit_difference(gl_map, precision)
|
||||
debit_credit_diff, trx_cur_debit_credit_diff = get_debit_credit_difference(gl_map, precision)
|
||||
if abs(debit_credit_diff) > allowance:
|
||||
if not (
|
||||
voucher_type == "Journal Entry"
|
||||
@@ -455,14 +455,23 @@ def process_debit_credit_difference(gl_map):
|
||||
|
||||
def get_debit_credit_difference(gl_map, precision):
|
||||
debit_credit_diff = 0.0
|
||||
trx_cur_debit_credit_diff = 0
|
||||
|
||||
for entry in gl_map:
|
||||
entry.debit = flt(entry.debit, precision)
|
||||
entry.credit = flt(entry.credit, precision)
|
||||
debit_credit_diff += entry.debit - entry.credit
|
||||
|
||||
debit_credit_diff = flt(debit_credit_diff, precision)
|
||||
entry.debit_in_transaction_currency = flt(entry.debit_in_transaction_currency, precision)
|
||||
entry.credit_in_transaction_currency = flt(entry.credit_in_transaction_currency, precision)
|
||||
trx_cur_debit_credit_diff += (
|
||||
entry.debit_in_transaction_currency - entry.credit_in_transaction_currency
|
||||
)
|
||||
|
||||
return debit_credit_diff
|
||||
debit_credit_diff = flt(debit_credit_diff, precision)
|
||||
trx_cur_debit_credit_diff = flt(trx_cur_debit_credit_diff, precision)
|
||||
|
||||
return debit_credit_diff, trx_cur_debit_credit_diff
|
||||
|
||||
|
||||
def get_debit_credit_allowance(voucher_type, precision):
|
||||
@@ -489,7 +498,7 @@ def has_opening_entries(gl_map: list) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def make_round_off_gle(gl_map, debit_credit_diff, precision):
|
||||
def make_round_off_gle(gl_map, debit_credit_diff, trx_cur_debit_credit_diff, precision):
|
||||
round_off_account, round_off_cost_center, round_off_for_opening = get_round_off_account_and_cost_center(
|
||||
gl_map[0].company, gl_map[0].voucher_type, gl_map[0].voucher_no
|
||||
)
|
||||
@@ -534,6 +543,12 @@ def make_round_off_gle(gl_map, debit_credit_diff, precision):
|
||||
"credit_in_account_currency": debit_credit_diff if debit_credit_diff > 0 else 0,
|
||||
"debit": abs(debit_credit_diff) if debit_credit_diff < 0 else 0,
|
||||
"credit": debit_credit_diff if debit_credit_diff > 0 else 0,
|
||||
"debit_in_transaction_currency": abs(trx_cur_debit_credit_diff)
|
||||
if trx_cur_debit_credit_diff < 0
|
||||
else 0,
|
||||
"credit_in_transaction_currency": trx_cur_debit_credit_diff
|
||||
if trx_cur_debit_credit_diff > 0
|
||||
else 0,
|
||||
"cost_center": round_off_cost_center,
|
||||
"party_type": None,
|
||||
"party": None,
|
||||
|
||||
@@ -1119,20 +1119,19 @@ class AccountsController(TransactionBase):
|
||||
)
|
||||
|
||||
# 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 self.doctype not in ["Purchase Invoice", "Sales Invoice", "Journal Entry", "Payment Entry"]:
|
||||
gl_dict.update(
|
||||
{
|
||||
"transaction_currency": self.get("currency") or self.company_currency,
|
||||
"transaction_exchange_rate": 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")})
|
||||
@@ -2758,6 +2757,11 @@ class AccountsController(TransactionBase):
|
||||
elif self.doctype == "Payment Entry":
|
||||
self.make_advance_payment_ledger_for_payment()
|
||||
|
||||
def set_transaction_currency_and_rate_in_gl_map(self, gl_entries):
|
||||
for x in gl_entries:
|
||||
x["transaction_currency"] = self.currency
|
||||
x["transaction_exchange_rate"] = self.get("conversion_rate") or 1
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_tax_rate(account_head):
|
||||
|
||||
@@ -1,69 +1,109 @@
|
||||
import frappe
|
||||
from frappe.query_builder.functions import Sum
|
||||
from frappe.utils import flt
|
||||
from frappe.utils import flt, getdate
|
||||
|
||||
from erpnext.accounts.utils import get_fiscal_year
|
||||
from erpnext.stock.doctype.purchase_receipt.purchase_receipt import adjust_incoming_rate_for_pr
|
||||
|
||||
|
||||
def execute():
|
||||
table = frappe.qb.DocType("Purchase Receipt Item")
|
||||
parent = frappe.qb.DocType("Purchase Receipt")
|
||||
query = (
|
||||
frappe.qb.from_(table)
|
||||
.join(parent)
|
||||
.on(table.parent == parent.name)
|
||||
.select(
|
||||
table.parent,
|
||||
table.name,
|
||||
table.amount,
|
||||
table.billed_amt,
|
||||
table.amount_difference_with_purchase_invoice,
|
||||
table.rate,
|
||||
table.qty,
|
||||
parent.conversion_rate,
|
||||
)
|
||||
.where((table.amount_difference_with_purchase_invoice != 0) & (table.docstatus == 1))
|
||||
)
|
||||
try:
|
||||
if fiscal_year_dates := get_fiscal_year(frappe.utils.datetime.date.today()):
|
||||
query.where(parent.posting_date.between(fiscal_year_dates[1], fiscal_year_dates[2]))
|
||||
except Exception:
|
||||
if not frappe.db.get_single_value("Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate"):
|
||||
return
|
||||
|
||||
if result := query.run(as_dict=True):
|
||||
item_wise_billed_qty = get_billed_qty_against_purchase_receipt([item.name for item in result])
|
||||
|
||||
purchase_receipts = set()
|
||||
precision = frappe.get_precision("Purchase Receipt Item", "amount")
|
||||
for item in result:
|
||||
adjusted_amt = 0.0
|
||||
|
||||
if (
|
||||
item.billed_amt is not None
|
||||
and item.amount is not None
|
||||
and item_wise_billed_qty.get(item.name)
|
||||
):
|
||||
adjusted_amt = (
|
||||
flt(item.billed_amt / item_wise_billed_qty.get(item.name)) - flt(item.rate)
|
||||
) * item.qty
|
||||
adjusted_amt = flt(
|
||||
adjusted_amt * flt(item.conversion_rate),
|
||||
precision,
|
||||
for company in frappe.get_all("Company", pluck="name"):
|
||||
table = frappe.qb.DocType("Purchase Receipt Item")
|
||||
parent = frappe.qb.DocType("Purchase Receipt")
|
||||
query = (
|
||||
frappe.qb.from_(table)
|
||||
.join(parent)
|
||||
.on(table.parent == parent.name)
|
||||
.select(
|
||||
table.parent,
|
||||
table.name,
|
||||
table.amount,
|
||||
table.billed_amt,
|
||||
table.amount_difference_with_purchase_invoice,
|
||||
table.rate,
|
||||
table.qty,
|
||||
parent.conversion_rate,
|
||||
)
|
||||
.where(
|
||||
(table.amount_difference_with_purchase_invoice != 0)
|
||||
& (table.docstatus == 1)
|
||||
& (parent.company == company)
|
||||
)
|
||||
)
|
||||
|
||||
if adjusted_amt != item.amount_difference_with_purchase_invoice:
|
||||
frappe.db.set_value(
|
||||
"Purchase Receipt Item",
|
||||
item.name,
|
||||
"amount_difference_with_purchase_invoice",
|
||||
adjusted_amt,
|
||||
update_modified=False,
|
||||
posting_date = "2024-04-01"
|
||||
|
||||
# Get the last accounting period end date
|
||||
accounting_period = frappe.get_all(
|
||||
"Accounting Period", {"company": company}, ["end_date"], order_by="end_date desc", limit=1
|
||||
)
|
||||
if (
|
||||
accounting_period
|
||||
and accounting_period[0].end_date
|
||||
and getdate(accounting_period[0].end_date) > getdate(posting_date)
|
||||
):
|
||||
posting_date = accounting_period[0].end_date
|
||||
|
||||
# Get the last period closing voucher end date
|
||||
period_closing_voucher = frappe.get_all(
|
||||
"Period Closing Voucher",
|
||||
{"company": company, "docstatus": 1},
|
||||
["period_end_date"],
|
||||
order_by="period_end_date desc",
|
||||
limit=1,
|
||||
)
|
||||
if (
|
||||
period_closing_voucher
|
||||
and period_closing_voucher[0].period_end_date
|
||||
and getdate(period_closing_voucher[0].period_end_date) > getdate(posting_date)
|
||||
):
|
||||
posting_date = period_closing_voucher[0].period_end_date
|
||||
|
||||
try:
|
||||
fiscal_year = get_fiscal_year(frappe.utils.datetime.date.today())
|
||||
except Exception:
|
||||
return
|
||||
else:
|
||||
if fiscal_year and getdate(fiscal_year[1]) > getdate(posting_date):
|
||||
posting_date = fiscal_year[1]
|
||||
query = query.where(parent.posting_date > posting_date)
|
||||
|
||||
if result := query.run(as_dict=True):
|
||||
item_wise_billed_qty = get_billed_qty_against_purchase_receipt([item.name for item in result])
|
||||
|
||||
purchase_receipts = set()
|
||||
precision = frappe.get_precision("Purchase Receipt Item", "amount")
|
||||
for item in result:
|
||||
adjusted_amt = 0.0
|
||||
|
||||
if (
|
||||
item.billed_amt is not None
|
||||
and item.amount is not None
|
||||
and item_wise_billed_qty.get(item.name)
|
||||
):
|
||||
adjusted_amt = (
|
||||
flt(item.billed_amt / item_wise_billed_qty.get(item.name)) - flt(item.rate)
|
||||
) * item.qty
|
||||
adjusted_amt = flt(
|
||||
adjusted_amt * flt(item.conversion_rate),
|
||||
precision,
|
||||
)
|
||||
purchase_receipts.add(item.parent)
|
||||
|
||||
for pr in purchase_receipts:
|
||||
adjust_incoming_rate_for_pr(frappe.get_doc("Purchase Receipt", pr))
|
||||
if adjusted_amt != item.amount_difference_with_purchase_invoice:
|
||||
frappe.db.set_value(
|
||||
"Purchase Receipt Item",
|
||||
item.name,
|
||||
"amount_difference_with_purchase_invoice",
|
||||
adjusted_amt,
|
||||
update_modified=False,
|
||||
)
|
||||
purchase_receipts.add(item.parent)
|
||||
|
||||
for pr in purchase_receipts:
|
||||
adjust_incoming_rate_for_pr(frappe.get_doc("Purchase Receipt", pr))
|
||||
|
||||
|
||||
def get_billed_qty_against_purchase_receipt(pr_names):
|
||||
|
||||
@@ -6,8 +6,14 @@ from frappe.model.utils.rename_field import rename_field
|
||||
def execute():
|
||||
doctypes = frappe.get_all("Service Level Agreement", pluck="document_type")
|
||||
for doctype in doctypes:
|
||||
rename_fieldname(doctype + "-resolution_by", "sla_resolution_by")
|
||||
rename_fieldname(doctype + "-resolution_date", "sla_resolution_date")
|
||||
if doctype == "Issue":
|
||||
continue
|
||||
|
||||
if frappe.db.exists("Custom Field", {"fieldname": doctype + "-resolution_by"}):
|
||||
rename_fieldname(doctype + "-resolution_by", "sla_resolution_by")
|
||||
|
||||
if frappe.db.exists("Custom Field", {"fieldname": doctype + "-resolution_date"}):
|
||||
rename_fieldname(doctype + "-resolution_date", "sla_resolution_date")
|
||||
|
||||
rename_field("Issue", "resolution_by", "sla_resolution_by")
|
||||
rename_field("Issue", "resolution_date", "sla_resolution_date")
|
||||
|
||||
Reference in New Issue
Block a user