fix(HR): Change Due Advance Amount to Pending Amount (#22123)
* rename 'Due Advance Amount' field to 'Pending Amount' * changed fieldname and references for easier debugging * added patch for moving data * added newline added Co-authored-by: Anurag Mishra <32095923+Anurag810@users.noreply.github.com>
This commit is contained in:
parent
90957b7f74
commit
86ea75e49e
@ -139,13 +139,13 @@ frappe.ui.form.on('Employee Advance', {
|
|||||||
employee: function (frm) {
|
employee: function (frm) {
|
||||||
if (frm.doc.employee) {
|
if (frm.doc.employee) {
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: "erpnext.hr.doctype.employee_advance.employee_advance.get_due_advance_amount",
|
method: "erpnext.hr.doctype.employee_advance.employee_advance.get_pending_amount",
|
||||||
args: {
|
args: {
|
||||||
"employee": frm.doc.employee,
|
"employee": frm.doc.employee,
|
||||||
"posting_date": frm.doc.posting_date
|
"posting_date": frm.doc.posting_date
|
||||||
},
|
},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
frm.set_value("due_advance_amount",r.message);
|
frm.set_value("pending_amount",r.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
"column_break_11",
|
"column_break_11",
|
||||||
"advance_amount",
|
"advance_amount",
|
||||||
"paid_amount",
|
"paid_amount",
|
||||||
"due_advance_amount",
|
"pending_amount",
|
||||||
"claimed_amount",
|
"claimed_amount",
|
||||||
"return_amount",
|
"return_amount",
|
||||||
"section_break_7",
|
"section_break_7",
|
||||||
@ -102,14 +102,6 @@
|
|||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"depends_on": "eval:cur_frm.doc.employee",
|
|
||||||
"fieldname": "due_advance_amount",
|
|
||||||
"fieldtype": "Currency",
|
|
||||||
"label": "Due Advance Amount",
|
|
||||||
"options": "Company:company:default_currency",
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"fieldname": "claimed_amount",
|
"fieldname": "claimed_amount",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
@ -177,11 +169,19 @@
|
|||||||
"fieldname": "repay_unclaimed_amount_from_salary",
|
"fieldname": "repay_unclaimed_amount_from_salary",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Repay unclaimed amount from salary"
|
"label": "Repay unclaimed amount from salary"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"depends_on": "eval:cur_frm.doc.employee",
|
||||||
|
"fieldname": "pending_amount",
|
||||||
|
"fieldtype": "Currency",
|
||||||
|
"label": "Pending Amount",
|
||||||
|
"options": "Company:company:default_currency",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"is_submittable": 1,
|
"is_submittable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-03-06 15:11:33.747535",
|
"modified": "2020-06-12 12:42:39.833818",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "HR",
|
"module": "HR",
|
||||||
"name": "Employee Advance",
|
"name": "Employee Advance",
|
||||||
|
@ -95,7 +95,7 @@ class EmployeeAdvance(Document):
|
|||||||
frappe.db.set_value("Employee Advance", self.name, "status", self.status)
|
frappe.db.set_value("Employee Advance", self.name, "status", self.status)
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_due_advance_amount(employee, posting_date):
|
def get_pending_amount(employee, posting_date):
|
||||||
employee_due_amount = frappe.get_all("Employee Advance", \
|
employee_due_amount = frappe.get_all("Employee Advance", \
|
||||||
filters = {"employee":employee, "docstatus":1, "posting_date":("<=", posting_date)}, \
|
filters = {"employee":employee, "docstatus":1, "posting_date":("<=", posting_date)}, \
|
||||||
fields = ["advance_amount", "paid_amount"])
|
fields = ["advance_amount", "paid_amount"])
|
||||||
|
@ -680,6 +680,7 @@ erpnext.patches.v12_0.update_appointment_reminder_scheduler_entry
|
|||||||
erpnext.patches.v12_0.retain_permission_rules_for_video_doctype
|
erpnext.patches.v12_0.retain_permission_rules_for_video_doctype
|
||||||
erpnext.patches.v12_0.remove_duplicate_leave_ledger_entries #2020-05-22
|
erpnext.patches.v12_0.remove_duplicate_leave_ledger_entries #2020-05-22
|
||||||
erpnext.patches.v13_0.patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive
|
erpnext.patches.v13_0.patch_to_fix_reverse_linking_in_additional_salary_encashment_and_incentive
|
||||||
|
erpnext.patches.v12_0.move_due_advance_amount_to_pending_amount
|
||||||
execute:frappe.delete_doc_if_exists("Page", "appointment-analytic")
|
execute:frappe.delete_doc_if_exists("Page", "appointment-analytic")
|
||||||
execute:frappe.rename_doc("Desk Page", "Getting Started", "Home", force=True)
|
execute:frappe.rename_doc("Desk Page", "Getting Started", "Home", force=True)
|
||||||
erpnext.patches.v12_0.unset_customer_supplier_based_on_type_of_item_price
|
erpnext.patches.v12_0.unset_customer_supplier_based_on_type_of_item_price
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2019, Frappe and Contributors
|
||||||
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
''' Move from due_advance_amount to pending_amount '''
|
||||||
|
frappe.db.sql(''' UPDATE `tabEmployee Advance` SET pending_amount=due_advance_amount ''')
|
Loading…
x
Reference in New Issue
Block a user