mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-28 22:28:24 +00:00
rename dt first cut
This commit is contained in:
@@ -68,10 +68,10 @@ class DocType:
|
||||
n_tasks = {}
|
||||
|
||||
for p in pl:
|
||||
t1 = sql('select count(*) from tabTicket where project=%s and docstatus!=2', p)[0][0]
|
||||
t1 = sql('select count(*) from tabTask 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]
|
||||
t2 = sql('select count(*) from tabTask 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}
|
||||
@@ -80,15 +80,15 @@ class DocType:
|
||||
ret = {}
|
||||
|
||||
# resource list
|
||||
rl = sql("select distinct allocated_to, assignee_email from tabTicket")
|
||||
rl = sql("select distinct allocated_to, assignee_email from tabTask")
|
||||
|
||||
# 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]]['Total'] = sql("select count(*) from tabTask where allocated_to=%s and docstatus!=2", r[0])[0][0]
|
||||
ret[r[1]]['Closed'] = sql("select count(*) from tabTask 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
|
||||
@@ -98,7 +98,7 @@ class DocType:
|
||||
|
||||
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,"") != ""')]
|
||||
rl = [p[0] for p in sql('select distinct allocated_to from tabTask where docstatus != 2 and ifnull(allocated_to,"") != ""')]
|
||||
return {'pl':pl, 'rl':rl}
|
||||
|
||||
def get_tasks(self, arg):
|
||||
@@ -113,7 +113,7 @@ class DocType:
|
||||
|
||||
tl = sql("""
|
||||
select subject, allocated_to, project, exp_start_date, exp_end_date, priority, status, name
|
||||
from tabTicket
|
||||
from tabTask
|
||||
where
|
||||
((exp_start_date between '%(st)s' and '%(end)s') or
|
||||
(exp_end_date between '%(st)s' and '%(end)s') or
|
||||
@@ -122,7 +122,7 @@ class DocType:
|
||||
return convert_to_lists(tl)
|
||||
|
||||
def declare_proj_completed(self, arg):
|
||||
chk = sql("select name from `tabTicket` where project=%s and status='Open'", arg)
|
||||
chk = sql("select name from `tabTask` 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.")
|
||||
@@ -136,7 +136,7 @@ def sent_reminder_task():
|
||||
task_list = sql("""
|
||||
select subject, allocated_to, project, exp_start_date, exp_end_date,
|
||||
priority, status, name, senders_name, opening_date, review_date, description
|
||||
from tabTicket
|
||||
from tabTask
|
||||
where task_email_notify=1
|
||||
and sent_reminder=0
|
||||
and status='Open'
|
||||
@@ -157,5 +157,5 @@ def sent_reminder_task():
|
||||
<p>(This notification is autogenerated)</p>""" % i
|
||||
sendmail(i['allocated_to'], sender='automail@webnotestech.com', msg=msg2,send_now=1, \
|
||||
subject='A task has been assigned')
|
||||
sql("update `tabTicket` set sent_reminder='1' where name='%(name)s' and allocated_to= '%(allocated_to)s'" % i)
|
||||
sql("update `tabTask` set sent_reminder='1' where name='%(name)s' and allocated_to= '%(allocated_to)s'" % i)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# DocType, Ticket
|
||||
# DocType, Task
|
||||
[
|
||||
|
||||
# These values are common in all dictionaries
|
||||
@@ -33,7 +33,7 @@
|
||||
{
|
||||
'doctype': u'DocField',
|
||||
'name': '__common__',
|
||||
'parent': u'Ticket',
|
||||
'parent': u'Task',
|
||||
'parentfield': u'fields',
|
||||
'parenttype': u'DocType'
|
||||
},
|
||||
@@ -42,16 +42,16 @@
|
||||
{
|
||||
'doctype': u'DocPerm',
|
||||
'name': '__common__',
|
||||
'parent': u'Ticket',
|
||||
'parent': u'Task',
|
||||
'parentfield': u'permissions',
|
||||
'parenttype': u'DocType',
|
||||
'read': 1
|
||||
},
|
||||
|
||||
# DocType, Ticket
|
||||
# DocType, Task
|
||||
{
|
||||
'doctype': 'DocType',
|
||||
'name': u'Ticket'
|
||||
'name': u'Task'
|
||||
},
|
||||
|
||||
# DocPerm
|
||||
@@ -346,7 +346,7 @@
|
||||
'label': u'Category',
|
||||
'oldfieldname': u'category',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Ticket Category',
|
||||
'options': u'Task Category',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
@@ -28,9 +28,9 @@ cur_frm.fields_dict['timesheet_details'].grid.get_field("project_name").get_quer
|
||||
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';
|
||||
if(d.task_id) cond1 = 'ifnull(`tabTask`.project, "") = `tabProject`.name AND `tabTask`.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});
|
||||
return repl('SELECT distinct `tabProject`.`name` FROM `tabProject`, `tabTask` 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){
|
||||
@@ -41,7 +41,7 @@ cur_frm.cscript.task_name = function(doc, cdt, cdn){
|
||||
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';
|
||||
if(d.project_name) cond = 'ifnull(`tabTask`.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});
|
||||
return repl('SELECT distinct `tabTask`.`subject` FROM `tabTask` WHERE %(cond)s `tabTask`.`subject` LIKE "%s" ORDER BY `tabTask`.`subject` ASC LIMIT 50', {cond:cond});
|
||||
}
|
||||
@@ -45,7 +45,7 @@ class DocType:
|
||||
return (ret)
|
||||
|
||||
def get_task_details(self, task_sub):
|
||||
tsk = sql("select name, project, customer, customer_name from `tabTicket` where subject = %s", task_sub)
|
||||
tsk = sql("select name, project, customer, customer_name from `tabTask` 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 ret
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
'label': u'Task Id',
|
||||
'oldfieldname': u'task_id',
|
||||
'oldfieldtype': u'Link',
|
||||
'options': u'Ticket',
|
||||
'options': u'Task',
|
||||
'permlevel': 0,
|
||||
'search_index': 1,
|
||||
'width': u'150px'
|
||||
|
||||
@@ -217,7 +217,7 @@ GanttTask = function(grid, data, idx) {
|
||||
|
||||
// label
|
||||
this.label = $a(grid.y_labels, 'div', '', {'top':(idx*40) + 'px', overflow:'hidden', position:'absolute', 'width':'100%', height: '40px'});
|
||||
var l1 = $a($a(this.label, 'div'), 'span', 'link_type'); l1.innerHTML = data[0]; l1.dn = data[7]; l1.onclick = function() { loaddoc('Ticket', this.dn) };
|
||||
var l1 = $a($a(this.label, 'div'), 'span', 'link_type'); l1.innerHTML = data[0]; l1.dn = data[7]; l1.onclick = function() { loaddoc('Task', this.dn) };
|
||||
var l2 = $a(this.label, 'div', '', {fontSize:'10px'}); l2.innerHTML = data[1];
|
||||
|
||||
// bar
|
||||
|
||||
@@ -12,9 +12,9 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'columns': 'Delivery Note\x01ID,Delivery Note\x01Project Name,Delivery Note\x01Customer,Delivery Note\x01Customer Name,Delivery Note\x01Posting Date,Delivery Note Detail\x01Item Code,Delivery Note Detail\x01Item Name,Delivery Note Detail\x01Quantity,Delivery Note Detail\x01Amount*',
|
||||
'columns': 'Delivery Note\x01ID,Delivery Note\x01Project Name,Delivery Note\x01Customer,Delivery Note\x01Customer Name,Delivery Note\x01Posting Date,Delivery Note Item\x01Item Code,Delivery Note Item\x01Item Name,Delivery Note Item\x01Quantity,Delivery Note Item\x01Amount*',
|
||||
'criteria_name': 'Dispatch Report',
|
||||
'doc_type': 'Delivery Note Detail',
|
||||
'doc_type': 'Delivery Note Item',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Delivery Note\x01Saved':1,'Delivery Note\x01Submitted':1,'Delivery Note\x01Status':'Submitted','Delivery Note\x01Fiscal Year':''}",
|
||||
'module': 'Projects',
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
//this.add_filter({fieldname:'item_code', label:'Item Code', fieldtype:'Link', options:'Item',ignore : 1,parent:'Delivery Note Detail'});
|
||||
//this.add_filter({fieldname:'item_code', label:'Item Code', fieldtype:'Link', options:'Item',ignore : 1,parent:'Delivery Note Item'});
|
||||
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Project Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Delivery Note'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'add_cond': 'IFNULL(`tabDelivery Note`.`project_name`,"")!=""',
|
||||
'columns': 'Delivery Note\x01ID,Delivery Note\x01Project Name,Delivery Note\x01Customer,Delivery Note\x01Customer Name,Delivery Note Detail\x01Item Code,Delivery Note Detail\x01Item Name,Delivery Note Detail\x01Quantity,Delivery Note\x01Posting Date,Delivery Note\x01% Billed,Delivery Note Detail\x01Amount*',
|
||||
'columns': 'Delivery Note\x01ID,Delivery Note\x01Project Name,Delivery Note\x01Customer,Delivery Note\x01Customer Name,Delivery Note Item\x01Item Code,Delivery Note Item\x01Item Name,Delivery Note Item\x01Quantity,Delivery Note\x01Posting Date,Delivery Note\x01% Billed,Delivery Note Item\x01Amount*',
|
||||
'criteria_name': 'Projectwise Delivered Qty and Costs',
|
||||
'doc_type': 'Delivery Note Detail',
|
||||
'doc_type': 'Delivery Note Item',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Delivery Note\x01Submitted':1,'Delivery Note\x01Status':'Submitted','Delivery Note\x01Fiscal Year':''}",
|
||||
'module': 'Projects',
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
|
||||
//this.add_filter({fieldname:'item_code', label:'Item Code', fieldtype:'Link', options:'Item',ignore : 1,parent:'Sales Order Detail'});
|
||||
//this.add_filter({fieldname:'item_code', label:'Item Code', fieldtype:'Link', options:'Item',ignore : 1,parent:'Sales Order Item'});
|
||||
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Project Name'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df.filter_hide = 0;
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'add_col': "SUM(`tabSales Order Detail`.`qty` - `tabSales Order Detail`.`delivered_qty`) AS 'Pending Qty'\nSUM((`tabSales Order Detail`.`qty` - `tabSales Order Detail`.`delivered_qty`)* `tabSales Order Detail`.basic_rate) AS 'Pending Amount'",
|
||||
'add_cond': '`tabSales Order Detail`.`qty` > `tabSales Order Detail`.`delivered_qty`\nIFNULL(`tabSales Order`.`project_name`,"")!=""\n`tabSales Order`.order_type = \'Sales\'',
|
||||
'columns': 'Sales Order\x01ID,Sales Order\x01Project Name,Sales Order\x01Customer,Sales Order\x01Customer Name,Sales Order Detail\x01Item Code,Sales Order Detail\x01Item Name,Sales Order\x01% Delivered,Sales Order\x01% Billed,Sales Order\x01Sales Order Date,Sales Order\x01Expected Delivery Date',
|
||||
'add_col': "SUM(`tabSales Order Item`.`qty` - `tabSales Order Item`.`delivered_qty`) AS 'Pending Qty'\nSUM((`tabSales Order Item`.`qty` - `tabSales Order Item`.`delivered_qty`)* `tabSales Order Item`.basic_rate) AS 'Pending Amount'",
|
||||
'add_cond': '`tabSales Order Item`.`qty` > `tabSales Order Item`.`delivered_qty`\nIFNULL(`tabSales Order`.`project_name`,"")!=""\n`tabSales Order`.order_type = \'Sales\'',
|
||||
'columns': 'Sales Order\x01ID,Sales Order\x01Project Name,Sales Order\x01Customer,Sales Order\x01Customer Name,Sales Order Item\x01Item Code,Sales Order Item\x01Item Name,Sales Order\x01% Delivered,Sales Order\x01% Billed,Sales Order\x01Sales Order Date,Sales Order\x01Expected Delivery Date',
|
||||
'criteria_name': 'Projectwise Pending Qty and Costs',
|
||||
'doc_type': 'Sales Order Detail',
|
||||
'doc_type': 'Sales Order Item',
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Sales Order\x01Submitted':1,'Sales Order\x01Status':'Submitted','Sales Order\x01Fiscal Year':''}",
|
||||
'module': 'Projects',
|
||||
|
||||
@@ -88,7 +88,7 @@ report.get_query = function() {
|
||||
if(fy !='') cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name, t1.status, t1.project_name, t1.supplier, t1.supplier_name,t1.grand_total FROM `tabPurchase Receipt` t1, `tabPurchase Receipt Detail` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
var q = 'SELECT DISTINCT t1.name, t1.status, t1.project_name, t1.supplier, t1.supplier_name,t1.grand_total FROM `tabPurchase Receipt` t1, `tabPurchase Receipt Item` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
|
||||
return q;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ report.get_query = function() {
|
||||
if(company) cond += ' t1.company = "'+company+'" AND ';
|
||||
if(fy !='') cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name , t1.credit_to , t1.project_name, t1.supplier, t1.supplier_name , t1.grand_total FROM `tabPayable Voucher` t1, `tabPV Detail` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
var q = 'SELECT DISTINCT t1.name , t1.credit_to , t1.project_name, t1.supplier, t1.supplier_name , t1.grand_total FROM `tabPurchase Invoice` t1, `tabPurchase Invoice Item` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ if based_on == 'Purchase Order':
|
||||
col = [['Purchase Order ID','Link','Purchase Order'],['Status','Data',''],['Project Name','Link','Project'],['Supplier','Link','Supplier'],['Supplier Name','Data',''],['% Received','Data',''],['% Billed','Data',''],['Grand Total','Currency','']]
|
||||
|
||||
elif based_on == 'Purchase Invoice':
|
||||
col = [['Purchase Receipt ID','Link','Payable Voucher'],['Status','Data',''],['Project Name','Link','Project'],['Supplier','Link','Supplier'],['Supplier Name','Data',''],['Grand Total','Currency','']]
|
||||
col = [['Purchase Receipt ID','Link','Purchase Invoice'],['Status','Data',''],['Project Name','Link','Project'],['Supplier','Link','Supplier'],['Supplier Name','Data',''],['Grand Total','Currency','']]
|
||||
|
||||
elif based_on == 'Purchase Receipt':
|
||||
col = [['Purchase Invoice ID','Link','Purchase Receipt'],['Credit To','Data',''],['Project Name','Link','Project'],['Supplier','Link','Supplier'],['Supplier Name','Data',''],['Grand Total','Currency','']]
|
||||
|
||||
@@ -89,7 +89,7 @@ report.get_query = function() {
|
||||
if(company) cond += ' t1.company = "'+company+'" AND ';
|
||||
if(fy) cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name, t1.status, t1.project_name, t1.customer, t1.customer_name, t1.per_billed, t1.per_installed, t1.grand_total FROM `tabDelivery Note` t1, `tabDelivery Note Detail` t2 WHERE '+cond+' IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2';
|
||||
var q = 'SELECT DISTINCT t1.name, t1.status, t1.project_name, t1.customer, t1.customer_name, t1.per_billed, t1.per_installed, t1.grand_total FROM `tabDelivery Note` t1, `tabDelivery Note Item` t2 WHERE '+cond+' IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2';
|
||||
|
||||
return q;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ report.get_query = function() {
|
||||
if(fy) cond += ' t1.fiscal_year = "'+fy+'" AND ';
|
||||
|
||||
|
||||
var q = 'SELECT DISTINCT t1.name , t1.debit_to , t1.project_name , t1.customer , t1.customer_name , t1.grand_total FROM `tabReceivable Voucher` t1, `tabRV Detail` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
var q = 'SELECT DISTINCT t1.name , t1.debit_to , t1.project_name , t1.customer , t1.customer_name , t1.grand_total FROM `tabSales Invoice` t1, `tabSales Invoice Item` t2 WHERE '+cond +'IFNULL(t1.project_name,"") !="" AND t1.docstatus != 2 AND t1.name = t2.parent';
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ elif based_on == 'Delivery Note':
|
||||
cols = [['Delivery Note No','Link','150px','Delivery Note'], ['Status','Data','100px',''], ['Project Name','Link','200px','Project'], ['Customer','Link','150px','Customer'], ['Customer Name','Data','200px',''], ['% Installed','Currency','100px',''], ['% Billed','Currency','100px',''], ['Grand Total','Currency','150px','']]
|
||||
|
||||
elif based_on == 'Sales Invoice':
|
||||
cols = [['Sales Invoice No','Link','150px','Receivable Voucher'], ['Debit To','Data','150px',''], ['Project Name','Link','200px','Project'], ['Customer','Link','150px','Customer'], ['Customer Name','Data','200px',''], ['Grand Total','Currency','150px','']]
|
||||
cols = [['Sales Invoice No','Link','150px','Sales Invoice'], ['Debit To','Data','150px',''], ['Project Name','Link','200px','Project'], ['Customer','Link','150px','Customer'], ['Customer Name','Data','200px',''], ['Grand Total','Currency','150px','']]
|
||||
|
||||
|
||||
for c in cols:
|
||||
|
||||
Reference in New Issue
Block a user