diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index 4578f308b3..695a721553 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -226,6 +226,12 @@ frappe.ui.form.on('Payment Entry', { party: function(frm) { if(frm.doc.payment_type && frm.doc.party_type && frm.doc.party) { + if(!frm.doc.posting_date) { + frappe.msgprint(__("Please select Posting Date before selecting Party")) + frm.set_value("party", ""); + return ; + } + frm.set_party_account_based_on_party = true; return frappe.call({ diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.json b/erpnext/accounts/doctype/payment_entry/payment_entry.json index 43d43ca9d7..2057d07d83 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.json +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.json @@ -75,7 +75,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_list_view": 0, + "in_list_view": 1, "label": "Payment Type", "length": 0, "no_copy": 0, @@ -1426,7 +1426,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-09-02 11:34:14.817383", + "modified": "2016-09-05 11:06:18.183458", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Entry", diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry_list.js b/erpnext/accounts/doctype/payment_entry/payment_entry_list.js deleted file mode 100644 index 81230d0820..0000000000 --- a/erpnext/accounts/doctype/payment_entry/payment_entry_list.js +++ /dev/null @@ -1,6 +0,0 @@ -frappe.listview_settings['Payment Entry'] = { - add_fields: ["payment_type"], - get_indicator: function(doc) { - return [__(doc.payment_type), (doc.docstatus==0 ? 'red' : 'blue'), 'status=' + doc.payment_type] - } -} diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 0debe4aced..6da496ba17 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -17,7 +17,8 @@ def get_filters_cond(doctype, filters, conditions): if isinstance(f[1], basestring) and f[1][0] == '!': flt.append([doctype, f[0], '!=', f[1][1:]]) else: - flt.append([doctype, f[0], '=', f[1]]) + value = frappe.db.escape(f[1]) if isinstance(f[1], basestring) else f[1] + flt.append([doctype, f[0], '=', value]) query = DatabaseQuery(doctype) query.filters = flt diff --git a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py index 4cbccafb15..e77b90f958 100644 --- a/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py @@ -187,14 +187,17 @@ class MaintenanceSchedule(TransactionBase): if not sr_details: frappe.throw(_("Serial No {0} not found").format(serial_no)) - if sr_details.warranty_expiry_date and sr_details.warranty_expiry_date>=amc_start_date: - throw(_("Serial No {0} is under warranty upto {1}").format(serial_no, sr_details.warranty_expiry_date)) + if sr_details.warranty_expiry_date \ + and getdate(sr_details.warranty_expiry_date) >= getdate(amc_start_date): + throw(_("Serial No {0} is under warranty upto {1}") + .format(serial_no, sr_details.warranty_expiry_date)) - if sr_details.amc_expiry_date and sr_details.amc_expiry_date >= amc_start_date: - throw(_("Serial No {0} is under maintenance contract upto {1}").format(serial_no, sr_details.amc_start_date)) + if sr_details.amc_expiry_date and getdate(sr_details.amc_expiry_date) >= getdate(amc_start_date): + throw(_("Serial No {0} is under maintenance contract upto {1}") + .format(serial_no, sr_details.amc_start_date)) if not sr_details.warehouse and sr_details.delivery_date and \ - sr_details.delivery_date >= amc_start_date: + getdate(sr_details.delivery_date) >= getdate(amc_start_date): throw(_("Maintenance start date can not be before delivery date for Serial No {0}") .format(serial_no)) diff --git a/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py b/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py index ab0b4a12e7..cc854a4ac7 100644 --- a/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py +++ b/erpnext/projects/report/daily_timesheet_summary/daily_timesheet_summary.py @@ -12,8 +12,9 @@ def execute(filters=None): filters["from_time"] = "00:00:00" filters["to_time"] = "24:00:00" - columns = [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("From Datetime") + "::140", - _("To Datetime") + "::140", _("Hours") + "::70", _("Activity Type") + "::120", _("Task") + ":Link/Task:150", + columns = [_("Timesheet") + ":Link/Timesheet:120", _("Employee") + "::150", _("Employee Name") + "::150", + _("From Datetime") + "::140", _("To Datetime") + "::140", _("Hours") + "::70", + _("Activity Type") + "::120", _("Task") + ":Link/Task:150", _("Project") + ":Link/Project:120", _("Status") + "::70"] conditions = "ts.docstatus = 1" @@ -27,7 +28,8 @@ def execute(filters=None): return columns, data def get_data(conditions, filters): - time_sheet = frappe.db.sql(""" select ts.name, ts.employee, tsd.from_time, tsd.to_time, tsd.hours, + time_sheet = frappe.db.sql(""" select ts.name, ts.employee, ts.employee_name, + tsd.from_time, tsd.to_time, tsd.hours, tsd.activity_type, tsd.task, tsd.project, ts.status from `tabTimesheet Detail` tsd, `tabTimesheet` ts where ts.name = tsd.parent and %s order by ts.name"""%(conditions), filters, as_list=1)