Merge pull request #36573 from ruthra-kumar/system_generated_field_and_update_remarks
refactor: 'is system generated' field and better remarks in Journal Entry
This commit is contained in:
commit
18e3c67d97
@ -9,6 +9,7 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"entry_type_and_date",
|
"entry_type_and_date",
|
||||||
|
"is_system_generated",
|
||||||
"title",
|
"title",
|
||||||
"voucher_type",
|
"voucher_type",
|
||||||
"naming_series",
|
"naming_series",
|
||||||
@ -88,7 +89,7 @@
|
|||||||
"label": "Entry Type",
|
"label": "Entry Type",
|
||||||
"oldfieldname": "voucher_type",
|
"oldfieldname": "voucher_type",
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"options": "Journal Entry\nInter Company Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry\nExchange Rate Revaluation\nExchange Gain Or Loss\nDeferred Revenue\nDeferred Expense",
|
"options": "Journal Entry\nInter Company Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry\nDepreciation Entry\nExchange Rate Revaluation\nExchange Gain Or Loss\nDeferred Revenue\nDeferred Expense\nReversal Of ITC",
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"search_index": 1
|
"search_index": 1
|
||||||
},
|
},
|
||||||
@ -533,57 +534,28 @@
|
|||||||
"label": "Process Deferred Accounting",
|
"label": "Process Deferred Accounting",
|
||||||
"options": "Process Deferred Accounting",
|
"options": "Process Deferred Accounting",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"depends_on": "eval:doc.is_system_generated == 1;",
|
||||||
|
"fieldname": "is_system_generated",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Is System Generated",
|
||||||
|
"no_copy": 1,
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-file-text",
|
"icon": "fa fa-file-text",
|
||||||
"idx": 176,
|
"idx": 176,
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-03-01 14:58:59.286591",
|
"modified": "2023-08-10 14:32:22.366895",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Journal Entry",
|
"name": "Journal Entry",
|
||||||
"naming_rule": "By \"Naming Series\" field",
|
"naming_rule": "By \"Naming Series\" field",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [],
|
||||||
{
|
|
||||||
"amend": 1,
|
|
||||||
"cancel": 1,
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "Accounts User",
|
|
||||||
"share": 1,
|
|
||||||
"submit": 1,
|
|
||||||
"write": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"amend": 1,
|
|
||||||
"cancel": 1,
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"import": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "Accounts Manager",
|
|
||||||
"share": 1,
|
|
||||||
"submit": 1,
|
|
||||||
"write": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"email": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "Auditor"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
|
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
|||||||
@ -797,6 +797,9 @@ class JournalEntry(AccountsController):
|
|||||||
def create_remarks(self):
|
def create_remarks(self):
|
||||||
r = []
|
r = []
|
||||||
|
|
||||||
|
if self.flags.skip_remarks_creation:
|
||||||
|
return
|
||||||
|
|
||||||
if self.user_remark:
|
if self.user_remark:
|
||||||
r.append(_("Note: {0}").format(self.user_remark))
|
r.append(_("Note: {0}").format(self.user_remark))
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import frappe
|
|||||||
from frappe import _, msgprint, qb
|
from frappe import _, msgprint, qb
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe.query_builder.custom import ConstantColumn
|
from frappe.query_builder.custom import ConstantColumn
|
||||||
from frappe.utils import flt, get_link_to_form, getdate, nowdate, today
|
from frappe.utils import flt, fmt_money, get_link_to_form, getdate, nowdate, today
|
||||||
|
|
||||||
import erpnext
|
import erpnext
|
||||||
from erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation import (
|
from erpnext.accounts.doctype.process_payment_reconciliation.process_payment_reconciliation import (
|
||||||
@ -657,6 +657,7 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
|||||||
"reference_name": inv.against_voucher,
|
"reference_name": inv.against_voucher,
|
||||||
"cost_center": erpnext.get_default_cost_center(company),
|
"cost_center": erpnext.get_default_cost_center(company),
|
||||||
"exchange_rate": inv.exchange_rate,
|
"exchange_rate": inv.exchange_rate,
|
||||||
|
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} against {inv.against_voucher}",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"account": inv.account,
|
"account": inv.account,
|
||||||
@ -671,6 +672,7 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
|||||||
"reference_name": inv.voucher_no,
|
"reference_name": inv.voucher_no,
|
||||||
"cost_center": erpnext.get_default_cost_center(company),
|
"cost_center": erpnext.get_default_cost_center(company),
|
||||||
"exchange_rate": inv.exchange_rate,
|
"exchange_rate": inv.exchange_rate,
|
||||||
|
"user_remark": f"{fmt_money(flt(inv.allocated_amount), currency=company_currency)} from {inv.voucher_no}",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
@ -678,6 +680,9 @@ def reconcile_dr_cr_note(dr_cr_notes, company):
|
|||||||
|
|
||||||
jv.flags.ignore_mandatory = True
|
jv.flags.ignore_mandatory = True
|
||||||
jv.flags.ignore_exchange_rate = True
|
jv.flags.ignore_exchange_rate = True
|
||||||
|
jv.remark = None
|
||||||
|
jv.flags.skip_remarks_creation = True
|
||||||
|
jv.is_system_generated = True
|
||||||
jv.submit()
|
jv.submit()
|
||||||
|
|
||||||
if inv.difference_amount != 0:
|
if inv.difference_amount != 0:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user