mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
restructured erpnext and deleted unwanted
This commit is contained in:
0
support/search_criteria/__init__.py
Normal file
0
support/search_criteria/__init__.py
Normal file
0
support/search_criteria/amc_summary/__init__.py
Normal file
0
support/search_criteria/amc_summary/__init__.py
Normal file
9
support/search_criteria/amc_summary/amc_summary.js
Normal file
9
support/search_criteria/amc_summary/amc_summary.js
Normal file
@@ -0,0 +1,9 @@
|
||||
report.customize_filters = function() {
|
||||
this.hide_all_filters();
|
||||
this.mytabs.items['Select Columns'].hide();
|
||||
this.mytabs.items['More Filters'].hide()
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Territory'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Item Group'].df.filter_hide = 0;
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Territory'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Item Group'].df.in_first_page = 1;
|
||||
}
|
||||
70
support/search_criteria/amc_summary/amc_summary.py
Normal file
70
support/search_criteria/amc_summary/amc_summary.py
Normal file
@@ -0,0 +1,70 @@
|
||||
# ADD NEW COLUMNS
|
||||
row_list = [['Item Group','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:
|
||||
cc = r[col_idx['Territory']]
|
||||
item_groups = sql("select distinct item_group from `tabSerial No` where territory = '%s' and item_group like '%%%s'" %(cc,filter_values.get('item_group')))
|
||||
|
||||
for col in range(len(colnames)-1): # this would make all first row blank. just for look
|
||||
r.append('')
|
||||
out.append(r)
|
||||
|
||||
# Add Totals for each Territory
|
||||
# -----------------------------
|
||||
det = sql("select COUNT(CASE WHEN amc_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN amc_expiry_date <= '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date <= '%s' THEN name ELSE NULL END) from `tabSerial No` where territory = '%s' and item_group like '%%%s'" %(nowdate,nowdate,nowdate,nowdate,cc,filter_values.get('item_group')))
|
||||
r[col_idx['Item Group']] = ''
|
||||
|
||||
r[col_idx['Out of AMC']] = cstr(det[0][0])
|
||||
r[col_idx['Under AMC']] = cstr(det[0][1])
|
||||
r[col_idx['Out of Warranty']] = cstr(det[0][2])
|
||||
r[col_idx['Under Warranty']] = cstr(det[0][3])
|
||||
tot = cint(det[0][0]) + cint(det[0][1]) + cint(det[0][2]) + cint(det[0][3])
|
||||
r[col_idx['Total']] = cstr(tot)
|
||||
|
||||
|
||||
oa += cint(det[0][0])
|
||||
ua += cint(det[0][1])
|
||||
ow += cint(det[0][2])
|
||||
uw += cint(det[0][3])
|
||||
sum += tot
|
||||
|
||||
|
||||
# Add Brand Details belonging to Territory
|
||||
# ----------------------------------------
|
||||
for br in item_groups:
|
||||
br_det = sql("select COUNT(CASE WHEN amc_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN amc_expiry_date <= '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date > '%s' THEN name ELSE NULL END), COUNT(CASE WHEN warranty_expiry_date <= '%s' THEN name ELSE NULL END) from `tabSerial No` where territory = '%s' and item_group = '%s'"%(nowdate,nowdate,nowdate,nowdate,cc,br[0]))
|
||||
t_row = ['' for i in range(len(colnames))]
|
||||
t_row[col_idx['Item Group']] = br[0]
|
||||
|
||||
t_row[col_idx['Out of AMC']] = cint(br_det[0][0])
|
||||
t_row[col_idx['Under AMC']] = cint(br_det[0][1])
|
||||
t_row[col_idx['Out of Warranty']] = cint(br_det[0][2])
|
||||
t_row[col_idx['Under Warranty']] = cint(br_det[0][3])
|
||||
tot = cint(br_det[0][0]) + cint(br_det[0][1]) + cint(br_det[0][2])+ cint(br_det[0][3])
|
||||
t_row[col_idx['Total']] = tot
|
||||
out.append(t_row)
|
||||
|
||||
|
||||
#ADD NEW ROW
|
||||
# ----------
|
||||
newrow=['','TOTAL',oa,ua,ow,uw,sum]
|
||||
out.append(newrow)
|
||||
res=out
|
||||
37
support/search_criteria/amc_summary/amc_summary.txt
Normal file
37
support/search_criteria/amc_summary/amc_summary.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': "`tabSerial No`.`territory` is not null\n`tabSerial No`.`territory` != ''\n`tabSerial No`.`status` not in ('In Store', 'Scrapped')",
|
||||
'add_tab': None,
|
||||
'columns': 'Serial No\x01Territory',
|
||||
'creation': '2010-08-08 17:09:32',
|
||||
'criteria_name': 'AMC Summary',
|
||||
'custom_query': '',
|
||||
'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': '`tabSerial No`.`cost_center`',
|
||||
'idx': None,
|
||||
'modified': '2010-07-15 16:00:11',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Maintenance',
|
||||
'name': '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': '`tabSerial No`.`cost_center`',
|
||||
'sort_order': 'ASC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
0
support/search_criteria/customer_issues/__init__.py
Normal file
0
support/search_criteria/customer_issues/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
report.customize_filters = function() {
|
||||
this.filter_fields_dict['Customer Issue'+FILTER_SEP +'Status'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Customer Issue'+FILTER_SEP +'Allocated To'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Customer Issue'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
}
|
||||
|
||||
this.mytabs.items['Select Columns'].hide()
|
||||
37
support/search_criteria/customer_issues/customer_issues.txt
Normal file
37
support/search_criteria/customer_issues/customer_issues.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': 'Customer Issue\x01ID,Customer Issue\x01Status,Customer Issue\x01Complaint Date,Customer Issue\x01Complaint,Customer Issue\x01Item Code,Customer Issue\x01Item Name,Customer Issue\x01Allocated To,Customer Issue\x01Allocated On,Customer Issue\x01Resolved By,Customer Issue\x01Resolution Date,Customer Issue\x01Customer Name,Customer Issue\x01Fiscal Year',
|
||||
'creation': '2010-09-01 15:47:57',
|
||||
'criteria_name': 'Customer Issues',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Customer Issue',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Customer Issue\x01Saved':1,'Customer Issue\x01Submitted':1,'Customer Issue\x01Status':'','Customer Issue\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-08-30 13:21:32',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Maintenance',
|
||||
'name': 'customer_issues',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': '`tabCustomer Issue`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,4 @@
|
||||
report.customize_filters = function() {
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
this.filter_fields_dict['Sales Order'+FILTER_SEP +'Fiscal Year'].df['report_default'] = sys_defaults.fiscal_year;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': "SUM((`tabSales Order Detail`.`qty` - `tabSales Order Detail`.`billed_qty`) * `tabSales Order Detail`.`basic_rate`) AS 'Pending Amount'",
|
||||
'add_cond': "`tabSales Order`.status != 'Stopped'\n`tabSales Order`.order_type='Maintenance'",
|
||||
'add_tab': None,
|
||||
'columns': 'Sales Order\x01ID,Sales Order\x01Customer,Sales Order\x01Customer Name,Sales Order\x01Customer Address,Sales Order\x01Status,Sales Order\x01% Billed,Sales Order\x01Sales Order Date',
|
||||
'creation': '2010-09-01 15:47:57',
|
||||
'criteria_name': 'Maintenance Orderwise Pending Amount To Bill',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Sales Order Detail',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Sales Order\x01Saved':1,'Sales Order\x01Submitted':1,'Sales Order\x01Status':'','Sales Order\x01Fiscal Year':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-08-30 13:40:44',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Maintenance',
|
||||
'name': 'maintenance_orderwise_pending_amount_to_bill',
|
||||
'owner': 'ashwini@webnotestech.com',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': 'Sales Order',
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': '`tabSales Order`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,13 @@
|
||||
report.customize_filters = function() {
|
||||
|
||||
this.filter_fields_dict['Maintenance Schedule Detail'+FILTER_SEP +'From Scheduled Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Maintenance Schedule Detail'+FILTER_SEP +'To Scheduled Date'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Maintenance Schedule Detail'+FILTER_SEP +'Incharge Name'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Customer'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Customer Name'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Sales Order No'].df.in_first_page = 1;
|
||||
//this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Status'].df.in_first_page = 0;
|
||||
this.filter_fields_dict['Maintenance Schedule'+FILTER_SEP +'Company'].df['report_default'] = sys_defaults.company;
|
||||
}
|
||||
|
||||
this.mytabs.items['Select Columns'].hide()
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': 'Maintenance Schedule Detail\x01Item Code,Maintenance Schedule Detail\x01Item Name,Maintenance Schedule Detail\x01Serial No,Maintenance Schedule Detail\x01Incharge Name,Maintenance Schedule Detail\x01Scheduled Date,Maintenance Schedule\x01Customer Name,Maintenance Schedule\x01Address,Maintenance Schedule\x01Sales Order No',
|
||||
'creation': '2010-09-01 15:47:57',
|
||||
'criteria_name': 'Maintenance Schedule Details',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Maintenance Schedule Detail',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Maintenance Schedule\x01Submitted':1,'Maintenance Schedule\x01Status':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-08-30 13:18:23',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Maintenance',
|
||||
'name': 'maintenance_schedule_details',
|
||||
'owner': 'nabin@webnotestech.com',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': 'Maintenance Schedule',
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': '`tabMaintenance Schedule Detail`.`item_code`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
//this.mytabs.items['Select Columns'].hide();
|
||||
|
||||
report.customize_filters = function() {
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Status'].df.in_first_page = 0;
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Customer'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Customer Name'].df.in_first_page = 1;
|
||||
this.filter_fields_dict['Serial No'+FILTER_SEP +'Maintenance Status'].df.in_first_page = 1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
'add_col': None,
|
||||
'add_cond': None,
|
||||
'add_tab': None,
|
||||
'columns': 'Serial No\x01ID,Serial No\x01Item Code,Serial No\x01Description,Serial No\x01Status,Serial No\x01Item Group,Serial No\x01Purchase Receipt No,Serial No\x01Delivery Note No,Serial No\x01Customer,Serial No\x01Customer Name,Serial No\x01AMC Expiry Date,Serial No\x01Warranty Expiry Date',
|
||||
'creation': '2010-09-01 15:47:57',
|
||||
'criteria_name': 'Warranty/AMC Expiry Details',
|
||||
'custom_query': '',
|
||||
'description': None,
|
||||
'dis_filters': None,
|
||||
'disabled': None,
|
||||
'doc_type': 'Serial No',
|
||||
'docstatus': 0,
|
||||
'doctype': 'Search Criteria',
|
||||
'filters': "{'Serial No\x01Saved':1,'Serial No\x01Status':'','Serial No\x01Maintenance Status':''}",
|
||||
'graph_series': None,
|
||||
'graph_values': None,
|
||||
'group_by': None,
|
||||
'idx': None,
|
||||
'modified': '2010-08-30 13:32:21',
|
||||
'modified_by': 'Administrator',
|
||||
'module': 'Maintenance',
|
||||
'name': 'warranty-amc_expiry_details',
|
||||
'owner': 'Administrator',
|
||||
'page_len': 50,
|
||||
'parent': None,
|
||||
'parent_doc_type': None,
|
||||
'parentfield': None,
|
||||
'parenttype': None,
|
||||
'report_script': None,
|
||||
'server_script': None,
|
||||
'sort_by': '`tabSerial No`.`name`',
|
||||
'sort_order': 'DESC',
|
||||
'standard': 'Yes'
|
||||
}
|
||||
]
|
||||
@@ -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