Merge pull request #3983 from grandoc/develop

[Qual] Uniformize code
This commit is contained in:
Laurent Destailleur 2015-11-16 23:31:40 +01:00
commit 66f24ff400
7 changed files with 61 additions and 61 deletions

View File

@ -140,7 +140,7 @@ if (empty($reshook))
header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result); header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
exit(); exit();
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }
} }
@ -156,7 +156,7 @@ if (empty($reshook))
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id); header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
exit(); exit();
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }
@ -180,7 +180,7 @@ if (empty($reshook))
header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php'); header('Location: ' . DOL_URL_ROOT . '/compta/facture/list.php');
exit(); exit();
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action=''; $action='';
} }
} }
@ -213,7 +213,7 @@ if (empty($reshook))
exit(); exit();
} }
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} }
} }
@ -235,13 +235,13 @@ if (empty($reshook))
if ($object->type == Facture::TYPE_CREDIT_NOTE) { if ($object->type == Facture::TYPE_CREDIT_NOTE) {
// Si avoir, le signe doit etre negatif // Si avoir, le signe doit etre negatif
if ($object->total_ht >= 0) { if ($object->total_ht >= 0) {
setEventMessage($langs->trans("ErrorInvoiceAvoirMustBeNegative"), 'errors'); setEventMessages($langs->trans("ErrorInvoiceAvoirMustBeNegative"), null, 'errors');
$action = ''; $action = '';
} }
} else { } else {
// Si non avoir, le signe doit etre positif // Si non avoir, le signe doit etre positif
if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) { if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) {
setEventMessage($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), 'errors'); setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors');
$action = ''; $action = '';
} }
} }
@ -311,7 +311,7 @@ if (empty($reshook))
$object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']); $object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']);
if ($object->date_lim_reglement < $object->date) { if ($object->date_lim_reglement < $object->date) {
$object->date_lim_reglement = $object->calculate_date_lim_reglement(); $object->date_lim_reglement = $object->calculate_date_lim_reglement();
setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), 'warnings'); setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings');
} }
$result = $object->update($user); $result = $object->update($user);
if ($result < 0) if ($result < 0)
@ -354,7 +354,7 @@ if (empty($reshook))
if ($ret > 0) { if ($ret > 0) {
$result = $object->insert_discount($_POST["remise_id"]); $result = $object->insert_discount($_POST["remise_id"]);
if ($result < 0) { if ($result < 0) {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} else { } else {
dol_print_error($db, $object->error); dol_print_error($db, $object->error);
@ -367,7 +367,7 @@ if (empty($reshook))
$result = $discount->link_to_invoice(0, $id); $result = $discount->link_to_invoice(0, $id);
if ($result < 0) { if ($result < 0) {
setEventMessage($discount->error, 'errors'); setEventMessages($discount->error, $discount->errors, 'errors');
} }
} }
} }
@ -449,7 +449,7 @@ if (empty($reshook))
else else
{ {
if (count($object->errors)) setEventMessage($object->errors, 'errors'); if (count($object->errors)) setEventMessage($object->errors, 'errors');
else setEventMessage($object->error, 'errors'); else setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }
@ -477,7 +477,7 @@ if (empty($reshook))
{ {
if (! $idwarehouse || $idwarehouse == - 1) { if (! $idwarehouse || $idwarehouse == - 1) {
$error ++; $error ++;
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
$action = ''; $action = '';
} }
} }
@ -511,7 +511,7 @@ if (empty($reshook))
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0) if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0)
{ {
$result=$object->set_draft($user, $idwarehouse); $result=$object->set_draft($user, $idwarehouse);
if ($result<0) setEventMessage($object->error,'errors'); if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
// Define output language // Define output language
@ -539,7 +539,7 @@ if (empty($reshook))
{ {
$object->fetch($id); $object->fetch($id);
$result = $object->set_paid($user); $result = $object->set_paid($user);
if ($result<0) setEventMessage($object->error,'errors'); if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
} // Classif "paid partialy" } // Classif "paid partialy"
else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement) else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement)
{ {
@ -548,7 +548,7 @@ if (empty($reshook))
$close_note = $_POST["close_note"]; $close_note = $_POST["close_note"];
if ($close_code) { if ($close_code) {
$result = $object->set_paid($user, $close_code, $close_note); $result = $object->set_paid($user, $close_code, $close_note);
if ($result<0) setEventMessage($object->error,'errors'); if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
} }
@ -559,7 +559,7 @@ if (empty($reshook))
$close_note = $_POST["close_note"]; $close_note = $_POST["close_note"];
if ($close_code) { if ($close_code) {
$result = $object->set_canceled($user, $close_code, $close_note); $result = $object->set_canceled($user, $close_code, $close_note);
if ($result<0) setEventMessage($object->error,'errors'); if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
} else { } else {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
} }
@ -603,7 +603,7 @@ if (empty($reshook))
elseif ($object->type == Facture::TYPE_DEPOSIT) elseif ($object->type == Facture::TYPE_DEPOSIT)
$discount->description = '(DEPOSIT)'; $discount->description = '(DEPOSIT)';
else { else {
setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors'); setEventMessages($langs->trans('CantConvertToReducAnInvoiceOfThisType'), null, 'errors');
} }
$discount->tva_tx = abs($object->total_ttc); $discount->tva_tx = abs($object->total_ttc);
$discount->fk_soc = $object->socid; $discount->fk_soc = $object->socid;
@ -636,13 +636,13 @@ if (empty($reshook))
} }
else else
{ {
setEventMessage($object->error,'errors'); setEventMessages($object->error, $object->errors, 'errors');
$db->rollback(); $db->rollback();
} }
} }
else else
{ {
setEventMessage($discount->error,'errors'); setEventMessages($discount->error, $discount->errors, 'errors');
$db->rollback(); $db->rollback();
} }
} }
@ -705,7 +705,7 @@ if (empty($reshook))
$id = $object->createFromCurrent($user); $id = $object->createFromCurrent($user);
if ($id <= 0) { if ($id <= 0) {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }
@ -979,7 +979,7 @@ if (empty($reshook))
$amountdeposit = ($totalamount * $valuedeposit) / 100; $amountdeposit = ($totalamount * $valuedeposit) / 100;
} }
} else { } else {
setEventMessage($srcobject->error, 'errors'); setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++; $error ++;
} }
} }
@ -1119,12 +1119,12 @@ if (empty($reshook))
if ($reshook < 0) if ($reshook < 0)
$error ++; $error ++;
} else { } else {
setEventMessage($srcobject->error, 'errors'); setEventMessages($srcobject->error, $srcobject->errors, 'errors');
$error ++; $error ++;
} }
} }
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$error ++; $error ++;
} }
} // If some invoice's lines already known } // If some invoice's lines already known
@ -1237,11 +1237,11 @@ if (empty($reshook))
} }
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++; $error ++;
} }
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
$error ++; $error ++;
} }
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not ''
@ -1250,16 +1250,16 @@ if (empty($reshook))
$error ++; $error ++;
} }
if ($qty == '') { if ($qty == '') {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error ++; $error ++;
} }
if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) { if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) {
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
$error ++; $error ++;
} }
if ($qty < 0) { if ($qty < 0) {
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors'); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++; $error ++;
} }
if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) {
@ -1413,7 +1413,7 @@ if (empty($reshook))
if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) { if (! empty($price_min) && (price2num($pu_ht) * (1 - price2num($remise_percent) / 100) < price2num($price_min))) {
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
setEventMessage($mesg, 'errors'); setEventMessages($mesg, null, 'errors');
} else { } else {
// Insert line // Insert line
$result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit); $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $date_start, $date_end, 0, $info_bits, '', $price_base_type, $pu_ttc, $type, - 1, $special_code, '', 0, GETPOST('fk_parent_line'), $fournprice, $buyingprice, $label, $array_options, $_POST['progress'], '', $fk_unit);
@ -1473,7 +1473,7 @@ if (empty($reshook))
unset($_POST['situations']); unset($_POST['situations']);
unset($_POST['progress']); unset($_POST['progress']);
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
$action = ''; $action = '';
@ -1555,7 +1555,7 @@ if (empty($reshook))
// Check price is not lower than minimum (check is done only for standard or replacement invoices) // Check price is not lower than minimum (check is done only for standard or replacement invoices)
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) {
setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors'); setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error ++; $error ++;
} }
} else { } else {
@ -1570,7 +1570,7 @@ if (empty($reshook))
} }
if ($qty < 0) { if ($qty < 0) {
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors'); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error ++; $error ++;
} }
@ -1634,7 +1634,7 @@ if (empty($reshook))
unset($_POST['situations']); unset($_POST['situations']);
unset($_POST['progress']); unset($_POST['progress']);
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} }
@ -1728,8 +1728,8 @@ if (empty($reshook))
$upload_dir = $conf->facture->dir_output; $upload_dir = $conf->facture->dir_output;
$file = $upload_dir . '/' . GETPOST('file'); $file = $upload_dir . '/' . GETPOST('file');
$ret = dol_delete_file($file, 0, 0, 0, $object); $ret = dol_delete_file($file, 0, 0, 0, $object);
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
$action = ''; $action = '';
} }
} elseif ($action == 'update_extras') { } elseif ($action == 'update_extras') {
@ -1775,9 +1775,9 @@ if (empty($reshook))
} else { } else {
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("errors"); $langs->load("errors");
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors'); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
} else { } else {
setEventMessage($object->error, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
} // bascule du statut d'un contact } // bascule du statut d'un contact
@ -2387,7 +2387,7 @@ if ($action == 'create')
$cntinvoice=count($objectsrc->linkedObjects['facture']); $cntinvoice=count($objectsrc->linkedObjects['facture']);
if ($cntinvoice>=1) if ($cntinvoice>=1)
{ {
setEventMessage('WarningBillExist','warnings'); setEventMessages('WarningBillExist', null, 'warnings');
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')'; echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
} }
echo '</td></tr>'; echo '</td></tr>';

View File

@ -118,7 +118,7 @@ if (empty($reshook))
{ {
$langs->load("errors"); $langs->load("errors");
//$error++; //$error++;
setEventMessage($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), 'warnings'); setEventMessages($langs->transnoentities("WarningPaymentDateLowerThanInvoiceDate", dol_print_date($datepaye,'day'), dol_print_date($tmpinvoice->date, 'day'), $tmpinvoice->ref), null, 'warnings');
} }
} }
@ -129,7 +129,7 @@ if (empty($reshook))
// Check parameters // Check parameters
if (! GETPOST('paiementcode')) if (! GETPOST('paiementcode'))
{ {
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors'); setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), null, 'errors');
$error++; $error++;
} }
@ -138,20 +138,20 @@ if (empty($reshook))
// If bank module is on, account is required to enter a payment // If bank module is on, account is required to enter a payment
if (GETPOST('accountid') <= 0) if (GETPOST('accountid') <= 0)
{ {
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors'); setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors');
$error++; $error++;
} }
} }
if (empty($totalpayment) && empty($atleastonepaymentnotnull)) if (empty($totalpayment) && empty($atleastonepaymentnotnull))
{ {
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors'); setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), null, 'errors');
$error++; $error++;
} }
if (empty($datepaye)) if (empty($datepaye))
{ {
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors'); setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors');
$error++; $error++;
} }
} }
@ -194,7 +194,7 @@ if (empty($reshook))
// Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement // Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement
if (GETPOST('accountid') <= 0) if (GETPOST('accountid') <= 0)
{ {
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors'); setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors');
$error++; $error++;
} }
} }
@ -212,7 +212,7 @@ if (empty($reshook))
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0)); $paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0));
if ($paiement_id < 0) if ($paiement_id < 0)
{ {
setEventMessage($paiement->error, 'errors'); setEventMessages($paiement->error, $paiement->errors, 'errors');
$error++; $error++;
} }
} }
@ -224,7 +224,7 @@ if (empty($reshook))
$result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),GETPOST('chqemetteur'),GETPOST('chqbank')); $result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),GETPOST('chqemetteur'),GETPOST('chqbank'));
if ($result < 0) if ($result < 0)
{ {
setEventMessage($paiement->error, 'errors'); setEventMessages($paiement->error, $paiement->errors, 'errors');
$error++; $error++;
} }
} }

View File

@ -70,7 +70,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char
} }
else else
{ {
setEventMessage($paiement->error, 'errors'); setEventMessages($paiement->error, $paiement->errors, 'errors');
$db->rollback(); $db->rollback();
} }
} }
@ -108,7 +108,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char
} }
else else
{ {
setEventMessage($paiement->error); setEventMessages($paiement->error, $paiement->errors, 'errors');
$db->rollback(); $db->rollback();
} }
} }
@ -140,7 +140,7 @@ $h++;
dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, 'payment'); dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, 'payment');
/* /*
* Confirmation de la suppression du paiement * Deletion confirmation of payment
*/ */
if ($action == 'delete') if ($action == 'delete')
{ {
@ -149,7 +149,7 @@ if ($action == 'delete')
} }
/* /*
* Confirmation de la validation du paiement * Validation confirmation of payment
*/ */
if ($action == 'valide') if ($action == 'valide')
{ {

View File

@ -68,7 +68,7 @@ if ($action == 'confirm_rejet')
{ {
$error++; $error++;
$langs->load("error"); $langs->load("error");
setEventMessage($langs->transnoentities("ErrorDateMustBeBeforeToday"),'errors'); setEventMessages($langs->transnoentities("ErrorDateMustBeBeforeToday"), null, 'errors');
} }
if (GETPOST('motif','alpha') == 0) if (GETPOST('motif','alpha') == 0)
@ -261,7 +261,7 @@ if ($id)
if ($sortfield == "") $sortfield="pl.fk_soc"; if ($sortfield == "") $sortfield="pl.fk_soc";
/* /*
* Liste des factures * List of invoices
*/ */
$sql = "SELECT pf.rowid"; $sql = "SELECT pf.rowid";
$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc, f.paye, f.fk_statut"; $sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc, f.paye, f.fk_statut";

View File

@ -166,18 +166,18 @@ if ($action == 'delete')
{ {
$object->error=$accountline->error; $object->error=$accountline->error;
$db->rollback(); $db->rollback();
setEventMessage($object->error,'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
{ {
$db->rollback(); $db->rollback();
setEventMessage($object->error,'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
} }
else else
{ {
setEventMessage('Error try do delete a line linked to a conciliated bank transaction','errors'); setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors');
} }
} }

View File

@ -103,7 +103,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
} }
elseif (! is_numeric($amount)) elseif (! is_numeric($amount))
{ {
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors'); setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), null, 'errors');
$action = 'create'; $action = 'create';
} }
else else
@ -148,7 +148,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
} }
elseif (! is_numeric($amount)) elseif (! is_numeric($amount))
{ {
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors'); setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), null, 'errors');
$action = 'create'; $action = 'create';
} }
else else
@ -164,7 +164,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
$result=$chargesociales->update($user); $result=$chargesociales->update($user);
if ($result <= 0) if ($result <= 0)
{ {
setEventMessage($chargesociales->error, 'errors'); setEventMessages($chargesociales->error, $chargesociales->errors, 'errors');
} }
} }
} }

View File

@ -114,7 +114,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
else else
{ {
$db->rollback(); $db->rollback();
setEventMessage($tva->error, 'errors'); setEventMessages($tva->error, $tva->errors, 'errors');
$action="create"; $action="create";
} }
} }
@ -150,18 +150,18 @@ if ($action == 'delete')
{ {
$tva->error=$accountline->error; $tva->error=$accountline->error;
$db->rollback(); $db->rollback();
setEventMessage($tva->error,'errors'); setEventMessages($tva->error, $tva->errors, 'errors');
} }
} }
else else
{ {
$db->rollback(); $db->rollback();
setEventMessage($tva->error,'errors'); setEventMessages($tva->error, $tva->errors, 'errors');
} }
} }
else else
{ {
setEventMessage('Error try do delete a line linked to a conciliated bank transaction','errors'); setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors');
} }
} }