Skip to content

Commit

Permalink
Fixed bank address on create
Browse files Browse the repository at this point in the history
  • Loading branch information
W1W1-M committed Sep 18, 2024
1 parent 0a79404 commit a1a2629
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion htdocs/compta/bank/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
7 changes: 6 additions & 1 deletion htdocs/compta/bank/class/account.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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)."'";
Expand Down

0 comments on commit a1a2629

Please sign in to comment.