diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 14489b9232986..56c80657233da 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -141,7 +141,8 @@ $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); - $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); + $object->address = trim(GETPOST("account_address", "alphanohtml")); + $object->domiciliation = $object->address; // deprecated $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->owner_zip = trim(GETPOST("owner_zip", 'alphanohtml')); $object->owner_town = trim(GETPOST("owner_town", 'alphanohtml')); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 84f08b0ab6834..1357f7dbab2f6 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -717,6 +717,11 @@ public function create(User $user, $notrigger = 0) $balance = 0; } + if (empty($this->address && !empty($this->domiciliation))) { + dol_syslog(get_class($this)."::create domiciliation is deprecated use address", LOG_NOTICE); + $this->address = $this->domiciliation; + } + // Load the library to validate/check a BAN account require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; @@ -768,7 +773,7 @@ public function create(User $user, $notrigger = 0) $sql .= ", '".$this->db->escape($this->cle_rib)."'"; $sql .= ", '".$this->db->escape($this->bic)."'"; $sql .= ", '".$this->db->escape($this->iban)."'"; - $sql .= ", '".$this->db->escape($this->domiciliation)."'"; + $sql .= ", '".$this->db->escape($this->address)."'"; $sql .= ", ".((int) $this->pti_in_ctti); $sql .= ", '".$this->db->escape($this->proprio)."'"; $sql .= ", '".$this->db->escape($this->owner_address)."'";