QUAL Deprecated "domiciliation". Replaced with "address"

This commit is contained in:
Laurent Destailleur 2024-02-21 16:43:41 +01:00
parent b6d0e1d21e
commit de789e03df
10 changed files with 84 additions and 52 deletions

View File

@ -141,8 +141,10 @@ if (empty($reshook)) {
$object->iban = trim(GETPOST("iban"));
$object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1;
$object->domiciliation = trim(GETPOST("account_address", "alphanohtml")); // deprecated
$object->address = trim(GETPOST("account_address", "alphanohtml"));
$object->proprio = trim(GETPOST("proprio", 'alphanohtml'));
$object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml"));
$object->owner_address = trim(GETPOST("owner_address", 'alphanohtml'));
$object->owner_zip = trim(GETPOST("owner_zip", 'alphanohtml'));
$object->owner_town = trim(GETPOST("owner_town", 'alphanohtml'));

View File

@ -1859,7 +1859,6 @@ class Account extends CommonObject
$this->specimen = 1;
$this->ref = 'MBA';
$this->label = 'My Big Company Bank account';
$this->bank = 'MyBank';
$this->courant = Account::TYPE_CURRENT;
$this->clos = Account::STATUS_OPEN;
$this->code_banque = '30001';
@ -1868,7 +1867,9 @@ class Account extends CommonObject
$this->cle_rib = '85';
$this->bic = 'AA12';
$this->iban = 'FR7630001007941234567890185';
$this->domiciliation = 'Banque de France';
$this->bank = 'MyBank';
$this->address = 'Rue de Paris';
$this->proprio = 'Owner';
$this->owner_address = 'Owner address';
$this->owner_zip = 'Owner zip';

View File

@ -2057,7 +2057,7 @@ class BonPrelevement extends CommonObject
* @param float $amount amount
* @param string $ref ref of invoice
* @param int $facid id of invoice
* @param string $rib_dom rib domiciliation
* @param string $rib_dom bank address
* @param string $type 'direct-debit' or 'bank-transfer'
* @return void
* @see EnregDestinataireSEPA()
@ -2082,9 +2082,9 @@ class BonPrelevement extends CommonObject
fwrite($this->file, substr(strtoupper($client_nom)." ", 0, 24));
// Domiciliation facultative D1
$domiciliation = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => ""));
fwrite($this->file, substr($domiciliation." ", 0, 24));
// Address optional D1
$address = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => ""));
fwrite($this->file, substr($address." ", 0, 24));
// Zone Reservee D2

View File

@ -76,22 +76,23 @@ class box_comptes extends ModeleBoxes
$this->info_box_head = array('text' => $langs->trans("BoxTitleCurrentAccounts"));
if ($user->hasRight('banque', 'lire')) {
$sql = "SELECT b.rowid, b.ref, b.label, b.bank,b.number, b.courant, b.clos, b.rappro, b.url";
$sql = "SELECT b.rowid, b.ref, b.label, b.bank, b.number, b.courant, b.clos, b.rappro, b.url";
$sql .= ", b.code_banque, b.code_guichet, b.cle_rib, b.bic, b.iban_prefix as iban";
$sql .= ", b.domiciliation, b.proprio, b.owner_address";
$sql .= ", b.domiciliation as address, b.proprio, b.owner_address";
$sql .= ", b.account_number, b.currency_code";
$sql .= ", b.min_allowed, b.min_desired, comment";
$sql .= ', b.fk_accountancy_journal';
$sql .= ', aj.code as accountancy_journal';
$sql .= " FROM ".MAIN_DB_PREFIX."bank_account as b";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_journal as aj ON aj.rowid=b.fk_accountancy_journal';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'accounting_journal as aj ON aj.rowid = b.fk_accountancy_journal';
$sql .= " WHERE b.entity = ".$conf->entity;
$sql .= " AND clos = 0";
//$sql.= " AND courant = 1";
$sql .= " ORDER BY label";
$sql .= $this->db->plimit($max, 0);
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
$num = $this->db->num_rows($result);

View File

@ -829,7 +829,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
* @param int $curx X
* @param int $cury Y
* @param Account $account Bank account object
* @param int $onlynumber Output only number (bank+desk+key+number according to country, but without name of bank and domiciliation)
* @param int $onlynumber Output only number (bank+desk+key+number according to country, but without name of bank and address)
* @param int $default_font_size Default font size
* @return float The Y PDF position
*/
@ -942,9 +942,9 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0,
$pdf->SetFont('', '', $default_font_size - $diffsizecontent);
if (empty($onlynumber) && !empty($account->domiciliation)) {
if (empty($onlynumber) && (!empty($account->domiciliation) || !empty($account->address))) {
$pdf->SetXY($curx, $cury);
$val = $outputlangs->transnoentities("Residence").': '.$outputlangs->convToOutputCharset($account->domiciliation);
$val = $outputlangs->transnoentities("Residence").': '.$outputlangs->convToOutputCharset(empty($account->address) ? $account->domiciliation : $account->address);
$pdf->MultiCell(100, 3, $val, 0, 'L', 0);
//$nboflines=dol_nboflines_bis($val,120);
//$cury+=($nboflines*3)+2;

View File

@ -1095,7 +1095,7 @@ class Thirdparties extends DolibarrApi
* We select all the records that match the socid
*/
$sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,";
$sql = "SELECT rowid, fk_soc, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation as address, proprio,";
$sql .= " owner_address, default_rib, label, datec, tms as datem, rum, frstrecur";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib";
if ($id) {

View File

@ -164,14 +164,33 @@ class CompanyBankAccount extends Account
* @var string label
*/
public $label;
public $bank;
public $code_banque;
public $code_guichet;
public $number;
public $cle_rib;
public $bic;
public $iban_prefix;
public $bank;
/**
* @var string Bank address
* @deprecated Replaced with address
*/
public $domiciliation;
public $address;
/**
* @var int state id
*/
public $state_id;
/**
* @var int country id
*/
public $fk_country;
public $country_code;
/**
* @var string owner
@ -188,16 +207,6 @@ class CompanyBankAccount extends Account
*/
public $default_rib;
/**
* @var int state id
*/
public $state_id;
/**
* @var id country id
*/
public $fk_country;
/**
* @var string currency code
*/
@ -225,7 +234,6 @@ class CompanyBankAccount extends Account
public $cvn;
public $exp_date_month;
public $exp_date_year;
public $country_code;
public $approved;
/**
@ -397,9 +405,12 @@ class CompanyBankAccount extends Account
return -1;
}
if (dol_strlen($this->domiciliation) > 255) {
if (!empty($this->domiciliation) && dol_strlen($this->domiciliation) > 255) {
$this->domiciliation = dol_trunc($this->domiciliation, 254, 'right', 'UTF-8', 1);
}
if (!empty($this->address) && dol_strlen($this->address) > 255) {
$this->address = dol_trunc($this->address, 254, 'right', 'UTF-8', 1);
}
if (dol_strlen($this->owner_address) > 255) {
$this->owner_address = dol_trunc($this->owner_address, 254, 'right', 'UTF-8', 1);
}
@ -418,7 +429,7 @@ class CompanyBankAccount extends Account
$sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'";
$sql .= ",bic='".$this->db->escape($this->bic)."'";
$sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'";
$sql .= ",domiciliation = '".$this->db->escape($this->domiciliation)."'";
$sql .= ",domiciliation = '".$this->db->escape($this->address ? $this->address : $this->domiciliation)."'";
$sql .= ",proprio = '".$this->db->escape($this->proprio)."'";
$sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'";
$sql .= ",default_rib = ".((int) $this->default_rib);
@ -481,13 +492,13 @@ class CompanyBankAccount extends Account
return -1;
}
$sql = "SELECT rowid, type, fk_soc as socid, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban, domiciliation, proprio,";
$sql .= " owner_address, default_rib, label, datec, tms as datem, rum, frstrecur, date_rum,";
$sql .= " stripe_card_ref, stripe_account, ext_payment_site";
$sql .= " ,last_main_doc";
$sql .= " ,model_pdf";
$sql = "SELECT rowid, label, type, fk_soc as socid, bank, number, code_banque, code_guichet, cle_rib, bic, iban_prefix as iban,";
$sql .= " domiciliation as address,";
$sql .= " proprio, owner_address, default_rib, datec, tms as datem, rum, frstrecur, date_rum,";
$sql .= " stripe_card_ref, stripe_account, ext_payment_site,";
$sql .= " last_main_doc, model_pdf";
$sql .= " FROM ".MAIN_DB_PREFIX."societe_rib";
if ($id) {
$sql .= " WHERE rowid = ".((int) $id);
} elseif ($socid > 0) {
@ -517,7 +528,10 @@ class CompanyBankAccount extends Account
$this->cle_rib = $obj->cle_rib;
$this->bic = $obj->bic;
$this->iban = $obj->iban;
$this->domiciliation = $obj->domiciliation;
$this->domiciliation = $obj->address;
$this->address = $obj->address;
$this->proprio = $obj->proprio;
$this->owner_address = $obj->owner_address;
$this->label = $obj->label;
@ -675,10 +689,13 @@ class CompanyBankAccount extends Account
$this->cle_rib = '50';
$this->bic = 'CC12';
$this->iban = 'FR999999999';
$this->domiciliation = 'Bank address of customer corp';
$this->address = 'Rue de Paris';
$this->country_id = 1;
$this->proprio = 'Owner';
$this->owner_address = 'Owner address';
$this->country_id = 1;
$this->owner_country_id = 1;
$this->rum = 'UMR-CU1212-0007-5-1475405262';
$this->date_rum = dol_now() - 10000;

View File

@ -175,7 +175,10 @@ if (empty($reshook)) {
$companybankaccount->cle_rib = GETPOST('cle_rib', 'alpha');
$companybankaccount->bic = GETPOST('bic', 'alpha');
$companybankaccount->iban = GETPOST('iban', 'alpha');
$companybankaccount->domiciliation = GETPOST('domiciliation', 'alpha');
$companybankaccount->domiciliation = GETPOST('address', 'alpha');
$companybankaccount->address = GETPOST('address', 'alpha');
$companybankaccount->proprio = GETPOST('proprio', 'alpha');
$companybankaccount->owner_address = GETPOST('owner_address', 'alpha');
$companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha');
@ -305,7 +308,10 @@ if (empty($reshook)) {
$companybankaccount->cle_rib = GETPOST('cle_rib', 'alpha');
$companybankaccount->bic = GETPOST('bic', 'alpha');
$companybankaccount->iban = GETPOST('iban', 'alpha');
$companybankaccount->domiciliation = GETPOST('domiciliation', 'alpha');
$companybankaccount->domiciliation = GETPOST('address', 'alpha');
$companybankaccount->address = GETPOST('address', 'alpha');
$companybankaccount->proprio = GETPOST('proprio', 'alpha');
$companybankaccount->owner_address = GETPOST('owner_address', 'alpha');
$companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha');
@ -2010,8 +2016,8 @@ if ($socid && $action == 'edit' && $permissiontoaddupdatepaymentinformation) {
}
print '<tr><td class="tdtop">'.$langs->trans("BankAccountDomiciliation").'</td><td>';
print '<textarea name="domiciliation" rows="4" cols="40" maxlength="255">';
print $companybankaccount->domiciliation;
print '<textarea name="address" rows="4" cols="40" maxlength="255">';
print $companybankaccount->address;
print "</textarea></td></tr>";
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';
@ -2181,8 +2187,8 @@ if ($socid && $action == 'create' && $permissiontoaddupdatepaymentinformation) {
}
print '<tr><td class="tdtop">'.$langs->trans("BankAccountDomiciliation").'</td><td>';
print '<textarea name="domiciliation" rows="'.ROWS_4.'" class="quatrevingtpercent" maxlength="255">';
print GETPOST('domiciliation');
print '<textarea name="address" rows="'.ROWS_4.'" class="quatrevingtpercent" maxlength="255">';
print GETPOST('address');
print "</textarea></td></tr>";
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';

View File

@ -125,7 +125,8 @@ if ($action == 'add' && !$cancel && $permissiontoaddbankaccount) {
$account->cle_rib = GETPOST('cle_rib', 'alpha');
$account->bic = GETPOST('bic', 'alpha');
$account->iban = GETPOST('iban', 'alpha');
$account->domiciliation = GETPOST('domiciliation', 'alpha');
$account->domiciliation = GETPOST('address', 'alpha');
$account->address = GETPOST('address', 'alpha');
$account->proprio = GETPOST('proprio', 'alpha');
$account->owner_address = GETPOST('owner_address', 'alpha');
@ -156,7 +157,8 @@ if ($action == 'update' && !$cancel && $permissiontoaddbankaccount) {
$account->cle_rib = GETPOST('cle_rib', 'alpha');
$account->bic = GETPOST('bic', 'alpha');
$account->iban = GETPOST('iban', 'alpha');
$account->domiciliation = GETPOST('domiciliation', 'alpha');
$account->domiciliation = GETPOST('address', 'alpha');
$account->address = GETPOST('address', 'alpha');
$account->proprio = GETPOST('proprio', 'alpha');
$account->owner_address = GETPOST('owner_address', 'alpha');
@ -1004,8 +1006,8 @@ if ($id && ($action == 'edit' || $action == 'create') && $user->hasRight('user',
}
print '<tr><td class="tdtop">'.$langs->trans("BankAccountDomiciliation").'</td><td colspan="4">';
print '<textarea name="domiciliation" rows="4" class="quatrevingtpercent">';
print dol_escape_htmltag($account->domiciliation);
print '<textarea name="address" rows="4" class="quatrevingtpercent">';
print dol_escape_htmltag($account->address);
print "</textarea></td></tr>";
print '<tr><td>'.$langs->trans("BankAccountOwner").'</td>';

View File

@ -135,7 +135,7 @@ class UserBankAccount extends Account
$sql .= ",cle_rib='".$this->db->escape($this->cle_rib)."'";
$sql .= ",bic='".$this->db->escape($this->bic)."'";
$sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'";
$sql .= ",domiciliation='".$this->db->escape($this->domiciliation)."'";
$sql .= ",domiciliation='".$this->db->escape($this->address ? $this->address :$this->domiciliation)."'";
$sql .= ",proprio = '".$this->db->escape($this->proprio)."'";
$sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'";
$sql .= ",currency_code = '".$this->db->escape($this->currency_code)."'";
@ -189,8 +189,8 @@ class UserBankAccount extends Account
return -1;
}
$sql = "SELECT ur.rowid, ur.fk_user, ur.entity, ur.bank, ur.number, ur.code_banque, ur.code_guichet, ur.cle_rib, ur.bic, ur.iban_prefix as iban, ur.domiciliation, ur.proprio";
$sql .= ", ur.owner_address, ur.label, ur.datec, ur.tms as datem";
$sql = "SELECT ur.rowid, ur.fk_user, ur.entity, ur.bank, ur.number, ur.code_banque, ur.code_guichet, ur.cle_rib, ur.bic, ur.iban_prefix as iban, ur.domiciliation as address";
$sql .= ", ur.proprio, ur.owner_address, ur.label, ur.datec, ur.tms as datem";
$sql .= ', ur.currency_code, ur.state_id, ur.fk_country as country_id';
$sql .= ', c.code as country_code, c.label as country';
$sql .= ', d.code_departement as state_code, d.nom as state';
@ -222,7 +222,10 @@ class UserBankAccount extends Account
$this->cle_rib = $obj->cle_rib;
$this->bic = $obj->bic;
$this->iban = $obj->iban;
$this->domiciliation = $obj->domiciliation;
$this->domiciliation = $obj->address;
$this->address = $obj->address;
$this->proprio = $obj->proprio;
$this->owner_address = $obj->owner_address;
$this->label = $obj->label;