Merge pull request #2004 from anandpdoshi/anand-july-30

[fixes] Leave Application and Toggle Rounded Totals
This commit is contained in:
Anand Doshi 2014-07-30 17:40:01 +05:30
commit b9fed3f046
3 changed files with 9 additions and 7 deletions

View File

@ -252,7 +252,7 @@ def get_events(start, end):
if "Employee" in frappe.get_roles():
add_department_leaves(events, start, end, employee, company)
add_leaves(events, start, end, employee, company, match_conditions)
add_leaves(events, start, end, match_conditions)
add_block_dates(events, start, end, employee, company)
add_holidays(events, start, end, employee, company)
@ -270,9 +270,9 @@ def add_department_leaves(events, start, end, employee, company):
and company=%s""", (department, company))
match_conditions = "employee in (\"%s\")" % '", "'.join(department_employees)
add_leaves(events, start, end, employee, company, match_conditions=match_conditions)
add_leaves(events, start, end, match_conditions=match_conditions)
def add_leaves(events, start, end, employee, company, match_conditions=None):
def add_leaves(events, start, end, match_conditions=None):
query = """select name, from_date, to_date, employee_name, half_day,
status, employee, docstatus
from `tabLeave Application` where

View File

@ -73,4 +73,4 @@ execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool") # 29-07
execute:frappe.delete_doc("DocType", "Payment to Invoice Matching Tool Detail") # 29-07-2014
execute:frappe.delete_doc("Page", "trial-balance") #2014-07-22
erpnext.patches.v4_2.delete_old_print_formats #2014-07-29
erpnext.patches.v4_2.toggle_rounded_total
erpnext.patches.v4_2.toggle_rounded_total #2014-07-30

View File

@ -57,6 +57,8 @@ class GlobalDefaults(Document):
# Make property setters to hide rounded total fields
for doctype in ("Quotation", "Sales Order", "Sales Invoice", "Delivery Note"):
for fieldname in ("rounded_total", "rounded_total_export"):
make_property_setter(doctype, fieldname, "hidden", self.disable_rounded_total, "Check")
make_property_setter(doctype, fieldname, "print_hide", self.disable_rounded_total, "Check")
make_property_setter(doctype, "rounded_total", "hidden", self.disable_rounded_total, "Check")
make_property_setter(doctype, "rounded_total", "print_hide", 1, "Check")
make_property_setter(doctype, "rounded_total_export", "hidden", self.disable_rounded_total, "Check")
make_property_setter(doctype, "rounded_total_export", "print_hide", self.disable_rounded_total, "Check")