Clean depracted table

This commit is contained in:
Laurent Destailleur
2023-11-20 17:46:57 +01:00
parent e7a629b319
commit ed122e5408
5 changed files with 1 additions and 90 deletions

View File

@@ -3995,57 +3995,8 @@ class Form
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Return list of delivery address
*
* @param string $selected Id contact pre-selectionn
* @param int $socid Id of company
* @param string $htmlname Name of HTML field
* @param int $showempty Add an empty field
* @return integer
*/
public function select_address($selected, $socid, $htmlname = 'address_id', $showempty = 0)
{
// phpcs:enable
// looking for users
$sql = "SELECT a.rowid, a.label";
$sql .= " FROM " . $this->db->prefix() . "societe_address as a";
$sql .= " WHERE a.fk_soc = " . ((int) $socid);
$sql .= " ORDER BY a.label ASC";
dol_syslog(get_class($this) . "::select_address", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
print '<select class="flat" id="select_' . $htmlname . '" name="' . $htmlname . '">';
if ($showempty) {
print '<option value="0">&nbsp;</option>';
}
$num = $this->db->num_rows($resql);
$i = 0;
if ($num) {
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
if ($selected && $selected == $obj->rowid) {
print '<option value="' . $obj->rowid . '" selected>' . $obj->label . '</option>';
} else {
print '<option value="' . $obj->rowid . '">' . $obj->label . '</option>';
}
$i++;
}
}
print '</select>';
return $num;
} else {
dol_print_error($this->db);
return -1;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load into cache list of payment terms
*

View File

@@ -1,37 +0,0 @@
-- ========================================================================
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2013 Houssin Regis <regis.houssin@inodbox.com>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
--
-- ========================================================================
create table llx_societe_address
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime, -- creation date
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
label varchar(30), --
fk_soc integer DEFAULT 0, --
name varchar(60), -- company name
address varchar(255), -- company adresse
zip varchar(10), -- zipcode
town varchar(50), -- town
fk_pays integer DEFAULT 0, --
phone varchar(20), -- phone number
fax varchar(20), -- fax number
note text, --
fk_user_creat integer,
fk_user_modif integer
)ENGINE=innodb;

View File

@@ -17,7 +17,7 @@
-- ========================================================================
-- This table contains the contacts by default of a thirdparty
-- Such contacts will be added to document automatiall if their role match the one expected by the document.
-- Such contacts will be added to document automatically if their role match the one expected by the document.
create table llx_societe_contacts
(

View File

@@ -161,7 +161,6 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_propaldet_extrafield
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_resource FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_salary FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_address FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_prices FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_societe_remise FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();

View File

@@ -104,7 +104,6 @@ class Societe extends CommonObject
*/
protected $childtablesoncascade = array(
'societe_prices',
'societe_address',
'product_fournisseur_price',
'product_customer_price_log',
'product_customer_price',
@@ -5208,7 +5207,6 @@ class Societe extends CommonObject
* Do not include llx_societe because it will be replaced later
*/
$tables = array(
'societe_address',
'societe_commerciaux',
'societe_prices',
'societe_remise',