Patch fixes
This commit is contained in:
@@ -33,7 +33,7 @@ class PayrollEntry(Document):
|
|||||||
if self.payroll_frequency:
|
if self.payroll_frequency:
|
||||||
condition = """and payroll_frequency = '%(payroll_frequency)s'"""% {"payroll_frequency": self.payroll_frequency}
|
condition = """and payroll_frequency = '%(payroll_frequency)s'"""% {"payroll_frequency": self.payroll_frequency}
|
||||||
|
|
||||||
sal_struct = frappe.db.sql("""
|
sal_struct = frappe.db.sql_list("""
|
||||||
select
|
select
|
||||||
name from `tabSalary Structure`
|
name from `tabSalary Structure`
|
||||||
where
|
where
|
||||||
@@ -54,7 +54,8 @@ class PayrollEntry(Document):
|
|||||||
where
|
where
|
||||||
t1.name = t2.employee
|
t1.name = t2.employee
|
||||||
and t2.docstatus = 1
|
and t2.docstatus = 1
|
||||||
%s order by t2.from_date desc"""% cond, {"sal_struct": sal_struct, "from_date": self.start_date}, as_dict=True)
|
%s order by t2.from_date desc
|
||||||
|
""" % cond, {"sal_struct": tuple(sal_struct), "from_date": self.start_date}, as_dict=True)
|
||||||
return emp_list
|
return emp_list
|
||||||
|
|
||||||
def fill_employee_details(self):
|
def fill_employee_details(self):
|
||||||
|
|||||||
@@ -8,9 +8,15 @@ from erpnext.hr.doctype.salary_structure_assignment.salary_structure_assignment
|
|||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
frappe.reload_doc("hr", "doctype", "salary_structure_assignment")
|
frappe.reload_doc("hr", "doctype", "salary_structure_assignment")
|
||||||
|
frappe.db.sql("""
|
||||||
|
delete from `tabSalary Structure Assignment`
|
||||||
|
where salary_structure in (select name from `tabSalary Structure` where is_active='No' or docstatus!=1)
|
||||||
|
""")
|
||||||
for d in frappe.db.sql("""
|
for d in frappe.db.sql("""
|
||||||
select sse.*, ss.company from `tabSalary Structure Employee` sse, `tabSalary Structure` ss
|
select sse.*, ss.company
|
||||||
where ss.name = sse.parent AND sse.employee in (select name from `tabEmployee` where ifNull(status, '') != 'Left')""", as_dict=1):
|
from `tabSalary Structure Employee` sse, `tabSalary Structure` ss
|
||||||
|
where ss.name = sse.parent AND ss.is_active='Yes'
|
||||||
|
AND sse.employee in (select name from `tabEmployee` where ifNull(status, '') != 'Left')""", as_dict=1):
|
||||||
try:
|
try:
|
||||||
s = frappe.new_doc("Salary Structure Assignment")
|
s = frappe.new_doc("Salary Structure Assignment")
|
||||||
s.employee = d.employee
|
s.employee = d.employee
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ def execute():
|
|||||||
[ default_warehouse, buying_cost_center, expense_account, selling_cost_center, income_account ]
|
[ default_warehouse, buying_cost_center, expense_account, selling_cost_center, income_account ]
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
if not frappe.db.has_column('Item', 'default_warehouse'):
|
||||||
|
return
|
||||||
|
|
||||||
frappe.reload_doc('stock', 'doctype', 'item_default')
|
frappe.reload_doc('stock', 'doctype', 'item_default')
|
||||||
frappe.reload_doc('stock', 'doctype', 'item')
|
frappe.reload_doc('stock', 'doctype', 'item')
|
||||||
|
|||||||
Reference in New Issue
Block a user