From 3bc1d352365ac2ed29dd18e9db16daa17d6e7e96 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 24 Oct 2024 12:38:41 +0200 Subject: [PATCH] QUAL The property ->domiciliation and ->propio on bank accounts has been deprecated and replaced with property ->address and ->owner_name --- ChangeLog | 1 + htdocs/admin/paymentbybanktransfer.php | 2 +- htdocs/admin/prelevement.php | 2 +- htdocs/compta/bank/card.php | 3 -- htdocs/compta/bank/class/account.class.php | 27 ++++++----------- .../class/bonprelevement.class.php | 4 +-- .../core/class/commondocgenerator.class.php | 2 +- htdocs/core/class/commoninvoice.class.php | 2 +- htdocs/core/lib/pdf.lib.php | 4 +-- htdocs/core/lib/security.lib.php | 4 +-- .../facture/doc/pdf_octopus.modules.php | 2 +- htdocs/public/stripe/ipn.php | 21 +++++++------- .../class/companybankaccount.class.php | 12 +++----- .../class/companypaymentmode.class.php | 7 +++++ htdocs/societe/paymentmodes.php | 29 ++++++++++--------- htdocs/stripe/class/stripe.class.php | 4 +-- htdocs/user/bank.php | 12 ++++---- htdocs/user/class/userbankaccount.class.php | 8 ++--- 18 files changed, 71 insertions(+), 75 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4fc1a613681..e205c90cda5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ The following changes may create regressions for some external modules, but were be set (not allowed by PHP 8.2). A module can already return an array with key 'no_button_delete', 'no_button_edit', 'no_button_copy' for same purpose. * The old function dol_bc($var, $moreclass = '') has been removed. If you called it, just stop to call it. * The trigger code CATEGORY_LINK and CATEGORY_UNLINK has been replaced with code CATEGORY_MODIFY. You can read ->context['linkto'] or ->context['unlinkoff' to detect we want to make a link or unlink. +* The property ->domiciliation and ->propio on bank accounts has been deprecated and replaced with property ->address and ->owner_name ***** ChangeLog for 20.0.1 compared to 20.0.0 ***** diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index 9e397724dcb..01b51753042 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -71,7 +71,7 @@ if ($action == "set") { if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_BIC", $account->bic,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->owner_address,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; */ } else { diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 9435eacd0c9..9553528474d 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -72,7 +72,7 @@ if ($action == "set") { if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_BIC", $account->bic,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->owner_address,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; */ } else { diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index d4de338baaa..089ce2d5319 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -145,9 +145,7 @@ if (empty($reshook)) { $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->address = trim(GETPOST("account_address", "alphanohtml")); - $object->domiciliation = $object->address; // deprecated - $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_name = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->owner_zip = trim(GETPOST("owner_zip", 'alphanohtml')); @@ -263,7 +261,6 @@ if (empty($reshook)) { $object->iban = trim(GETPOST("iban")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; - $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_name = trim(GETPOST("proprio", 'alphanohtml')); $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->owner_zip = trim(GETPOST("owner_zip", 'alphanohtml')); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ef4d39c06f7..91f1a0644cd 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -737,20 +737,11 @@ class Account extends CommonObject if (empty($balance)) { $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; - } if (empty($this->status && !empty($this->clos))) { dol_syslog(get_class($this)."::create clos is deprecated use status", LOG_NOTICE); $this->status = $this->clos; } - 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'; @@ -804,7 +795,7 @@ class Account extends CommonObject $sql .= ", '".$this->db->escape($this->iban)."'"; $sql .= ", '".$this->db->escape($this->address)."'"; $sql .= ", ".((int) $this->pti_in_ctti); - $sql .= ", '".$this->db->escape($this->owner_name ? $this->owner_name : $this->proprio)."'"; + $sql .= ", '".$this->db->escape($this->owner_name)."'"; $sql .= ", '".$this->db->escape($this->owner_address)."'"; $sql .= ", '".$this->db->escape($this->owner_zip)."'"; $sql .= ", '".$this->db->escape($this->owner_town)."'"; @@ -928,7 +919,7 @@ class Account extends CommonObject $sql .= ",iban_prefix = '".$this->db->escape($this->iban)."'"; $sql .= ",domiciliation='".$this->db->escape($this->address)."'"; $sql .= ",pti_in_ctti=".((int) $this->pti_in_ctti); - $sql .= ",proprio = '".$this->db->escape($this->owner_name ? $this->owner_name : $this->proprio)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",owner_zip = '".$this->db->escape($this->owner_zip)."'"; $sql .= ",owner_town = '".$this->db->escape($this->owner_town)."'"; @@ -1035,8 +1026,8 @@ class Account extends CommonObject $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->address ? $this->address : $this->domiciliation)."'"; - $sql .= ",proprio = '".$this->db->escape($this->owner_name ? $this->owner_name : $this->proprio)."'"; + $sql .= ",domiciliation='".$this->db->escape($this->address)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",owner_zip = '".$this->db->escape($this->owner_zip)."'"; $sql .= ",owner_town = '".$this->db->escape($this->owner_town)."'"; @@ -1108,7 +1099,7 @@ class Account extends CommonObject $this->courant = $obj->type; $this->bank = $obj->bank; $this->clos = $obj->status; - $this->status = $obj->status; + $this->status = $obj->status; $this->rappro = $obj->rappro; $this->url = $obj->url; @@ -1118,16 +1109,17 @@ class Account extends CommonObject $this->cle_rib = $obj->cle_rib; $this->bic = $obj->bic; $this->iban = $obj->iban; - $this->domiciliation = $obj->address; $this->address = $obj->address; - $this->pti_in_ctti = $obj->pti_in_ctti; - $this->proprio = $obj->owner_name; + $this->owner_name = $obj->owner_name; + $this->proprio = $this->owner_name; $this->owner_address = $obj->owner_address; $this->owner_zip = $obj->owner_zip; $this->owner_town = $obj->owner_town; $this->owner_country_id = $obj->owner_country_id; + $this->pti_in_ctti = $obj->pti_in_ctti; + $this->state_id = $obj->state_id; $this->state_code = $obj->state_code; $this->state = $obj->state; @@ -1961,7 +1953,6 @@ class Account extends CommonObject $this->bank = 'MyBank'; $this->address = 'Rue de Paris'; - $this->proprio = 'Owner'; $this->owner_name = 'Owner'; $this->owner_address = 'Owner address'; $this->owner_zip = 'Owner zip'; diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 89919a8b1d5..5a4faa32e62 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1458,7 +1458,7 @@ class BonPrelevement extends CommonObject $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Example "FR78ZZZ123456" - $this->raison_sociale = $account->proprio; + $this->raison_sociale = $account->owner_name; } $this->factures = $factures_prev_id; $this->context['factures_prev'] = $factures_prev; @@ -2533,7 +2533,7 @@ class BonPrelevement extends CommonObject $this->emetteur_ics = (($type == 'bank-transfer' && getDolGlobalString("SEPA_USE_IDS")) ? $account->ics_transfer : $account->ics); // Ex: PRELEVEMENT_ICS = "FR78ZZZ123456"; - $this->raison_sociale = $account->proprio; + $this->raison_sociale = $account->owner_name; } // Get pending payments diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index ca60491f6d1..b1124c9ff8d 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -760,7 +760,7 @@ abstract class CommonDocGenerator $resarray[$array_key.'_bank_bic'] = (empty($bank_account) ? '' : $bank_account->bic); $resarray[$array_key.'_bank_label'] = (empty($bank_account) ? '' : $bank_account->label); $resarray[$array_key.'_bank_number'] = (empty($bank_account) ? '' : $bank_account->number); - $resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->proprio); + $resarray[$array_key.'_bank_proprio'] = (empty($bank_account) ? '' : $bank_account->owner_name); $resarray[$array_key.'_bank_address'] = (empty($bank_account) ? '' : $bank_account->address); $resarray[$array_key.'_bank_state'] = (empty($bank_account) ? '' : $bank_account->state); $resarray[$array_key.'_bank_country'] = (empty($bank_account) ? '' : $bank_account->country); diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 64d2223ec1e..52de45fcc92 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -1884,7 +1884,7 @@ abstract class CommonInvoice extends CommonObject // If a bank account is provided and we ask to use it as creditor, we use the bank address // TODO In a future, we may always use this address, and if name/address/zip/town/country differs from $mysoc, we can use the address of $mysoc into the final seller field ? $s .= "S\n"; - $s .= dol_trunc($bankaccount->proprio, 70, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc($bankaccount->owner_name, 70, 'right', 'UTF-8', 1)."\n"; $addresslinearray = explode("\n", $bankaccount->owner_address); $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 2532ccdfe8c..5401717a869 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -951,9 +951,9 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $pdf->SetFont('', '', $default_font_size - $diffsizecontent); - if (empty($onlynumber) && (!empty($account->domiciliation) || !empty($account->address))) { + if (empty($onlynumber) && !empty($account->address)) { $pdf->SetXY($curx, $cury); - $val = $outputlangs->transnoentities("Residence").': '.$outputlangs->convToOutputCharset(empty($account->address) ? $account->domiciliation : $account->address); + $val = $outputlangs->transnoentities("Residence").': '.$outputlangs->convToOutputCharset($account->address); $pdf->MultiCell(100, 3, $val, 0, 'L', 0); //$nboflines=dol_nboflines_bis($val,120); //$cury+=($nboflines*3)+2; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 58b96ef6057..f66206c50af 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -34,7 +34,7 @@ * @param string $chain string to encode * @param string $key rule to use for delta ('0', '1' or 'myownkey') * @return string encoded string - * @see dol_decode() + * @see dol_decode(), dolEncrypt() */ function dol_encode($chain, $key = '1') { @@ -65,7 +65,7 @@ function dol_encode($chain, $key = '1') * @param string $chain string to decode * @param string $key rule to use for delta ('0', '1' or 'myownkey') * @return string decoded string - * @see dol_encode() + * @see dol_encode(), dolDecrypt */ function dol_decode($chain, $key = '1') { diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index de620ae12d3..b688c5f2232 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1491,7 +1491,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->proprio), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 80d605a79ad..3d8db1970c6 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -708,21 +708,22 @@ if ($event->type == 'payout.created') { if ($idthirdparty > 0) { // If the payment mode attached is to a stripe account owned by an external customer in societe_account (so a thirdparty that has a Stripe account), // we can create the payment mode - $companypaymentmode->stripe_card_ref = $db->escape($event->data->object->id); + $companypaymentmode->stripe_card_ref = $event->data->object->id; $companypaymentmode->fk_soc = $idthirdparty; $companypaymentmode->bank = null; $companypaymentmode->label = ''; - $companypaymentmode->number = $db->escape($event->data->object->id); - $companypaymentmode->last_four = $db->escape($event->data->object->card->last4); - $companypaymentmode->card_type = $db->escape($event->data->object->card->branding); - $companypaymentmode->proprio = $db->escape($event->data->object->billing_details->name); - $companypaymentmode->exp_date_month = $db->escape($event->data->object->card->exp_month); - $companypaymentmode->exp_date_year = $db->escape($event->data->object->card->exp_year); + $companypaymentmode->number = $event->data->object->id; + $companypaymentmode->last_four = $event->data->object->card->last4; + $companypaymentmode->card_type = $event->data->object->card->branding; + $companypaymentmode->owner_name = $event->data->object->billing_details->name; + $companypaymentmode->proprio = $companypaymentmode->owner_name; // We still need this formodulebuilder because name of field is "proprio" + $companypaymentmode->exp_date_month = $event->data->object->card->exp_month; + $companypaymentmode->exp_date_year = $event->data->object->card->exp_year; $companypaymentmode->cvn = null; - $companypaymentmode->datec = $db->escape($event->data->object->created); + $companypaymentmode->datec = $event->data->object->created; $companypaymentmode->default_rib = 0; - $companypaymentmode->type = $db->escape($event->data->object->type); - $companypaymentmode->country_code = $db->escape($event->data->object->card->country); + $companypaymentmode->type = $event->data->object->type; + $companypaymentmode->country_code = $event->data->object->card->country; $companypaymentmode->status = $servicestatus; // TODO Check that a payment mode $companypaymentmode->stripe_card_ref does not exists yet to avoid to create duplicates diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 006eaad69c0..27196d2f086 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -390,9 +390,6 @@ class CompanyBankAccount extends Account return -1; } - 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); } @@ -413,9 +410,9 @@ class CompanyBankAccount extends Account $sql .= ",number='".$this->db->escape($this->number)."'"; $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->address ? $this->address : $this->domiciliation)."'"; - $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; + $sql .= ",iban_prefix = '".$this->db->escape(dolEncrypt($this->iban))."'"; + $sql .= ",domiciliation = '".$this->db->escape($this->address)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",default_rib = ".((int) $this->default_rib); if (isModEnabled('prelevement')) { @@ -517,11 +514,10 @@ class CompanyBankAccount extends Account $this->bic = $obj->bic; $this->iban = $obj->iban; - $this->domiciliation = $obj->address; $this->address = $obj->address; + $this->owner_name = $obj->owner_name; $this->proprio = $obj->owner_name; - $this->owner_name = $obj->owner_name; $this->owner_address = $obj->owner_address; $this->label = $obj->label; $this->default_rib = $obj->default_rib; diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index f8ac46a6598..c10425cba79 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -150,9 +150,16 @@ class CompanyPaymentMode extends CommonObject * @var string */ public $iban_prefix; + + /** @deprecated Use address */ public $domiciliation; + public $address; + /** @deprecated Use owner_name*/ public $proprio; + public $owner_name; + public $owner_address; + public $default_rib; public $rum; public $date_rum; diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 4ab780cfabf..5ccbee75eba 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -184,7 +184,6 @@ if (empty($reshook)) { $companybankaccount->iban = GETPOST('iban', 'alpha'); $companybankaccount->address = GETPOST('address', 'alpha'); - $companybankaccount->domiciliation = $companybankaccount->address; $companybankaccount->owner_name = GETPOST('proprio', 'alpha'); $companybankaccount->proprio = $companybankaccount->owner_name; @@ -254,7 +253,8 @@ if (empty($reshook)) { $companypaymentmode->label = GETPOST('label', 'alpha'); $companypaymentmode->number = GETPOST('cardnumber', 'alpha'); $companypaymentmode->last_four = substr(GETPOST('cardnumber', 'alpha'), -4); - $companypaymentmode->proprio = GETPOST('proprio', 'alpha'); + $companypaymentmode->owner_name = GETPOST('proprio', 'alpha'); + $companypaymentmode->proprio = $companypaymentmode->owner_name; $companypaymentmode->exp_date_month = GETPOSTINT('exp_date_month'); $companypaymentmode->exp_date_year = GETPOSTINT('exp_date_year'); $companypaymentmode->cvn = GETPOST('cvn', 'alpha'); @@ -315,10 +315,10 @@ if (empty($reshook)) { $companybankaccount->bic = GETPOST('bic', 'alpha'); $companybankaccount->iban = GETPOST('iban', 'alpha'); - $companybankaccount->domiciliation = GETPOST('address', 'alpha'); $companybankaccount->address = GETPOST('address', 'alpha'); - $companybankaccount->proprio = GETPOST('proprio', 'alpha'); + $companybankaccount->owner_name = GETPOST('proprio', 'alpha'); + $companybankaccount->proprio = $companybankaccount->owner_name; $companybankaccount->owner_address = GETPOST('owner_address', 'alpha'); $companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha'); $companybankaccount->rum = GETPOST('rum', 'alpha'); @@ -1276,8 +1276,8 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; // Information (Owner, ...) print ''; - if ($companypaymentmodetemp->proprio) { - print ''.$companypaymentmodetemp->proprio.'
'; + if ($companypaymentmodetemp->owner_name) { + print ''.$companypaymentmodetemp->owner_name.'
'; } if ($companypaymentmodetemp->last_four) { print '....'.$companypaymentmodetemp->last_four; @@ -1819,28 +1819,28 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print ''; print''; // Account number - print ''; + print ''; print ''; // IBAN - print ''; + print ''; //var_dump($src); print ''; // BIC - print ''; + print ''; //var_dump($src); print ''; if (isModEnabled('prelevement')) { // RUM - print ''; + print ''; //var_dump($src); print ''; // Date - print ''; + print ''; //var_dump($src); print ''; // Mode mandate - print ''; + print ''; //var_dump($src); print ''; } @@ -1889,6 +1889,9 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled('prelevement')) { $colspan += 3; } + if (!getDolGlobalInt('SOCIETE_DISABLE_BANKACCOUNT') && getDolGlobalInt("SOCIETE_RIB_ALLOW_ONLINESIGN")) { + $colspan++; + } print ''.$langs->trans("NoBANRecord").''; } @@ -2111,7 +2114,7 @@ if ($socid && $action == 'editcard' && $permissiontoaddupdatepaymentinformation) print ''; print ''.$langs->trans("NameOnCard").''; - print ''; + print ''; print ''.$langs->trans("CardNumber").''; print ''; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 89fa5273b88..3915a4b60ca 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -845,7 +845,7 @@ class Stripe extends CommonObject $card = null; - $sql = "SELECT sa.stripe_card_ref, sa.proprio, sa.exp_date_month, sa.exp_date_year, sa.number, sa.cvn"; // stripe_card_ref is card_.... + $sql = "SELECT sa.stripe_card_ref, sa.proprio as owner_name, sa.exp_date_month, sa.exp_date_year, sa.number, sa.cvn"; // stripe_card_ref is card_.... $sql .= " FROM ".MAIN_DB_PREFIX."societe_rib as sa"; $sql .= " WHERE sa.rowid = ".((int) $object->id); // We get record from ID, no need for filter on entity $sql .= " AND sa.type = 'card'"; @@ -885,7 +885,7 @@ class Stripe extends CommonObject $exp_date_year = $obj->exp_date_year; $number = $obj->number; $cvc = $obj->cvn; // cvn in database, cvc for stripe - $cardholdername = $obj->proprio; + $cardholdername = $obj->owner_name; $ipaddress = getUserRemoteIP(); diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 884874982cd..ea453dbe9ab 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -130,10 +130,10 @@ 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('address', 'alpha'); $account->address = GETPOST('address', 'alpha'); - $account->owner_name = GETPOST('proprio', 'alpha'); - $account->proprio = $account->owner_name; + + $account->owner_name = GETPOST('proprio', 'alpha'); + $account->proprio = $account->owner_name; $account->owner_address = GETPOST('owner_address', 'alpha'); $account->currency_code = trim(GETPOST("account_currency_code")); @@ -163,9 +163,9 @@ 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('address', 'alpha'); $account->address = GETPOST('address', 'alpha'); - $account->proprio = GETPOST('proprio', 'alpha'); + $account->owner_name = GETPOST('proprio', 'alpha'); + $account->proprio = $account->owner_name; $account->owner_address = GETPOST('owner_address', 'alpha'); $account->currency_code = trim(GETPOST("account_currency_code")); @@ -1018,7 +1018,7 @@ if ($id && ($action == 'edit' || $action == 'create') && $permissiontoaddbankacc print ""; print ''.$langs->trans("BankAccountOwner").''; - print ''; + print ''; print "\n"; print ''.$langs->trans("BankAccountOwnerAddress").''; diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index d9a65fb5212..b97e8bb0c4c 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -137,8 +137,8 @@ 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->address ? $this->address : $this->domiciliation)."'"; - $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; + $sql .= ",domiciliation='".$this->db->escape($this->address)."'"; + $sql .= ",proprio = '".$this->db->escape($this->owner_name)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",currency_code = '".$this->db->escape($this->currency_code)."'"; $sql .= ",state_id = ".($this->state_id > 0 ? ((int) $this->state_id) : "null"); @@ -227,12 +227,12 @@ class UserBankAccount extends Account $this->courant = self::TYPE_CURRENT; $this->type = self::TYPE_CURRENT; - $this->domiciliation = $obj->address; $this->address = $obj->address; - $this->proprio = $obj->owner_name; $this->owner_name = $obj->owner_name; + $this->proprio = $obj->owner_name; $this->owner_address = $obj->owner_address; + $this->label = $obj->label; $this->datec = $this->db->jdate($obj->datec); $this->datem = $this->db->jdate($obj->datem);