Merge branch '15.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-04-09 00:56:42 +02:00
commit b8c8d2af93
10 changed files with 56 additions and 17 deletions

View File

@ -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))
{

View File

@ -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 '</a>';
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("AmountToWithdraw").'</td>';
print '<tr class="oddeven"><td>'.$langs->trans("AmountToTransfer").'</td>';
print '<td class="right"><span class="amount">';
print price($bprev->SommeAPrelever('bank-transfer'), '', '', 1, -1, -1, 'auto');
print '</span></td></tr></table></div><br>';
@ -102,7 +102,7 @@ print '</span></td></tr></table></div><br>';
*/
$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 '<tr class="oddeven"><td>';
print $invoicestatic->getNomUrl(1, 'withdraw');
@ -159,7 +168,7 @@ if ($resql) {
print '</td>';
print '<td class="right">';
print price($obj->amount);
print '<span class="amount">'.price($obj->amount).'</span>';
print '</td>';
print '<td class="right">';

View File

@ -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 .= ")";

View File

@ -449,9 +449,17 @@ if ($resql) {
// RIB
print '<td>';
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 '</td>';

View File

@ -102,7 +102,7 @@ print '</span></td></tr></table></div><br>';
*/
$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 '<tr class="oddeven"><td>';
print $invoicestatic->getNomUrl(1, 'withdraw');
@ -158,7 +168,7 @@ if ($resql) {
print '</td>';
print '<td class="right">';
print price($obj->amount);
print '<span class="amount">'.price($obj->amount).'</span>';
print '</td>';
print '<td class="right">';

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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 '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&token='.newToken().'token='.newToken().'&id=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&token='.newToken().'&id=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
} else {
print '<div class="inline-block divButAction"><span class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">' . $langs->trans("AddCustomerPrice") . '</span></div>';
}

View File

@ -1469,7 +1469,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
if (!empty($conf->prelevement->enabled)) {
$colspan += 2;
}
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoBANRecord").'</td></tr>';
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoBANRecord").'</span></td></tr>';
}
print '</table>';