mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-09 23:39:28 +00:00
fixes and cleanups.
This commit is contained in:
@@ -6,15 +6,17 @@ frappe.ui.form.on("Timesheet", {
|
||||
setup: function(frm) {
|
||||
frm.get_field('time_logs').grid.editable_fields = [
|
||||
{fieldname: 'billable', columns: 1},
|
||||
{fieldname: 'project', columns: 3},
|
||||
{fieldname: 'activity_type', columns: 2},
|
||||
{fieldname: 'from_time', columns: 3},
|
||||
{fieldname: 'hours', columns: 1},
|
||||
{fieldname: 'project', columns: 3}
|
||||
{fieldname: 'hours', columns: 1}
|
||||
];
|
||||
|
||||
frm.fields_dict.employee.get_query = function() {
|
||||
return {
|
||||
query:"erpnext.projects.doctype.timesheet.timesheet.get_employee_list"
|
||||
filters:{
|
||||
'status': 'Active'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 0,
|
||||
"autoname": "naming_series:",
|
||||
"beta": 0,
|
||||
@@ -662,7 +662,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-26 00:01:56.055046",
|
||||
"modified": "2016-08-01 08:54:31.840829",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Timesheet",
|
||||
|
||||
@@ -94,7 +94,7 @@ class Timesheet(Document):
|
||||
if self.production_order and flt(data.completed_qty) == 0:
|
||||
frappe.throw(_("Row {0}: Completed Qty must be greater than zero.").format(data.idx))
|
||||
|
||||
if self.production_order and flt(pending_qty) < flt(data.completed_qty):
|
||||
if self.production_order and flt(pending_qty) < flt(data.completed_qty) and flt(pending_qty) > 0:
|
||||
frappe.throw(_("Row {0}: Completed Qty cannot be more than {1} for operation {2}").format(data.idx, pending_qty, data.operation),
|
||||
OverProductionLoggedError)
|
||||
|
||||
@@ -290,10 +290,3 @@ def get_activity_cost(employee=None, activity_type=None):
|
||||
["costing_rate", "billing_rate"], as_dict=True)
|
||||
|
||||
return rate[0] if rate else {}
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_employee_list(doctype, txt, searchfield, start, page_len, filters):
|
||||
return frappe.db.sql("""select distinct employee, employee_name
|
||||
from `tabSalary Structure` where salary_slip_based_on_timesheet=1
|
||||
and employee like %(txt)s or employee_name like %(txt)s limit %(start)s, %(page_len)s""",
|
||||
{'txt': "%%%s%%"% txt, 'start': start, 'page_len': page_len})
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Billable",
|
||||
"label": "Bill",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -121,7 +121,7 @@
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_list_view": 0,
|
||||
"label": "Hours",
|
||||
"label": "Hrs",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
@@ -532,7 +532,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-07-26 00:07:58.267131",
|
||||
"modified": "2016-08-06 03:14:31.691605",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Projects",
|
||||
"name": "Timesheet Detail",
|
||||
|
||||
Reference in New Issue
Block a user