diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 324800910da..f01e74a0cf4 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1453,9 +1453,13 @@ class Account extends CommonObject
// Call function to check BAN
- if (!checkIbanForAccount($this) || !checkSwiftForAccount($this)) {
+ if (!checkIbanForAccount($this)) {
$this->error_number = 12;
- $this->error_message = 'IBANSWIFTControlError';
+ $this->error_message = 'IBANNotValid';
+ }
+ if (!checkSwiftForAccount($this)) {
+ $this->error_number = 12;
+ $this->error_message = 'SwiftNotValid';
}
/*if (! checkBanForAccount($this))
{
diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php
index b8675b3a7e5..6c14987e5ba 100644
--- a/htdocs/compta/paymentbybanktransfer/index.php
+++ b/htdocs/compta/paymentbybanktransfer/index.php
@@ -66,7 +66,7 @@ if (prelevement_check_config('bank-transfer') < 0) {
$newcardbutton = '';
if ($usercancreate) {
- $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type=bank-transfer');
+ $newcardbutton .= dolGetButtonTitle($langs->trans('NewPaymentByBankTransfer'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type=bank-transfer');
}
print load_fiche_titre($langs->trans("SuppliersStandingOrdersArea"), $newcardbutton);
@@ -90,7 +90,7 @@ print $bprev->nbOfInvoiceToPay('bank-transfer');
print '';
print '';
-print '
| '.$langs->trans("AmountToWithdraw").' | ';
+print '
| '.$langs->trans("AmountToTransfer").' | ';
print '';
print price($bprev->SommeAPrelever('bank-transfer'), '', '', 1, -1, -1, 'auto');
print ' |
';
@@ -102,7 +102,7 @@ print '
';
*/
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
$sql .= " pfd.date_demande, pfd.amount,";
-$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra";
+$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (empty($user->rights->societe->client->voir) && !$socid) {
@@ -149,6 +149,15 @@ if ($resql) {
$thirdpartystatic->name = $obj->name;
$thirdpartystatic->email = $obj->email;
$thirdpartystatic->tva_intra = $obj->tva_intra;
+ $thirdpartystatic->siren = $obj->idprof1;
+ $thirdpartystatic->siret = $obj->idprof2;
+ $thirdpartystatic->ape = $obj->idprof3;
+ $thirdpartystatic->idprof1 = $obj->idprof1;
+ $thirdpartystatic->idprof2 = $obj->idprof2;
+ $thirdpartystatic->idprof3 = $obj->idprof3;
+ $thirdpartystatic->idprof4 = $obj->idprof4;
+ $thirdpartystatic->idprof5 = $obj->idprof5;
+ $thirdpartystatic->idprof6 = $obj->idprof6;
print '| ';
print $invoicestatic->getNomUrl(1, 'withdraw');
@@ -159,7 +168,7 @@ if ($resql) {
print ' | ';
print '';
- print price($obj->amount);
+ print ''.price($obj->amount).'';
print ' | ';
print '';
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index 6181bafdca8..36d3afd42ad 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -920,7 +920,7 @@ class BonPrelevement extends CommonObject
if (!$error) {
$ref = substr($year, -2).$month;
- $sql = "SELECT substring(ref from char_length(ref) - 1)";
+ $sql = "SELECT substring(ref from char_length(ref) - 1)"; // To extract "YYMMXX" from "TYYMMXX"
$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons";
$sql .= " WHERE ref LIKE '%".$this->db->escape($ref)."%'";
$sql .= " AND entity = ".((int) $conf->entity);
@@ -931,8 +931,14 @@ class BonPrelevement extends CommonObject
if ($resql) {
$row = $this->db->fetch_row($resql);
- $ref = "T".$ref.str_pad(dol_substr("00".intval($row[0]) + 1, 0, 2), 2, "0", STR_PAD_LEFT);
+ // Build the new ref
+ $ref = "T".$ref.str_pad(dol_substr("00".(intval($row[0]) + 1), 0, 2), 2, "0", STR_PAD_LEFT);
+
+ // $conf->abc->dir_output may be:
+ // /home/ldestailleur/git/dolibarr_15.0/documents/abc/
+ // or
+ // /home/ldestailleur/git/dolibarr_15.0/documents/X/abc with X >= 2 with multicompany.
if ($type != 'bank-transfer') {
$dir = $conf->prelevement->dir_output.'/receipts';
} else {
@@ -949,7 +955,7 @@ class BonPrelevement extends CommonObject
$sql .= "ref, entity, datec, type";
$sql .= ") VALUES (";
$sql .= "'".$this->db->escape($ref)."'";
- $sql .= ", ".$conf->entity;
+ $sql .= ", ".((int) $conf->entity);
$sql .= ", '".$this->db->idate($now)."'";
$sql .= ", '".($type == 'bank-transfer' ? 'bank-transfer' : 'debit-order')."'";
$sql .= ")";
diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php
index 3f00a4f0660..1049ce4cf1a 100644
--- a/htdocs/compta/prelevement/create.php
+++ b/htdocs/compta/prelevement/create.php
@@ -449,9 +449,17 @@ if ($resql) {
// RIB
print ' | ';
- print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
- if ($bac->verif() <= 0) {
- print img_warning('Error on default bank number for IBAN : '.$bac->error_message);
+ if ($bac->id > 0) {
+ if (!empty($bac->iban) || !empty($bac->bic)) {
+ print $bac->iban.(($bac->iban && $bac->bic) ? ' / ' : '').$bac->bic;
+ if ($bac->verif() <= 0) {
+ print img_warning('Error on default bank number for IBAN : '.$langs->trans($bac->error_message));
+ }
+ } else {
+ print img_warning($langs->trans("IBANNotDefined"));
+ }
+ } else {
+ print img_warning($langs->trans("NoBankAccountDefined"));
}
print ' | ';
diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php
index 4aef7e8b9e4..fc640eccc1c 100644
--- a/htdocs/compta/prelevement/index.php
+++ b/htdocs/compta/prelevement/index.php
@@ -102,7 +102,7 @@ print '
';
*/
$sql = "SELECT f.ref, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
$sql .= " pfd.date_demande, pfd.amount,";
-$sql .= " s.nom as name, s.email, s.rowid as socid";
+$sql .= " s.nom as name, s.email, s.rowid as socid, s.tva_intra, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
if (empty($user->rights->societe->client->voir) && !$socid) {
@@ -148,6 +148,16 @@ if ($resql) {
$thirdpartystatic->id = $obj->socid;
$thirdpartystatic->name = $obj->name;
$thirdpartystatic->email = $obj->email;
+ $thirdpartystatic->tva_intra = $obj->tva_intra;
+ $thirdpartystatic->siren = $obj->idprof1;
+ $thirdpartystatic->siret = $obj->idprof2;
+ $thirdpartystatic->ape = $obj->idprof3;
+ $thirdpartystatic->idprof1 = $obj->idprof1;
+ $thirdpartystatic->idprof2 = $obj->idprof2;
+ $thirdpartystatic->idprof3 = $obj->idprof3;
+ $thirdpartystatic->idprof4 = $obj->idprof4;
+ $thirdpartystatic->idprof5 = $obj->idprof5;
+ $thirdpartystatic->idprof6 = $obj->idprof6;
print '| ';
print $invoicestatic->getNomUrl(1, 'withdraw');
@@ -158,7 +168,7 @@ if ($resql) {
print ' | ';
print '';
- print price($obj->amount);
+ print ''.price($obj->amount).'';
print ' | ';
print '';
diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang
index eb25d563f62..9d145ef354d 100644
--- a/htdocs/langs/en_US/withdrawals.lang
+++ b/htdocs/langs/en_US/withdrawals.lang
@@ -31,6 +31,7 @@ SupplierInvoiceWaitingWithdraw=Vendor invoice waiting for payment by credit tran
InvoiceWaitingWithdraw=Invoice waiting for direct debit
InvoiceWaitingPaymentByBankTransfer=Invoice waiting for credit transfer
AmountToWithdraw=Amount to withdraw
+AmountToTransfer=Amount to transfer
NoInvoiceToWithdraw=No invoice open for '%s' is waiting. Go on tab '%s' on invoice card to make a request.
NoSupplierInvoiceToWithdraw=No supplier invoice with open 'Direct credit requests' is waiting. Go on tab '%s' on invoice card to make a request.
ResponsibleUser=User Responsible
diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang
index fae9c7e2f78..03b60e71bca 100644
--- a/htdocs/langs/fr_FR/withdrawals.lang
+++ b/htdocs/langs/fr_FR/withdrawals.lang
@@ -31,6 +31,7 @@ SupplierInvoiceWaitingWithdraw=Facture fournisseur en attente de paiement par vi
InvoiceWaitingWithdraw=Factures en attente de prélèvement
InvoiceWaitingPaymentByBankTransfer=Facture en attente de virement
AmountToWithdraw=Somme à prélever
+AmountToTransfer=Somme à transferrer
NoInvoiceToWithdraw=Aucune facture ouverte pour '%s' n'est en attente. Allez sur l'onglet '%s' sur la facture pour faire une demande.
NoSupplierInvoiceToWithdraw=Aucune facture fournisseur avec des demandes de virement ouvertes n'est en attente. Allez sur l'onglet '%s' sur la fiche facture pour faire une demande.
ResponsibleUser=Utilisateur responsable
diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php
index d1040364182..aa213461e24 100644
--- a/htdocs/modulebuilder/template/myobject_document.php
+++ b/htdocs/modulebuilder/template/myobject_document.php
@@ -132,7 +132,7 @@ if ($enablepermissioncheck) {
$permissiontoadd = $user->rights->mymodule->myobject->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
} else {
$permissiontoread = 1;
- $permission = 1;
+ $permissiontoadd = 1;
}
// Security check (enable the most restrictive one)
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 42066170f17..47322e2c692 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1298,7 +1298,7 @@ if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $a
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
- print '';
+ print '';
} else {
print ' ' . $langs->trans("AddCustomerPrice") . ' ';
}
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index 06397108da5..96409faf2f9 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -1469,7 +1469,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (!empty($conf->prelevement->enabled)) {
$colspan += 2;
}
- print ' |
| '.$langs->trans("NoBANRecord").' |
';
+ print '| '.$langs->trans("NoBANRecord").' |
';
}
print '';