customer addresses and contacts report (query)
diff --git a/patches/october_2012/remove_old_customer_contact_address.js b/patches/october_2012/remove_old_customer_contact_address.js
new file mode 100644
index 0000000..0e435fd
--- /dev/null
+++ b/patches/october_2012/remove_old_customer_contact_address.js
@@ -0,0 +1,7 @@
+def execute():
+ import webnotes
+ webnotes.conn.sql("""delete from `tabSearch Criteria` \
+ where name = 'customer_address_contact'""")
+
+ from webnotes.modules import reload_doc
+ reload_doc('report', 'customer_addresses_and_contacts', 'selling')
\ No newline at end of file
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 04ec2a3..f750ac0 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -619,4 +619,8 @@
'patch_module': 'patches.october_2012',
'patch_file': 'fix_wrong_vouchers',
},
+ {
+ 'patch_module': 'patches.october_2012',
+ 'patch_file': 'remove_old_customer_contact_address',
+ },
]
diff --git a/selling/report/__init__.py b/selling/report/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/selling/report/__init__.py
diff --git a/selling/report/customer_addresses_and_contacts/__init__.py b/selling/report/customer_addresses_and_contacts/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/selling/report/customer_addresses_and_contacts/__init__.py
diff --git a/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt b/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt
new file mode 100644
index 0000000..621571d
--- /dev/null
+++ b/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt
@@ -0,0 +1,27 @@
+# Report, Customer Addresses and Contacts
+[
+
+ # These values are common in all dictionaries
+ {
+ u'creation': '2012-10-04 17:36:36',
+ u'docstatus': 0,
+ u'modified': '2012-10-04 18:24:07',
+ u'modified_by': u'Administrator',
+ u'owner': u'Administrator'
+ },
+
+ # These values are common for all Report
+ {
+ u'doctype': u'Report',
+ 'is_standard': u'Yes',
+ u'name': u'__common__',
+ 'query': u'SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc',
+ 'ref_doctype': u'Customer'
+ },
+
+ # Report, Customer Addresses and Contacts
+ {
+ u'doctype': u'Report',
+ u'name': u'Customer Addresses and Contacts'
+ }
+]
\ No newline at end of file
diff --git a/selling/search_criteria/customer_address_contact/__init__.py b/selling/search_criteria/customer_address_contact/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/selling/search_criteria/customer_address_contact/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/selling/search_criteria/customer_address_contact/customer_address_contact.py b/selling/search_criteria/customer_address_contact/customer_address_contact.py
deleted file mode 100644
index 4ec0e1a..0000000
--- a/selling/search_criteria/customer_address_contact/customer_address_contact.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from __future__ import unicode_literals
-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
\ No newline at end of file
diff --git a/selling/search_criteria/customer_address_contact/customer_address_contact.sql b/selling/search_criteria/customer_address_contact/customer_address_contact.sql
deleted file mode 100644
index b30a6f9..0000000
--- a/selling/search_criteria/customer_address_contact/customer_address_contact.sql
+++ /dev/null
@@ -1,28 +0,0 @@
-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
- )
-WHERE
- `tabCustomer`.docstatus<2
-ORDER BY
- `tabCustomer`.customer_name asc
\ No newline at end of file
diff --git a/selling/search_criteria/customer_address_contact/customer_address_contact.txt b/selling/search_criteria/customer_address_contact/customer_address_contact.txt
deleted file mode 100644
index 3c94a52..0000000
--- a/selling/search_criteria/customer_address_contact/customer_address_contact.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-# Search Criteria, customer_address_contact
-[
-
- # These values are common in all dictionaries
- {
- 'creation': '2012-04-17 11:29:10',
- 'docstatus': 0,
- 'modified': '2012-05-23 18:17:40',
- 'modified_by': u'Administrator',
- 'owner': u'Administrator'
- },
-
- # These values are common for all Search Criteria
- {
- 'columns': u'Customer\x01ID,Customer\x01Customer Name',
- 'criteria_name': u'Customer Address Contact',
- 'doc_type': u'Customer',
- 'doctype': 'Search Criteria',
- 'filters': u"{'Customer\x01Saved':1,'Customer\x01Submitted':1}",
- 'module': u'Selling',
- 'name': '__common__',
- 'page_len': 50,
- 'standard': u'Yes'
- },
-
- # Search Criteria, customer_address_contact
- {
- 'doctype': 'Search Criteria',
- 'name': u'customer_address_contact'
- }
-]
\ No newline at end of file