Merge pull request #6280 from nabinhait/minorfixes

Minor fixes
This commit is contained in:
Nabin Hait 2016-09-05 12:32:09 +05:30 committed by GitHub
commit 3bd5014b7b
6 changed files with 23 additions and 17 deletions

View File

@ -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({

View File

@ -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",

View File

@ -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]
}
}

View File

@ -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

View File

@ -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))

View File

@ -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)