mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
restructured erpnext and deleted unwanted
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
this.mytabs.items['Select Columns'].hide();
|
||||
this.mytabs.items['More Filters'].hide();
|
||||
this.add_filter({fieldname:'based_on', label:'Based On', fieldtype:'Select', options:'Territory'+NEWLINE+'Item Group',ignore:1,parent:'Serial No',in_first_page:1, report_default:'Item Group'});
|
||||
}
|
||||
|
||||
report.aftertableprint = function(t) {
|
||||
$yt(t,'*',1,{whiteSpace:'pre'});
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
opt = filter_values.get('based_on')
|
||||
opt_dict = {'Territory':'territory', 'Item Group':'item_group'}
|
||||
|
||||
# ADD NEW COLUMNS
|
||||
row_list = [[opt,'Data','150px',''],
|
||||
['Out of AMC','Int','150px',''],
|
||||
['Under AMC','Int','150px',''],
|
||||
['Out of Warranty','Int','150px',''],
|
||||
['Under Warranty','Int','150px',''],
|
||||
['Total','Int','150px','']]
|
||||
|
||||
for r in row_list:
|
||||
colnames.append(r[0])
|
||||
coltypes.append(r[1])
|
||||
colwidths.append(r[2])
|
||||
coloptions.append(r[3])
|
||||
col_idx[r[0]] = len(colnames)-1
|
||||
|
||||
|
||||
#ADD VALUES TO THE COLUMN
|
||||
out=[]
|
||||
oa,ua,ow,uw,sum=0,0,0,0,0
|
||||
nowdate = nowdate()
|
||||
for r in res:
|
||||
lft_rgt = sql("select lft, rgt from `tab%s` where name = '%s'" % (opt,r[col_idx[opt]].strip()))
|
||||
|
||||
|
||||
det = sql("select COUNT(CASE WHEN t1.amc_expiry_date < '%s' THEN t1.name ELSE NULL END), COUNT(CASE WHEN t1.amc_expiry_date >= '%s' THEN t1.name ELSE NULL END), COUNT(CASE WHEN t1.warranty_expiry_date < '%s' THEN t1.name ELSE NULL END), COUNT(CASE WHEN t1.warranty_expiry_date >= '%s' THEN t1.name ELSE NULL END) from `tabSerial No` t1, `tab%s` t2 where t1.%s = t2.name and t2.lft>= '%s' and t2. rgt <= '%s' and t1.status not in ('In Store', 'Scrapped','Not in Use') and ifnull(item_group,'')!='' and ifnull(territory,'')!=''" %(nowdate,nowdate,nowdate,nowdate,opt, opt_dict[opt], lft_rgt[0][0], lft_rgt[0][1]))
|
||||
|
||||
r.append(cint(det[0][0]))
|
||||
r.append(cint(det[0][1]))
|
||||
r.append(cint(det[0][2]))
|
||||
r.append(cint(det[0][3]))
|
||||
tot = cint(det[0][0]) + cint(det[0][1]) + cint(det[0][2]) + cint(det[0][3])
|
||||
r.append(tot)
|
||||
out.append(r)
|
||||
@@ -0,0 +1 @@
|
||||
SELECT CONCAT(REPEAT(' ', COUNT(parent.name) - 1), node.name) AS name FROM `tab%(based_on)s` AS node,`tab%(based_on)s` AS parent WHERE node.lft BETWEEN parent.lft AND parent.rgt AND node.docstatus !=2 GROUP BY node.name ORDER BY node.lft
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': '',
|
||||
'creation': '2010-12-14 17:56:43',
|
||||
'criteria_name': 'Warranty/AMC Summary',
|
||||
'custom_query': None,
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Serial No',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Serial No\x01Saved':1,'Serial No\x01Status':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-09-25 12:14:49',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Maintenance',
|
||||
'name': 'warranty-amc_summary',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': 'name',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user