diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6e5f5eb7134..45b326dd043 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -273,6 +273,10 @@ class Facture extends CommonInvoice */ public $online_payment_url; + /** + * @var string IP address + */ + public $ip; /** @@ -709,6 +713,7 @@ class Facture extends CommonInvoice $sql .= ", retained_warranty"; $sql .= ", retained_warranty_date_limit"; $sql .= ", retained_warranty_fk_cond_reglement"; + $sql .= ", ip"; $sql .= ")"; $sql .= " VALUES ("; $sql .= "'(PROV)'"; @@ -748,6 +753,7 @@ class Facture extends CommonInvoice $sql .= ", ".(empty($this->retained_warranty) ? "0" : $this->db->escape((string) $this->retained_warranty)); $sql .= ", ".(!empty($this->retained_warranty_date_limit) ? "'".$this->db->idate($this->retained_warranty_date_limit)."'" : 'NULL'); $sql .= ", ".(int) $this->retained_warranty_fk_cond_reglement; + $sql .= ", ".(!empty($this->ip) ? "'".$this->db->escape($this->ip)."'" : "null"); $sql .= ")"; $resql = $this->db->query($sql); diff --git a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql index f558f14dbed..cc375e9b4de 100644 --- a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql +++ b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql @@ -112,6 +112,7 @@ CREATE TABLE llx_accounting_analytic_distribution ( ALTER TABLE llx_accounting_analytic_distribution ADD CONSTRAINT fk_accounting_analytic_distribution_fk_analytic_account FOREIGN KEY (fk_analytic_account) REFERENCES llx_accounting_analytic_account (rowid); ALTER TABLE llx_facture ADD COLUMN dispute_status integer DEFAULT 0 after payment_reference; +ALTER TABLE llx_facture ADD COLUMN ip varchar(250); ALTER TABLE llx_commande ADD COLUMN ip varchar(250); ALTER TABLE llx_commande ADD COLUMN user_agent varchar(255); @@ -179,4 +180,3 @@ ALTER TABLE llx_supplier_proposal ADD COLUMN deposit_percent varchar(63) DEFAULT ALTER TABLE llx_commande_fournisseur ADD COLUMN deposit_percent varchar(63) DEFAULT NULL AFTER fk_cond_reglement; -- end of migration - diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index d8a88ee966d..dabca7ae65e 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -114,5 +114,6 @@ create table llx_facture multicurrency_tx double(24,8) DEFAULT 1, multicurrency_total_ht double(24,8) DEFAULT 0, multicurrency_total_tva double(24,8) DEFAULT 0, - multicurrency_total_ttc double(24,8) DEFAULT 0 + multicurrency_total_ttc double(24,8) DEFAULT 0, + ip varchar(250) --ip used to create record (for public submission page) )ENGINE=innodb;