[Vtigercrm-developers] address module
Adam Heinz
amh at metricwise.net
Fri Jun 1 07:55:16 PDT 2012
Has anyone given any thought to building a standalone address module?
There are a lot of repeated (and inconsistently named) address fields
in the database. Wouldn't it be simpler to have a single
vtiger_address table with an addresstype picklist ('shipping',
'billing', 'mailing', 'other'), then just refer to this table as a
related module?
mysql> desc vtiger_contactaddress;
+------------------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+---------------+------+-----+---------+-------+
| contactaddressid | int(19) | NO | PRI | 0 | |
| mailingcity | varchar(40) | YES | | NULL | |
| mailingstreet | varchar(250) | YES | | NULL | |
| mailingcountry | varchar(40) | YES | | NULL | |
| othercountry | varchar(30) | YES | | NULL | |
| mailingstate | varchar(30) | YES | | NULL | |
| mailingpobox | varchar(30) | YES | | NULL | |
| othercity | varchar(40) | YES | | NULL | |
| otherstate | varchar(50) | YES | | NULL | |
| mailingzip | varchar(30) | YES | | NULL | |
| otherzip | varchar(30) | YES | | NULL | |
| otherstreet | varchar(250) | YES | | NULL | |
| otherpobox | varchar(30) | YES | | NULL | |
+------------------+---------------+------+-----+---------+-------+
mysql> desc vtiger_organizationdetails;
+------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| organizationname | varchar(60) | NO | PRI | | |
| address | varchar(150) | YES | | NULL | |
| city | varchar(100) | YES | | NULL | |
| state | varchar(100) | YES | | NULL | |
| country | varchar(100) | YES | | NULL | |
| code | varchar(30) | YES | | NULL | |
| phone | varchar(30) | YES | | NULL | |
| fax | varchar(30) | YES | | NULL | |
| website | varchar(100) | YES | | NULL | |
| logoname | varchar(50) | YES | | NULL | |
| logo | mediumtext | YES | | NULL | |
| showtax | varchar(1) | NO | | NULL | |
+------------------+--------------+------+-----+---------+-------+
mysql> desc vtiger_quotesbillads;
+--------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+--------------+------+-----+---------+-------+
| quotebilladdressid | int(19) | NO | PRI | 0 | |
| bill_city | varchar(30) | YES | | NULL | |
| bill_code | varchar(30) | YES | | NULL | |
| bill_country | varchar(30) | YES | | NULL | |
| bill_state | varchar(30) | YES | | NULL | |
| bill_street | varchar(250) | YES | | NULL | |
| bill_pobox | varchar(30) | YES | | NULL | |
+--------------------+--------------+------+-----+---------+-------+
mysql> desc vtiger_quotesshipads;
+--------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+--------------+------+-----+---------+-------+
| quoteshipaddressid | int(19) | NO | PRI | 0 | |
| ship_city | varchar(30) | YES | | NULL | |
| ship_code | varchar(30) | YES | | NULL | |
| ship_country | varchar(30) | YES | | NULL | |
| ship_state | varchar(30) | YES | | NULL | |
| ship_street | varchar(250) | YES | | NULL | |
| ship_pobox | varchar(30) | YES | | NULL | |
+--------------------+--------------+------+-----+---------+-------+
mysql> desc vtiger_accountbillads;
+------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| accountaddressid | int(19) | NO | PRI | 0 | |
| bill_city | varchar(30) | YES | | NULL | |
| bill_code | varchar(30) | YES | | NULL | |
| bill_country | varchar(30) | YES | | NULL | |
| bill_state | varchar(30) | YES | | NULL | |
| bill_street | varchar(250) | YES | | NULL | |
| bill_pobox | varchar(30) | YES | | NULL | |
+------------------+--------------+------+-----+---------+-------+
mysql> desc vtiger_accountshipads;
+------------------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| accountaddressid | int(19) | NO | PRI | 0 | |
| ship_city | varchar(30) | YES | | NULL | |
| ship_code | varchar(30) | YES | | NULL | |
| ship_country | varchar(30) | YES | | NULL | |
| ship_state | varchar(30) | YES | | NULL | |
| ship_pobox | varchar(30) | YES | | NULL | |
| ship_street | varchar(250) | YES | | NULL | |
+------------------+--------------+------+-----+---------+-------+
More information about the vtigercrm-developers
mailing list