fix in customer address contact report
This commit is contained in:
parent
9327bb9585
commit
9da0bf6106
@ -0,0 +1,4 @@
|
||||
def execute():
|
||||
import webnotes
|
||||
import webnotes.modules
|
||||
webnotes.modules.reload_doc('selling', 'search_criteria', 'customer_address_contact')
|
@ -392,5 +392,9 @@ patch_list = [
|
||||
'patch_file': 'create_report_manager_role',
|
||||
'description': 'Create report manager role if not exists'
|
||||
},
|
||||
|
||||
{
|
||||
'patch_module': 'patches.may_2012',
|
||||
'patch_file': 'reload_customer_address_contact',
|
||||
'description': 'Reload report customer address contact'
|
||||
},
|
||||
]
|
@ -0,0 +1,22 @@
|
||||
col_defs = [
|
||||
{'label': 'Id', 'type': 'Link', 'width': '', 'options': 'Customer'},
|
||||
{'label': 'Customer Name'},
|
||||
{'label': 'Address Line 1', 'width': '200px'},
|
||||
{'label': 'Address Line 2', 'width': '200px'},
|
||||
{'label': 'City'},
|
||||
{'label': 'State'},
|
||||
{'label': 'Pincode', 'width': '80px'},
|
||||
{'label': 'Country', 'width': '100px'},
|
||||
{'label': 'Contact First Name'},
|
||||
{'label': 'Contact Last Name'},
|
||||
{'label': 'Contact Phone', 'width': '100px'},
|
||||
{'label': 'Contact Mobile', 'width': '100px'},
|
||||
{'label': 'Contact Email'},
|
||||
]
|
||||
webnotes.msgprint(colnames)
|
||||
for col in col_defs:
|
||||
colnames.append(col['label'])
|
||||
coltypes.append(col.get('type') or 'Data')
|
||||
colwidths.append(col.get('width') or '150px')
|
||||
coloptions.append(col.get('options') or '')
|
||||
col_idx[col['label']] = len(colnames) - 1
|
@ -0,0 +1,26 @@
|
||||
select
|
||||
`tabCustomer`.name,
|
||||
`tabCustomer`.customer_name,
|
||||
`tabAddress`.address_line1,
|
||||
`tabAddress`.address_line2,
|
||||
`tabAddress`.city,
|
||||
`tabAddress`.state,
|
||||
`tabAddress`.pincode,
|
||||
`tabAddress`.country,
|
||||
`tabContact`.first_name,
|
||||
`tabContact`.last_name,
|
||||
`tabContact`.phone,
|
||||
`tabContact`.mobile_no,
|
||||
`tabContact`.email_id
|
||||
from
|
||||
`tabCustomer`
|
||||
left join `tabAddress` on (
|
||||
`tabAddress`.customer=`tabCustomer`.name and
|
||||
ifnull(`tabAddress`.is_primary_address, 0)=1
|
||||
)
|
||||
left join `tabContact` on (
|
||||
`tabContact`.customer=`tabCustomer`.name and
|
||||
ifnull(`tabContact`.is_primary_contact, 0)=1
|
||||
)
|
||||
order by
|
||||
`tabCustomer`.customer_name asc
|
@ -3,18 +3,15 @@
|
||||
|
||||
# These values are common in all dictionaries
|
||||
{
|
||||
'creation': '2012-04-03 12:49:51',
|
||||
'creation': '2012-04-17 11:29:10',
|
||||
'docstatus': 0,
|
||||
'modified': '2012-04-03 12:49:51',
|
||||
'modified': '2012-05-23 18:17:40',
|
||||
'modified_by': u'Administrator',
|
||||
'owner': u'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all Search Criteria
|
||||
{
|
||||
'add_col': u"`tabAddress`.address_line1 AS 'Address Line 1'\n`tabAddress`.address_line2 AS 'Address Line 2'\n`tabAddress`.city AS 'City'\n`tabAddress`.state AS 'State'\n`tabAddress`.pincode AS 'Pincode'\n`tabAddress`.country AS 'Country'\n`tabContact`.first_name AS 'Contact First Name'\n`tabContact`.last_name AS 'Contact Last Name'\n`tabContact`.phone AS 'Contact Phone'\n`tabContact`.mobile_no AS 'Contact Mobile'\n`tabContact`.email_id AS 'Contact Email'",
|
||||
'add_cond': u'`tabAddress`.customer=`tabCustomer`.name\nifnull(`tabAddress`.is_primary_address, 0)=1\n`tabContact`.customer=`tabCustomer`.name\nifnull(`tabContact`.is_primary_contact, 0)=1',
|
||||
'add_tab': u'`tabAddress`\n`tabContact`',
|
||||
'columns': u'Customer\x01ID,Customer\x01Customer Name',
|
||||
'criteria_name': u'Customer Address Contact',
|
||||
'doc_type': u'Customer',
|
||||
@ -23,8 +20,6 @@
|
||||
'module': u'Selling',
|
||||
'name': '__common__',
|
||||
'page_len': 50,
|
||||
'sort_by': u'`tabCustomer`.`customer_name`',
|
||||
'sort_order': u'ASC',
|
||||
'standard': u'Yes'
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user