[Qual] Uniformize code
This commit is contained in:
parent
c2ec4a4fd2
commit
f308606ee1
@ -140,7 +140,7 @@ if (empty($reshook))
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $result);
|
||||
exit();
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
@ -156,7 +156,7 @@ if (empty($reshook))
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?facid=' . $id);
|
||||
exit();
|
||||
} 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');
|
||||
exit();
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action='';
|
||||
}
|
||||
}
|
||||
@ -213,7 +213,7 @@ if (empty($reshook))
|
||||
exit();
|
||||
}
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
@ -235,13 +235,13 @@ if (empty($reshook))
|
||||
if ($object->type == Facture::TYPE_CREDIT_NOTE) {
|
||||
// Si avoir, le signe doit etre negatif
|
||||
if ($object->total_ht >= 0) {
|
||||
setEventMessage($langs->trans("ErrorInvoiceAvoirMustBeNegative"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorInvoiceAvoirMustBeNegative"), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
} else {
|
||||
// Si non avoir, le signe doit etre positif
|
||||
if (empty($conf->global->FACTURE_ENABLE_NEGATIVE) && $object->total_ht < 0) {
|
||||
setEventMessage($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorInvoiceOfThisTypeMustBePositive"), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
@ -311,7 +311,7 @@ if (empty($reshook))
|
||||
$object->date_lim_reglement = dol_mktime(12, 0, 0, $_POST['paymenttermmonth'], $_POST['paymenttermday'], $_POST['paymenttermyear']);
|
||||
if ($object->date_lim_reglement < $object->date) {
|
||||
$object->date_lim_reglement = $object->calculate_date_lim_reglement();
|
||||
setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), 'warnings');
|
||||
setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings');
|
||||
}
|
||||
$result = $object->update($user);
|
||||
if ($result < 0)
|
||||
@ -354,7 +354,7 @@ if (empty($reshook))
|
||||
if ($ret > 0) {
|
||||
$result = $object->insert_discount($_POST["remise_id"]);
|
||||
if ($result < 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
dol_print_error($db, $object->error);
|
||||
@ -367,7 +367,7 @@ if (empty($reshook))
|
||||
|
||||
$result = $discount->link_to_invoice(0, $id);
|
||||
if ($result < 0) {
|
||||
setEventMessage($discount->error, 'errors');
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -449,7 +449,7 @@ if (empty($reshook))
|
||||
else
|
||||
{
|
||||
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) {
|
||||
$error ++;
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("Warehouse")), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
}
|
||||
@ -511,7 +511,7 @@ if (empty($reshook))
|
||||
if ($resteapayer == $object->total_ttc && $object->paye == 0 && $ventilExportCompta == 0)
|
||||
{
|
||||
$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
|
||||
@ -539,7 +539,7 @@ if (empty($reshook))
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result = $object->set_paid($user);
|
||||
if ($result<0) setEventMessage($object->error,'errors');
|
||||
if ($result<0) setEventMessages($object->error, $object->errors, 'errors');
|
||||
} // Classif "paid partialy"
|
||||
else if ($action == 'confirm_paid_partially' && $confirm == 'yes' && $user->rights->facture->paiement)
|
||||
{
|
||||
@ -548,7 +548,7 @@ if (empty($reshook))
|
||||
$close_note = $_POST["close_note"];
|
||||
if ($close_code) {
|
||||
$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 {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
|
||||
}
|
||||
@ -559,7 +559,7 @@ if (empty($reshook))
|
||||
$close_note = $_POST["close_note"];
|
||||
if ($close_code) {
|
||||
$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 {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Reason")), null, 'errors');
|
||||
}
|
||||
@ -603,7 +603,7 @@ if (empty($reshook))
|
||||
elseif ($object->type == Facture::TYPE_DEPOSIT)
|
||||
$discount->description = '(DEPOSIT)';
|
||||
else {
|
||||
setEventMessage($langs->trans('CantConvertToReducAnInvoiceOfThisType'),'errors');
|
||||
setEventMessages($langs->trans('CantConvertToReducAnInvoiceOfThisType'), null, 'errors');
|
||||
}
|
||||
$discount->tva_tx = abs($object->total_ttc);
|
||||
$discount->fk_soc = $object->socid;
|
||||
@ -636,13 +636,13 @@ if (empty($reshook))
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($discount->error,'errors');
|
||||
setEventMessages($discount->error, $discount->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -705,7 +705,7 @@ if (empty($reshook))
|
||||
|
||||
$id = $object->createFromCurrent($user);
|
||||
if ($id <= 0) {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -979,7 +979,7 @@ if (empty($reshook))
|
||||
$amountdeposit = ($totalamount * $valuedeposit) / 100;
|
||||
}
|
||||
} else {
|
||||
setEventMessage($srcobject->error, 'errors');
|
||||
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
@ -1119,12 +1119,12 @@ if (empty($reshook))
|
||||
if ($reshook < 0)
|
||||
$error ++;
|
||||
} else {
|
||||
setEventMessage($srcobject->error, 'errors');
|
||||
setEventMessages($srcobject->error, $srcobject->errors, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
} // If some invoice's lines already known
|
||||
@ -1237,11 +1237,11 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
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 ++;
|
||||
}
|
||||
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 ++;
|
||||
}
|
||||
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 ++;
|
||||
}
|
||||
if ($qty == '') {
|
||||
setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
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 ++;
|
||||
}
|
||||
if ($qty < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
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))) {
|
||||
$mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency));
|
||||
setEventMessage($mesg, 'errors');
|
||||
setEventMessages($mesg, null, 'errors');
|
||||
} else {
|
||||
// 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);
|
||||
@ -1473,7 +1473,7 @@ if (empty($reshook))
|
||||
unset($_POST['situations']);
|
||||
unset($_POST['progress']);
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
|
||||
$action = '';
|
||||
@ -1555,7 +1555,7 @@ if (empty($reshook))
|
||||
|
||||
// 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))) {
|
||||
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 ++;
|
||||
}
|
||||
} else {
|
||||
@ -1570,7 +1570,7 @@ if (empty($reshook))
|
||||
}
|
||||
if ($qty < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), 'errors');
|
||||
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
|
||||
$error ++;
|
||||
}
|
||||
|
||||
@ -1634,7 +1634,7 @@ if (empty($reshook))
|
||||
unset($_POST['situations']);
|
||||
unset($_POST['progress']);
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1728,8 +1728,8 @@ if (empty($reshook))
|
||||
$upload_dir = $conf->facture->dir_output;
|
||||
$file = $upload_dir . '/' . GETPOST('file');
|
||||
$ret = dol_delete_file($file, 0, 0, 0, $object);
|
||||
if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile')));
|
||||
else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors');
|
||||
if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
$action = '';
|
||||
}
|
||||
} elseif ($action == 'update_extras') {
|
||||
@ -1775,9 +1775,9 @@ if (empty($reshook))
|
||||
} else {
|
||||
if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
|
||||
$langs->load("errors");
|
||||
setEventMessage($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), 'errors');
|
||||
setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors');
|
||||
} else {
|
||||
setEventMessage($object->error, 'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} // bascule du statut d'un contact
|
||||
@ -2387,7 +2387,7 @@ if ($action == 'create')
|
||||
$cntinvoice=count($objectsrc->linkedObjects['facture']);
|
||||
if ($cntinvoice>=1)
|
||||
{
|
||||
setEventMessage('WarningBillExist','warnings');
|
||||
setEventMessages('WarningBillExist', null, 'warnings');
|
||||
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
|
||||
}
|
||||
echo '</td></tr>';
|
||||
|
||||
@ -118,7 +118,7 @@ if (empty($reshook))
|
||||
{
|
||||
$langs->load("errors");
|
||||
//$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
|
||||
if (! GETPOST('paiementcode'))
|
||||
{
|
||||
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), 'errors');
|
||||
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('PaymentMode')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -138,20 +138,20 @@ if (empty($reshook))
|
||||
// If bank module is on, account is required to enter a payment
|
||||
if (GETPOST('accountid') <= 0)
|
||||
{
|
||||
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
|
||||
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($totalpayment) && empty($atleastonepaymentnotnull))
|
||||
{
|
||||
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), 'errors');
|
||||
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->trans('PaymentAmount')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (empty($datepaye))
|
||||
{
|
||||
setEventMessage($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), 'errors');
|
||||
setEventMessages($langs->transnoentities('ErrorFieldRequired',$langs->transnoentities('Date')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -194,7 +194,7 @@ if (empty($reshook))
|
||||
// Si module bank actif, un compte est obligatoire lors de la saisie d'un paiement
|
||||
if (GETPOST('accountid') <= 0)
|
||||
{
|
||||
setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), 'errors');
|
||||
setEventMessages($langs->trans('ErrorFieldRequired',$langs->transnoentities('AccountToCredit')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -212,7 +212,7 @@ if (empty($reshook))
|
||||
$paiement_id = $paiement->create($user, (GETPOST('closepaidinvoices')=='on'?1:0));
|
||||
if ($paiement_id < 0)
|
||||
{
|
||||
setEventMessage($paiement->error, 'errors');
|
||||
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -224,7 +224,7 @@ if (empty($reshook))
|
||||
$result=$paiement->addPaymentToBank($user,'payment',$label,GETPOST('accountid'),GETPOST('chqemetteur'),GETPOST('chqbank'));
|
||||
if ($result < 0)
|
||||
{
|
||||
setEventMessage($paiement->error, 'errors');
|
||||
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($paiement->error, 'errors');
|
||||
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -108,7 +108,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char
|
||||
}
|
||||
else
|
||||
{
|
||||
setEventMessage($paiement->error);
|
||||
setEventMessages($paiement->error, $paiement->errors, 'errors');
|
||||
$db->rollback();
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ $h++;
|
||||
dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0, 'payment');
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression du paiement
|
||||
* Deletion confirmation of payment
|
||||
*/
|
||||
if ($action == 'delete')
|
||||
{
|
||||
@ -149,7 +149,7 @@ if ($action == 'delete')
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de la validation du paiement
|
||||
* Validation confirmation of payment
|
||||
*/
|
||||
if ($action == 'valide')
|
||||
{
|
||||
|
||||
@ -68,7 +68,7 @@ if ($action == 'confirm_rejet')
|
||||
{
|
||||
$error++;
|
||||
$langs->load("error");
|
||||
setEventMessage($langs->transnoentities("ErrorDateMustBeBeforeToday"),'errors');
|
||||
setEventMessages($langs->transnoentities("ErrorDateMustBeBeforeToday"), null, 'errors');
|
||||
}
|
||||
|
||||
if (GETPOST('motif','alpha') == 0)
|
||||
@ -261,7 +261,7 @@ if ($id)
|
||||
if ($sortfield == "") $sortfield="pl.fk_soc";
|
||||
|
||||
/*
|
||||
* Liste des factures
|
||||
* List of invoices
|
||||
*/
|
||||
$sql = "SELECT pf.rowid";
|
||||
$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc, f.paye, f.fk_statut";
|
||||
|
||||
@ -166,18 +166,18 @@ if ($action == 'delete')
|
||||
{
|
||||
$object->error=$accountline->error;
|
||||
$db->rollback();
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($object->error,'errors');
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -103,7 +103,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer)
|
||||
}
|
||||
elseif (! is_numeric($amount))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), null, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
else
|
||||
@ -148,7 +148,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
||||
}
|
||||
elseif (! is_numeric($amount))
|
||||
{
|
||||
setEventMessage($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), 'errors');
|
||||
setEventMessages($langs->trans("ErrorFieldMustBeANumeric",$langs->transnoentities("Amount")), null, 'errors');
|
||||
$action = 'create';
|
||||
}
|
||||
else
|
||||
@ -164,7 +164,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
|
||||
$result=$chargesociales->update($user);
|
||||
if ($result <= 0)
|
||||
{
|
||||
setEventMessage($chargesociales->error, 'errors');
|
||||
setEventMessages($chargesociales->error, $chargesociales->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($tva->error, 'errors');
|
||||
setEventMessages($tva->error, $tva->errors, 'errors');
|
||||
$action="create";
|
||||
}
|
||||
}
|
||||
@ -150,18 +150,18 @@ if ($action == 'delete')
|
||||
{
|
||||
$tva->error=$accountline->error;
|
||||
$db->rollback();
|
||||
setEventMessage($tva->error,'errors');
|
||||
setEventMessages($tva->error, $tva->errors, 'errors');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$db->rollback();
|
||||
setEventMessage($tva->error,'errors');
|
||||
setEventMessages($tva->error, $tva->errors, 'errors');
|
||||
}
|
||||
}
|
||||
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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user