added tittles to je

This commit is contained in:
Ali 2026-03-06 23:24:12 +04:00
parent f76b09116b
commit 378ccd33ee
1 changed files with 9 additions and 4 deletions

View File

@ -27,6 +27,15 @@ class CustomPayrollEntry(PayrollEntry):
return super().make_bank_entry(for_withheld_salaries) return super().make_bank_entry(for_withheld_salaries)
def make_journal_entry(self, accounts, currencies, voucher_type="Journal Entry", **kwargs):
je = super().make_journal_entry(accounts, currencies, voucher_type=voucher_type, **kwargs)
if voucher_type == "Bank Entry":
custom_title = "Əmək həqqi və tutulmaların hesablanması"
frappe.db.set_value("Journal Entry", je.name, {"title": custom_title, "pay_to_recd_from": custom_title}, update_modified=False)
je.title = custom_title
je.pay_to_recd_from = custom_title
return je
def set_accounting_entries_for_bank_entry( def set_accounting_entries_for_bank_entry(
self, je_payment_amount, user_remark, employee_wise_accounting_enabled self, je_payment_amount, user_remark, employee_wise_accounting_enabled
): ):
@ -34,11 +43,8 @@ class CustomPayrollEntry(PayrollEntry):
je_payment_amount, user_remark, employee_wise_accounting_enabled je_payment_amount, user_remark, employee_wise_accounting_enabled
) )
custom_title = "Əmək həqqi və tutulmaların hesablanması"
deductions = getattr(self, "_bank_entry_deductions", {}) deductions = getattr(self, "_bank_entry_deductions", {})
if not deductions: if not deductions:
bank_entry.db_set({"title": custom_title, "pay_to_recd_from": custom_title})
return bank_entry return bank_entry
precision = frappe.get_precision("Journal Entry Account", "debit_in_account_currency") precision = frappe.get_precision("Journal Entry Account", "debit_in_account_currency")
@ -78,5 +84,4 @@ class CustomPayrollEntry(PayrollEntry):
bank_entry.append("accounts", credit_row) bank_entry.append("accounts", credit_row)
bank_entry.save(ignore_permissions=True) bank_entry.save(ignore_permissions=True)
bank_entry.db_set({"title": custom_title, "pay_to_recd_from": custom_title})
return bank_entry return bank_entry