mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 09:54:47 +00:00
Sourced wnframework-modules from Google Code as erpnext
This commit is contained in:
0
projects/doctype/__init__.py
Normal file
0
projects/doctype/__init__.py
Normal file
0
projects/doctype/activity_type/__init__.py
Normal file
0
projects/doctype/activity_type/__init__.py
Normal file
136
projects/doctype/activity_type/activity_type.txt
Normal file
136
projects/doctype/activity_type/activity_type.txt
Normal file
@@ -0,0 +1,136 @@
|
||||
[
|
||||
{
|
||||
'allow_attach': None,
|
||||
'allow_copy': None,
|
||||
'allow_email': None,
|
||||
'allow_print': None,
|
||||
'allow_rename': None,
|
||||
'allow_trash': None,
|
||||
'autoname': 'field:activity_type',
|
||||
'change_log': None,
|
||||
'client_script': None,
|
||||
'client_script_core': None,
|
||||
'client_string': None,
|
||||
'colour': 'White:FFF',
|
||||
'creation': '2011-02-21 15:43:40',
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocType',
|
||||
'document_type': None,
|
||||
'dt_template': None,
|
||||
'hide_heading': None,
|
||||
'hide_toolbar': None,
|
||||
'idx': None,
|
||||
'in_create': None,
|
||||
'in_dialog': 1,
|
||||
'is_transaction_doc': None,
|
||||
'issingle': None,
|
||||
'istable': None,
|
||||
'max_attachments': None,
|
||||
'menu_index': None,
|
||||
'modified': '2011-02-21 15:43:40',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Projects',
|
||||
'name': 'Activity Type',
|
||||
'name_case': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': None,
|
||||
'parent_node': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'print_outline': None,
|
||||
'read_only': None,
|
||||
'read_only_onload': None,
|
||||
'search_fields': None,
|
||||
'section_style': 'Simple',
|
||||
'server_code': None,
|
||||
'server_code_compiled': None,
|
||||
'server_code_core': None,
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': None,
|
||||
'smallicon': None,
|
||||
'use_template': None,
|
||||
'version': 12
|
||||
},
|
||||
{
|
||||
'amend': None,
|
||||
'cancel': None,
|
||||
'create': 1,
|
||||
'creation': '2011-02-21 15:43:40',
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': None,
|
||||
'idx': 1,
|
||||
'match': None,
|
||||
'modified': '2011-02-21 15:43:40',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'PERM00739',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Activity Type',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'read': 1,
|
||||
'role': 'System Manager',
|
||||
'submit': None,
|
||||
'write': 1
|
||||
},
|
||||
{
|
||||
'amend': None,
|
||||
'cancel': None,
|
||||
'create': 1,
|
||||
'creation': '2011-02-21 15:43:40',
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': None,
|
||||
'idx': 2,
|
||||
'match': None,
|
||||
'modified': '2011-02-21 15:43:40',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'PERM00740',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Activity Type',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'read': 1,
|
||||
'role': 'Projects User',
|
||||
'submit': None,
|
||||
'write': 1
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-21 15:43:40',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'activity_type',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 1,
|
||||
'in_filter': None,
|
||||
'label': 'Activity Type',
|
||||
'modified': '2011-02-21 15:43:40',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04231',
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Activity Type',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 1,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
}
|
||||
]
|
||||
0
projects/doctype/project/__init__.py
Normal file
0
projects/doctype/project/__init__.py
Normal file
39
projects/doctype/project/project.js
Normal file
39
projects/doctype/project/project.js
Normal file
@@ -0,0 +1,39 @@
|
||||
//-------------------------- Onload ---------------------------
|
||||
cur_frm.cscript.onload = function(doc, cdt, cdn) {
|
||||
if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'});
|
||||
}
|
||||
|
||||
//------------------- Get Contact Person based on customer selected ---------------------------
|
||||
cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) {
|
||||
if(doc.customer)
|
||||
return 'SELECT `tabContact`.contact_name FROM `tabContact` WHERE (`tabContact`.is_customer = 1 AND `tabContact`.customer_name = "'+ doc.customer+'") AND `tabContact`.docstatus != 2 AND `tabContact`.contact_name LIKE "%s" ORDER BY `tabContact`.contact_name ASC LIMIT 50';
|
||||
else
|
||||
msgprint("Please select Customer first")
|
||||
}
|
||||
|
||||
//-------------------------------- get query select Territory ------------------------------------------
|
||||
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
|
||||
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
|
||||
}
|
||||
|
||||
//------------------------ Customer and its primary contact Details ------------------------------------
|
||||
cur_frm.cscript.customer = function(doc, cdt, cdn) {
|
||||
if(doc.customer) get_server_fields('get_customer_details', '','', doc, cdt, cdn, 1);
|
||||
}
|
||||
|
||||
//--------------------- Customer's Contact Person Details --------------------------------------------
|
||||
cur_frm.cscript.contact_person = function(doc, cdt, cdn) {
|
||||
if(doc.contact_person) {
|
||||
get_server_fields('get_contact_details','','',doc, cdt, cdn, 1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------- calculate gross profit --------------------------------
|
||||
cur_frm.cscript.project_value = function(doc, cdt, cdn){
|
||||
get_server_fields('get_gross_profit','','',doc, cdt, cdn, 1);
|
||||
}
|
||||
|
||||
//--------- calculate gross profit --------------------------------
|
||||
cur_frm.cscript.est_material_cost = function(doc, cdt, cdn){
|
||||
get_server_fields('get_gross_profit','','',doc, cdt, cdn, 1);
|
||||
}
|
||||
76
projects/doctype/project/project.py
Normal file
76
projects/doctype/project/project.py
Normal file
@@ -0,0 +1,76 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
set = webnotes.conn.set
|
||||
sql = webnotes.conn.sql
|
||||
get_value = webnotes.conn.get_value
|
||||
in_transaction = webnotes.conn.in_transaction
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self, doc, doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
# Get Customer Details along with its primary contact details
|
||||
# ==============================================================
|
||||
def get_customer_details(self):
|
||||
details =sql("select address, territory, customer_group,customer_name from `tabCustomer` where name=%s and docstatus!=2",(self.doc.customer),as_dict=1)
|
||||
if details:
|
||||
ret = {
|
||||
'customer_address' : details and details[0]['address'] or '',
|
||||
'territory' : details and details[0]['territory'] or '',
|
||||
'customer_group' : details and details[0]['customer_group'] or '',
|
||||
'customer_name' : details and details[0]['customer_name'] or ''
|
||||
}
|
||||
#get primary contact details(this is done separately coz. , if join query used & no primary contact thn it would not be able to fetch customer details)
|
||||
contact_det = sql("select contact_name, contact_no, email_id from `tabContact` where customer_name='%s' and is_customer=1 and is_primary_contact='Yes' and docstatus!=2" %(self.doc.customer), as_dict = 1)
|
||||
ret['contact_person'] = contact_det and contact_det[0]['contact_name'] or ''
|
||||
ret['contact_no'] = contact_det and contact_det[0]['contact_no'] or ''
|
||||
ret['email_id'] = contact_det and contact_det[0]['email_id'] or ''
|
||||
return cstr(ret)
|
||||
else:
|
||||
msgprint("Customer : %s does not exist in system." % (self.doc.customer))
|
||||
raise Exception
|
||||
|
||||
# Get customer's contact person details
|
||||
# ==============================================================
|
||||
def get_contact_details(self):
|
||||
contact = sql("select contact_no, email_id from `tabContact` where contact_name = '%s' and customer_name = '%s' and docstatus != 2" %(self.doc,contact_person,self.doc.customer), as_dict=1)
|
||||
if contact:
|
||||
ret = {
|
||||
'contact_no' : contact and contact[0]['contact_no'] or '',
|
||||
'email_id' : contact and contact[0]['email_id'] or ''
|
||||
}
|
||||
return str(ret)
|
||||
else:
|
||||
msgprint("Contact Person : %s does not exist in the system." % (self.doc,contact_person))
|
||||
raise Exception
|
||||
|
||||
#calculate gross profit
|
||||
#=============================================
|
||||
def get_gross_profit(self):
|
||||
pft, per_pft =0, 0
|
||||
pft = flt(self.doc.project_value) - flt(self.doc.est_material_cost)
|
||||
#if pft > 0:
|
||||
per_pft = (flt(pft) / flt(self.doc.project_value)) * 100
|
||||
ret = {'gross_margin_value': pft, 'per_gross_margin': per_pft}
|
||||
return cstr(ret)
|
||||
|
||||
# validate
|
||||
#================================================
|
||||
def validate(self):
|
||||
if self.doc.project_start_date and self.doc.completion_date:
|
||||
if getdate(self.doc.completion_date) < getdate(self.doc.project_start_date):
|
||||
msgprint("Expected Completion Date can not be less than Project Start Date")
|
||||
raise Exception
|
||||
1220
projects/doctype/project/project.txt
Normal file
1220
projects/doctype/project/project.txt
Normal file
File diff suppressed because it is too large
Load Diff
0
projects/doctype/project_activity/__init__.py
Normal file
0
projects/doctype/project_activity/__init__.py
Normal file
83
projects/doctype/project_activity/project_activity.js
Normal file
83
projects/doctype/project_activity/project_activity.js
Normal file
@@ -0,0 +1,83 @@
|
||||
cur_frm.cscript.onload = function(doc, dt, dn) {
|
||||
// created?
|
||||
if(cur_frm.mylist) {
|
||||
cur_frm.mylist.run();
|
||||
return;
|
||||
} else {
|
||||
|
||||
// create a new listing
|
||||
var lst = new Listing('Activities Updates');
|
||||
|
||||
lst.colwidths = ['5%','30%','40%','25%'];
|
||||
|
||||
// define options
|
||||
var opts = {};
|
||||
|
||||
opts.head_main_style = {};
|
||||
opts.cell_style = { padding:'3px 2px', borderRight : '0px', borderBottom : '1px solid #AAA', verticalAlign: 'top'}
|
||||
opts.head_style = { padding:'3px 2px', borderBottom : '1px solid #AAA'}
|
||||
opts.alt_cell_style = {};
|
||||
opts.hide_print = 1;
|
||||
opts.no_border = 1;
|
||||
|
||||
opts.hide_export = 1;
|
||||
opts.hide_print = 1;
|
||||
opts.hide_rec_label = 1;
|
||||
|
||||
lst.opts = opts;
|
||||
|
||||
// query
|
||||
lst.get_query = function() {
|
||||
var doc = cur_frm.doc;
|
||||
this.query = "select owner,creation,`update`, hours from `tabProject Activity Update` where parent = '"+doc.name+"'";
|
||||
this.query_max = "select count(*) from `tabProject Activity Update` where parent = '"+doc.name+"'";
|
||||
}
|
||||
|
||||
lst.show_cell = function(cell,ri,ci,d){
|
||||
|
||||
// owner and date
|
||||
if (ci==0){
|
||||
var d1 = $a(cell,'div');
|
||||
var img = $a(cell,'img','',{width:'40px'});
|
||||
set_user_img(img,d[ri][0])
|
||||
var d2 = $a(cell,'div');
|
||||
d2.innerHTML = d[ri][0] + ' on: ' + date.str_to_user(d[ri][1]);
|
||||
}
|
||||
|
||||
// update
|
||||
if(ci==1) {
|
||||
cell.innerHTML = replace_newlines(d[ri][2]);
|
||||
}
|
||||
|
||||
// Hours
|
||||
if (ci==2) {
|
||||
cell.innerHTML = d[ri][3] + ' hrs';
|
||||
}
|
||||
}
|
||||
|
||||
lst.make(cur_frm.fields_dict['Updates HTML'].wrapper);
|
||||
cur_frm.mylist = lst;
|
||||
lst.run();
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc, dt, dn) {
|
||||
|
||||
// show activities only after project is saved
|
||||
|
||||
var fl = ['new_update','Add','hours','Updates HTML'];
|
||||
if(doc.__islocal) {
|
||||
hide_field(fl);}
|
||||
else {
|
||||
unhide_field(fl); }
|
||||
}
|
||||
|
||||
cur_frm.cscript['Add'] = function(doc, dt, dn) {
|
||||
var callback = function(r,rt) {
|
||||
|
||||
// refresh listing
|
||||
cur_frm.mylist.run();
|
||||
|
||||
}
|
||||
$c_obj([doc],'add_update','',callback);
|
||||
}
|
||||
32
projects/doctype/project_activity/project_activity.py
Normal file
32
projects/doctype/project_activity/project_activity.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
set = webnotes.conn.set
|
||||
sql = webnotes.conn.sql
|
||||
get_value = webnotes.conn.get_value
|
||||
in_transaction = webnotes.conn.in_transaction
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d, dl
|
||||
|
||||
def add_update(self):
|
||||
d = Document('Project Activity Update')
|
||||
d.parent = self.doc.name
|
||||
d.update = self.doc.new_update
|
||||
d.hours = self.doc.hours
|
||||
d.save(1)
|
||||
|
||||
self.doc.new_update = ''
|
||||
self.doc.hours = ''
|
||||
1
projects/doctype/project_activity/project_activity.txt
Normal file
1
projects/doctype/project_activity/project_activity.txt
Normal file
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
[{'section_style': 'Simple', 'is_transaction_doc': None, 'creation': '2010-04-20 13:32:19', 'search_fields': None, 'module': 'Projects', 'doctype': 'DocType', 'change_log': None, 'print_outline': '', 'owner': 'Administrator', 'in_dialog': None, 'in_create': None, 'read_only': None, 'allow_email': None, 'dt_template': None, 'hide_heading': None, 'issingle': None, 'allow_rename': None, 'smallicon': None, 'allow_attach': None, 'show_in_menu': None, 'max_attachments': None, 'version': 1, 'menu_index': None, 'docstatus': 0, 'allow_copy': None, 'istable': 1, 'description': None, 'parent': None, 'server_code': None, 'allow_trash': None, 'allow_print': None, 'autoname': None, 'client_script_core': None, 'client_string': None, 'use_template': None, 'modified_by': 'Administrator', 'document_type': None, 'name': 'Project Activity Update', 'idx': None, 'hide_toolbar': None, 'colour': 'White:FFF', 'client_script': None, 'modified': '2010-09-20 14:06:57', 'server_code_error': None, 'name_case': '', 'parenttype': None, 'read_only_onload': None, 'server_code_core': None, 'server_code_compiled': None, 'parent_node': None, 'parentfield': None}, {'no_copy': None, 'oldfieldtype': 'Text', 'creation': '2010-04-20 13:32:19', 'doctype': 'DocField', 'oldfieldname': 'update', 'owner': 'Administrator', 'reqd': None, 'in_filter': None, 'print_hide': None, 'modified_by': 'Administrator', 'label': 'Update', 'width': None, 'trigger': None, 'depends_on': None, 'docstatus': 0, 'hidden': None, 'permlevel': 0, 'description': None, 'parent': 'Project Activity Update', 'search_index': None, 'allow_on_submit': None, 'icon': None, 'name': 'FL04817', 'idx': 1, 'default': None, 'colour': None, 'modified': '2010-04-20 13:32:19', 'parenttype': 'DocType', 'fieldname': 'update', 'fieldtype': 'Text', 'options': None, 'report_hide': None, 'parentfield': 'fields'}, {'no_copy': None, 'oldfieldtype': 'Float', 'creation': '2010-04-20 13:32:19', 'doctype': 'DocField', 'oldfieldname': 'hours', 'owner': 'Administrator', 'reqd': None, 'in_filter': None, 'print_hide': None, 'modified_by': 'Administrator', 'label': 'Hours', 'width': None, 'trigger': '', 'depends_on': None, 'docstatus': 0, 'hidden': None, 'permlevel': 0, 'description': 'e.g. 0.5, 2.5 etc', 'parent': 'Project Activity Update', 'search_index': None, 'allow_on_submit': None, 'icon': None, 'name': 'FL04818', 'idx': 2, 'default': None, 'colour': 'White:FFF', 'modified': '2010-04-20 13:32:19', 'parenttype': 'DocType', 'fieldname': 'hours', 'fieldtype': 'Float', 'options': '', 'report_hide': None, 'parentfield': 'fields'}]
|
||||
0
projects/doctype/project_control/__init__.py
Normal file
0
projects/doctype/project_control/__init__.py
Normal file
116
projects/doctype/project_control/project_control.py
Normal file
116
projects/doctype/project_control/project_control.py
Normal file
@@ -0,0 +1,116 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
set = webnotes.conn.set
|
||||
sql = webnotes.conn.sql
|
||||
get_value = webnotes.conn.get_value
|
||||
in_transaction = webnotes.conn.in_transaction
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,d,dl):
|
||||
self.doc, self.doclist = d,dl
|
||||
|
||||
def get_projects(self, arg):
|
||||
# project list
|
||||
pl=[]
|
||||
status={}
|
||||
if arg == 'Open':
|
||||
pl = [p[0] for p in sql("select name from `tabProject` where status = 'Open' order by creation desc limit 20")]
|
||||
for p1 in pl:
|
||||
status[p1] = 'Open'
|
||||
elif arg == 'Completed':
|
||||
pl = [p[0] for p in sql("select name from `tabProject` where status = 'Completed' order by creation desc limit 20")]
|
||||
for p2 in pl:
|
||||
status[p2] = 'Completed'
|
||||
elif arg == 'Cancelled':
|
||||
pl = [p[0] for p in sql("select name from `tabProject` where status = 'Cancelled' order by creation desc limit 20")]
|
||||
for p3 in pl:
|
||||
status[p3] = 'Cancelled'
|
||||
else:
|
||||
#pl = [p[0] for p in sql("select name from `tabProject` order by creation desc limit 20")]
|
||||
pl1 = sql("select name, status from `tabProject` order by creation desc limit 20", as_dict=1)
|
||||
for p4 in pl1:
|
||||
status[p4['name']] = p4['status']
|
||||
pl.append(p4['name'])
|
||||
|
||||
# milestones in the next 7 days for active projects
|
||||
ml = convert_to_lists(sql("select t1.milestone_date, t1.milestone, t1.parent from `tabProject Milestone` t1, tabProject t2 where t1.parent = t2.name and t2.status='Open' and DATEDIFF(t1.milestone_date, CURDATE()) BETWEEN 0 AND 7 ORDER BY t1.milestone_date ASC"))
|
||||
|
||||
# percent of activity completed per project
|
||||
comp = {}
|
||||
n_tasks = {}
|
||||
|
||||
for p in pl:
|
||||
t1 = sql('select count(*) from tabTicket where project=%s and docstatus!=2', p)[0][0]
|
||||
n_tasks[p] = t1 or 0
|
||||
if t1:
|
||||
t2 = sql('select count(*) from tabTicket where project=%s and docstatus!=2 and status="Closed"', p)[0][0]
|
||||
comp[p] = cint(flt(t2)*100/t1)
|
||||
|
||||
return {'pl':pl, 'ml':ml, 'comp':comp, 'n_tasks':n_tasks, 'status':status}
|
||||
|
||||
def get_resources(self):
|
||||
ret = {}
|
||||
|
||||
# resource list
|
||||
rl = sql("select distinct allocated_to, assignee_email from tabTicket")
|
||||
|
||||
# get open & closed tickets
|
||||
for r in rl:
|
||||
if r[0]:
|
||||
ret[r[1]] = {}
|
||||
ret[r[1]]['id'] = r[0]
|
||||
ret[r[1]]['Total'] = sql("select count(*) from tabTicket where allocated_to=%s and docstatus!=2", r[0])[0][0]
|
||||
ret[r[1]]['Closed'] = sql("select count(*) from tabTicket where allocated_to=%s and status='Closed' and docstatus!=2", r[0])[0][0]
|
||||
ret[r[1]]['percent'] = cint(flt(ret[r[1]]['Closed']) * 100 / ret[r[1]]['Total'])
|
||||
|
||||
return ret
|
||||
|
||||
# --------------------------------------------------------------
|
||||
# for Gantt Chart
|
||||
|
||||
def get_init_data(self, arg=''):
|
||||
pl = [p[0] for p in sql('select name from tabProject where docstatus != 2')]
|
||||
rl = [p[0] for p in sql('select distinct allocated_to from tabTicket where docstatus != 2 and ifnull(allocated_to,"") != ""')]
|
||||
return {'pl':pl, 'rl':rl}
|
||||
|
||||
def get_tasks(self, arg):
|
||||
start_date, end_date, project, resource = arg.split('~~~')
|
||||
|
||||
cl = ''
|
||||
if project and project != 'All':
|
||||
cl = " and ifnull(project,'') = '%s'" % project
|
||||
|
||||
if resource and resource != 'All':
|
||||
cl = " and ifnull(allocated_to,'') = '%s'" % resource
|
||||
|
||||
tl = sql("""
|
||||
select subject, allocated_to, project, exp_start_date, exp_end_date, priority, status, name
|
||||
from tabTicket
|
||||
where
|
||||
((exp_start_date between '%(st)s' and '%(end)s') or
|
||||
(exp_end_date between '%(st)s' and '%(end)s') or
|
||||
(exp_start_date < '%(st)s' and exp_end_date > '%(end)s')) %(cond)s order by exp_start_date limit 100""" % {'st': start_date, 'end': end_date, 'cond':cl})
|
||||
|
||||
return convert_to_lists(tl)
|
||||
|
||||
def declare_proj_completed(self, arg):
|
||||
chk = sql("select name from `tabTicket` where project=%s and status='Open'", arg)
|
||||
if chk:
|
||||
chk_lst = [x[0] for x in chk]
|
||||
msgprint("Task(s) "+','.join(chk_lst)+" has staus 'Open'. Please submit all tasks against this project before closing the project.")
|
||||
return cstr('false')
|
||||
else:
|
||||
sql("update `tabProject` set status = 'Completed' where name = %s", arg)
|
||||
return cstr('true')
|
||||
1
projects/doctype/project_control/project_control.txt
Normal file
1
projects/doctype/project_control/project_control.txt
Normal file
@@ -0,0 +1 @@
|
||||
[{'section_style': 'Simple', 'is_transaction_doc': None, 'creation': '2010-04-20 15:42:00', 'search_fields': None, 'module': 'Projects', 'doctype': 'DocType', 'change_log': None, 'print_outline': '', 'owner': 'harshada@webnotestech.com', 'in_dialog': None, 'in_create': None, 'read_only': None, 'allow_email': None, 'dt_template': None, 'hide_heading': None, 'issingle': 1, 'allow_rename': None, 'smallicon': None, 'allow_attach': None, 'show_in_menu': None, 'max_attachments': None, 'version': 43, 'menu_index': None, 'docstatus': 0, 'allow_copy': None, 'istable': None, 'description': None, 'parent': None, 'server_code': None, 'allow_trash': None, 'allow_print': None, 'autoname': None, 'client_script_core': None, 'client_string': None, 'use_template': None, 'modified_by': 'ashwini@webnotestech.com', 'document_type': '', 'name': 'Project Control', 'idx': None, 'hide_toolbar': None, 'colour': 'White:FFF', 'client_script': None, 'modified': '2010-11-02 10:10:37', 'server_code_error': ' ', 'name_case': '', 'parenttype': None, 'read_only_onload': None, 'server_code_core': None, 'server_code_compiled': None, 'parent_node': None, 'parentfield': None}]
|
||||
0
projects/doctype/project_milestone/__init__.py
Normal file
0
projects/doctype/project_milestone/__init__.py
Normal file
1
projects/doctype/project_milestone/project_milestone.txt
Normal file
1
projects/doctype/project_milestone/project_milestone.txt
Normal file
@@ -0,0 +1 @@
|
||||
[{'section_style': 'Simple', 'is_transaction_doc': None, 'creation': '2010-04-20 13:27:02', 'search_fields': None, 'module': 'Projects', 'doctype': 'DocType', 'change_log': None, 'print_outline': '', 'owner': 'Administrator', 'in_dialog': None, 'in_create': None, 'read_only': None, 'allow_email': None, 'dt_template': None, 'hide_heading': None, 'issingle': None, 'allow_rename': None, 'smallicon': None, 'allow_attach': None, 'show_in_menu': None, 'max_attachments': None, 'version': 1, 'menu_index': None, 'docstatus': 0, 'allow_copy': None, 'istable': 1, 'description': None, 'parent': None, 'server_code': None, 'allow_trash': None, 'allow_print': None, 'autoname': None, 'client_script_core': None, 'client_string': None, 'use_template': None, 'modified_by': 'Administrator', 'document_type': None, 'name': 'Project Milestone', 'idx': None, 'hide_toolbar': None, 'colour': 'White:FFF', 'client_script': None, 'modified': '2010-09-20 14:06:57', 'server_code_error': ' ', 'name_case': '', 'parenttype': None, 'read_only_onload': None, 'server_code_core': None, 'server_code_compiled': None, 'parent_node': None, 'parentfield': None}, {'no_copy': None, 'oldfieldtype': 'Date', 'creation': '2010-04-20 13:27:02', 'doctype': 'DocField', 'oldfieldname': 'milestone_date', 'owner': 'Administrator', 'reqd': None, 'in_filter': None, 'print_hide': None, 'modified_by': 'Administrator', 'label': 'Milestone Date', 'width': None, 'trigger': None, 'depends_on': None, 'docstatus': 0, 'hidden': None, 'permlevel': 0, 'description': None, 'parent': 'Project Milestone', 'search_index': None, 'allow_on_submit': None, 'icon': None, 'name': 'FL04807', 'idx': 1, 'default': None, 'colour': None, 'modified': '2010-04-20 13:27:02', 'parenttype': 'DocType', 'fieldname': 'milestone_date', 'fieldtype': 'Date', 'options': None, 'report_hide': None, 'parentfield': 'fields'}, {'no_copy': None, 'oldfieldtype': 'Text', 'creation': '2010-04-20 13:27:02', 'doctype': 'DocField', 'oldfieldname': 'milestone', 'owner': 'Administrator', 'reqd': None, 'in_filter': None, 'print_hide': None, 'modified_by': 'Administrator', 'label': 'Milestone', 'width': '300px', 'trigger': None, 'depends_on': None, 'docstatus': 0, 'hidden': None, 'permlevel': 0, 'description': None, 'parent': 'Project Milestone', 'search_index': None, 'allow_on_submit': None, 'icon': None, 'name': 'FL04808', 'idx': 2, 'default': None, 'colour': None, 'modified': '2010-04-20 13:27:02', 'parenttype': 'DocType', 'fieldname': 'milestone', 'fieldtype': 'Text', 'options': None, 'report_hide': None, 'parentfield': 'fields'}, {'no_copy': None, 'oldfieldtype': 'Select', 'creation': '2010-04-20 13:27:02', 'doctype': 'DocField', 'oldfieldname': 'status', 'owner': 'Administrator', 'reqd': None, 'in_filter': None, 'print_hide': None, 'modified_by': 'Administrator', 'label': 'Status', 'width': None, 'trigger': None, 'depends_on': None, 'docstatus': 0, 'hidden': None, 'permlevel': 0, 'description': None, 'parent': 'Project Milestone', 'search_index': None, 'allow_on_submit': None, 'icon': None, 'name': 'FL04809', 'idx': 3, 'default': None, 'colour': None, 'modified': '2010-04-20 13:27:02', 'parenttype': 'DocType', 'fieldname': 'status', 'fieldtype': 'Select', 'options': 'Pending\nCompleted', 'report_hide': None, 'parentfield': 'fields'}]
|
||||
0
projects/doctype/ticket/__init__.py
Normal file
0
projects/doctype/ticket/__init__.py
Normal file
16
projects/doctype/ticket/ticket.comp.js
Normal file
16
projects/doctype/ticket/ticket.comp.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
cur_frm.cscript.onload=function(doc,cdt,cdn){if(!doc.senders_name){doc.senders_name=user_fullname;doc.senders_email=user;refresh_many(['senders_name','senders_email']);}
|
||||
if(doc.__islocal){doc.status='Open';doc.opening_date=get_today();refresh_many(['status','opening_date']);}
|
||||
else{if(!doc.opening_date){doc.opening_date=dateutil.str_to_user(only_date(doc.creation));refresh_field('opening_date');}}
|
||||
if(doc.status=='Open')doc.review_date=doc.closing_date='';else if(doc.status=='Pending Review')doc.closing_date='';refresh_many(['closing_date','review_date']);if(doc.project)cur_frm.cscript.project(doc,cdt,cdn);}
|
||||
cur_frm.cscript.refresh=function(doc,cdt,cdn){cur_frm.clear_custom_buttons();if(doc.status=='Pending Review'&&(doc.senders_name==user_fullname||doc.senders_email==user)){cur_frm.add_custom_button('Declare Completed',cur_frm.cscript['Declare Completed']);cur_frm.add_custom_button('Reopen Task',cur_frm.cscript['Reopen Task']);}
|
||||
if(doc.status=='Open'&&!doc.__islocal){cur_frm.add_custom_button('Cancel Task',cur_frm.cscript['Cancel Task']);if(doc.allocated_to==user)cur_frm.add_custom_button('Get Approval',cur_frm.cscript['Get Approval']);}}
|
||||
cur_frm.fields_dict['project'].get_query=function(doc,cdt,cdn){var cond='';if(doc.customer)cond='ifnull(`tabProject`.customer, "") = "'+doc.customer+'" AND';return repl('SELECT distinct `tabProject`.`name` FROM `tabProject` WHERE %(cond)s `tabProject`.`name` LIKE "%s" ORDER BY `tabProject`.`name` ASC LIMIT 50',{cond:cond});}
|
||||
cur_frm.cscript.project=function(doc,cdt,cdn){if(doc.project)get_server_fields('get_project_details','','',doc,cdt,cdn,1);}
|
||||
cur_frm.fields_dict['customer'].get_query=function(doc,cdt,cdn){var cond='';if(doc.project)cond='ifnull(`tabProject`.customer, "") = `tabCustomer`.name AND ifnull(`tabProject`.name, "") = "'+doc.project+'" AND';return repl('SELECT distinct `tabCustomer`.`name` FROM `tabCustomer`, `tabProject` WHERE %(cond)s `tabCustomer`.`name` LIKE "%s" ORDER BY `tabCustomer`.`name` ASC LIMIT 50',{cond:cond});}
|
||||
cur_frm.cscript.customer=function(doc,cdt,cdn){if(doc.customer)get_server_fields('get_customer_details','','',doc,cdt,cdn,1);else doc.customer_name='';}
|
||||
cur_frm.cscript.allocated_to=function(doc,cdt,cdn){get_server_fields('get_allocated_to_name','','',doc,cdt,cdn,1);}
|
||||
cur_frm.cscript['Get Approval']=function(){$c_obj(make_doclist(cur_frm.doc.doctype,cur_frm.doc.name),'set_for_review','',function(r,rt){if(r.message=='true'){doc.status='Pending Review';refresh_many(['review_date','status']);cur_frm.cscript.refresh(cur_frm.doc,cur_frm.doc.doctype,cur_frm.doc.name);}});}
|
||||
cur_frm.cscript['Reopen Task']=function(){$c_obj(make_doclist(cur_frm.doc.doctype,cur_frm.doc.name),'reopen_task','',function(r,rt){if(r.message=='true'){doc.status='Open';refresh_many(['status']);cur_frm.cscript.refresh(cur_frm.doc,cur_frm.doc.doctype,cur_frm.doc.name);}});}
|
||||
cur_frm.cscript['Cancel Task']=function(){$c_obj(make_doclist(cur_frm.doc.doctype,cur_frm.doc.name),'cancel_task','',function(r,rt){if(r.message=='true'){doc.status='Cancelled';refresh_many(['status']);cur_frm.cscript.refresh(cur_frm.doc,cur_frm.doc.doctype,cur_frm.doc.name);}});}
|
||||
cur_frm.cscript['Declare Completed']=function(){$c_obj(make_doclist(cur_frm.doc.doctype,cur_frm.doc.name),'declare_completed','',function(r,rt){if(r.message=='true'){doc.status='Closed';refresh_many(['review_date','closing_date','status']);cur_frm.cscript.refresh(cur_frm.doc,cur_frm.doc.doctype,cur_frm.doc.name);}});}
|
||||
106
projects/doctype/ticket/ticket.js
Normal file
106
projects/doctype/ticket/ticket.js
Normal file
@@ -0,0 +1,106 @@
|
||||
cur_frm.cscript.onload = function(doc,cdt,cdn){
|
||||
if(!doc.senders_name) {
|
||||
doc.senders_name = user_fullname;
|
||||
doc.senders_email = user;
|
||||
refresh_many(['senders_name', 'senders_email']);
|
||||
}
|
||||
|
||||
if(doc.__islocal) {
|
||||
doc.status = 'Open';
|
||||
doc.opening_date = get_today();
|
||||
refresh_many(['status', 'opening_date']);
|
||||
}
|
||||
else{
|
||||
if(!doc.opening_date){
|
||||
doc.opening_date = dateutil.str_to_user(only_date(doc.creation));
|
||||
refresh_field('opening_date');
|
||||
}
|
||||
}
|
||||
|
||||
//hide unhide field depends on status
|
||||
if(doc.status == 'Open') doc.review_date = doc.closing_date = '';
|
||||
else if(doc.status == 'Pending Review') doc.closing_date = '';
|
||||
refresh_many(['closing_date','review_date']);
|
||||
|
||||
if(doc.project) cur_frm.cscript.project(doc, cdt, cdn);
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc,cdt,cdn) {
|
||||
cur_frm.clear_custom_buttons();
|
||||
if(doc.status == 'Pending Review' && (doc.senders_name == user_fullname || doc.senders_email == user)) {
|
||||
cur_frm.add_custom_button('Declare Completed', cur_frm.cscript['Declare Completed']);
|
||||
cur_frm.add_custom_button('Reopen Task', cur_frm.cscript['Reopen Task']);
|
||||
}
|
||||
if(doc.status == 'Open' && !doc.__islocal) {
|
||||
cur_frm.add_custom_button('Cancel Task', cur_frm.cscript['Cancel Task']);
|
||||
if(doc.allocated_to == user) cur_frm.add_custom_button('Get Approval', cur_frm.cscript['Get Approval']);
|
||||
}
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['project'].get_query = function(doc,cdt,cdn){
|
||||
var cond='';
|
||||
if(doc.customer) cond = 'ifnull(`tabProject`.customer, "") = "'+doc.customer+'" AND';
|
||||
|
||||
return repl('SELECT distinct `tabProject`.`name` FROM `tabProject` WHERE %(cond)s `tabProject`.`name` LIKE "%s" ORDER BY `tabProject`.`name` ASC LIMIT 50', {cond:cond});
|
||||
}
|
||||
|
||||
|
||||
cur_frm.cscript.project = function(doc, cdt, cdn){
|
||||
if(doc.project) get_server_fields('get_project_details', '','', doc, cdt, cdn, 1);
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['customer'].get_query = function(doc,cdt,cdn){
|
||||
var cond='';
|
||||
if(doc.project) cond = 'ifnull(`tabProject`.customer, "") = `tabCustomer`.name AND ifnull(`tabProject`.name, "") = "'+doc.project+'" AND';
|
||||
|
||||
return repl('SELECT distinct `tabCustomer`.`name` FROM `tabCustomer`, `tabProject` WHERE %(cond)s `tabCustomer`.`name` LIKE "%s" ORDER BY `tabCustomer`.`name` ASC LIMIT 50', {cond:cond});
|
||||
}
|
||||
|
||||
cur_frm.cscript.customer = function(doc, cdt, cdn){
|
||||
if(doc.customer) get_server_fields('get_customer_details', '','', doc, cdt, cdn, 1);
|
||||
else doc.customer_name ='';
|
||||
}
|
||||
|
||||
cur_frm.cscript.allocated_to = function(doc,cdt,cdn){
|
||||
get_server_fields('get_allocated_to_name','','',doc,cdt,cdn,1);
|
||||
}
|
||||
|
||||
cur_frm.cscript['Get Approval'] = function(){
|
||||
$c_obj(make_doclist(cur_frm.doc.doctype, cur_frm.doc.name), 'set_for_review', '',function(r, rt) {
|
||||
if(r.message == 'true'){
|
||||
doc.status = 'Pending Review'; //for refresh
|
||||
refresh_many(['review_date','status']);
|
||||
cur_frm.cscript.refresh(cur_frm.doc, cur_frm.doc.doctype, cur_frm.doc.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cur_frm.cscript['Reopen Task'] = function(){
|
||||
$c_obj(make_doclist(cur_frm.doc.doctype, cur_frm.doc.name), 'reopen_task', '',function(r, rt) {
|
||||
if(r.message == 'true'){
|
||||
doc.status = 'Open'; //for refresh
|
||||
refresh_many(['status']);
|
||||
cur_frm.cscript.refresh(cur_frm.doc, cur_frm.doc.doctype, cur_frm.doc.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cur_frm.cscript['Cancel Task'] = function(){
|
||||
$c_obj(make_doclist(cur_frm.doc.doctype, cur_frm.doc.name), 'cancel_task', '',function(r, rt) {
|
||||
if(r.message == 'true'){
|
||||
doc.status = 'Cancelled'; //for refresh
|
||||
refresh_many(['status']);
|
||||
cur_frm.cscript.refresh(cur_frm.doc, cur_frm.doc.doctype, cur_frm.doc.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cur_frm.cscript['Declare Completed'] = function(){
|
||||
$c_obj(make_doclist(cur_frm.doc.doctype, cur_frm.doc.name),'declare_completed', '',function(r, rt) {
|
||||
if(r.message == 'true'){
|
||||
doc.status = 'Closed'; //for refresh
|
||||
refresh_many(['review_date', 'closing_date', 'status']);
|
||||
cur_frm.cscript.refresh(cur_frm.doc, cur_frm.doc.doctype, cur_frm.doc.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
167
projects/doctype/ticket/ticket.py
Normal file
167
projects/doctype/ticket/ticket.py
Normal file
@@ -0,0 +1,167 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
sql = webnotes.conn.sql
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,doc,doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
def get_project_details(self):
|
||||
cust = sql("select customer, customer_name from `tabProject` where name = %s", self.doc.project)
|
||||
if cust:
|
||||
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
|
||||
return cstr(ret)
|
||||
|
||||
def get_customer_details(self):
|
||||
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
|
||||
if cust:
|
||||
ret = {'customer_name': cust and cust[0][0] or ''}
|
||||
return cstr(ret)
|
||||
|
||||
def get_allocated_to_name(self):
|
||||
as_em = sql("select first_name, last_name from `tabProfile` where name=%s",self.doc.allocated_to)
|
||||
ret = { 'allocated_to_name' : as_em and (as_em[0][0] + ' ' + as_em[0][1]) or ''}
|
||||
return cstr(ret)
|
||||
|
||||
# validate
|
||||
#--------------------------------------------
|
||||
|
||||
|
||||
def validate(self):
|
||||
if not self.doc.opening_date:
|
||||
msgprint("Please enter Opening Date.")
|
||||
raise Exception
|
||||
elif getdate(self.doc.opening_date) > getdate(nowdate()):
|
||||
msgprint("Opening date can not be future date")
|
||||
raise Exception
|
||||
|
||||
if self.doc.exp_start_date and self.doc.exp_end_date and getdate(self.doc.exp_start_date) > getdate(self.doc.exp_end_date):
|
||||
msgprint("'Expected Start Date' can not be greater than 'Expected End Date'")
|
||||
raise Exception
|
||||
|
||||
if self.doc.act_start_date and self.doc.act_end_date and getdate(self.doc.act_start_date) > getdate(self.doc.act_end_date):
|
||||
msgprint("'Actual Start Date' can not be greater than 'Actual End Date'")
|
||||
raise Exception
|
||||
|
||||
if self.doc.opening_date and self.doc.review_date and getdate(self.doc.opening_date) > getdate(self.doc.review_date):
|
||||
msgprint("Review Date should be greater than or equal to Opening Date ")
|
||||
raise Exception
|
||||
|
||||
if self.doc.closing_date and self.doc.review_date and getdate(self.doc.closing_date) < getdate(self.doc.review_date):
|
||||
msgprint("Closing Date should be greater than or equal to Review Date ")
|
||||
raise Exception
|
||||
|
||||
# on update
|
||||
#--------------------------------------------
|
||||
|
||||
def on_update(self):
|
||||
pass
|
||||
|
||||
#validate before sending for approval
|
||||
def validate_for_pending_review(self):
|
||||
if not self.doc.allocated_to:
|
||||
msgprint("Please enter allocated_to.")
|
||||
raise Exception
|
||||
self.validate_with_timesheet_dates()
|
||||
|
||||
#validate before closing task
|
||||
def validate_for_closed(self):
|
||||
self.check_non_submitted_timesheets()
|
||||
self.get_actual_total_hrs()
|
||||
|
||||
def check_non_submitted_timesheets(self):
|
||||
chk = sql("select t1.name from `tabTimesheet` t1, `tabTimesheet Detail` t2 where t2.parent=t1.name and t2.task_id=%s and t1.status='Draft'", self.doc.name)
|
||||
if chk:
|
||||
chk_lst = [x[0] for x in chk]
|
||||
msgprint("Please submit timesheet(s) : "+','.join(chk_lst)+" before declaring this task as completed. As details of this task present in timesheet(s)")
|
||||
raise Exception
|
||||
|
||||
#calculate actual total hours taken to complete task from timesheets
|
||||
def get_actual_total_hrs(self):
|
||||
import datetime
|
||||
import time
|
||||
chk = sql("select t2.act_total_hrs from `tabTimesheet` t1, `tabTimesheet Detail` t2 where t2.parent = t1.name and t2.task_id = %s and t1.status = 'Submitted' and ifnull(t2.act_total_hrs, '')!='' order by t1.timesheet_date asc", self.doc.name)
|
||||
if chk:
|
||||
chk_lst = [x[0] for x in chk]
|
||||
actual_total = total =0
|
||||
|
||||
for m in chk_lst:
|
||||
m1, m2=[], 0
|
||||
m1 = m.split(":")
|
||||
m2 = (datetime.timedelta(minutes=cint(m1[1]), hours=cint(m1[0]))).seconds
|
||||
total = total + m2
|
||||
|
||||
actual_total = time.strftime("%H:%M", time.gmtime(total))
|
||||
set(self.doc, 'act_total_hrs', actual_total)
|
||||
|
||||
# validate and fetch actual start and end date
|
||||
def validate_with_timesheet_dates(self):
|
||||
chk = sql("select t1.name, t1.timesheet_date from `tabTimesheet` t1, `tabTimesheet Detail` t2 where t2.parent = t1.name and t2.task_id = %s and t1.status = 'Submitted' order by t1.timesheet_date asc", self.doc.name, as_dict=1)
|
||||
if chk:
|
||||
if self.doc.act_start_date:
|
||||
if chk[0]['timesheet_date'] > getdate(self.doc.act_start_date) or chk[0]['timesheet_date'] < getdate(self.doc.act_start_date):
|
||||
msgprint("Actual start date of this task is "+cstr(chk[0]['timesheet_date'])+" as per timesheet "+cstr(chk[0]['name']))
|
||||
raise Exception
|
||||
else:
|
||||
self.doc.act_start_date = chk[0]['timesheet_date']
|
||||
|
||||
if self.doc.act_end_date:
|
||||
if chk[len(chk)-1]['timesheet_date'] < getdate(self.doc.act_end_date) or chk[len(chk)-1]['timesheet_date'] > getdate(self.doc.act_end_date):
|
||||
msgprint("Actual end date of this task is "+cstr(chk[len(chk)-1]['timesheet_date'])+" as per timesheet "+cstr(chk[len(chk)-1]['name']))
|
||||
raise Exception
|
||||
else:
|
||||
self.doc.act_end_date = chk[len(chk)-1]['timesheet_date']
|
||||
|
||||
def set_for_review(self):
|
||||
self.check_non_submitted_timesheets()
|
||||
self.validate_for_pending_review()
|
||||
self.get_actual_total_hrs()
|
||||
self.doc.review_date = nowdate()
|
||||
set(self.doc, 'status', 'Pending Review')
|
||||
self.doc.save()
|
||||
return cstr('true')
|
||||
|
||||
def reopen_task(self):
|
||||
set(self.doc, 'status', 'Open')
|
||||
self.doc.save()
|
||||
return cstr('true')
|
||||
|
||||
def declare_completed(self):
|
||||
if self.doc.status == 'Open':
|
||||
self.validate_for_pending_review()
|
||||
self.doc.review_date = nowdate()
|
||||
else:
|
||||
self.validate_with_timesheet_dates()
|
||||
self.validate_for_closed()
|
||||
self.doc.closing_date = nowdate()
|
||||
set(self.doc, 'status', 'Closed')
|
||||
set(self.doc, 'docstatus', 1)
|
||||
self.doc.save()
|
||||
return cstr('true')
|
||||
|
||||
def cancel_task(self):
|
||||
chk = sql("select distinct t1.name from `tabTimesheet` t1, `tabTimesheet Detail` t2 where t2.parent = t1.name and t2.task_id = %s and t1.status!='Cancelled'", self.doc.name)
|
||||
if chk:
|
||||
chk_lst = [x[0] for x in chk]
|
||||
msgprint("Timesheet(s) "+','.join(chk_lst)+" created against this task. Thus can not be cancelled")
|
||||
raise Exception
|
||||
else:
|
||||
set(self.doc, 'status', 'Cancelled')
|
||||
set(self.doc, 'docstatus', 2)
|
||||
self.doc.save()
|
||||
return cstr('true')
|
||||
|
||||
def on_cancel(self):
|
||||
self.cancel_task()
|
||||
1590
projects/doctype/ticket/ticket.txt
Normal file
1590
projects/doctype/ticket/ticket.txt
Normal file
File diff suppressed because it is too large
Load Diff
0
projects/doctype/timesheet/__init__.py
Normal file
0
projects/doctype/timesheet/__init__.py
Normal file
31
projects/doctype/timesheet/timesheet.js
Normal file
31
projects/doctype/timesheet/timesheet.js
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
// ======================= OnLoad =============================================
|
||||
cur_frm.cscript.onload = function(doc,cdt,cdn){
|
||||
if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'});
|
||||
if(!doc.timesheet_date) set_multiple(cdt,cdn,{timesheet_date:get_today()});
|
||||
}
|
||||
|
||||
cur_frm.cscript.refresh = function(doc,cdt,cdn){}
|
||||
|
||||
|
||||
cur_frm.fields_dict['timesheet_details'].grid.get_field("project_name").get_query = function(doc,cdt,cdn){
|
||||
var cond=cond1='';
|
||||
var d = locals[cdt][cdn];
|
||||
//if(d.customer_name) cond = 'ifnull(`tabProject`.customer_name, "") = "'+d.customer_name+'" AND';
|
||||
if(d.task_id) cond1 = 'ifnull(`tabTicket`.project, "") = `tabProject`.name AND `tabTicket`.name = "'+d.task_id+'" AND';
|
||||
|
||||
return repl('SELECT distinct `tabProject`.`name` FROM `tabProject`, `tabTicket` WHERE %(cond1)s `tabProject`.`name` LIKE "%s" ORDER BY `tabProject`.`name` ASC LIMIT 50', {cond1:cond1});
|
||||
}
|
||||
|
||||
cur_frm.cscript.task_name = function(doc, cdt, cdn){
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.task_name) get_server_fields('get_task_details', d.task_name, 'timesheet_details', doc, cdt, cdn, 1);
|
||||
}
|
||||
|
||||
cur_frm.fields_dict['timesheet_details'].grid.get_field("task_name").get_query = function(doc,cdt,cdn){
|
||||
var cond='';
|
||||
var d = locals[cdt][cdn];
|
||||
if(d.project_name) cond = 'ifnull(`tabTicket`.project, "") = "'+d.project_name+'" AND';
|
||||
|
||||
return repl('SELECT distinct `tabTicket`.`subject` FROM `tabTicket` WHERE %(cond)s `tabTicket`.`subject` LIKE "%s" ORDER BY `tabTicket`.`subject` ASC LIMIT 50', {cond:cond});
|
||||
}
|
||||
81
projects/doctype/timesheet/timesheet.py
Normal file
81
projects/doctype/timesheet/timesheet.py
Normal file
@@ -0,0 +1,81 @@
|
||||
# Please edit this list and import only required elements
|
||||
import webnotes
|
||||
|
||||
from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
|
||||
from webnotes.model import db_exists
|
||||
from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
|
||||
from webnotes.model.doclist import getlist, copy_doclist
|
||||
from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
|
||||
from webnotes import session, form, is_testing, msgprint, errprint
|
||||
|
||||
set = webnotes.conn.set
|
||||
sql = webnotes.conn.sql
|
||||
get_value = webnotes.conn.get_value
|
||||
in_transaction = webnotes.conn.in_transaction
|
||||
convert_to_lists = webnotes.conn.convert_to_lists
|
||||
|
||||
# -----------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
class DocType:
|
||||
def __init__(self,doc,doclist=[]):
|
||||
self.doc = doc
|
||||
self.doclist = doclist
|
||||
|
||||
def get_customer_details(self, project_name):
|
||||
cust = sql("select customer, customer_name from `tabProject` where name = %s", project_name)
|
||||
if cust:
|
||||
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
|
||||
return (ret)
|
||||
|
||||
def get_task_details(self, task_sub):
|
||||
tsk = sql("select name, project, customer, customer_name from `tabTicket` where subject = %s", task_sub)
|
||||
if tsk:
|
||||
ret = {'task_id': tsk and tsk[0][0] or '', 'project_name': tsk and tsk[0][1] or '', 'customer_name': tsk and tsk[0][3] or ''}
|
||||
return cstr(ret)
|
||||
|
||||
def validate(self):
|
||||
if getdate(self.doc.timesheet_date) > getdate(nowdate()):
|
||||
msgprint("You can not prepare timesheet for future date")
|
||||
raise Exception
|
||||
|
||||
chk = sql("select name from `tabTimesheet` where timesheet_date=%s and owner=%s and status!='Cancelled' and name!=%s", (self.doc.timesheet_date, self.doc.owner, self.doc.name))
|
||||
if chk:
|
||||
msgprint("You have already created timesheet "+ cstr(chk and chk[0][0] or '')+" for this date.")
|
||||
raise Exception
|
||||
|
||||
import time
|
||||
for d in getlist(self.doclist, 'timesheet_details'):
|
||||
if d.act_start_time and d.act_end_time:
|
||||
d1 = time.strptime(d.act_start_time, "%H:%M")
|
||||
d2 = time.strptime(d.act_end_time, "%H:%M")
|
||||
|
||||
if d1 > d2:
|
||||
msgprint("Start time can not be greater than end time. Check for Task Id : "+cstr(d.task_id))
|
||||
raise Exception
|
||||
elif d1 == d2:
|
||||
msgprint("Start time and end time can not be same. Check for Task Id : "+cstr(d.task_id))
|
||||
raise Exception
|
||||
|
||||
def calculate_total_hr(self):
|
||||
import datetime
|
||||
import time
|
||||
for d in getlist(self.doclist, 'timesheet_details'):
|
||||
x1 = d.act_start_time.split(":")
|
||||
x2 = d.act_end_time.split(":")
|
||||
|
||||
d1 = datetime.timedelta(minutes=cint(x1[1]), hours=cint(x1[0]))
|
||||
d2 = datetime.timedelta(minutes=cint(x2[1]), hours=cint(x2[0]))
|
||||
d3 = (d2 - d1).seconds
|
||||
d.act_total_hrs = time.strftime("%H:%M", time.gmtime(d3))
|
||||
sql("update `tabTimesheet Detail` set act_total_hrs = %s where parent=%s and name=%s", (d.act_total_hrs,self.doc.name,d.name))
|
||||
|
||||
def on_update(self):
|
||||
self.calculate_total_hr()
|
||||
set(self.doc, 'status', 'Draft')
|
||||
|
||||
def on_submit(self):
|
||||
set(self.doc, 'status', 'Submitted')
|
||||
|
||||
def on_cancel(self):
|
||||
set(self.doc, 'status', 'Cancelled')
|
||||
510
projects/doctype/timesheet/timesheet.txt
Normal file
510
projects/doctype/timesheet/timesheet.txt
Normal file
@@ -0,0 +1,510 @@
|
||||
[
|
||||
{
|
||||
'_last_update': '1300962490',
|
||||
'allow_attach': None,
|
||||
'allow_copy': None,
|
||||
'allow_email': None,
|
||||
'allow_print': None,
|
||||
'allow_rename': None,
|
||||
'allow_trash': None,
|
||||
'autoname': 'TimeSheet.#####',
|
||||
'change_log': None,
|
||||
'client_script': None,
|
||||
'client_script_core': None,
|
||||
'client_string': None,
|
||||
'colour': 'White:FFF',
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocType',
|
||||
'document_type': None,
|
||||
'dt_template': None,
|
||||
'hide_heading': None,
|
||||
'hide_toolbar': None,
|
||||
'idx': None,
|
||||
'in_create': None,
|
||||
'in_dialog': None,
|
||||
'is_transaction_doc': None,
|
||||
'issingle': None,
|
||||
'istable': None,
|
||||
'max_attachments': None,
|
||||
'menu_index': None,
|
||||
'modified': '2011-03-05 17:16:43',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Projects',
|
||||
'name': 'Timesheet',
|
||||
'name_case': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': None,
|
||||
'parent_node': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'print_outline': None,
|
||||
'read_only': None,
|
||||
'read_only_onload': None,
|
||||
'search_fields': 'status, owner, timesheet_date',
|
||||
'section_style': 'Simple',
|
||||
'server_code': None,
|
||||
'server_code_compiled': None,
|
||||
'server_code_core': None,
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': None,
|
||||
'smallicon': None,
|
||||
'subject': '%(owner)s',
|
||||
'tag_fields': '',
|
||||
'use_template': None,
|
||||
'version': 68
|
||||
},
|
||||
{
|
||||
'amend': 1,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'creation': '2010-12-23 11:48:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': None,
|
||||
'idx': None,
|
||||
'match': None,
|
||||
'modified': '2010-12-23 11:48:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'PERM00769',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'read': 1,
|
||||
'role': 'Projects User',
|
||||
'submit': 1,
|
||||
'write': 1
|
||||
},
|
||||
{
|
||||
'amend': None,
|
||||
'cancel': None,
|
||||
'create': None,
|
||||
'creation': '2010-12-23 11:48:49',
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': None,
|
||||
'idx': None,
|
||||
'match': None,
|
||||
'modified': '2010-12-23 11:48:49',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'PERM00770',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 1,
|
||||
'read': 1,
|
||||
'role': 'Projects User',
|
||||
'submit': None,
|
||||
'write': None
|
||||
},
|
||||
{
|
||||
'amend': 1,
|
||||
'cancel': 1,
|
||||
'create': 1,
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': None,
|
||||
'idx': 1,
|
||||
'match': None,
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'PERM00739',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'read': 1,
|
||||
'role': 'Administrator',
|
||||
'submit': 1,
|
||||
'write': 1
|
||||
},
|
||||
{
|
||||
'amend': None,
|
||||
'cancel': None,
|
||||
'create': None,
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocPerm',
|
||||
'execute': None,
|
||||
'idx': 2,
|
||||
'match': None,
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'PERM00740',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'permissions',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 1,
|
||||
'read': 1,
|
||||
'role': 'Administrator',
|
||||
'submit': None,
|
||||
'write': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-03-05 17:16:42',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': None,
|
||||
'fieldtype': 'Section Break',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 1,
|
||||
'in_filter': None,
|
||||
'label': 'Timesheet Details',
|
||||
'modified': '2011-03-05 17:16:42',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04673',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': 'White:FFF',
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'default': 'Draft',
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'status',
|
||||
'fieldtype': 'Select',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 2,
|
||||
'in_filter': 0,
|
||||
'label': 'Status',
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04235',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'status',
|
||||
'oldfieldtype': 'Select',
|
||||
'options': '\nDraft\nSubmitted\nCancelled',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 1,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 1,
|
||||
'search_index': 1,
|
||||
'trigger': '',
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': 'White:FFF',
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'default': 'Today',
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'timesheet_date',
|
||||
'fieldtype': 'Date',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 3,
|
||||
'in_filter': 1,
|
||||
'label': 'Timesheet Date',
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04236',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'timesheet_date',
|
||||
'oldfieldtype': 'Date',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 1,
|
||||
'search_index': 1,
|
||||
'trigger': '',
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'owner',
|
||||
'fieldtype': 'Link',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 4,
|
||||
'in_filter': 1,
|
||||
'label': 'Timesheet By',
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04237',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'owner',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Profile',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 1,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'amended_from',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': 1,
|
||||
'icon': None,
|
||||
'idx': 5,
|
||||
'in_filter': None,
|
||||
'label': 'Amended From',
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04238',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'amended_from',
|
||||
'oldfieldtype': 'Data',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'amendment_date',
|
||||
'fieldtype': 'Date',
|
||||
'hidden': 1,
|
||||
'icon': None,
|
||||
'idx': 6,
|
||||
'in_filter': None,
|
||||
'label': 'Amendment Date',
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04239',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'amendment_date',
|
||||
'oldfieldtype': 'Date',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 1,
|
||||
'print_hide': 1,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-03-05 17:16:42',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': None,
|
||||
'fieldtype': 'Column Break',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 7,
|
||||
'in_filter': None,
|
||||
'label': None,
|
||||
'modified': '2011-03-05 17:16:42',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04674',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-03-05 17:16:42',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'notes',
|
||||
'fieldtype': 'Text',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 8,
|
||||
'in_filter': None,
|
||||
'label': 'Notes',
|
||||
'modified': '2011-03-05 17:16:42',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04672',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-03-05 17:16:42',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': None,
|
||||
'fieldtype': 'Section Break',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 9,
|
||||
'in_filter': None,
|
||||
'label': None,
|
||||
'modified': '2011-03-05 17:16:42',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04675',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': 'Simple',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2010-12-14 10:33:07',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'timesheet_details',
|
||||
'fieldtype': 'Table',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 10,
|
||||
'in_filter': None,
|
||||
'label': 'Timesheet Details',
|
||||
'modified': '2010-12-14 10:33:07',
|
||||
'modified_by': 'Administrator',
|
||||
'name': 'FL04240',
|
||||
'no_column': None,
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'timesheet_details',
|
||||
'oldfieldtype': 'Table',
|
||||
'options': 'Timesheet Detail',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': None
|
||||
}
|
||||
]
|
||||
0
projects/doctype/timesheet_detail/__init__.py
Normal file
0
projects/doctype/timesheet_detail/__init__.py
Normal file
370
projects/doctype/timesheet_detail/timesheet_detail.txt
Normal file
370
projects/doctype/timesheet_detail/timesheet_detail.txt
Normal file
@@ -0,0 +1,370 @@
|
||||
[
|
||||
{
|
||||
'allow_attach': None,
|
||||
'allow_copy': None,
|
||||
'allow_email': None,
|
||||
'allow_print': None,
|
||||
'allow_rename': None,
|
||||
'allow_trash': None,
|
||||
'autoname': 'TSD.#####',
|
||||
'change_log': None,
|
||||
'client_script': None,
|
||||
'client_script_core': None,
|
||||
'client_string': None,
|
||||
'colour': 'White:FFF',
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocType',
|
||||
'document_type': None,
|
||||
'dt_template': None,
|
||||
'hide_heading': None,
|
||||
'hide_toolbar': None,
|
||||
'idx': None,
|
||||
'in_create': None,
|
||||
'in_dialog': None,
|
||||
'is_transaction_doc': None,
|
||||
'issingle': None,
|
||||
'istable': None,
|
||||
'max_attachments': None,
|
||||
'menu_index': None,
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'module': 'Projects',
|
||||
'name': 'Timesheet Detail',
|
||||
'name_case': None,
|
||||
'owner': 'Administrator',
|
||||
'parent': None,
|
||||
'parent_node': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'print_outline': None,
|
||||
'read_only': None,
|
||||
'read_only_onload': None,
|
||||
'search_fields': None,
|
||||
'section_style': 'Simple',
|
||||
'server_code': None,
|
||||
'server_code_compiled': None,
|
||||
'server_code_core': None,
|
||||
'server_code_error': ' ',
|
||||
'show_in_menu': None,
|
||||
'smallicon': None,
|
||||
'use_template': None,
|
||||
'version': 15
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'act_start_time',
|
||||
'fieldtype': 'Time',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 1,
|
||||
'in_filter': None,
|
||||
'label': 'Actual Start Time',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04246',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'act_start_time',
|
||||
'oldfieldtype': 'Time',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 1,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': '160px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'act_end_time',
|
||||
'fieldtype': 'Time',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 2,
|
||||
'in_filter': None,
|
||||
'label': 'Actual End Time',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04247',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'act_end_time',
|
||||
'oldfieldtype': 'Time',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 1,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': '160px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'activity_type',
|
||||
'fieldtype': 'Link',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 3,
|
||||
'in_filter': None,
|
||||
'label': 'Activity Type',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04248',
|
||||
'no_copy': None,
|
||||
'oldfieldname': None,
|
||||
'oldfieldtype': None,
|
||||
'options': 'Activity Type',
|
||||
'owner': 'Administrator',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 1,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': '200px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'other_details',
|
||||
'fieldtype': 'Text',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 4,
|
||||
'in_filter': None,
|
||||
'label': 'Additional Info',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04249',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'other_details',
|
||||
'oldfieldtype': 'Text',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': '200px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'act_total_hrs',
|
||||
'fieldtype': 'Data',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 5,
|
||||
'in_filter': None,
|
||||
'label': 'Total Hours (Actual)',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04250',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'act_total_hrs',
|
||||
'oldfieldtype': 'Data',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 1,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': '100px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'customer_name',
|
||||
'fieldtype': 'Link',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 6,
|
||||
'in_filter': None,
|
||||
'label': 'Customer Name',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04251',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'customer_name',
|
||||
'oldfieldtype': 'Data',
|
||||
'options': 'Customer',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': None,
|
||||
'trigger': None,
|
||||
'width': '150px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'project_name',
|
||||
'fieldtype': 'Link',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 7,
|
||||
'in_filter': 1,
|
||||
'label': 'Project',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04252',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'project_name',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Project',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 0,
|
||||
'search_index': 1,
|
||||
'trigger': None,
|
||||
'width': '150px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'task_id',
|
||||
'fieldtype': 'Link',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 8,
|
||||
'in_filter': 1,
|
||||
'label': 'Task Id',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04253',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'task_id',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': 'Ticket',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': None,
|
||||
'search_index': 1,
|
||||
'trigger': None,
|
||||
'width': '150px'
|
||||
},
|
||||
{
|
||||
'allow_on_submit': None,
|
||||
'colour': None,
|
||||
'creation': '2011-02-26 11:39:45',
|
||||
'default': None,
|
||||
'depends_on': None,
|
||||
'description': None,
|
||||
'docstatus': 0,
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'task_name',
|
||||
'fieldtype': 'Link',
|
||||
'hidden': None,
|
||||
'icon': None,
|
||||
'idx': 9,
|
||||
'in_filter': None,
|
||||
'label': 'Task Name',
|
||||
'modified': '2011-02-26 11:39:45',
|
||||
'modified_by': 'Guest',
|
||||
'name': 'FL04254',
|
||||
'no_copy': None,
|
||||
'oldfieldname': 'task_name',
|
||||
'oldfieldtype': 'Link',
|
||||
'options': None,
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'parent': 'Timesheet Detail',
|
||||
'parentfield': 'fields',
|
||||
'parenttype': 'DocType',
|
||||
'permlevel': 0,
|
||||
'print_hide': None,
|
||||
'report_hide': None,
|
||||
'reqd': 0,
|
||||
'search_index': 0,
|
||||
'trigger': None,
|
||||
'width': '250px'
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user