mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-07 07:20:26 +00:00
fix(HR): Rename due_advance_amount field in Employee Advance for v12 (#22216)
* added patch for moving data * changed fieldname and references for easier debugging * style: Added EOF * reload doc for patch
This commit is contained in:
@@ -113,13 +113,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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,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",
|
||||||
@@ -101,14 +101,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",
|
||||||
@@ -169,11 +161,25 @@
|
|||||||
"label": "Returned Amount",
|
"label": "Returned Amount",
|
||||||
"options": "Company:company:default_currency",
|
"options": "Company:company:default_currency",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "repay_unclaimed_amount_from_salary",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"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": "2019-12-15 19:04:07.044505",
|
"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"])
|
||||||
|
|||||||
@@ -669,3 +669,5 @@ erpnext.patches.v12_0.set_serial_no_status #2020-05-21
|
|||||||
erpnext.patches.v12_0.update_price_list_currency_in_bom
|
erpnext.patches.v12_0.update_price_list_currency_in_bom
|
||||||
erpnext.patches.v12_0.update_uom_conversion_factor
|
erpnext.patches.v12_0.update_uom_conversion_factor
|
||||||
erpnext.patches.v12_0.set_italian_import_supplier_invoice_permissions
|
erpnext.patches.v12_0.set_italian_import_supplier_invoice_permissions
|
||||||
|
execute:frappe.reload_doc("HR", "doctype", "Employee Advance")
|
||||||
|
erpnext.patches.v12_0.move_due_advance_amount_to_pending_amount
|
||||||
|
|||||||
@@ -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 ''')
|
||||||
Reference in New Issue
Block a user