From f5688b2eecf8a56effd263936ac1ac8bf0dbdf6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 21 May 2020 01:52:25 +0200 Subject: [PATCH] add new rule --- htdocs/compta/accounting-files.php | 12 +- htdocs/compta/ajaxpayment.php | 6 +- htdocs/compta/bank/annuel.php | 27 +-- htdocs/compta/bank/bankentries_list.php | 71 ++---- htdocs/compta/bank/budget.php | 3 +- htdocs/compta/bank/card.php | 30 +-- htdocs/compta/bank/categ.php | 3 +- htdocs/compta/bank/class/account.class.php | 72 ++---- .../bank/class/api_bankaccounts.class.php | 9 +- .../bank/class/paymentvarious.class.php | 24 +- htdocs/compta/bank/graph.php | 54 ++--- htdocs/compta/bank/line.php | 51 ++--- htdocs/compta/bank/list.php | 6 +- htdocs/compta/bank/releve.php | 24 +- htdocs/compta/bank/transfer.php | 9 +- htdocs/compta/bank/treso.php | 9 +- htdocs/compta/bank/various_payment/card.php | 21 +- .../compta/bank/various_payment/document.php | 3 +- htdocs/compta/bank/various_payment/list.php | 6 +- .../compta/cashcontrol/cashcontrol_card.php | 24 +- .../compta/cashcontrol/cashcontrol_list.php | 3 +- htdocs/compta/cashcontrol/report.php | 6 +- htdocs/compta/charges/index.php | 18 +- htdocs/compta/clients.php | 3 +- htdocs/compta/deplacement/card.php | 45 ++-- .../deplacement/class/deplacement.class.php | 21 +- htdocs/compta/deplacement/document.php | 3 +- htdocs/compta/deplacement/index.php | 3 +- htdocs/compta/deplacement/list.php | 3 +- htdocs/compta/deplacement/stats/index.php | 3 +- htdocs/compta/facture/card-rec.php | 99 +++----- htdocs/compta/facture/card.php | 131 ++++------- .../facture/class/api_invoices.class.php | 9 +- .../facture/class/facture-rec.class.php | 97 +++----- htdocs/compta/facture/class/facture.class.php | 214 ++++++------------ .../facture/class/paymentterm.class.php | 18 +- htdocs/compta/facture/contact.php | 12 +- htdocs/compta/facture/document.php | 6 +- .../compta/facture/invoicetemplate_list.php | 15 +- htdocs/compta/facture/list.php | 21 +- htdocs/compta/facture/prelevement.php | 48 ++-- htdocs/compta/facture/stats/index.php | 9 +- .../facture/tpl/linkedobjectblock.tpl.php | 3 +- htdocs/compta/index.php | 48 ++-- htdocs/compta/journal/purchasesjournal.php | 5 +- htdocs/compta/journal/sellsjournal.php | 5 +- htdocs/compta/localtax/card.php | 15 +- .../compta/localtax/class/localtax.class.php | 45 ++-- htdocs/compta/localtax/clients.php | 24 +- htdocs/compta/localtax/index.php | 12 +- htdocs/compta/localtax/list.php | 3 +- htdocs/compta/localtax/quadri_detail.php | 21 +- htdocs/compta/paiement.php | 21 +- htdocs/compta/paiement/card.php | 24 +- htdocs/compta/paiement/cheque/card.php | 60 ++--- .../cheque/class/remisecheque.class.php | 75 ++---- htdocs/compta/paiement/cheque/index.php | 6 +- htdocs/compta/paiement/cheque/list.php | 6 +- .../compta/paiement/class/paiement.class.php | 69 ++---- htdocs/compta/paiement/list.php | 8 +- htdocs/compta/paiement/rapport.php | 3 +- htdocs/compta/paiement/tovalidate.php | 3 +- htdocs/compta/paiement_charge.php | 9 +- htdocs/compta/payment_sc/card.php | 9 +- htdocs/compta/paymentbybanktransfer/index.php | 9 +- htdocs/compta/prelevement/bons.php | 3 +- htdocs/compta/prelevement/card.php | 6 +- .../class/bonprelevement.class.php | 123 ++++------ .../class/ligneprelevement.class.php | 6 +- .../class/rejetprelevement.class.php | 27 +-- htdocs/compta/prelevement/create.php | 18 +- htdocs/compta/prelevement/demandes.php | 6 +- htdocs/compta/prelevement/factures.php | 6 +- htdocs/compta/prelevement/fiche-rejet.php | 9 +- htdocs/compta/prelevement/fiche-stat.php | 6 +- htdocs/compta/prelevement/index.php | 9 +- htdocs/compta/prelevement/line.php | 24 +- htdocs/compta/prelevement/list.php | 3 +- htdocs/compta/prelevement/rejets.php | 3 +- htdocs/compta/prelevement/stats.php | 6 +- htdocs/compta/recap-compta.php | 9 +- htdocs/compta/resultat/clientfourn.php | 53 ++--- htdocs/compta/resultat/index.php | 26 +-- htdocs/compta/resultat/result.php | 4 +- htdocs/compta/sociales/card.php | 30 +-- .../sociales/class/chargesociales.class.php | 27 +-- .../class/paymentsocialcontribution.class.php | 27 +-- htdocs/compta/sociales/document.php | 3 +- htdocs/compta/sociales/list.php | 12 +- htdocs/compta/sociales/payments.php | 18 +- htdocs/compta/stats/byratecountry.php | 3 +- htdocs/compta/stats/cabyprodserv.php | 3 +- htdocs/compta/stats/cabyuser.php | 5 +- htdocs/compta/stats/casoc.php | 5 +- htdocs/compta/stats/index.php | 23 +- htdocs/compta/stats/supplier_turnover.php | 18 +- .../stats/supplier_turnover_by_prodserv.php | 3 +- .../stats/supplier_turnover_by_thirdparty.php | 3 +- htdocs/compta/tva/card.php | 18 +- htdocs/compta/tva/class/tva.class.php | 51 ++--- htdocs/compta/tva/clients.php | 12 +- htdocs/compta/tva/document.php | 3 +- htdocs/compta/tva/index.php | 12 +- htdocs/compta/tva/list.php | 9 +- htdocs/compta/tva/quadri_detail.php | 18 +- htdocs/contact/agenda.php | 6 +- .../actions_contactcard_common.class.php | 9 +- .../actions_contactcard_default.class.php | 3 +- htdocs/contact/card.php | 69 ++---- htdocs/contact/class/contact.class.php | 60 ++--- htdocs/contact/consumption.php | 12 +- htdocs/contact/ldap.php | 15 +- htdocs/contact/list.php | 9 +- htdocs/contact/perso.php | 24 +- htdocs/contact/vcard.php | 3 +- htdocs/contrat/agenda.php | 3 +- htdocs/contrat/card.php | 102 +++------ htdocs/contrat/class/api_contracts.class.php | 6 +- htdocs/contrat/class/contrat.class.php | 113 ++++----- htdocs/contrat/contact.php | 6 +- htdocs/contrat/document.php | 3 +- htdocs/contrat/index.php | 33 +-- htdocs/contrat/list.php | 3 +- htdocs/contrat/services_list.php | 12 +- htdocs/cron/admin/cron.php | 6 +- htdocs/cron/card.php | 33 +-- htdocs/cron/class/cronjob.class.php | 42 ++-- htdocs/cron/list.php | 15 +- htdocs/dav/dav.class.php | 30 +-- htdocs/dav/dav.lib.php | 6 +- .../class/DataCollector/DolLogsCollector.php | 3 +- htdocs/ecm/ajax/ecmdatabase.php | 9 +- htdocs/ecm/class/ecmdirectory.class.php | 48 ++-- htdocs/ecm/class/ecmfiles.class.php | 6 +- htdocs/ecm/class/htmlecm.form.class.php | 6 +- htdocs/ecm/dir_add_card.php | 16 +- htdocs/ecm/dir_card.php | 46 ++-- htdocs/ecm/file_card.php | 27 +-- htdocs/ecm/index.php | 15 +- htdocs/ecm/index_auto.php | 15 +- .../class/emailcollector.class.php | 72 ++---- .../class/emailcollectoraction.class.php | 3 +- .../class/emailcollectorfilter.class.php | 3 +- htdocs/expedition/card.php | 150 ++++-------- .../expedition/class/api_shipments.class.php | 6 +- htdocs/expedition/class/expedition.class.php | 174 +++++--------- .../class/expeditionbatch.class.php | 12 +- htdocs/expedition/contact.php | 3 +- htdocs/expedition/index.php | 3 +- htdocs/expedition/list.php | 6 +- htdocs/expedition/shipment.php | 33 +-- htdocs/expedition/stats/index.php | 3 +- htdocs/expensereport/ajax/ajaxik.php | 12 +- htdocs/expensereport/ajax/ajaxprojet.php | 6 +- htdocs/expensereport/card.php | 159 +++++-------- .../class/api_expensereports.class.php | 3 +- .../class/expensereport.class.php | 192 ++++++---------- .../class/expensereport_ik.class.php | 12 +- .../class/expensereport_rule.class.php | 9 +- .../class/paymentexpensereport.class.php | 30 +-- htdocs/expensereport/document.php | 3 +- htdocs/expensereport/index.php | 3 +- htdocs/expensereport/list.php | 18 +- htdocs/expensereport/payment/card.php | 12 +- htdocs/expensereport/payment/payment.php | 6 +- htdocs/expensereport/stats/index.php | 3 +- .../tpl/expensereport_linktofile.tpl.php | 6 +- htdocs/fichinter/card-rec.php | 21 +- htdocs/fichinter/card.php | 72 ++---- htdocs/fichinter/class/fichinter.class.php | 87 +++---- htdocs/fichinter/contact.php | 3 +- htdocs/fichinter/document.php | 3 +- htdocs/fichinter/index.php | 3 +- htdocs/fichinter/list.php | 3 +- htdocs/fichinter/stats/index.php | 9 +- htdocs/fourn/card.php | 36 +-- .../class/api_supplier_invoices.class.php | 3 +- htdocs/fourn/class/fournisseur.class.php | 12 +- .../class/fournisseur.commande.class.php | 210 ++++++----------- .../fournisseur.commande.dispatch.class.php | 15 +- .../fourn/class/fournisseur.facture.class.php | 133 ++++------- .../fourn/class/fournisseur.product.class.php | 44 ++-- htdocs/fourn/class/paiementfourn.class.php | 48 ++-- htdocs/fourn/commande/card.php | 144 ++++-------- htdocs/fourn/commande/contact.php | 12 +- htdocs/fourn/commande/dispatch.php | 24 +- htdocs/fourn/commande/document.php | 3 +- htdocs/fourn/commande/index.php | 9 +- htdocs/fourn/commande/info.php | 6 +- htdocs/fourn/commande/list.php | 18 +- htdocs/fourn/commande/note.php | 3 +- htdocs/fourn/commande/orderstoinvoice.php | 6 +- htdocs/fourn/contact.php | 3 +- htdocs/fourn/facture/card.php | 131 ++++------- htdocs/fourn/facture/contact.php | 12 +- htdocs/fourn/facture/document.php | 3 +- htdocs/fourn/facture/impayees.php | 3 +- htdocs/fourn/facture/list.php | 6 +- htdocs/fourn/facture/paiement.php | 27 +-- htdocs/fourn/facture/rapport.php | 3 +- .../facture/tpl/linkedobjectblock.tpl.php | 3 +- htdocs/fourn/index.php | 9 +- htdocs/fourn/paiement/card.php | 24 +- htdocs/fourn/product/list.php | 3 +- htdocs/fourn/recap-fourn.php | 9 +- htdocs/ftp/admin/ftpclient.php | 15 +- htdocs/ftp/index.php | 71 ++---- htdocs/holiday/card.php | 78 +++---- htdocs/holiday/class/holiday.class.php | 108 +++------ htdocs/holiday/define_holiday.php | 12 +- htdocs/holiday/document.php | 12 +- htdocs/holiday/list.php | 9 +- htdocs/holiday/month_report.php | 3 +- htdocs/imports/class/import.class.php | 12 +- htdocs/imports/import.php | 71 ++---- 215 files changed, 1910 insertions(+), 3784 deletions(-) diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index faf2feeb7a0..b14e3adafad 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -335,8 +335,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $filesarray[$nofile['item'].'_'.$nofile['id']] = $nofile; } - else - { + else { foreach ($files as $key => $file) { $file['id'] = $objd->id; @@ -384,8 +383,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { $i++; } } - else - { + else { dol_print_error($db); } @@ -492,8 +490,7 @@ if ($result && $action == "dl" && !$error) exit(); } - else - { + else { setEventMessages($langs->trans("FailedToOpenFile", $zipname), null, 'errors'); } } @@ -626,8 +623,7 @@ if (!empty($date_start) && !empty($date_stop)) { print ''.$langs->trans("NoItem").''; } - else - { + else { // Sort array by date ASC to calculate balance $totalET_debit = 0; diff --git a/htdocs/compta/ajaxpayment.php b/htdocs/compta/ajaxpayment.php index f380d8b4ee5..0129d1e5f43 100644 --- a/htdocs/compta/ajaxpayment.php +++ b/htdocs/compta/ajaxpayment.php @@ -81,13 +81,11 @@ if ($currentInvId) // Here to breakdown $remainAmount = $currentRemain - $currentAmount; // To keep value between curRemain and curAmount $result += $remainAmount; // result must be deduced by $currentAmount += $remainAmount; // curAmount put to curRemain - } else - { + } else { $currentAmount = $currentRemain; $result += $currentRemain; } - } else - { + } else { // Reset the substraction for this amount $result += price2num($currentAmount); $currentAmount = 0; diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 1f6e5e6620c..51d838878b8 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -51,8 +51,7 @@ if (!$year_start) $year_start = $year_current - 2; $year_end = $year_current; } -else -{ +else { $year_end = $year_start + 2; } @@ -108,8 +107,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -136,8 +134,7 @@ if ($resql) $i++; } } -else -{ +else { dol_print_error($db); } @@ -158,8 +155,7 @@ if (!empty($id)) { dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); } - else - { + else { $bankaccount = new Account($db); $listid = explode(',', $id); foreach ($listid as $key => $aId) @@ -171,8 +167,7 @@ if (!empty($id)) } } } -else -{ +else { print $langs->trans("AllAccounts"); } @@ -281,8 +276,7 @@ if ($result < 0) $error++; setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); } -else -{ +else { // Calcul de $min et $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -299,8 +293,7 @@ else $min = $db->jdate($obj->min); $max = $db->jdate($obj->max); } - else - { + else { dol_print_error($db); } $log = "graph.php: min=".$min." max=".$max; @@ -339,8 +332,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -426,8 +418,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 7d059734126..d5fb533016e 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -69,8 +69,7 @@ if ($fielvalue) if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque', $fieldvalue, 'bank_account&bank_account', '', '', $fieldtype); } -else -{ +else { if ($user->socid) $socid = $user->socid; $result = restrictedArea($user, 'banque'); } @@ -242,15 +241,13 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', ' } } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("NoRecordSelected"), null, 'errors'); } } - else - { + else { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorPleaseTypeBankTransactionReportName"), null, 'errors'); @@ -287,8 +284,7 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) { $amount = price2num($_POST["addcredit"]); } - else - { + else { $amount = - price2num($_POST["adddebit"]); } @@ -338,13 +334,11 @@ if (GETPOST('save') && !$cancel && $user->rights->banque->modifier) header("Location: ".$_SERVER['PHP_SELF'].($id ? "?id=".$id : '')); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $action = 'addline'; } } @@ -469,8 +463,7 @@ if ($id > 0 || !empty($ref)) } } } -else -{ +else { llxHeader('', $langs->trans("BankTransactions"), '', '', 0, 0, array(), array(), $param); } @@ -675,8 +668,7 @@ if ($resql) print $liste; if ($numr <= 0) print ''.$langs->trans("None").''; } - else - { + else { dol_print_error($db); } @@ -793,13 +785,12 @@ if ($resql) { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier); } - else // If direct entries is not done using miscellaneous payments + else // If direct entries is not done using miscellaneous payments { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier); } } - else - { + else { $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1); } } @@ -1041,8 +1032,7 @@ if ($resql) $balancebefore = $objforbalance->previoustotal + ($sign * $objp->amount); } // If sort is asc,asc,asc then total of previous date is balance of line before the next line to show - else - { + else { $balance = $objforbalance->previoustotal; } } @@ -1129,8 +1119,7 @@ if ($resql) $balance = price2num($balancebefore, 'MT'); // balance = balancebefore of previous line (sort is desc) $balancebefore = price2num($balancebefore - ($sign * $objp->amount), 'MT'); } - else - { + else { $balancebefore = price2num($balance, 'MT'); // balancebefore = balance of previous line (sort is asc) $balance = price2num($balance + ($sign * $objp->amount), 'MT'); } @@ -1142,8 +1131,7 @@ if ($resql) $cachebankaccount[$objp->bankid] = $bankaccounttmp; $bankaccount = $bankaccounttmp; } - else - { + else { $bankaccount = $cachebankaccount[$objp->bankid]; } @@ -1279,8 +1267,7 @@ if ($resql) print $bankstatic->getNomUrl(1, ''); print ')'; } - else - { + else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' ('.$langs->trans("TransferFrom").' '; @@ -1306,8 +1293,7 @@ if ($resql) elseif ($links[$key]['type'] == 'sc') { } - else - { + else { // Show link with label $links[$key]['label'] if (!empty($objp->label) && !empty($links[$key]['label'])) print ' - '; print ''; @@ -1317,8 +1303,7 @@ if ($resql) if ($reg[1] == 'paiement') $reg[1] = 'Payment'; print ' '.$langs->trans($reg[1]); } - else - { + else { print ' '.$links[$key]['label']; } print ''; @@ -1396,8 +1381,7 @@ if ($resql) $companystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; print $companystatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -1450,13 +1434,11 @@ if ($resql) { print ' '.price($balancebefore).''; } - else - { + else { print ' '.price($balancebefore).''; } } - else - { + else { print '-'; } if (!$i) $totalarray['nbfield']++; @@ -1470,13 +1452,11 @@ if ($resql) { print ' '.price($balance).''; } - else - { + else { print ' '.price($balance).''; } } - else - { + else { print '-'; } if (!$i) $totalarray['nbfield']++; @@ -1523,16 +1503,14 @@ if ($resql) print img_edit(); print ''; } - else - { + else { if ($user->rights->banque->modifier || $user->rights->banque->consolidate) { print ''; print img_edit(); print ''; } - else - { + else { print ''; print img_view(); print ''; @@ -1610,8 +1588,7 @@ if ($resql) print ''; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php index 042117808d5..3a15ddf72e1 100644 --- a/htdocs/compta/bank/budget.php +++ b/htdocs/compta/bank/budget.php @@ -90,8 +90,7 @@ if ($result) print ''.price($total).''; print ''.price($totalnb ?price2num($total / $totalnb, 'MT') : 0).''; } -else -{ +else { dol_print_error($db); } print ""; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 593893878e0..3af40ffb2a0 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -100,8 +100,7 @@ if ($action == 'add') { $object->account_number = ''; } - else - { + else { $object->account_number = $account_number; } $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int'); @@ -168,8 +167,7 @@ if ($action == 'add') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -206,8 +204,7 @@ if ($action == 'update') { $object->account_number = ''; } - else - { + else { $object->account_number = $account_number; } $fk_accountancy_journal = GETPOST('fk_accountancy_journal', 'int'); @@ -260,8 +257,7 @@ if ($action == 'update') $_GET["id"] = $_POST["id"]; // Force chargement page en mode visu } - else - { + else { $error++; setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; // Force chargement page edition @@ -272,8 +268,7 @@ if ($action == 'update') { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -291,8 +286,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == "yes" && $user->rights-> header("Location: ".DOL_URL_ROOT."/compta/bank/list.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -399,8 +393,7 @@ if ($action == 'create') { $formcompany->select_departement(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : '', $selectedcode, 'account_state_id'); } - else - { + else { print $countrynotdefined; } print ''; @@ -545,8 +538,7 @@ if ($action == 'create') print $formaccounting->select_account($object->account_number, 'account_number', 1, '', 1, 1); print ''; } - else - { + else { print ''.$langs->trans("AccountancyCode").''; print 'account_number).'">'; } @@ -577,8 +569,7 @@ if ($action == 'create') /* Visu et edition */ /* */ /* ************************************************************************** */ -else -{ +else { if (($_GET["id"] || $_GET["ref"]) && $action != 'edit') { $object = new Account($db); @@ -887,8 +878,7 @@ else { print $formcompany->select_state(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : $object->state_id, $selectedcode, 'account_state_id'); } - else - { + else { print $countrynotdefined; } print ''; diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php index 308dad5dbca..b7bbb4d157e 100644 --- a/htdocs/compta/bank/categ.php +++ b/htdocs/compta/bank/categ.php @@ -133,8 +133,7 @@ if ($result) print ''; print ""; } - else - { + else { print "".$objp->label.""; print ''; print ''.img_edit().''; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 3fcbffba3b2..cae83563b42 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -404,8 +404,7 @@ class Account extends CommonObject $rowid = $this->db->last_insert_id(MAIN_DB_PREFIX."bank_url"); return $rowid; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -510,8 +509,7 @@ class Account extends CommonObject $obj = $this->db->fetch_object($resql); $oper = $obj->code; } - else - { + else { dol_print_error($this->db, 'Failed to get payment type code'); return -1; } @@ -721,13 +719,11 @@ class Account extends CommonObject // End call triggers } } - else - { + else { $error++; } } - else - { + else { if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $this->error = $langs->trans("ErrorBankLabelAlreadyExists"); @@ -744,8 +740,7 @@ class Account extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -837,8 +832,7 @@ class Account extends CommonObject // End call triggers } } - else - { + else { $error++; $this->error = $this->db->lasterror(); dol_print_error($this->db); @@ -849,8 +843,7 @@ class Account extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -908,8 +901,7 @@ class Account extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_print_error($this->db); return -1; @@ -1007,13 +999,11 @@ class Account extends CommonObject return 1; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror; $this->errors[] = $this->error; return -1; @@ -1114,8 +1104,7 @@ class Account extends CommonObject } } } - else - { + else { $error++; $this->error = "Error ".$this->db->lasterror(); } @@ -1126,8 +1115,7 @@ class Account extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1292,8 +1280,7 @@ class Account extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -1331,8 +1318,7 @@ class Account extends CommonObject } $this->db->free($resql); } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -1476,8 +1462,7 @@ class Account extends CommonObject { return 1; } - else - { + else { return 0; } } @@ -1897,8 +1882,7 @@ class AccountLine extends CommonObject $this->db->free($result); return $ret; } - else - { + else { return -1; } } @@ -2015,8 +1999,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -$nbko; } @@ -2054,8 +2037,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -$nbko; } @@ -2086,8 +2068,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; @@ -2152,8 +2133,7 @@ class AccountLine extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2190,8 +2170,7 @@ class AccountLine extends CommonObject return 1; } } - else - { + else { dol_print_error($this->db); return 0; } @@ -2257,8 +2236,7 @@ class AccountLine extends CommonObject return 1; } } - else - { + else { dol_print_error($this->db); return 0; } @@ -2334,8 +2312,7 @@ class AccountLine extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2477,8 +2454,7 @@ class AccountLine extends CommonObject $alreadydispatched = $obj->nb; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index ad75559b362..6943d2bc5e1 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -226,8 +226,7 @@ class BankAccounts extends DolibarrApi { $amount_to = $amount; } - else - { + else { if (!$amount_to || empty($amount_to)) { throw new RestException(422, 'You must provide amount_to value since bankaccount_from and bankaccount_to does not share the same currency.'); @@ -304,8 +303,7 @@ class BankAccounts extends DolibarrApi ) ); } - else - { + else { $this->db->rollback(); throw new RestException(500, $accountfrom->error.' '.$accountto->error); } @@ -339,8 +337,7 @@ class BankAccounts extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $account->error); } } diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 6af394ad4b4..ec88fea3f84 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -170,8 +170,7 @@ class PaymentVarious extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -245,8 +244,7 @@ class PaymentVarious extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -431,8 +429,7 @@ class PaymentVarious extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $error++; } @@ -469,14 +466,12 @@ class PaymentVarious extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -500,8 +495,7 @@ class PaymentVarious extends CommonObject { return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -677,8 +671,7 @@ class PaymentVarious extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -706,8 +699,7 @@ class PaymentVarious extends CommonObject $alreadydispatched = $obj->nb; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 347353be84f..796529a24d9 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -85,8 +85,7 @@ if ($result < 0) $error++; setEventMessages($langs->trans("ErrorFailedToCreateDir"), null, 'errors'); } -else -{ +else { // Calcul $min and $max $sql = "SELECT MIN(b.datev) as min, MAX(b.datev) as max"; $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; @@ -103,8 +102,7 @@ else $min = $db->jdate($obj->min); $max = $db->jdate($obj->max); } - else - { + else { dol_print_error($db); } if (empty($min)) $min = dol_now() - 3600 * 24; @@ -152,8 +150,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -175,8 +172,7 @@ else $solde = $row[0]; $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -200,8 +196,7 @@ else { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph } - else - { + else { $datas[$i] = $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -295,8 +290,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -318,8 +312,7 @@ else $solde = $row[0]; $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -344,8 +337,7 @@ else { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph } - else - { + else { $datas[$i] = $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -432,8 +424,7 @@ else $i++; } } - else - { + else { dol_print_error($db); } @@ -460,8 +451,7 @@ else { $datas[$i] = ''; // Valeur speciale permettant de ne pas tracer le graph } - else - { + else { $datas[$i] = 0 + $solde + $subtotal; } $datamin[$i] = $object->min_desired; @@ -558,8 +548,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -592,8 +581,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -675,8 +663,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } $sql = "SELECT date_format(b.datev,'%m')"; @@ -700,8 +687,7 @@ else } $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -771,15 +757,13 @@ if ($account) $morehtml = ''.$langs->trans("ShowAllAccounts").''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam, 0, '', '', 1); } - else - { + else { $morehtml = ''.$langs->trans("BackToAccount").''; print $langs->trans("AllAccounts"); //print $morehtml; } } - else - { + else { $bankaccount = new Account($db); $listid = explode(',', $account); foreach ($listid as $key => $id) @@ -791,8 +775,7 @@ if ($account) } } } -else -{ +else { print $langs->trans("AllAccounts"); } @@ -809,8 +792,7 @@ if ($mode == 'showalltime') print $langs->trans("GoBack"); print ''; } -else -{ +else { print ''; print $langs->trans("ShowAllTimeBalance"); print ''; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index bf8dc6f5649..a1c37d59050 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -100,8 +100,7 @@ if ($action == 'confirm_delete_categ' && $confirm == "yes" && $user->rights->ban dol_print_error($db); } } - else - { + else { setEventMessages($langs->trans("MissingIds"), null, 'errors'); } } @@ -121,8 +120,7 @@ if ($user->rights->banque->modifier && $action == "update") { $actarget->fetch(GETPOST('accountid', 'int')); } - else - { + else { $actarget->fetch($id); } @@ -192,8 +190,7 @@ if ($user->rights->banque->modifier && $action == "update") setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -230,8 +227,7 @@ if ($user->rights->banque->consolidate && ($action == 'num_releve' || $action == setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); $db->commit(); } - else - { + else { $db->rollback(); dol_print_error($db); } @@ -325,8 +321,7 @@ if ($result) { $form->select_comptes($acct->id, 'accountid', 0, '', 0); } - else - { + else { print $acct->getNomUrl(1, 'transactions', 'reflabel'); } print ''; @@ -464,8 +459,7 @@ if ($result) } print ''; } - else - { + else { print ''.$objp->fk_type.' '.$objp->num_chq.''; } print ""; @@ -480,8 +474,7 @@ if ($result) print ''; print ''; } - else - { + else { print ''.$objp->emetteur.''; } print ""; @@ -496,8 +489,7 @@ if ($result) print ''; print ''; } - else - { + else { print ''.$objp->banque.''; } print ""; @@ -518,8 +510,7 @@ if ($result) } print ''; } - else - { + else { print ''; print dol_print_date($db->jdate($objp->do), "day"); print ''; @@ -542,8 +533,7 @@ if ($result) } print ''; } - else - { + else { print ''; print dol_print_date($db->jdate($objp->dv), "day"); print ''; @@ -561,23 +551,20 @@ if ($result) // Label generique car entre parentheses. On l'affiche en le traduisant print $langs->trans($reg[1]); } - else - { + else { print $objp->label; } print '">'; print ''; } - else - { + else { print ''; if (preg_match('/^\((.*)\)$/i', $objp->label, $reg)) { // Label generique car entre parentheses. On l'affiche en le traduisant print $langs->trans($reg[1]); } - else - { + else { print $objp->label; } print ''; @@ -592,8 +579,7 @@ if ($result) print 'rappro ? ' disabled' : '').' value="'.price($objp->amount).'"> '.$langs->trans("Currency".$acct->currency_code); print ''; } - else - { + else { print ''; print price($objp->amount); print ''; @@ -650,15 +636,13 @@ if ($result) print $langs->trans("AccountStatement").' rappro ? ' disabled' : '').'>'; print ''; } - else - { + else { print $langs->trans("AccountStatement").' rappro ? ' disabled' : '').'>'; } if ($objp->num_releve) print '   ('.$langs->trans("AccountStatement").' '.$objp->num_releve.')'; print ''; } - else - { + else { print ''.$objp->num_releve.' '; } print ''; @@ -670,8 +654,7 @@ if ($result) print 'rappro ? ' checked="checked"' : '')).'">'; print ''; } - else - { + else { print ''.yn($objp->rappro).''; } print ''; diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index b1c76c529ad..bc45c708f33 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -488,8 +488,7 @@ foreach ($accounts as $key=>$type) $accountingaccount->fetch('', $objecttmp->account_number, 1); print $accountingaccount->getNomUrl(0, 1, 1, '', 1); } - else - { + else { print $objecttmp->account_number; } print ''; @@ -506,8 +505,7 @@ foreach ($accounts as $key=>$type) $accountingjournal->fetch($objecttmp->fk_accountancy_journal); print $accountingjournal->getNomUrl(0, 1, 1, '', 1); } - else - { + else { print ''; } print ''; diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index c737af4a89e..65476665963 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -296,16 +296,14 @@ if (empty($numref)) { // } - else - { + else { print ''; print ''; if ($action != 'editbankreceipt' || $objp->numr != $brref) { print ''.$objp->numr.''; } - else - { + else { print ''; print ''; print ''; @@ -356,13 +354,11 @@ if (empty($numref)) print "\n\n"; } - else - { + else { dol_print_error($db); } } -else -{ +else { /** * Show list of record into a bank statement */ @@ -554,8 +550,7 @@ else print $bankstatic->getNomUrl(1, ''); print ')'; } - else - { + else { $bankstatic->id = $objp->bankid; $bankstatic->label = $objp->bankref; print ' ('.$langs->trans("from").' '; @@ -626,8 +621,7 @@ else $ii++; } } - else - { + else { dol_print_error($db); } } @@ -639,8 +633,7 @@ else $totald = $totald + abs($objp->amount); print ''.price($objp->amount * -1)." \n"; } - else - { + else { $totalc = $totalc + abs($objp->amount); print ' '.price($objp->amount)."\n"; } @@ -653,8 +646,7 @@ else print img_edit(); print ""; } - else - { + else { print " "; } print ""; diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index aa4c39e55ee..99a66321648 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -88,8 +88,7 @@ if ($action == 'add') { $amountto = $amount; } - else - { + else { if (!$amountto) { $error++; @@ -131,14 +130,12 @@ if ($action == 'add') setEventMessages($mesgs, null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($accountfrom->error.' '.$accountto->error, null, 'errors'); $db->rollback(); } } - else - { + else { $error++; setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); } diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php index b8d259cdc8d..929a1611775 100644 --- a/htdocs/compta/bank/treso.php +++ b/htdocs/compta/bank/treso.php @@ -73,8 +73,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) { $viewline = $vline; } - else - { + else { $viewline = 20; } @@ -305,8 +304,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) $i++; } } - else - { + else { dol_print_error($db); } @@ -327,8 +325,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"]) print ""; print ""; } -else -{ +else { print $langs->trans("ErrorBankAccountNotFound"); } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index c4fdc3be56a..ffabd082bfa 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -164,8 +164,7 @@ if (empty($reshook)) header("Location: ".$urltogo); exit; } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -199,21 +198,18 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/list.php'); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages('Error try do delete a line linked to a conciliated bank transaction', null, 'errors'); } } @@ -392,8 +388,7 @@ if ($action == 'create') { print $formaccounting->select_auxaccount($subledger_account, 'subledger_account', 1, ''); } - else - { + else { print ''; } print ''; @@ -565,13 +560,11 @@ if ($id) print '
'.$langs->trans("Delete").'
'; } } - else - { + else { print '
'.$langs->trans("Delete").'
'; } } - else - { + else { print '
'.$langs->trans("Delete").'
'; } diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php index d81b9bdd41a..624ead86073 100644 --- a/htdocs/compta/bank/various_payment/document.php +++ b/htdocs/compta/bank/various_payment/document.php @@ -150,8 +150,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 5f68440809c..5fa44ba8555 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -76,8 +76,7 @@ if (!GETPOST('typeid')) if ($part[0] == 'v.fk_typepayment') $typeid = $part[1]; } } -else -{ +else { $typeid = GETPOST('typeid'); } @@ -374,8 +373,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 3780fbc1afe..fce50a977e4 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -178,8 +178,7 @@ elseif ($action == "add") $db->commit(); $action = "view"; } - else - { + else { $db->rollback; $action = "view"; } @@ -218,8 +217,7 @@ if ($action == "valid") // validate = close setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } - else - { + else { setEventMessages($langs->trans("CashFenceDone"), null); $db->commit(); } @@ -254,8 +252,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) header("Location: ".$backurlforlist); exit; } - else - { + else { if (!empty($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, null, 'errors'); } @@ -330,8 +327,7 @@ if ($action == "create" || $action == "start" || $action == 'close') } else dol_print_error($db); } - else - { + else { setEventMessages($langs->trans("SetupOfTerminalNotComplete", $terminaltouse), null, 'errors'); $error++; } @@ -350,8 +346,7 @@ if ($action == "create" || $action == "start" || $action == 'close') if ($key == 'cash') $sql .= " AND cp.code = 'LIQ'"; elseif ($key == 'cheque') $sql .= " AND cp.code = 'CHQ'"; elseif ($key == 'card') $sql .= " AND cp.code = 'CB'"; - else - { + else { dol_print_error('Value for key = '.$key.' not supported'); exit; } @@ -394,8 +389,7 @@ if ($action == "create" || $action == "start" || $action == 'close') print ''; print ''; } - else - { + else { print ''; } @@ -470,8 +464,7 @@ if ($action == "create" || $action == "start" || $action == 'close') { print ''; } - else - { + else { print ''; } print ''; @@ -712,8 +705,7 @@ if (empty($action) || $action == "view" || $action == "close") print ''; print ''; } - else - { + else { print ''; } diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index a98c9ea83f5..5269c07bab2 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -260,8 +260,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index 1ea06eba9e9..5b9079f9d72 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -173,8 +173,7 @@ if ($resql) $cachebankaccount[$objp->bankid] = $bankaccounttmp; $bankaccount = $bankaccounttmp; } - else - { + else { $bankaccount = $cachebankaccount[$objp->bankid]; } @@ -312,8 +311,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 93065219248..991d039d1fb 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -104,8 +104,7 @@ if ($mode != 'sconly') $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 1); } -else -{ +else { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'object_payment', 0, '', '', $limit, 0); } @@ -241,8 +240,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''.price($totalpaye).""; print ""; } - else - { + else { dol_print_error($db); } print ''; @@ -357,8 +355,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -380,8 +377,7 @@ elseif ($mysoc->localtax2_assuj == "1") $j = 2; $numlt = 3; } -else -{ +else { $j = 0; $numlt = 0; } @@ -452,8 +448,7 @@ while ($j < $numlt) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -566,8 +561,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) print "
"; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index 6c1439d5466..74cc0d594e5 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -197,8 +197,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 463d9ea699f..b688bd17907 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -71,8 +71,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -89,8 +88,7 @@ elseif ($action == 'classifyrefunded' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -104,8 +102,7 @@ elseif ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depla header("Location: index.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -150,19 +147,16 @@ elseif ($action == 'add' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; } } - else - { + else { $action = 'create'; } } - else - { + else { header("Location: index.php"); exit; } @@ -190,13 +184,11 @@ elseif ($action == 'update' && $user->rights->deplacement->creer) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } @@ -413,8 +405,7 @@ elseif ($id) print ''; } - else - { + else { /* * Confirm delete trip */ @@ -493,8 +484,7 @@ elseif ($id) { $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1); } - else - { + else { $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0); } print ''; @@ -529,8 +519,7 @@ elseif ($id) { print ''.$langs->trans('Modify').''; } - else - { + else { print ''.$langs->trans('Modify').''; } } @@ -541,8 +530,7 @@ elseif ($id) { print ''.$langs->trans('Validate').''; } - else - { + else { print ''.$langs->trans('Validate').''; } } @@ -553,8 +541,7 @@ elseif ($id) { print ''.$langs->trans('ClassifyRefunded').''; } - else - { + else { print ''.$langs->trans('ClassifyRefunded').''; } } @@ -563,16 +550,14 @@ elseif ($id) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } print ''; } } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index ec4610179e2..8051d074db5 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -200,15 +200,13 @@ class Deplacement extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return $result; } } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -268,8 +266,7 @@ class Deplacement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -313,8 +310,7 @@ class Deplacement extends CommonObject return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -339,8 +335,7 @@ class Deplacement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -461,8 +456,7 @@ class Deplacement extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); } @@ -508,8 +502,7 @@ class Deplacement extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index 2cef0b3e6cd..4ad2044c0f1 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -124,8 +124,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 9d45bafd20f..9ed6e430c4c 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -193,8 +193,7 @@ if ($result) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print '
'; diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index a4cc8f24019..1ebaeb5c6fa 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -197,8 +197,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index cf745b784fc..91c6546a83c 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -168,8 +168,7 @@ if (!$user->rights->societe->client->voir || $user->socid) if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index cad443940f4..8256aeacc5a 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -239,8 +239,7 @@ if (empty($reshook)) $action = "create"; } } - else - { + else { $error++; setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -253,8 +252,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); exit; } - else - { + else { $db->rollback(); $error++; @@ -357,8 +355,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -381,8 +378,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -419,14 +415,12 @@ if (empty($reshook)) $db->commit(); $object->fetch($object->id); // Reload lines } - else - { + else { $db->rollback(); setEventMessages($db->lasterror(), null, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($line->error, $line->errors, 'errors'); } @@ -467,8 +461,7 @@ if (empty($reshook)) $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -579,8 +572,7 @@ if (empty($reshook)) { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } - else - { + else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -604,8 +596,7 @@ if (empty($reshook)) $desc = (!empty($prod->multilangs [$outputlangs->defaultlang] ["description"])) ? $prod->multilangs [$outputlangs->defaultlang] ["description"] : $prod->description; } - else - { + else { $desc = $prod->description; } @@ -641,8 +632,7 @@ if (empty($reshook)) $type = $prod->type; $fk_unit = $prod->fk_unit; } - else - { + else { $pu_ht = price2num($price_ht, 'MU'); $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); $tva_npr = (preg_match('/\*/', $tva_tx) ? 1 : 0); @@ -673,8 +663,7 @@ if (empty($reshook)) $mesg = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)); setEventMessages($mesg, null, 'errors'); } - else - { + else { // Insert line $result = $object->addline($desc, $pu_ht, $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, '', $pu_ttc, $type, - 1, $special_code, $label, $fk_unit, 0, $date_start_fill, $date_end_fill, $fournprice, $buyingprice); @@ -739,8 +728,7 @@ if (empty($reshook)) unset($_POST['situations']); unset($_POST['progress']); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } @@ -948,8 +936,7 @@ if (empty($reshook)) unset($_POST['situations']); unset($_POST['progress']); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1145,8 +1132,7 @@ if ($action == 'create') print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); print ""; } - else - { + else { print ''; } @@ -1199,13 +1185,11 @@ if ($action == 'create') print ''; print "\n"; } - else - { + else { dol_print_error('', "Error, no invoice ".$object->id); } } -else -{ +else { /* * View mode */ @@ -1329,8 +1313,7 @@ else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } - else - { + else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); } } else { @@ -1351,8 +1334,7 @@ else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); } - else - { + else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none'); } print ''; @@ -1460,8 +1442,7 @@ else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } - else - { + else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -1487,8 +1468,7 @@ else $select = 'select;'.implode(',', $list); print $form->editfieldval($langs->trans("Model"), 'modelpdf', $object->modelpdf, $object, $user->rights->facture->creer, $select); } - else - { + else { print $object->modelpdf; } print ""; @@ -1537,14 +1517,12 @@ else print ''; print ''; } - else - { + else { if ($object->frequency > 0) { print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); } - else - { + else { print $langs->trans("NotARecurringInvoiceTemplate"); } } @@ -1556,8 +1534,7 @@ else { print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day'); } - else - { + else { print $langs->trans("NextDateToExecution"); } print ''; @@ -1570,8 +1547,7 @@ else { if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late")); } - else - { + else { print img_info($langs->trans("MaxNumberOfGenerationReached")); } print ''; @@ -1583,8 +1559,7 @@ else { print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer); } - else - { + else { print $langs->trans("MaxPeriodNumber"); } print ''; @@ -1592,8 +1567,7 @@ else { print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max ? $object->nb_gen_max : '', $object, $user->rights->facture->creer); } - else - { + else { print ''; } print ''; @@ -1603,8 +1577,7 @@ else print ''; if ($action == 'auto_validate' || $object->frequency > 0) print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer); - else - print $langs->trans("StatusOfGeneratedInvoices"); + else print $langs->trans("StatusOfGeneratedInvoices"); print ''; $select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); if ($action == 'auto_validate' || $object->frequency > 0) @@ -1619,8 +1592,7 @@ else print ''; if ($action == 'generate_pdf' || $object->frequency > 0) print $form->editfieldkey($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $user->rights->facture->creer); - else - print $langs->trans("StatusOfGeneratedDocuments"); + else print $langs->trans("StatusOfGeneratedDocuments"); print ''; print ''; $select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc'); @@ -1631,8 +1603,7 @@ else print ''; print ''; } - else - { + else { print ''; } @@ -1734,20 +1705,17 @@ else { print '
'.$langs->trans("CreateBill").'
'; } - else - { + else { if (empty($object->frequency) || $object->date_when <= $today) { print '
'.$langs->trans("CreateBill").'
'; } - else - { + else { print '
'.$langs->trans("CreateBill").'
'; } } } - else - { + else { print '
'.$langs->trans("CreateBill").'
'; } } @@ -1758,8 +1726,7 @@ else { print '
'.$langs->trans("Disable").'
'; } - else - { + else { print '
'.$langs->trans("Enable").'
'; } } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index ab2262844bf..68b1a6e91df 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -619,8 +619,7 @@ if (empty($reshook)) } } } - else - { + else { //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); if ($key == 'EMAIL') { @@ -696,8 +695,7 @@ if (empty($reshook)) if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { if (count($object->errors)) setEventMessages(null, $object->errors, 'errors'); else setEventMessages($object->error, $object->errors, 'errors'); } @@ -972,8 +970,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -981,8 +978,7 @@ if (empty($reshook)) $db->commit(); } } - else - { + else { setEventMessages($discount->error, $discount->errors, 'errors'); $db->rollback(); } @@ -1176,8 +1172,7 @@ if (empty($reshook)) $searchPreviousInvoice = false; // find, exit; break; } - else - { + else { $lineIndex--; // go to previous invoice in cycle } } @@ -1470,8 +1465,7 @@ if (empty($reshook)) $amountdeposit[$tva] += $am / (1 + $tva / 100); // Convert into HT for the addline } } - else - { + else { if ($typeamount == 'amount') { $amountdeposit[0] = $valuedeposit; @@ -1725,8 +1719,7 @@ if (empty($reshook)) $error++; } } - else - { // If some invoice's lines coming from page + else { // If some invoice's lines coming from page $id = $object->create($user); for ($i = 1; $i <= $NBLINES; $i++) { @@ -1853,8 +1846,7 @@ if (empty($reshook)) { $mesg = $object->error; } - else - { + else { $nextSituationInvoice = new Facture($db); $nextSituationInvoice->fetch($id); @@ -1895,8 +1887,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit(); } - else - { + else { $db->rollback(); $action = 'create'; $_GET["origin"] = $_POST["origin"]; @@ -1922,8 +1913,7 @@ if (empty($reshook)) $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -1971,8 +1961,7 @@ if (empty($reshook)) } $error++; } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } @@ -1999,8 +1988,7 @@ if (empty($reshook)) if ($res = $prodcomb->fetchByProductCombination2ValuePairs($idprod, $combinations)) { $idprod = $res->fk_product_child; } - else - { + else { setEventMessages($langs->trans('ErrorProductCombinationNotFound'), null, 'errors'); $error++; } @@ -2065,8 +2053,7 @@ if (empty($reshook)) { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } - else - { + else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -2357,8 +2344,7 @@ if (empty($reshook)) } $error++; } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); $error++; } @@ -2458,8 +2444,7 @@ if (empty($reshook)) $mesg = $langs->trans("Line").' '.$i.' : '.$langs->trans("CantBeLessThanMinPercent"); setEventMessages($mesg, null, 'warnings'); $result = -1; - } else - $object->update_percent($line, $_POST['all_progress']); + } else $object->update_percent($line, $_POST['all_progress']); } } } @@ -2540,8 +2525,7 @@ if (empty($reshook)) $searchPreviousInvoice = false; // find, exit; break; } - else - { + else { $lineIndex--; // go to previous invoice in cycle } } @@ -2569,18 +2553,15 @@ if (empty($reshook)) setEventMessages($langs->trans('Updated'), '', 'mesgs'); header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); } - else - { + else { setEventMessages($langs->trans('ErrorOutingSituationInvoiceCreditNote'), array(), 'errors'); } } - else - { + else { setEventMessages($langs->trans('ErrorOutingSituationInvoiceOnUpdate'), array(), 'errors'); } } - else - { + else { setEventMessages($langs->trans('ErrorFindNextSituationInvoice'), array(), 'errors'); } } @@ -2875,8 +2856,7 @@ if ($action == 'create') $expesrc->fetch_optionals(); $object->array_options = $expesrc->array_options; } - else - { + else { $cond_reglement_id = (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0)); $mode_reglement_id = (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0)); $fk_account = (!empty($objectsrc->fk_account) ? $objectsrc->fk_account : (!empty($soc->fk_account) ? $soc->fk_account : 0)); @@ -2895,8 +2875,7 @@ if ($action == 'create') } } } - else - { + else { $cond_reglement_id = $soc->cond_reglement_id; $mode_reglement_id = $soc->mode_reglement_id; $fk_account = $soc->fk_account; @@ -2979,8 +2958,7 @@ if ($action == 'create') print ''; print ''."\n"; } - else - { + else { print ''.$langs->trans('Customer').''; print ''; print $form->select_company($soc->id, 'socid', '((s.client = 1 OR s.client = 3) AND s.status=1)', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); @@ -3204,8 +3182,7 @@ if ($action == 'create') print ''; } } - else - { + else { if (!empty($conf->global->INVOICE_USE_SITUATION)) { print '
'; @@ -3311,8 +3288,7 @@ if ($action == 'create') print '
'; } } - else - { + else { print '
'; if (empty($conf->global->INVOICE_CREDIT_NOTE_STANDALONE)) $tmp = ' '; else $tmp = ' '; @@ -3790,8 +3766,7 @@ elseif ($id > 0 || !empty($ref)) ); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1); } - else - { + else { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', 'no', 1); } } else { @@ -4128,8 +4103,7 @@ elseif ($id > 0 || !empty($ref)) foreach ($facidavoir as $id) { if ($i == 0) print ' '; - else - print ','; + else print ','; $facavoir = new Facture($db); $facavoir->fetch($id); print $facavoir->getNomUrl(1); @@ -4274,8 +4248,7 @@ elseif ($id > 0 || !empty($ref)) { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); } - else - { + else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none', 'CRDT'); } print ''; @@ -4339,8 +4312,7 @@ elseif ($id > 0 || !empty($ref)) { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } - else - { + else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -4362,8 +4334,7 @@ elseif ($id > 0 || !empty($ref)) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -4377,7 +4348,7 @@ elseif ($id > 0 || !empty($ref)) $displayWarranty = false; } - if($displayWarranty) { + if ($displayWarranty) { // Retained Warranty print ''; print ''; @@ -4433,8 +4403,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->retained_warranty_fk_cond_reglement, 'none'); if (!$displayWarranty) { print img_picto($langs->trans('RetainedWarrantyNeed100Percent'), 'warning.png', 'class="pictowarning valignmiddle" '); @@ -4468,8 +4437,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { print dol_print_date($object->retained_warranty_date_limit, 'day'); } print ''; @@ -4831,8 +4799,7 @@ elseif ($id > 0 || !empty($ref)) print ''; $resteapayeraffiche = $resteapayer; @@ -4928,8 +4895,7 @@ elseif ($id > 0 || !empty($ref)) { $retainedWarranty = $total_global_ttc * $object->retained_warranty / 100; } - else - { + else { // Because one day retained warranty could be used on standard invoices $retainedWarranty = $object->total_ttc * $object->retained_warranty / 100; } @@ -5119,8 +5085,7 @@ elseif ($id > 0 || !empty($ref)) } } } - else - { + else { print ''.$langs->trans('Modify').''; } } @@ -5159,8 +5124,7 @@ elseif ($id > 0 || !empty($ref)) } else { if ($usercansend) { print ''.$langs->trans('SendMail').''; - } else - print ''.$langs->trans('SendMail').''; + } else print ''.$langs->trans('SendMail').''; } } } @@ -5179,13 +5143,11 @@ elseif ($id > 0 || !empty($ref)) print ''.$langs->trans('MakeWithdrawRequest').''; } } - else - { + else { //print ''.$langs->trans("MakeWithdrawRequest").''; } } - else - { + else { //print ''.$langs->trans("MakeWithdrawRequest").''; } } @@ -5220,8 +5182,7 @@ elseif ($id > 0 || !empty($ref)) { print ''.$langs->trans('DoPaymentBack').''; } - else - { + else { print ''.$langs->trans('DoPaymentBack').''; } } @@ -5261,16 +5222,14 @@ elseif ($id > 0 || !empty($ref)) // If one payment or one credit note was linked to this invoice print ''.$langs->trans('ClassifyPaidPartially').''; } - else - { + else { if (empty($conf->global->INVOICE_CAN_NEVER_BE_CANCELED)) { if ($objectidnext) { print ''.$langs->trans('ClassifyCanceled').''; } - else - { + else { print ''.$langs->trans('ClassifyCanceled').''; } } @@ -5333,8 +5292,7 @@ elseif ($id > 0 || !empty($ref)) { print ''.$langs->trans("RemoveSituationFromCycle").''; } - else - { + else { print ''.$langs->trans("RemoveSituationFromCycle").''; } } @@ -5375,8 +5333,7 @@ elseif ($id > 0 || !empty($ref)) { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } else { diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 85da9cd5c37..d56d1b5cfef 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -549,8 +549,7 @@ class Invoices extends DolibarrApi if ($updateRes > 0) { return $this->get($id); } - else - { + else { throw new RestException(405, $this->invoice->error); } } @@ -1125,8 +1124,7 @@ class Invoices extends DolibarrApi { $this->db->commit(); } - else - { + else { $this->db->rollback(); throw new RestException(500, 'Could not set paid'); } @@ -1134,8 +1132,7 @@ class Invoices extends DolibarrApi $this->db->commit(); } } - else - { + else { $this->db->rollback(); throw new RestException(500, 'Discount creation error'); } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 71be89f30f5..904f59ea432 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -378,7 +378,7 @@ class FactureRec extends CommonInvoice } } } - else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) + else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) { $origin_id = $tmp_origin_id; $ret = $this->add_object_linked($origin, $origin_id); @@ -395,21 +395,18 @@ class FactureRec extends CommonInvoice { $this->db->rollback(); } - else - { + else { $this->db->commit(); return $this->id; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -1; } @@ -461,8 +458,7 @@ class FactureRec extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -585,15 +581,13 @@ class FactureRec extends CommonInvoice } return 1; } - else - { + else { $this->error = 'Bill with id '.$rowid.' or ref '.$ref.' not found sql='.$sql; dol_syslog('Facture::Fetch Error '.$this->error, LOG_ERR); return -2; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -723,8 +717,7 @@ class FactureRec extends CommonInvoice $this->db->free($result); return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -3; } @@ -767,14 +760,12 @@ class FactureRec extends CommonInvoice $res = $this->deleteExtraFields(); if ($res < 0) $error = -4; } - else - { + else { $this->error = $this->db->lasterror(); $error = -1; } } - else - { + else { $this->error = $this->db->lasterror(); $error = -2; } @@ -784,8 +775,7 @@ class FactureRec extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return $error; } @@ -861,8 +851,7 @@ class FactureRec extends CommonInvoice { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -970,8 +959,7 @@ class FactureRec extends CommonInvoice $this->update_price(); return $lineId; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1046,8 +1034,7 @@ class FactureRec extends CommonInvoice { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -1132,8 +1119,7 @@ class FactureRec extends CommonInvoice $this->update_price(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1226,8 +1212,7 @@ class FactureRec extends CommonInvoice if ($num) $this->output .= $langs->trans("FoundXQualifiedRecurringInvoiceTemplate", $num)."\n"; - else - $this->output .= $langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); + else $this->output .= $langs->trans("NoQualifiedRecurringInvoiceTemplateFound"); $saventity = $conf->entity; @@ -1289,8 +1274,7 @@ class FactureRec extends CommonInvoice } } } - else - { + else { $error++; $this->error = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n"; $this->errors[] = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity; @@ -1304,8 +1288,7 @@ class FactureRec extends CommonInvoice $nb_create++; $this->output .= $langs->trans("InvoiceGeneratedFromTemplate", $facture->ref, $facturerec->ref)."\n"; } - else - { + else { $db->rollback("createRecurringInvoices Process invoice template id=".$facturerec->id.", ref=".$facturerec->ref); } @@ -1435,8 +1418,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); } @@ -1457,8 +1439,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $labelStatus = $langs->trans('Disabled'); } @@ -1480,8 +1461,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1506,8 +1486,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1532,8 +1511,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1559,8 +1537,7 @@ class FactureRec extends CommonInvoice $labelStatus = $langs->trans('Active'); } } - else - { + else { if ($status == self::STATUS_SUSPENDED) { $statusType = 'status6'; $labelStatus = $langs->trans('Disabled'); @@ -1672,7 +1649,7 @@ class FactureRec extends CommonInvoice $line->total_tva = 9.8; $line->remise_percent = 50; } - else // (product line) + else // (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -1762,8 +1739,7 @@ class FactureRec extends CommonInvoice if (!empty($unit)) $this->unit_frequency = $unit; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1795,8 +1771,7 @@ class FactureRec extends CommonInvoice if ($increment_nb_gen_done > 0) $this->nb_gen_done++; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1828,8 +1803,7 @@ class FactureRec extends CommonInvoice $this->nb_gen_max = $nb; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1859,8 +1833,7 @@ class FactureRec extends CommonInvoice $this->auto_validate = $validate; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1890,8 +1863,7 @@ class FactureRec extends CommonInvoice $this->generate_pdf = $validate; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -1921,8 +1893,7 @@ class FactureRec extends CommonInvoice $this->modelpdf = $model; return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -2068,8 +2039,7 @@ class FactureLigneRec extends CommonInvoiceLine $this->db->free($result); return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -3; } @@ -2150,8 +2120,7 @@ class FactureLigneRec extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index fd6a6d32642..55adb5eb138 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -679,7 +679,7 @@ class Facture extends CommonInvoice } } } - else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) + else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) { $origin_id = $tmp_origin_id; $ret = $this->add_object_linked($origin, $origin_id); @@ -988,28 +988,24 @@ class Facture extends CommonInvoice $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -4; } } - else - { + else { $this->error = $langs->trans('FailedToUpdatePrice'); $this->db->rollback(); return -3; } } - else - { + else { dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -1241,8 +1237,7 @@ class Facture extends CommonInvoice $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -1646,15 +1641,13 @@ class Facture extends CommonInvoice } return 1; } - else - { + else { $this->error = 'Invoice with id='.$rowid.' or ref='.$ref.' or ref_ext='.$ref_ext.' not found'; dol_syslog(get_class($this)."::fetch Error ".$this->error, LOG_ERR); return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1776,8 +1769,7 @@ class Facture extends CommonInvoice $this->db->free($result); return 1; } - else - { + else { $this->error = $this->db->error(); return -3; } @@ -1816,8 +1808,7 @@ class Facture extends CommonInvoice { $this->tab_previous_situation_invoice[] = $invoice; } - else - { + else { $this->tab_next_situation_invoice[] = $invoice; } } @@ -1934,8 +1925,7 @@ class Facture extends CommonInvoice $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -2022,22 +2012,19 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $facligne->error; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $facligne->error; $this->db->rollback(); return -2; } } - else - { + else { $this->db->rollback(); return -3; } @@ -2063,8 +2050,7 @@ class Facture extends CommonInvoice $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture'; if (empty($ref_client)) $sql .= ' SET ref_client = NULL'; - else - $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; + else $sql .= ' SET ref_client = \''.$this->db->escape($ref_client).'\''; $sql .= ' WHERE rowid = '.$this->id; dol_syslog(__METHOD__.' this->id='.$this->id.', ref_client='.$ref_client, LOG_DEBUG); @@ -2095,8 +2081,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -2261,22 +2246,19 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -6; } } - else - { + else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -4; } } - else - { + else { $this->db->rollback(); return -2; } @@ -2322,8 +2304,7 @@ class Facture extends CommonInvoice if ($result < 0) $error++; // End call triggers } - else - { + else { $error++; $this->error = $this->db->lasterror(); } @@ -2333,14 +2314,12 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { return 0; } } @@ -2377,8 +2356,7 @@ class Facture extends CommonInvoice if ($result < 0) $error++; // End call triggers } - else - { + else { $error++; $this->error = $this->db->error(); dol_print_error($this->db); @@ -2389,8 +2367,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2446,15 +2423,13 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -2; @@ -2573,8 +2548,7 @@ class Facture extends CommonInvoice } $num = $this->getNextNumRef($this->thirdparty); } - else - { + else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -2804,8 +2778,7 @@ class Facture extends CommonInvoice } } } - else - { + else { $error++; } @@ -2814,8 +2787,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -2943,14 +2915,12 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -3070,8 +3040,7 @@ class Facture extends CommonInvoice { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -3213,22 +3182,19 @@ class Facture extends CommonInvoice $this->db->commit(); return $this->line->id; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->line->error; $this->db->rollback(); return -2; } } - else - { + else { dol_syslog(get_class($this)."::addline status of order must be Draft to allow use of ->addline()", LOG_ERR); return -3; } @@ -3444,15 +3410,13 @@ class Facture extends CommonInvoice $this->db->commit(); return $result; } - else - { + else { $this->error = $this->line->error; $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Invoice statut makes operation forbidden"; return -2; } @@ -3573,15 +3537,13 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } } - else - { + else { $this->db->rollback(); $this->error = $line->error; return -1; @@ -3640,8 +3602,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3709,8 +3670,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -3869,8 +3829,7 @@ class Facture extends CommonInvoice } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -3933,8 +3892,7 @@ class Facture extends CommonInvoice { $ga[$obj->fid] = $obj->ref.' ('.$obj->name.')'; } - else - { + else { $ga[$i]['id'] = $obj->fid; $ga[$i]['ref'] = $obj->ref; $ga[$i]['name'] = $obj->name; @@ -3944,8 +3902,7 @@ class Facture extends CommonInvoice } return $ga; } - else - { + else { dol_print_error($this->db); return -1; } @@ -3994,8 +3951,7 @@ class Facture extends CommonInvoice //print_r($return); return $return; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -4042,8 +3998,7 @@ class Facture extends CommonInvoice $sqlSit .= " ORDER BY fs.situation_counter"; $sql .= " AND ( f.type != ".self::TYPE_SITUATION." OR f.rowid IN (".$sqlSit.") )"; // Type non 5 si facture non avoir } - else - { + else { $sql .= " AND f.type != ".self::TYPE_SITUATION; // Type non 5 si facture non avoir } @@ -4069,8 +4024,7 @@ class Facture extends CommonInvoice return $return; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -4147,8 +4101,7 @@ class Facture extends CommonInvoice $error++; } } - else - { + else { $this->error = 'WithdrawRequestErrorNilAmount'; dol_syslog(get_class($this).'::demandeprelevement WithdrawRequestErrorNilAmount'); $error++; @@ -4167,22 +4120,19 @@ class Facture extends CommonInvoice if ($error) return -1; return 1; } - else - { + else { $this->error = "A request already exists"; dol_syslog(get_class($this).'::demandeprelevement Impossible de creer une demande, demande deja en cours'); return 0; } } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::demandeprelevement Erreur -2'); return -2; } } - else - { + else { $this->error = "Status of invoice does not allow this"; dol_syslog(get_class($this)."::demandeprelevement ".$this->error." $this->statut, $this->paye, $this->mode_reglement_id"); return -3; @@ -4207,8 +4157,7 @@ class Facture extends CommonInvoice { return 0; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::demande_prelevement_delete Error '.$this->error); return -1; @@ -4274,8 +4223,7 @@ class Facture extends CommonInvoice return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -4419,7 +4367,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_tva = 19.6; $line->remise_percent = 50; } - else // (product line) + else // (product line) { $prodid = mt_rand(1, $num_prods); $line->fk_product = $prodids[$prodid]; @@ -4506,8 +4454,7 @@ class Facture extends CommonInvoice $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -4669,8 +4616,7 @@ class Facture extends CommonInvoice $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(__METHOD__.' Error: '.$errmsg, LOG_ERR); @@ -4760,8 +4706,7 @@ class Facture extends CommonInvoice { $hasDelay = 1; } - else - { + else { $hasDelay = 0; } } @@ -4852,8 +4797,7 @@ class Facture extends CommonInvoice return -1; } } - else - { + else { // Because one day retained warranty could be used on standard invoices $retainedWarrantyAmount = $this->total_ttc * $this->retained_warranty / 100; } @@ -4890,15 +4834,13 @@ class Facture extends CommonInvoice $this->retained_warranty = floatval($value); return 1; } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarranty Erreur '.$sql.' - '.$this->db->error()); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarranty, status of the object is incompatible'); $this->error = 'Status of the object is incompatible '.$this->statut; return -2; @@ -4933,15 +4875,13 @@ class Facture extends CommonInvoice $this->retained_warranty_date_limit = $timestamp; return 1; } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit Erreur '.$sql.' - '.$this->db->error()); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this).'::setRetainedWarrantyDateLimit, status of the object is incompatible'); $this->error = 'Status of the object is incompatible '.$this->statut; return -2; @@ -5123,8 +5063,7 @@ class FactureLigne extends CommonInvoiceLine return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -5178,8 +5117,7 @@ class FactureLigne extends CommonInvoiceLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -5296,8 +5234,7 @@ class FactureLigne extends CommonInvoiceLine return -3; } } - else - { + else { $result = $discount->link_to_invoice($this->rowid, 0); if ($result < 0) { @@ -5308,16 +5245,14 @@ class FactureLigne extends CommonInvoiceLine } } } - else - { + else { $this->error = $langs->trans("ErrorADiscountThatHasBeenRemovedIsIncluded"); dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } - else - { + else { $this->error = $discount->error; dol_syslog(get_class($this)."::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); @@ -5340,8 +5275,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; @@ -5395,8 +5329,7 @@ class FactureLigne extends CommonInvoiceLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -5475,8 +5408,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -5519,8 +5451,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; $this->db->rollback(); return -1; @@ -5561,8 +5492,7 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 427daf445c5..1fddf20b023 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -146,8 +146,7 @@ class PaymentTerm // extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -203,8 +202,7 @@ class PaymentTerm // extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -240,8 +238,7 @@ class PaymentTerm // extends CommonObject $this->db->free($resql); return $ret; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -306,8 +303,7 @@ class PaymentTerm // extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -346,8 +342,7 @@ class PaymentTerm // extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -397,8 +392,7 @@ class PaymentTerm // extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 8eb47268186..77ff0f813c3 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -70,15 +70,13 @@ if ($action == 'addcontact' && $user->rights->facture->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -91,8 +89,7 @@ elseif ($action == 'swapstatut' && $user->rights->facture->creer) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db); } } @@ -208,8 +205,7 @@ if ($id > 0 || !empty($ref)) if ($res) break; } } - else - { + else { // Record not found print "ErrorRecordNotFound"; } diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index a901b985342..7e95b92cc3d 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -182,13 +182,11 @@ if ($id > 0 || !empty($ref)) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } - else - { + else { dol_print_error($db); } } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 65e9044f4f7..8275dbcf450 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -610,8 +610,7 @@ if ($resql) { if (!$objp->suspended && $objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late")); } - else - { + else { print img_info($langs->trans("MaxNumberOfGenerationReached")); } print ''; @@ -660,13 +659,11 @@ if ($resql) print ''; print $langs->trans("CreateBill").''; } - else - { + else { print $form->textwithpicto('', $langs->trans("DateIsNotEnough")); } } - else - { + else { print " "; } if (!$i) $totalarray['nbfield']++; @@ -677,8 +674,7 @@ if ($resql) $i++; } } - else - { + else { $colspan = 1; foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; } print ''; @@ -694,8 +690,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8b9e204f17e..7b3025db810 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -314,8 +314,7 @@ elseif ($massaction == 'withdrawrequest') $error++; setEventMessages($langs->trans("NotEnoughPermissions"), null, 'errors'); } - else - { + else { //Checking error $error = 0; @@ -387,8 +386,7 @@ elseif ($massaction == 'withdrawrequest') $db->commit(); $nbwithdrawrequestok++; } - else - { + else { $db->rollback(); setEventMessages($aBill->error, $aBill->errors, 'errors'); } @@ -516,8 +514,7 @@ if ($search_status != '-1' && $search_status != '') if ($search_status == '2') $sql .= " AND f.fk_statut = 2"; // payed Not that some corrupted data may contains f.fk_statut = 1 AND f.paye = 1 (it means payed too but should not happend. If yes, reopen and reclassify billed) if ($search_status == '3') $sql .= " AND f.fk_statut = 3"; // abandonned } - else - { + else { $sql .= " AND f.fk_statut IN (".$db->escape($search_status).")"; // When search_status is '1,2' for example } } @@ -564,8 +561,7 @@ if (!$sall) foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : ''); } } -else -{ +else { $sql .= natural_search(array_keys($fieldstosearchall), $sall); } @@ -1220,8 +1216,7 @@ if ($resql) { print $obj->ref; } - else - { + else { print $facturestatic->getNomUrl(1, '', 200, 0, '', 0, 1); } @@ -1317,8 +1312,7 @@ if ($resql) { print $thirdpartystatic->name; } - else - { + else { print $thirdpartystatic->getNomUrl(1, 'customer'); } print ''; @@ -1620,8 +1614,7 @@ if ($resql) print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 74de1c640d4..109231a240d 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -87,8 +87,7 @@ if (empty($reshook)) setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } @@ -293,13 +292,11 @@ if ($object->id > 0) { $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date, 'invoicedate'); } - else - { + else { print dol_print_date($object->date, 'daytext'); } } - else - { + else { print dol_print_date($object->date, 'daytext'); } print ''; @@ -319,13 +316,11 @@ if ($object->id > 0) { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); } - else - { + else { $form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); } } - else - { + else { print ' '; } print ''; @@ -344,16 +339,14 @@ if ($object->id > 0) { $form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id, $object->date_lim_reglement, 'paymentterm'); } - else - { + else { print dol_print_date($object->date_lim_reglement, 'daytext'); if ($object->hasDelay()) { print img_warning($langs->trans('Late')); } } } - else - { + else { print ' '; } print ''; @@ -370,8 +363,7 @@ if ($object->id > 0) { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id'); } - else - { + else { $form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none'); } print ''; @@ -389,8 +381,7 @@ if ($object->id > 0) { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); } - else - { + else { $form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); } print ""; @@ -503,8 +494,7 @@ if ($object->id > 0) $num = $db->num_rows($result_sql); $numopen = $num; } - else - { + else { dol_print_error($db); } @@ -521,8 +511,7 @@ if ($object->id > 0) $obj = $db->fetch_object($result_sql); if ($obj) $pending = $obj->amount; } - else - { + else { dol_print_error($db); } @@ -550,18 +539,15 @@ if ($object->id > 0) print ''; print ''; } - else - { + else { print ''.$langs->trans("MakeWithdrawRequest").''; } } - else - { + else { print ''.$langs->trans("MakeWithdrawRequest").''; } } - else - { + else { if ($num == 0) { if ($object->statut > Facture::STATUS_DRAFT) print ''.$langs->trans("MakeWithdrawRequest").''; @@ -635,8 +621,7 @@ if ($object->id > 0) $db->free($result_sql); } - else - { + else { dol_print_error($db); } @@ -697,8 +682,7 @@ if ($object->id > 0) $db->free($result); } - else - { + else { dol_print_error($db); } diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 284186b73ce..d0c7eacffc6 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; -if(!empty($conf->category->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; +if (!empty($conf->category->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); @@ -60,7 +60,7 @@ if ($user->socid > 0) $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear; -if(!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear=$year-2; +if (!empty($conf->global->INVOICE_STATS_GRAPHS_SHOW_2_YEARS)) $startyear=$year-2; else $startyear=$year-1; $endyear = $year; @@ -68,7 +68,7 @@ $endyear = $year; /* * View */ -if(!empty($conf->category->enabled)) $langs->load('categories'); +if (!empty($conf->category->enabled)) $langs->load('categories'); $form = new Form($db); $formcompany = new FormCompany($db); $formother = new FormOther($db); @@ -181,8 +181,7 @@ if (!$user->rights->societe->client->voir || $user->socid) if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$user->id.'-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filename_avg = $dir.'/ordersaverage-'.$year.'.png'; if ($mode == 'customer') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersaverage-'.$year.'.png'; if ($mode == 'supplier') $fileurl_avg = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstatssupplier&file=ordersaverage-'.$year.'.png'; diff --git a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php index a02a0fc1682..571a00d6b47 100644 --- a/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php +++ b/htdocs/compta/facture/tpl/linkedobjectblock.tpl.php @@ -79,8 +79,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) $total = $total + $sign * $objectlink->total_ht; echo price($objectlink->total_ht); } - else - { + else { echo ''.price($objectlink->total_ht).''; } } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 00b4987ad66..2efe20a2fc5 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -215,15 +215,13 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; print ''; } - else - { + else { print ''; } print "
'; @@ -4398,8 +4369,7 @@ elseif ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { print price($object->retained_warranty).'%'; } print '
'; if ($object->type != Facture::TYPE_DEPOSIT) print $langs->trans('AlreadyPaidNoCreditNotesNoDeposits'); - else - print $langs->trans('AlreadyPaid'); + else print $langs->trans('AlreadyPaid'); print ' :'.price($totalpaye).' 
'.$langs->trans("NoRecordFound").'
'.price($tot_ttc).'
'.$langs->trans("NoInvoice").'

"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -303,15 +301,13 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ''.price($tot_ttc).''; print ''; } - else - { + else { print ''.$langs->trans("NoInvoice").''; } print "

"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -429,8 +425,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $i++; } } - else - { + else { $colspan = 5; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; @@ -438,8 +433,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -530,16 +524,14 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU $i++; } } - else - { + else { $colspan = 5; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; } - else - { + else { dol_print_error($db); } } @@ -609,8 +601,7 @@ if (!empty($conf->don->enabled) && $user->rights->don->lire) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print '
'; @@ -687,15 +678,13 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ' '; print ''; } - else - { + else { print ''.$langs->trans("None").''; } print "
"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -816,8 +805,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user } $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -940,8 +928,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print ' '; print ''; } - else - { + else { $colspan = 6; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; @@ -949,8 +936,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -1050,16 +1036,14 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU print ' '; print ''; } - else - { + else { $colspan = 6; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php index 1459bbf2402..91d855d4454 100644 --- a/htdocs/compta/journal/purchasesjournal.php +++ b/htdocs/compta/journal/purchasesjournal.php @@ -91,7 +91,7 @@ $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescPurchasesJournal").'
'; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); -else $description .= $langs->trans("DepositsAreIncluded"); +else $description .= $langs->trans("DepositsAreIncluded"); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink); @@ -239,8 +239,7 @@ foreach ($tabfac as $key => $val) print ''.($mt < 0 ?price(-$mt) : '').""; print ''.($mt >= 0 ?price($mt) : '').""; } - else - { + else { print ''.($mt >= 0 ?price($mt) : '').""; print ''.($mt < 0 ?price(-$mt) : '').""; } diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php index 98bd5e989f7..a7eb09de31a 100644 --- a/htdocs/compta/journal/sellsjournal.php +++ b/htdocs/compta/journal/sellsjournal.php @@ -93,7 +93,7 @@ $exportlink = ''; $builddate = dol_now(); $description = $langs->trans("DescSellsJournal").'
'; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); -else $description .= $langs->trans("DepositsAreIncluded"); +else $description .= $langs->trans("DepositsAreIncluded"); $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0); report_header($name, '', $period, $periodlink, $description, $builddate, $exportlink); @@ -269,8 +269,7 @@ foreach ($tabfac as $key => $val) print ''.($mt >= 0 ?price($mt) : '').""; print ''.($mt < 0 ?price(-$mt) : '').""; } - else - { + else { print ''.($mt < 0 ?price(-$mt) : '').""; print ''.($mt >= 0 ?price($mt) : '').""; } diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 51275c7159f..e5a20b5486b 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -81,8 +81,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) header("Location: list.php?localTaxType=".$lttype); exit; } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $_GET["action"] = "create"; @@ -114,21 +113,18 @@ if ($action == 'delete') header("Location: ".DOL_URL_ROOT.'/compta/localtax/list.php?localTaxType='.$object->ltt); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; setEventMessages($mesg, null, 'errors'); } @@ -290,8 +286,7 @@ if ($id) { print ''.$langs->trans("Delete").''; } - else - { + else { print ''.$langs->trans("Delete").''; } print ""; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 6aa7c2b1a87..59adc220c8f 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -138,14 +138,12 @@ class Localtax extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -207,8 +205,7 @@ class Localtax extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -271,8 +268,7 @@ class Localtax extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -378,14 +374,12 @@ class Localtax extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -419,14 +413,12 @@ class Localtax extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -462,14 +454,12 @@ class Localtax extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -548,8 +538,7 @@ class Localtax extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $ok = 0; } @@ -568,21 +557,18 @@ class Localtax extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -605,8 +591,7 @@ class Localtax extends CommonObject if ($result) { return 1; } - else - { + else { dol_print_error($this->db); return -1; } diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 61a11a042f2..12112766c24 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -54,16 +54,14 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month")) { $date_start = dol_get_first_day($year_start, GETPOST("month"), false); $date_end = dol_get_last_day($year_start, GETPOST("month"), false); } - else - { + else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -202,8 +200,7 @@ if ($calc == 0 || $calc == 2) { $intra = $langs->trans('Unknown'); } - else - { + else { $intra = ''; } } @@ -230,15 +227,13 @@ if ($calc == 0 || $calc == 2) print ''.price($total).''; print ''; } - else - { + else { $langs->load("errors"); if ($coll_list == -1) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; elseif ($coll_list == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; - else - print ''.$langs->trans("Error").''; + else print ''.$langs->trans("Error").''; } } @@ -275,8 +270,7 @@ if ($calc == 0 || $calc == 1) { { $intra = $langs->trans('Unknown'); } - else - { + else { $intra = ''; } } @@ -305,15 +299,13 @@ if ($calc == 0 || $calc == 1) { print ''; } - else - { + else { $langs->load("errors"); if ($coll_list == -1) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; elseif ($coll_list == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; - else - print ''.$langs->trans("Error").''; + else print ''.$langs->trans("Error").''; } } diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index a08ac99d6bd..b8a906ac818 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -53,14 +53,12 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -153,8 +151,7 @@ function pt($db, $sql, $date) $previousmode = ''; $previousmonth = ''; } - else - { + else { $previousmode = $obj->mode; $previousmonth = $obj->dm; } @@ -389,8 +386,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc //'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 47a0f44be47..58ec8cb090e 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -96,8 +96,7 @@ if ($result) print ""; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 8e2e871251f..45d34f10cce 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -64,16 +64,14 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { $date_start = dol_get_first_day($year_start, empty($conf->global->SOCIETE_FISCAL_MONTH_START) ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 3) $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; elseif ($conf->global->MAIN_INFO_VAT_RETURN == 1) $date_end = dol_time_plus_duree($date_start, 1, 'm') - 1; } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -222,11 +220,9 @@ if (!is_array($x_coll) || !is_array($x_paye)) print ''.$langs->trans("ErrorNoAccountancyModuleLoaded").''; elseif ($x_coll == -2) print ''.$langs->trans("FeatureNotYetAvailable").''; - else - print ''.$langs->trans("Error").''; + else print ''.$langs->trans("Error").''; } -else -{ +else { $x_both = array(); //now, from these two arrays, get another array with one rate per line @@ -373,8 +369,7 @@ else print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); } - else - { + else { if ($type) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); if (preg_match('/^\((.*)\)$/', $fields['descr'], $reg)) @@ -533,8 +528,7 @@ else print $product_static->getNomUrl(1); if (dol_string_nohtmltag($fields['descr'])) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); } - else - { + else { if ($type) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); print $text.' '.dol_trunc(dol_string_nohtmltag($fields['descr']), 16); @@ -573,8 +567,7 @@ else { print $langs->trans("NA"); } - else - { + else { print price(price2num($fields['payment_amount'], 'MT')); if (isset($fields['payment_amount'])) { print ' ('.round($ratiopaymentinvoice * 100, 2).'%)'; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 4a7e387987c..5c0f258a091 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -313,8 +313,7 @@ if (empty($reshook)) header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -504,8 +503,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $form->select_comptes($accountid, 'accountid', 0, '', 2); print ''; } - else - { + else { print ' '; } print "\n"; @@ -561,8 +559,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { $sql .= ' AND type IN (0,1,3,5)'; // Standard invoice, replacement, deposit, situation } - else - { + else { $sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes } // Sort invoices by date and serial number: the older one comes first @@ -666,8 +663,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; } - else - { + else { print ''; } @@ -711,8 +707,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; } - else - { + else { print ''; print ''; } @@ -747,8 +742,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; } - else - { + else { print ''; print ''; } @@ -804,8 +798,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } $db->free($resql); } - else - { + else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index e14581f6531..f67a2e2c12a 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -66,8 +66,7 @@ if ($action == 'setnote' && $user->rights->facture->paiement) $db->commit(); $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -88,14 +87,12 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture-> header("Location: ".$backtopage); exit; } - else - { + else { header("Location: list.php"); exit; } } - else - { + else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -132,8 +129,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture-> header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); exit; } - else - { + else { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); @@ -148,8 +144,7 @@ if ($action == 'setnum_paiement' && !empty($_POST['num_paiement'])) { setEventMessages($langs->trans('PaymentNumberUpdateSucceeded'), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans('PaymentNumberUpdateFailed'), null, 'errors'); } } @@ -163,8 +158,7 @@ if ($action == 'setdatep' && !empty($_POST['datepday'])) { setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs'); } - else - { + else { setEventMessages($langs->trans('PaymentDateUpdateFailed'), null, 'errors'); } } @@ -414,8 +408,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -446,8 +439,7 @@ if ($user->socid == 0 && $action == '') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index eeb578ad731..44a160b35e0 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -80,8 +80,7 @@ if ($action == 'setdate' && $user->rights->banque->cheque) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -99,8 +98,7 @@ if ($action == 'setrefext' && $user->rights->banque->cheque) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -118,8 +116,7 @@ if ($action == 'setref' && $user->rights->banque->cheque) setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -150,13 +147,11 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("ErrorSelectAtLeastOne"), null, 'mesgs'); $action = 'new'; } @@ -171,8 +166,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -186,8 +180,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c header("Location: index.php"); exit; } - else - { + else { setEventMessages($paiement->error, $paiement->errors, 'errors'); } } @@ -213,8 +206,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -233,8 +225,7 @@ if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->rights->ban //exit; $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -262,8 +253,7 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) dol_print_error($db, $object->error); exit; } - else - { + else { header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc')); exit; } @@ -315,8 +305,7 @@ if ($action == 'new') print load_fiche_titre($langs->trans("Cheques"), '', 'bank_account'); } -else -{ +else { $result = $object->fetch($id, $ref); if ($result < 0) { @@ -510,8 +499,7 @@ if ($action == 'new') { print $paymentstatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -522,8 +510,7 @@ if ($action == 'new') { print $accountlinestatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -544,16 +531,14 @@ if ($action == 'new') { print ''; } - else - { + else { print ''.$langs->trans('NewCheckDepositOn', $account_label).''; } print '
'; print ''; } } -else -{ +else { $paymentstatic = new Paiement($db); $accountlinestatic = new AccountLine($db); $accountstatic = new Account($db); @@ -588,8 +573,7 @@ else print ''; print ''; } - else - { + else { print $object->date_bordereau ? dol_print_date($object->date_bordereau, 'day') : ' '; } @@ -700,8 +684,7 @@ else { print $paymentstatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -712,8 +695,7 @@ else { print $accountlinestatic->getNomUrl(1); } - else - { + else { print ' '; } print ''; @@ -737,8 +719,7 @@ else $i++; } } - else - { + else { print ''; print $langs->trans("None"); print ''; @@ -756,8 +737,7 @@ else print ""; } - else - { + else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 746065647d5..9d252a7456e 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -121,8 +121,7 @@ class RemiseCheque extends CommonObject { $this->ref = "(PROV".$this->id.")"; } - else - { + else { $this->ref = $obj->ref; } } @@ -130,8 +129,7 @@ class RemiseCheque extends CommonObject return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -228,8 +226,7 @@ class RemiseCheque extends CommonObject } $this->db->free($resql); } - else - { + else { $this->errno = -1026; dol_syslog("RemiseCheque::Create Error ".$this->errno, LOG_ERR); } @@ -270,8 +267,7 @@ class RemiseCheque extends CommonObject } } } - else - { + else { $this->errno = -1; $this->error = $this->db->lasterror(); $this->errno = $this->db->lasterrno(); @@ -289,8 +285,7 @@ class RemiseCheque extends CommonObject dol_syslog("RemiseCheque::Create end", LOG_DEBUG); return $this->id; } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::Create end", LOG_DEBUG); return $this->errno; @@ -342,8 +337,7 @@ class RemiseCheque extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::Delete ROLLBACK ($this->errno)"); } @@ -386,14 +380,12 @@ class RemiseCheque extends CommonObject $this->ref = $numref; $this->statut = 1; } - else - { + else { $this->errno = -1029; dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR); } } - else - { + else { $this->errno = -1033; dol_syslog("Remisecheque::Validate Error ".$this->errno, LOG_ERR); } @@ -405,8 +397,7 @@ class RemiseCheque extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::Validate ".$this->errno, LOG_ERR); return $this->errno; @@ -489,8 +480,7 @@ class RemiseCheque extends CommonObject return $numref; } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Bank")); return ""; @@ -545,8 +535,7 @@ class RemiseCheque extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -585,8 +574,7 @@ class RemiseCheque extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -665,16 +653,14 @@ class RemiseCheque extends CommonObject //$outputlangs->charset_output=$sav_charset_output; return 1; } - else - { + else { //$outputlangs->charset_output=$sav_charset_output; dol_syslog("Error"); dol_print_error($this->db, $docmodel->error); return 0; } } - else - { + else { $this->error = $langs->trans("ErrorFileDoesNotExists", $dir.$file); return -1; } @@ -721,8 +707,7 @@ class RemiseCheque extends CommonObject dol_syslog("RemiseCheque::updateAmount ERREUR UPDATE ($this->errno)"); } } - else - { + else { $this->errno = -1031; dol_syslog("RemiseCheque::updateAmount ERREUR SELECT ($this->errno)"); } @@ -731,8 +716,7 @@ class RemiseCheque extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); dol_syslog("RemiseCheque::updateAmount ROLLBACK ($this->errno)"); } @@ -762,8 +746,7 @@ class RemiseCheque extends CommonObject { $this->updateAmount(); } - else - { + else { $this->errno = -1032; dol_syslog("RemiseCheque::removeCheck ERREUR UPDATE ($this->errno)"); } @@ -839,30 +822,26 @@ class RemiseCheque extends CommonObject $this->db->commit(); return $rejectedPayment->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $rejectedPayment->error; $this->errors = $rejectedPayment->errors; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $rejectedPayment->error; $this->errors = $rejectedPayment->errors; $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -936,14 +915,12 @@ class RemiseCheque extends CommonObject $this->date_bordereau = $date; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } @@ -971,14 +948,12 @@ class RemiseCheque extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index c85553d59a8..7971a34db0d 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -77,8 +77,7 @@ if ($resql) { print ''; print "\n"; } -else -{ +else { dol_print_error($db); } @@ -141,8 +140,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index fe1f7c31050..cda8c2a679d 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -222,8 +222,7 @@ if ($resql) $i++; } } - else - { + else { print ''; print ''.$langs->trans("None").""; print ''; @@ -232,8 +231,7 @@ if ($resql) print ""; print "\n"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 9b0ee645fc7..99250bd9373 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -201,14 +201,12 @@ class Paiement extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->db->free($resql); return 0; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -243,8 +241,7 @@ class Paiement extends CommonObject $amounts = &$this->amounts; $amounts_to_update = &$this->multicurrency_amounts; } - else - { + else { $amounts = &$this->multicurrency_amounts; $amounts_to_update = &$this->amounts; } @@ -283,8 +280,7 @@ class Paiement extends CommonObject $total = $totalamount; $mtotal = $totalamount_converted; // Maybe use price2num with MT for the converted value } - else - { + else { $total = $totalamount_converted; // Maybe use price2num with MT for the converted value $mtotal = $totalamount; } @@ -340,8 +336,7 @@ class Paiement extends CommonObject if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice, nor situation invoice. We do nothing more."); elseif ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); //else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more."); - else - { + else { // If invoice is a down payment, we also convert down payment to discount if ($invoice->type == Facture::TYPE_DEPOSIT) { @@ -430,14 +425,12 @@ class Paiement extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } } - else - { + else { dol_syslog(get_class($this).'::Create Amount line '.$key.' not a number. We discard it.'); } } @@ -450,8 +443,7 @@ class Paiement extends CommonObject // Fin appel triggers } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -464,8 +456,7 @@ class Paiement extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -502,8 +493,7 @@ class Paiement extends CommonObject return -1; } } - else - { + else { $this->db->rollback(); return -2; } @@ -568,8 +558,7 @@ class Paiement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error; $this->db->rollback(); return -5; @@ -731,8 +720,7 @@ class Paiement extends CommonObject // Fin appel triggers } } - else - { + else { $this->error = $acc->error; $error++; } @@ -741,8 +729,7 @@ class Paiement extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); } } @@ -751,8 +738,7 @@ class Paiement extends CommonObject { return $bank_line_id; } - else - { + else { return -1; } } @@ -777,8 +763,7 @@ class Paiement extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::update_fk_bank '.$this->error); return -1; @@ -840,8 +825,7 @@ class Paiement extends CommonObject $this->db->commit(); return 0; } - else - { + else { $this->db->rollback(); return -2; } @@ -871,8 +855,7 @@ class Paiement extends CommonObject $this->num_payment = $this->db->escape($num); return 0; } - else - { + else { $this->error = 'Error -1 '.$this->db->error(); return -2; } @@ -896,8 +879,7 @@ class Paiement extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::valide '.$this->error); return -1; @@ -920,8 +902,7 @@ class Paiement extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this).'::reject '.$this->error); return -1; @@ -966,8 +947,7 @@ class Paiement extends CommonObject } $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -1000,8 +980,7 @@ class Paiement extends CommonObject return $billsarray; } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' -', LOG_DEBUG); return -1; @@ -1034,8 +1013,7 @@ class Paiement extends CommonObject return $amounts; } - else - { + else { $this->error = $this->db->error(); dol_syslog(get_class($this).'::getAmountsArray Error '.$this->error.' -', LOG_DEBUG); return -1; @@ -1119,8 +1097,7 @@ class Paiement extends CommonObject return $numref; } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Invoice")); return ""; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 20401d81a1a..dbdf4f4675e 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -130,8 +130,7 @@ if (GETPOST("orphelins", "alpha")) $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } -else -{ +else { $sql = "SELECT DISTINCT p.rowid, p.ref, p.datep as dp, p.amount,"; // DISTINCT is to avoid duplicate when there is a link to sales representatives $sql .= " p.statut, p.num_paiement as num_payment,"; $sql .= " c.code as paiement_code,"; @@ -161,7 +160,7 @@ else if ($userid) { if ($userid == -1) $sql .= " AND f.fk_user_author IS NULL"; - else $sql .= " AND f.fk_user_author = ".$userid; + else $sql .= " AND f.fk_user_author = ".$userid; } // Search criteria $sql .= dolSqlDateFilter("p.datep", $day, $month, $year); @@ -379,8 +378,7 @@ if ($resql) print ""; print "\n"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 76a1ce72d76..66f239fdf96 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -71,8 +71,7 @@ if ($action == 'builddoc') { $outputlangs->charset_output = $sav_charset_output; } - else - { + else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, $obj->error); } diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 91ef2c215e6..b978fc8e218 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -127,8 +127,7 @@ if ($resql) { print ''.$langs->trans("PaymentStatusToValidShort").''; } - else - { + else { print "-"; } diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 509e20f3613..d1b448c5932 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -142,8 +142,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y header('Location: '.$loc); exit; } - else - { + else { $db->rollback(); } } @@ -284,8 +283,7 @@ if ($action == 'create') { print ''.dol_print_date($objp->date_ech, 'day').''."\n"; } - else - { + else { print "!!!\n"; } @@ -306,8 +304,7 @@ if ($action == 'create') print ''; print ''; } - else - { + else { print '-'; } print ""; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 5fdfe327056..69b425356d1 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -67,8 +67,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->tax->char header("Location: ".DOL_URL_ROOT."/compta/sociales/payments.php?mode=sconly"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); } @@ -284,8 +283,7 @@ if ($resql) print "\n"; $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -317,8 +315,7 @@ if ($action == '') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } } diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index fd87dd5e447..d2611e8a354 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -159,14 +159,12 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).''; } print "
"; } -else -{ +else { dol_print_error($db); } @@ -221,8 +219,7 @@ if ($result) print "
"; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index c7c717e702b..106f848f732 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -191,8 +191,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index d81e101be3d..d5051e06bfa 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -409,8 +409,7 @@ if ($id > 0 || $ref) { print ''.$langs->trans("StatusRefused").''; } - else - { + else { print " "; } @@ -443,8 +442,7 @@ if ($id > 0 || $ref) $db->free($result); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0c21a3e6d2b..91a165ee454 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -152,20 +152,17 @@ class BonPrelevement extends CommonObject { $result = 0; } - else - { + else { $result = -1; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } } - else - { + else { $result = -2; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } } - else - { + else { $result = -3; dol_syslog(get_class($this)."::AddFacture Erreur $result"); } @@ -209,13 +206,11 @@ class BonPrelevement extends CommonObject { $num = $this->db->num_rows($resql); } - else - { + else { $result = -1; } } - else - { + else { /* * No aggregate */ @@ -244,8 +239,7 @@ class BonPrelevement extends CommonObject $line_id = $this->db->last_insert_id(MAIN_DB_PREFIX."prelevement_lignes"); $result = 0; } - else - { + else { dol_syslog(get_class($this)."::addline Error -2"); $result = -2; } @@ -321,14 +315,12 @@ class BonPrelevement extends CommonObject return 1; } - else - { + else { dol_syslog(get_class($this)."::Fetch Erreur aucune ligne retournee"); return -1; } } - else - { + else { return -2; } } @@ -397,16 +389,14 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 0; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::set_credite ROLLBACK "); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_credite Ouverture transaction SQL impossible "); return -2; } @@ -491,8 +481,7 @@ class BonPrelevement extends CommonObject dol_syslog(get_class($this)."::set_infocredit AddPayment Error"); $error++; } - else - { + else { $result = $paiement->addPaymentToBank($user, 'payment', '(WithdrawalPayment)', $bankaccount, '', ''); if ($result < 0) { @@ -517,8 +506,7 @@ class BonPrelevement extends CommonObject $error++; } } - else - { + else { dol_syslog(get_class($this)."::set_infocredit Update Bons Error"); $error++; } @@ -534,27 +522,23 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 0; } - else - { + else { $this->db->rollback(); dol_syslog("bon-prelevment::set_infocredit ROLLBACK "); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_infocredit 1025 Open SQL transaction impossible "); return -1025; } } - else - { + else { dol_syslog("bon-prelevment::set_infocredit 1027 Date de credit < Date de trans "); return -1027; } } - else - { + else { return -1026; } } @@ -597,8 +581,7 @@ class BonPrelevement extends CommonObject // TODO Call trigger to create a notification using notification module } - else - { + else { $error++; } @@ -610,16 +593,14 @@ class BonPrelevement extends CommonObject return 0; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::set_infotrans ROLLBACK", LOG_ERR); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_infotrans Ouverture transaction SQL impossible", LOG_CRIT); return -2; } @@ -664,8 +645,7 @@ class BonPrelevement extends CommonObject { $row = $this->db->fetch_row($resql); if (!$amounts) $arr[$i] = $row[0]; - else - { + else { $arr[$i] = array( $row[0], $row[1] @@ -676,8 +656,7 @@ class BonPrelevement extends CommonObject } $this->db->free($resql); } - else - { + else { dol_syslog(get_class($this)."::getListInvoices Erreur"); } @@ -715,8 +694,7 @@ class BonPrelevement extends CommonObject return $obj->nb; } - else - { + else { $error = 1; dol_syslog(get_class($this)."::SommeAPrelever Erreur -1"); dol_syslog($this->db->error()); @@ -760,8 +738,7 @@ class BonPrelevement extends CommonObject return $obj->nb; } - else - { + else { $this->error = get_class($this)."::NbFactureAPrelever Erreur -1 sql=".$this->db->error(); return -1; } @@ -849,8 +826,7 @@ class BonPrelevement extends CommonObject $this->db->free($resql); dol_syslog(__METHOD__."::Read invoices, ".$i." invoices to withdraw", LOG_DEBUG); } - else - { + else { $error++; dol_syslog(__METHOD__."::Read invoices error ".$this->db->error(), LOG_ERR); } @@ -895,26 +871,22 @@ class BonPrelevement extends CommonObject $i++; //dol_syslog(__METHOD__."::RIB is ok", LOG_DEBUG); } - else - { + else { dol_syslog(__METHOD__."::Check RIB Error on default bank number IBAN/BIC for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_WARNING); $this->invoice_in_error[$fac[0]] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); $this->thirdparty_in_error[$soc->id] = "Error on default bank number IBAN/BIC for invoice ".$fact->getNomUrl(0)." for thirdparty ".$soc->getNomUrl(0); } } - else - { + else { dol_syslog(__METHOD__."::Check RIB Failed to read company", LOG_WARNING); } } - else - { + else { dol_syslog(__METHOD__."::Check RIB Failed to read invoice", LOG_WARNING); } } } - else - { + else { dol_syslog(__METHOD__."::Check RIB No invoice to process", LOG_WARNING); } } @@ -941,8 +913,7 @@ class BonPrelevement extends CommonObject { $ok = 1; } - else - { + else { print $langs->trans("ModeWarning"); //"Option for real mode was not set, we stop after this simulation\n"; } } @@ -1000,14 +971,12 @@ class BonPrelevement extends CommonObject $this->id = $prev_id; $this->ref = $ref; } - else - { + else { $error++; dol_syslog(__METHOD__."::Create withdraw receipt ".$this->db->lasterror(), LOG_ERR); } } - else - { + else { $error++; dol_syslog(__METHOD__."::Get last withdraw receipt ".$this->db->lasterror(), LOG_ERR); } @@ -1129,15 +1098,13 @@ class BonPrelevement extends CommonObject { $this->db->commit(); } - else - { + else { $this->db->rollback(); } return count($factures_prev); } - else - { + else { return 0; } } @@ -1198,8 +1165,7 @@ class BonPrelevement extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -1301,8 +1267,7 @@ class BonPrelevement extends CommonObject { return 0; } - else - { + else { return -1; } } @@ -1327,8 +1292,7 @@ class BonPrelevement extends CommonObject { return 0; } - else - { + else { return -1; } } @@ -1359,8 +1323,7 @@ class BonPrelevement extends CommonObject { $result = 0; } - else - { + else { $result = -1; dol_syslog(get_class($this)."::AddNotification Error $result"); } @@ -1464,8 +1427,7 @@ class BonPrelevement extends CommonObject } $nbtotalDrctDbtTxInf = $i; } - else - { + else { fputs($this->file, 'ERROR DEBITOR '.$sql.$CrLf); // DEBITOR = Customers $result = -2; } @@ -1475,8 +1437,7 @@ class BonPrelevement extends CommonObject { $fileEmetteurSection .= $this->EnregEmetteurSEPA($conf, $date_actu, $nbtotalDrctDbtTxInf, $this->total, $CrLf, $format); } - else - { + else { fputs($this->file, 'ERROR CREDITOR'.$CrLf); // CREDITOR = My company } @@ -1543,8 +1504,7 @@ class BonPrelevement extends CommonObject $i++; } } - else - { + else { $result = -2; } @@ -1915,8 +1875,7 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; } - else - { + else { fputs($this->file, 'INCORRECT EMETTEUR '.$XML_SEPA_INFO.$CrLf); $result = -2; } diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 88b612554df..accd64e2694 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -97,16 +97,14 @@ class LignePrelevement $this->bon_ref = $obj->ref; $this->bon_rowid = $obj->bon_rowid; } - else - { + else { $result++; dol_syslog("LignePrelevement::Fetch rowid=$rowid numrows=0"); } $this->db->free($resql); } - else - { + else { $result++; dol_syslog("LignePrelevement::Fetch rowid=$rowid"); dol_syslog($this->db->error()); diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 8c033353637..1edd942fc42 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -161,8 +161,7 @@ class RejetPrelevement $error++; dol_syslog("RejetPrelevement::Create Error creation payment invoice ".$facs[$i][0]); } - else - { + else { $result = $pai->addPaymentToBank($user, 'payment', '(InvoiceRefused)', $bankaccount, '', ''); if ($result < 0) { @@ -192,8 +191,7 @@ class RejetPrelevement dol_syslog("RejetPrelevement::Create Commit"); $this->db->commit(); } - else - { + else { dol_syslog("RejetPrelevement::Create Rollback"); $this->db->rollback(); } @@ -228,8 +226,7 @@ class RejetPrelevement $userid = $row[0]; } } - else - { + else { dol_syslog("RejetPrelevement::_send_email Erreur lecture user"); } @@ -266,13 +263,11 @@ class RejetPrelevement { dol_syslog("RejetPrelevement::_send_email email envoye"); } - else - { + else { dol_syslog("RejetPrelevement::_send_email Erreur envoi email"); } } - else - { + else { dol_syslog("RejetPrelevement::_send_email Userid invalide"); } } @@ -310,8 +305,7 @@ class RejetPrelevement { $row = $this->db->fetch_row($resql); if (!$amounts) $arr[$i] = $row[0]; - else - { + else { $arr[$i] = array( $row[0], $row[1] @@ -322,8 +316,7 @@ class RejetPrelevement } $this->db->free($resql); } - else - { + else { dol_syslog("getListInvoices", LOG_ERR); } @@ -359,14 +352,12 @@ class RejetPrelevement return 0; } - else - { + else { dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid numrows=0"); return -1; } } - else - { + else { dol_syslog("RejetPrelevement::Fetch Erreur rowid=$rowid"); return -2; } diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 5306b6799b9..505ad070645 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -94,8 +94,7 @@ if (empty($reshook)) $mesg .= ''.$val."
\n"; } } - else - { + else { setEventMessages($langs->trans("DirectDebitOrderCreated", $bprev->getNomUrl(1)), null); } } @@ -175,21 +174,18 @@ if ($nb) { print ''.$langs->trans("CreateAll")."\n"; } } - else - { + else { if ($mysoc->isInEEC()) { print ''.$langs->trans("CreateForSepaFRST")."\n"; print ''.$langs->trans("CreateForSepaRCUR")."\n"; } - else - { + else { print ''.$langs->trans("CreateAll")."\n"; } } } -else -{ +else { print 'transnoentitiesnoconv("StandingOrders"))).'">'.$langs->trans("CreateAll")."\n"; } @@ -308,16 +304,14 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } print ""; print ""; print "
\n"; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 181f71a678c..64ac904db6c 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -89,8 +89,7 @@ if (!$status) { $title = $langs->trans("RequestStandingOrderToTreat"); } -else -{ +else { $title = $langs->trans("RequestStandingOrderTreated"); } @@ -143,8 +142,7 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { $num = $nbtotalofrecords; } -else -{ +else { $sql .= $db->plimit($limit + 1, $offset); $resql = $db->query($sql); diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index fb0a5548426..bb3cced3eb4 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -135,8 +135,7 @@ if ($prev_id > 0 || $ref) dol_fiche_end(); } - else - { + else { dol_print_error($db); } } @@ -290,8 +289,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 1cc454a3d4d..4bfc07b0292 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -136,8 +136,7 @@ if ($prev_id > 0 || $ref) dol_fiche_end(); } - else - { + else { dol_print_error($db); } } @@ -221,8 +220,7 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("None").''; } @@ -239,8 +237,7 @@ if ($resql) $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index 18028e2059a..5dd01bad41d 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -133,8 +133,7 @@ if ($prev_id > 0 || $ref) dol_fiche_end(); } - else - { + else { $langs->load("errors"); print $langs->trans("Error"); } @@ -186,8 +185,7 @@ if ($prev_id > 0 || $ref) print ""; $db->free($resql); } - else - { + else { print $db->error().' '.$sql; } } diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index eb2932fd4cb..faa56184891 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -159,14 +159,12 @@ if ($resql) $i++; } } - else - { + else { print ''.$langs->trans("NoInvoiceToWithdraw", $langs->transnoentitiesnoconv("StandingOrders")).''; } print "
"; } -else -{ +else { dol_print_error($db); } @@ -221,8 +219,7 @@ if ($result) print "
"; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 9169f71a377..89d6ad93636 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -103,13 +103,11 @@ if ($action == 'confirm_rejet') exit; } } - else - { + else { $action = "rejet"; } } - else - { + else { header("Location: line.php?id=".$id); exit; } @@ -162,15 +160,13 @@ if ($id) /* Historique pour certaines install */ print $langs->trans("Unknown"); } - else - { + else { print dol_print_date($rej->date_rejet, 'day'); } print ''; print ''.$langs->trans("RefusedInvoicing").''.$rej->invoicing.''; } - else - { + else { print ''.$resf.''; } } @@ -178,8 +174,7 @@ if ($id) print ''; dol_fiche_end(); } - else - { + else { dol_print_error($db); } @@ -246,13 +241,11 @@ if ($id) { print "id\">".$langs->trans("StandingOrderReject").""; } - else - { + else { print "trans("NotAllowed")."\">".$langs->trans("StandingOrderReject").""; } } - else - { + else { print "trans("NotPossibleForThisStatusOfWithdrawReceiptORLine")."\">".$langs->trans("StandingOrderReject").""; } } @@ -330,8 +323,7 @@ if ($id) $db->free($result); } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 48f9bcc7c54..b93042df8e6 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -236,8 +236,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 6d1994b7a4b..a7e7a6f3a53 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -118,8 +118,7 @@ if ($result) print ""; $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index c6d1962ff46..609c75e065d 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -126,8 +126,7 @@ if ($resql) print ""; $db->free(); } -else -{ +else { dol_print_error($db); } @@ -220,8 +219,7 @@ if ($resql) print ""; $db->free($resql); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 3f2112537b1..83388f21e49 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -212,14 +212,12 @@ if ($id > 0) $db->free($resqlp); } - else - { + else { dol_print_error($db); } } } - else - { + else { dol_print_error($db); } @@ -289,8 +287,7 @@ if ($id > 0) print ""; } } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 27bc4526a3e..8d7c0343b30 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -151,7 +151,7 @@ if ($modecompta == "CREANCES-DETTES") $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesResultDue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -213,8 +213,7 @@ if ($modecompta == 'BOOKKEEPING') { print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], 'amount', '', $param, 'class="right"', $sortfield, $sortorder); } -else -{ +else { if ($modecompta == 'CREANCES-DETTES') { print_liste_field_titre("AmountHT", $_SERVER["PHP_SELF"], 'amount_ht', '', $param, 'class="right"', $sortfield, $sortorder); @@ -313,15 +312,13 @@ if ($modecompta == 'BOOKKEEPING') $i++; } } - else - { + else { print ''.$langs->trans("NoRecordFound").''; } } else dol_print_error($db); } -else -{ +else { /* * Factures clients */ @@ -336,8 +333,7 @@ else $sql .= " AND f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2,5)"; - else - $sql .= " AND f.type IN (0,1,2,3,5)"; + else $sql .= " AND f.type IN (0,1,2,3,5)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } @@ -463,8 +459,7 @@ else $sql .= " AND f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2)"; - else - $sql .= " AND f.type IN (0,1,2,3)"; + else $sql .= " AND f.type IN (0,1,2,3)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; } @@ -518,8 +513,7 @@ else $i++; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; @@ -768,15 +762,13 @@ else $i++; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; } } - else - { + else { dol_print_error($db); } print ''; @@ -854,15 +846,13 @@ else print ''; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; } } - else - { + else { dol_print_error($db); } print ''; @@ -888,8 +878,7 @@ else $sql .= " WHERE p.entity IN (".getEntity('donation').")"; $sql .= " AND fk_statut in (1,2)"; } - else - { + else { $sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."don as p"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_donation as pe ON pe.fk_donation = p.rowid"; @@ -936,15 +925,13 @@ else $i++; } } - else - { + else { print ' '; print ''.$langs->trans("None").''; print ''; } } - else - { + else { dol_print_error($db); } print ''; @@ -1083,8 +1070,7 @@ else $sql .= " WHERE f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2,5)"; - else - $sql .= " AND f.type IN (0,1,2,3,5)"; + else $sql .= " AND f.type IN (0,1,2,3,5)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; $sql .= " AND f.entity IN (".getEntity('invoice').")"; @@ -1131,8 +1117,7 @@ else $sql .= " WHERE f.fk_statut IN (1,2)"; if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $sql .= " AND f.type IN (0,1,2)"; - else - $sql .= " AND f.type IN (0,1,2,3)"; + else $sql .= " AND f.type IN (0,1,2,3)"; if (!empty($date_start) && !empty($date_end)) $sql .= " AND f.datef >= '".$db->idate($date_start)."' AND f.datef <= '".$db->idate($date_end)."'"; $sql .= " AND f.entity = ".$conf->entity; @@ -1173,8 +1158,7 @@ else print ''.price($amount)."\n"; print "\n"; } - else - { + else { // VAT really already paid $amount = 0; $sql = "SELECT date_format(t.datev,'%Y-%m') as dm, sum(t.amount) as amount"; @@ -1254,8 +1238,7 @@ else } $db->free($result); } - else - { + else { dol_print_error($db); } print ' '; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index ad81a3943c1..04bed25d6b2 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -131,7 +131,7 @@ if ($modecompta == 'CREANCES-DETTES') $description = $langs->trans("RulesAmountWithTaxIncluded"); $description .= '
'.$langs->trans("RulesResultDue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= "
".$langs->trans("DepositsAreNotIncluded"); - else $description .= "
".$langs->trans("DepositsAreIncluded"); + else $description .= "
".$langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -724,8 +724,7 @@ if (!empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' | } } } - else - { + else { dol_print_error($db); } } @@ -786,8 +785,7 @@ if (!empty($conf->don->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecom } } } - else - { + else { dol_print_error($db); } } @@ -826,8 +824,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba } } } - else - { + else { dol_print_error($db); } @@ -856,8 +853,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY) && !empty($conf->ba } } } - else - { + else { dol_print_error($db); } } @@ -894,8 +890,7 @@ if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan } } } - else - { + else { dol_print_error($db); } } @@ -961,8 +956,7 @@ if (!empty($conf->accounting->enabled) && ($modecompta == 'BOOKKEEPING')) } } } - else - { + else { dol_print_error($db); } } @@ -1042,8 +1036,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $totsorties[$annee] += $decaiss[$case]; } } - else - { + else { if (isset($decaiss_ttc[$case]) && $decaiss_ttc[$case] != 0) { print ''.price(price2num($decaiss_ttc[$case], 'MT')).''; @@ -1063,8 +1056,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $totentrees[$annee] += $encaiss[$case]; } } - else - { + else { if (isset($encaiss_ttc[$case])) { print ''.price(price2num($encaiss_ttc[$case], 'MT')).''; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 66adea3371f..172929aabff 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -178,7 +178,7 @@ if ($modecompta == "CREANCES-DETTES") //$periodlink=''.img_previous().' '.img_next().''; $description = $langs->trans("RulesResultDue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -375,7 +375,7 @@ elseif ($modecompta == "BOOKKEEPING") print "\n"; //var_dump($sommes); - } else // normal category + } else // normal category { $code = $cat['code']; // Category code we process diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index d7f20622a43..0cb706d3177 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -129,8 +129,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') header("Location: list.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -166,8 +165,7 @@ if ($action == 'add' && $user->rights->tax->charges->creer) setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; } - else - { + else { $object->type = $actioncode; $object->label = GETPOST('label', 'alpha'); $object->date_ech = $dateech; @@ -211,8 +209,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->tax->charges->cre setEventMessages($langs->trans("ErrorFieldMustBeANumeric", $langs->transnoentities("Amount")), null, 'errors'); $action = 'create'; } - else - { + else { $result = $object->fetch($id); $object->date_ech = $dateech; @@ -272,8 +269,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $id = $originalId; $db->rollback(); @@ -281,8 +277,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char } } } - else - { + else { $db->rollback(); dol_print_error($db, $object->error); } @@ -432,8 +427,7 @@ if ($id > 0) { $formquestion[] = array('type' => 'checkbox', 'name' => 'clone_for_next_month', 'label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1); } - else - { + else { $formquestion[] = array('type' => 'date', 'name' => 'clone_date_ech', 'label' => $langs->trans("Date"), 'value' => -1); $formquestion[] = array('type' => 'date', 'name' => 'clone_period', 'label' => $langs->trans("PeriodEndDate"), 'value' => -1); } @@ -536,8 +530,7 @@ if ($id > 0) { print $form->selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1); } - else - { + else { print dol_print_date($object->periode, "day"); } print ""; @@ -675,8 +668,7 @@ if ($id > 0) $i++; } } - else - { + else { print ''.$langs->trans("None").''; print ''; print ''; @@ -696,8 +688,7 @@ if ($id > 0) $db->free($resql); } - else - { + else { dol_print_error($db); } @@ -768,8 +759,7 @@ if ($id > 0) print ""; } } - else - { + else { /* Social contribution not found */ dol_print_error('', $object->error); } diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 6d3f4dffa4a..0c709c031d5 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -172,13 +172,11 @@ class ChargeSociales extends CommonObject return 1; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -258,8 +256,7 @@ class ChargeSociales extends CommonObject return -1 * $error; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -329,8 +326,7 @@ class ChargeSociales extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -387,8 +383,7 @@ class ChargeSociales extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -422,13 +417,11 @@ class ChargeSociales extends CommonObject $this->db->free($result); return $obj->amount; } - else - { + else { return 0; } } - else - { + else { print $this->db->error(); return -1; } @@ -613,8 +606,7 @@ class ChargeSociales extends CommonObject $this->db->free($resql); return $amount; } - else - { + else { return -1; } } @@ -668,8 +660,7 @@ class ChargeSociales extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index bae8d28a756..9164ab39f1e 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -200,8 +200,7 @@ class PaymentSocialContribution extends CommonObject } } } - else - { + else { $error++; } } @@ -216,8 +215,7 @@ class PaymentSocialContribution extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -287,8 +285,7 @@ class PaymentSocialContribution extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -359,8 +356,7 @@ class PaymentSocialContribution extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -415,8 +411,7 @@ class PaymentSocialContribution extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -466,8 +461,7 @@ class PaymentSocialContribution extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -578,8 +572,7 @@ class PaymentSocialContribution extends CommonObject } } } - else - { + else { $this->error = $acc->error; $error++; } @@ -589,8 +582,7 @@ class PaymentSocialContribution extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -614,8 +606,7 @@ class PaymentSocialContribution extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->error(); return 0; } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index 3c73c8e6614..e63c5f354d0 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -164,8 +164,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 9d210c23d85..be5f7e6f973 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -81,8 +81,7 @@ if (!GETPOSTISSET('search_typeid')) if ($part[0] == 'cs.fk_type') $search_typeid = $part[1]; } } -else -{ +else { $search_typeid = GETPOST('search_typeid', 'int'); } @@ -209,8 +208,7 @@ if ($resql) print $countrynotdefined; print ''; } - else - { + else { print '
'; print ''."\n"; @@ -314,8 +312,7 @@ if ($resql) { print 'jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode), 'day').''; } - else - { + else { print ' '; } print "\n"; @@ -346,8 +343,7 @@ if ($resql) } print ''; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 5cfa5df06ed..05808877df9 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -93,8 +93,7 @@ if ($mode != 'sconly') $center = ($year ? ''.img_previous($langs->trans("Previous"), 'class="valignbottom"')." ".$langs->trans("Year").' '.$year.' '.img_next($langs->trans("Next"), 'class="valignbottom"')."" : ""); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit, 1); } -else -{ +else { print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $center, $num, $totalnboflines, 'title_accountancy', 0, '', '', $limit); } @@ -209,8 +208,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print '"; print ""; } - else - { + else { dol_print_error($db); } print '
'.price($totalpaye)."
'; @@ -288,8 +286,7 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -311,8 +308,7 @@ elseif ($mysoc->localtax2_assuj == "1") $j = 2; $numlt = 3; } -else -{ +else { $j = 0; $numlt = 0; } @@ -389,8 +385,7 @@ while ($j < $numlt) print ""; $db->free($result); } - else - { + else { dol_print_error($db); } } @@ -473,8 +468,7 @@ if (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) print "
"; } - else - { + else { dol_print_error($db); } } diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index acd58f90217..3859b19df91 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -78,8 +78,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 5831467ce63..513b0ffa350 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -104,8 +104,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 4d4f56a1354..6d720b4f96d 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -97,8 +97,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } } -else -{ +else { // TODO We define q } // $date_start and $date_end are defined. We force $year_start and $nbofyear @@ -154,7 +153,7 @@ if ($modecompta == "CREANCES-DETTES") { //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description = $langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index bec20998cfa..85a27c7574a 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -114,8 +114,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } } -else -{ +else { // TODO We define q } @@ -180,7 +179,7 @@ if ($modecompta == "CREANCES-DETTES") //$calcmode.='
('.$langs->trans("SeeReportInInputOutputMode",'','').')'; $description = $langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index d1a64e218d2..cfc521c7c13 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -124,7 +124,7 @@ if ($modecompta == "CREANCES-DETTES") $periodlink = ($year_start ? "".img_previous()." ".img_next()."" : ""); $description = $langs->trans("RulesCADue"); if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description .= $langs->trans("DepositsAreNotIncluded"); - else $description .= $langs->trans("DepositsAreIncluded"); + else $description .= $langs->trans("DepositsAreIncluded"); $builddate = dol_now(); //$exportlink=$langs->trans("NotYetAvailable"); } @@ -260,8 +260,7 @@ if ($modecompta == 'RECETTES-DEPENSES') $i++; } } - else - { + else { dol_print_error($db); } } @@ -340,8 +339,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre. print ''.price($cum_ht[$case], 1).''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -357,8 +355,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print price($cum[$case], 1); if ($modecompta != 'BOOKKEEPING') print ''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -391,8 +388,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print '-'; } } - else - { + else { print ''; if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; } @@ -484,8 +480,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total_ht[$annee] ?price($total_ht[$annee]) : "0").""; } - else - { + else { print ' '; } } @@ -495,8 +490,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total[$annee] ?price($total[$annee]) : "0").""; } - else - { + else { print ' '; } @@ -520,8 +514,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) print '+0%'; } } - else - { + else { print ''; if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } else { print ' '; } diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index 3ff41f4d114..e9e0ec5926c 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -290,8 +290,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) $now_show_delta = 1; // On a trouve le premier mois de la premiere annee generant du chiffre. print ''.price($cum_ht[$case], 1).''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -307,8 +306,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print price($cum[$case], 1); if ($modecompta != 'BOOKKEEPING') print ''; } - else - { + else { if ($minyearmonth < $case && $case <= max($maxyearmonth, $nowyearmonth)) { print '0'; } else { print ' '; } } @@ -341,8 +339,7 @@ for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) print '-'; } } - else - { + else { print ''; if ($minyearmonth <= $case && $case <= $maxyearmonth) { print '-'; } else { print ' '; } @@ -369,8 +366,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total_ht[$annee] ?price($total_ht[$annee]) : "0").""; } - else - { + else { print ' '; } } @@ -380,8 +376,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) { print ''.($total[$annee] ?price($total[$annee]) : "0").""; } - else - { + else { print ' '; } @@ -405,8 +400,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) print '+0%'; } } - else - { + else { print ''; if ($total[$annee] || ($minyear <= $annee && $annee <= max($nowyear, $maxyear))) { print '-'; } else { print ' '; } diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index fafb967ace1..9b25488c280 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -101,8 +101,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false); } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index fcae12f744b..76f9c246e87 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -108,8 +108,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } if ($q == 4) { $date_start = dol_get_first_day($year_start, 10, false); $date_end = dol_get_last_day($year_start, 12, false); } } -else -{ +else { // TODO We define q } diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 658c9353a00..3df7419019a 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -132,8 +132,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) header("Location: list.php"); exit; } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; @@ -167,21 +166,18 @@ if ($action == 'delete') header("Location: ".DOL_URL_ROOT.'/compta/tva/list.php'); exit; } - else - { + else { $object->error = $accountline->error; $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $db->rollback(); setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { $mesg = 'Error try do delete a line linked to a conciliated bank transaction'; setEventMessages($mesg, null, 'errors'); } @@ -389,13 +385,11 @@ if ($id) { print ''; } - else - { + else { print ''; } } - else - { + else { print ''; } print "
"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index c01408f3c9a..baeaff7a5d6 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -151,14 +151,12 @@ class Tva extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -225,8 +223,7 @@ class Tva extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -294,8 +291,7 @@ class Tva extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -405,14 +401,12 @@ class Tva extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -446,14 +440,12 @@ class Tva extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -489,14 +481,12 @@ class Tva extends CommonObject $this->db->free($result); return $ret; } - else - { + else { $this->db->free($result); return 0; } } - else - { + else { print $this->db->lasterror(); return -1; } @@ -613,8 +603,7 @@ class Tva extends CommonObject { $this->update_fk_bank($bank_line_id); } - else - { + else { $this->error = $acc->error; $ok = 0; } @@ -633,20 +622,17 @@ class Tva extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -1; @@ -670,8 +656,7 @@ class Tva extends CommonObject { return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -753,8 +738,7 @@ class Tva extends CommonObject $this->db->free($resql); return $amount; } - else - { + else { return -1; } } @@ -800,8 +784,7 @@ class Tva extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index bcedba7a074..158c974114d 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -67,8 +67,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", 'int')) { $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), false); $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), false); } - else - { + else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; @@ -92,8 +91,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -322,8 +320,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) 'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { $invoice_supplier->id = $x_paye[$my_paye_thirdpartyid]['facid'][$id]; $invoice_supplier->ref = $x_paye[$my_paye_thirdpartyid]['facnum'][$id]; $invoice_supplier->type = $x_paye[$my_paye_thirdpartyid]['type'][$id]; @@ -694,8 +691,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print $langs->trans("NA"); } - else - { + else { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index fabaf1ee705..45efc9681d8 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -149,8 +149,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 0a785aa78cd..c85f2bbdb8f 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -58,8 +58,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; @@ -83,8 +82,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -177,8 +175,7 @@ function pt($db, $sql, $date) $previousmode = ''; $previousmonth = ''; } - else - { + else { $previousmode = $obj->mode; $previousmonth = $obj->dm; } @@ -372,8 +369,7 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) // $mc //'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { //$invoice_supplier->id=$x_paye[$my_paye_rate]['facid'][$id]; //$invoice_supplier->ref=$x_paye[$my_paye_rate]['facnum'][$id]; //$invoice_supplier->type=$x_paye[$my_paye_rate]['type'][$id]; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 003a7eabcad..98eede887c8 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -73,8 +73,7 @@ if (empty($_REQUEST['typeid'])) if ($part[0] == 't.fk_typepayment') $typeid = $part[1]; } } -else -{ +else { $typeid = $_REQUEST['typeid']; } @@ -229,8 +228,7 @@ if ($result) { $type = ''.$langs->trans("PaymentTypeShort".$obj->payment_code).' '.$obj->num_payment.''; } - else - { + else { $type = ' '; } @@ -292,8 +290,7 @@ if ($result) $db->free($result); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 79ee69a030c..6e16165ab6c 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -67,8 +67,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end if (empty($q)) { if (GETPOST("month", "int")) { $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); } - else - { + else { if (empty($conf->global->MAIN_INFO_VAT_RETURN) || $conf->global->MAIN_INFO_VAT_RETURN == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); $date_end = dol_time_plus_duree($date_start, 3, 'm') - 1; @@ -92,8 +91,7 @@ if (empty($date_start) || empty($date_end)) // We define date_start and date_end } } } - else - { + else { if ($q == 1) { $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false); } if ($q == 2) { $date_start = dol_get_first_day($year_start, 4, false); $date_end = dol_get_last_day($year_start, 6, false); } if ($q == 3) { $date_start = dol_get_first_day($year_start, 7, false); $date_end = dol_get_last_day($year_start, 9, false); } @@ -316,8 +314,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) 'link' =>$expensereport->getNomUrl(1) ); } - else - { + else { $invoice_supplier->id = $x_paye[$my_paye_rate]['facid'][$id]; $invoice_supplier->ref = $x_paye[$my_paye_rate]['facnum'][$id]; $invoice_supplier->type = $x_paye[$my_paye_rate]['type'][$id]; @@ -440,8 +437,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); } } - else - { + else { if ($type) { $text = img_object($langs->trans('Service'), 'service'); } else { @@ -621,8 +617,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) print ' - '.dol_trunc(dol_string_nohtmltag($fields['descr']), 24); } } - else - { + else { if ($type) { $text = img_object($langs->trans('Service'), 'service'); } else { @@ -674,8 +669,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print $langs->trans("NA"); } - else - { + else { if (isset($fields['payment_amount']) && $fields['ftotal_ttc']) { $ratiopaymentinvoice = ($fields['payment_amount'] / $fields['ftotal_ttc']); } diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 625cf524169..874a964a965 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -77,8 +77,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); @@ -160,8 +159,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } -else -{ +else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index fbd31812fe8..e005d3dca7b 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -120,8 +120,7 @@ abstract class ActionsContactCardCommon $this->tpl['company'] = $objsoc->getNomUrl(1); $this->tpl['company_id'] = $objsoc->id; } - else - { + else { $this->tpl['company'] = $form->select_company($this->object->socid, 'socid', '', 1); } @@ -223,8 +222,7 @@ abstract class ActionsContactCardCommon $objsoc->fetch($this->object->socid); $this->tpl['company'] = $objsoc->getNomUrl(1); } - else - { + else { $this->tpl['company'] = $langs->trans("ContactNotLinkedToCompany"); } @@ -310,8 +308,7 @@ abstract class ActionsContactCardCommon { $obj = $this->db->fetch_object($resql); } - else - { + else { dol_print_error($this->db); } $this->object->country_id = $langs->trans("Country".$obj->code) ? $langs->trans("Country".$obj->code) : $obj->label; diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index 54b3f137967..6ac81ac8bd4 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -105,8 +105,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon $this->tpl['actionsdone'] = show_actions_done($conf, $langs, $db, $objsoc, $this->object, 1); } - else - { + else { // Confirm delete contact if ($action == 'delete' && $user->rights->societe->contact->supprimer) { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index a6e5bee1898..885878138ba 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -129,20 +129,17 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $error = $nuser->error; $errors = $nuser->errors; $db->rollback(); } } - else - { + else { $error = $nuser->error; $errors = $nuser->errors; $db->rollback(); } } - else - { + else { $error = $object->error; $errors = $object->errors; } } @@ -156,8 +153,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -171,8 +167,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } - else - { + else { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -278,8 +273,7 @@ if (empty($reshook)) header("Location: ".$url); exit; } - else - { + else { $db->rollback(); } } @@ -300,14 +294,12 @@ if (empty($reshook)) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/contact/list.php'); exit; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -351,8 +343,7 @@ if (empty($reshook)) { $errors[] = "ErrorFailedToSaveFile"; } - else - { + else { $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); // Create thumbs @@ -360,13 +351,11 @@ if (empty($reshook)) } } } - else - { + else { $errors[] = "ErrorBadImageFormat"; } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -452,8 +441,7 @@ if (empty($reshook)) } } } - else - { + else { $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_unsubscribe WHERE email = '".$db->escape($object->email)."' AND entity = ".$db->escape(getEntity('mailing', 0)); $resql = $db->query($sql); } @@ -465,8 +453,7 @@ if (empty($reshook)) $object->old_firstname = ''; $action = 'view'; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } @@ -526,8 +513,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) $objcanvas->assign_values($action, $object->id, $object->ref); // Set value for templates $objcanvas->display_canvas($action); // Show template } -else -{ +else { // ----------------------------------------- // When used in standard mode // ----------------------------------------- @@ -703,8 +689,7 @@ else { print ''; } - else - { + else { print ''; } @@ -712,8 +697,7 @@ else { print $formcompany->select_state(GETPOST("state_id", 'alpha') ? GETPOST("state_id", 'alpha') : $object->state_id, $object->country_code, 'state_id'); } - else - { + else { print $countrynotdefined; } print ''; @@ -871,8 +855,7 @@ else { print $form->selectDate($object->birthday, 'birthday', 0, 0, 0, "perso", 1, 0); } - else - { + else { print $form->selectDate('', 'birthday', 0, 0, 1, "perso", 1, 0); } print ''; @@ -882,8 +865,7 @@ else { print ''; } - else - { + else { print ''; } print ''; @@ -900,8 +882,7 @@ else print '     '; print ''; } - else - { + else { print '     '; print ''; } @@ -1031,8 +1012,7 @@ else { print ''; } - else - { + else { print ''; } @@ -1070,8 +1050,7 @@ else print ''.$langs->trans("NbOfEMailingsSend").''; print ''.$object->getNbOfEMailings().''; } - else - { + else { print ''; } print ''; @@ -1096,8 +1075,7 @@ else print ''; print ''.$form->selectyesno('no_email', (GETPOSTISSET("no_email") ?GETPOST("no_email", 'alpha') : $noemail), 1).''; } - else - { + else { print ''; } print ''; @@ -1479,8 +1457,7 @@ else $langs->load("mails"); print '
'.$langs->trans('SendMail').'
'; } - else - { + else { $langs->load("mails"); print '
'.$langs->trans('SendMail').'
'; } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d9753001db2..fc640e7e032 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -288,8 +288,7 @@ class Contact extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->lasterror(); return -1; @@ -389,15 +388,13 @@ class Contact extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -2; } } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); @@ -597,15 +594,13 @@ class Contact extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -$error; } } - else - { + else { $this->error = $this->db->lasterror().' sql='.$sql; $this->db->rollback(); return -1; @@ -762,13 +757,11 @@ class Contact extends CommonObject $this->error = $this->db->lasterror(); } } - else - { + else { $result = true; } } - else - { + else { $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_alert "; $sql .= "WHERE type=1 AND fk_contact=".$this->db->escape($id)." AND fk_user=".$user->id; $result = $this->db->query($sql); @@ -792,8 +785,7 @@ class Contact extends CommonObject $this->db->commit(); return 1; } - else - { + else { dol_syslog(get_class($this)."::update Error ".$this->error, LOG_ERR); $this->db->rollback(); return -$error; @@ -846,8 +838,7 @@ class Contact extends CommonObject $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; if ($id) $sql .= " WHERE c.rowid = ".$id; - else - { + else { $sql .= " WHERE c.entity IN (".getEntity($this->element).")"; if ($ref_ext) { $sql .= " AND c.ref_ext = '".$this->db->escape($ref_ext)."'"; @@ -943,8 +934,7 @@ class Contact extends CommonObject } $this->db->free($resql); } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -971,8 +961,7 @@ class Contact extends CommonObject } $this->db->free($resql); } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -988,14 +977,12 @@ class Contact extends CommonObject return 1; } - else - { + else { $this->error = $langs->trans("RecordNotFound"); return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1062,8 +1049,7 @@ class Contact extends CommonObject $this->db->free($resql); return 0; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -1119,8 +1105,7 @@ class Contact extends CommonObject $i++; } } - else - { + else { $error++; $this->error = $this->db->error().' sql='.$sql; } @@ -1187,8 +1172,7 @@ class Contact extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); dol_syslog("Error ".$this->error, LOG_ERR); return -1; @@ -1236,8 +1220,7 @@ class Contact extends CommonObject $this->db->free($resql); } - else - { + else { print $this->db->error(); } } @@ -1263,8 +1246,7 @@ class Contact extends CommonObject $this->db->free($resql); return $nb; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -1526,8 +1508,7 @@ class Contact extends CommonObject $this->db->rollback(); return -$error; } - else - { + else { $this->db->commit(); return 1; } @@ -1681,8 +1662,7 @@ class Contact extends CommonObject return $tab; } - else - { + else { $this->error = $this->db->error(); dol_print_error($this->db); return -1; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index ad4b5ca08f5..ff3570e7e82 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -424,8 +424,7 @@ if ($sql_select) { print $documentstaticline->getLibStatut(2); } - else - { + else { print $documentstatic->getLibStatut(2); } print ''; @@ -468,8 +467,7 @@ if ($sql_select) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - { + else { $label = $objp->product_label; } @@ -516,14 +514,12 @@ if ($sql_select) // Add date of deposit if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) echo ' ('.dol_print_date($discount->datec).')'; } - else - { + else { echo ($txt ? ' - ' : '').dol_htmlentitiesbr($objp->description); } } } - else - { + else { if ($objp->fk_product > 0) { echo $form->textwithtooltip($text, $description, 3, '', '', $i, 0, ''); diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 842d03cb3a6..7934bbd5996 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -68,8 +68,7 @@ if ($action == 'dolibarr2ldap') setEventMessages($langs->trans("ContactSynchronized"), null, 'mesgs'); $db->commit(); } - else - { + else { setEventMessages($ldap->error, $ldap->errors, 'errors'); $db->rollback(); } @@ -107,8 +106,7 @@ if ($object->socid > 0) print ''.$langs->trans("ThirdParty").''.$thirdparty->getNomUrl(1).''; } -else -{ +else { print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; @@ -184,21 +182,18 @@ if ($result > 0) { print ''.$langs->trans("ErrorFailedToReadLDAP").''; } - else - { + else { $result = show_ldap_content($records, 0, $records['count'], true); } } - else - { + else { print ''.$langs->trans("LDAPRecordNotFound").' (dn='.$dn.' - search='.$search.')'; } $ldap->unbind(); $ldap->close(); } -else -{ +else { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 9e7485d189f..a6add5c7d75 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -327,8 +327,7 @@ if ($search_priv != '0' && $search_priv != '1') { $sql .= " AND (p.priv='0' OR (p.priv='1' AND p.fk_user_creat=".$user->id."))"; } -else -{ +else { if ($search_priv == '0') $sql .= " AND p.priv='0'"; if ($search_priv == '1') $sql .= " AND (p.priv='1' AND p.fk_user_creat=".$user->id.")"; } @@ -404,8 +403,7 @@ if ($view == "recent") { $sql .= $db->order("p.datec", "DESC"); } -else -{ +else { $sql .= $db->order($sortfield, $sortorder); } @@ -923,8 +921,7 @@ while ($i < min($num, $limit)) $objsoc->fetch($obj->socid); print $objsoc->getNomUrl(1); } - else - print ' '; + else print ' '; print ''; if (!$i) $totalarray['nbfield']++; } diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index 5a6ea3eb032..5665030b6d5 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -86,20 +86,17 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- { setEventMessages($langs->trans("ErrorFailedToSaveFile"), null, 'errors'); } - else - { + else { // Create thumbs $object->addThumbs($newfile); } } } - else - { + else { setEventMessages("ErrorBadImageFormat", null, 'errors'); } } - else - { + else { switch ($_FILES['photo']['error']) { case 1: //uploaded file exceeds the upload_max_filesize directive in php.ini @@ -112,8 +109,7 @@ if ($action == 'update' && !$_POST["cancel"] && $user->rights->societe->contact- } } } - else - { + else { $error = $object->error; } } @@ -184,8 +180,7 @@ if ($action == 'edit') print ''.$langs->trans("ThirdParty").''.$objsoc->getNomUrl(1).''; } - else - { + else { print ''.$langs->trans("ThirdParty").''; print $langs->trans("ContactNotLinkedToCompany"); print ''; @@ -208,8 +203,7 @@ if ($action == 'edit') { print ''; } - else - { + else { print ''; } print ''; @@ -226,8 +220,7 @@ if ($action == 'edit') print ""; } -else -{ +else { // View mode dol_fiche_head($head, 'perso', $title, -1, 'contact'); @@ -302,8 +295,7 @@ else else print $langs->trans("BirthdayAlertOff"); print ''; } - else - { + else { print ''.$langs->trans("DateToBirth").''; } print ""; diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 75362491424..ee325317033 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -102,8 +102,7 @@ if ($company->id) $v->setEmail($company->email, 'INTERNET'); } // when e-mail of contact and company complete different use company e-mail at first (and contact e-mail at second) - else - { + else { $v->setEmail($company->email); // support by Microsoft Outlook (2019 and possible earlier) diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 0055b0ba428..36a9c950069 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -40,8 +40,7 @@ if (GETPOST('actioncode', 'array')) $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } -else -{ +else { $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9f825cdf009..7a2f8cf311f 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -133,8 +133,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -303,8 +302,7 @@ if (empty($reshook)) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["libelle"])) ? $prod->multilangs[$outputlangs->defaultlang]["libelle"] : $lines[$i]->product_label; } - else - { + else { $label = $lines[$i]->product_label; } $desc = ($lines[$i]->desc && $lines[$i]->desc != $lines[$i]->libelle) ?dol_htmlentitiesbr($lines[$i]->desc) : ''; @@ -355,8 +353,7 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($srcobject->error, $srcobject->errors, 'errors'); $error++; } @@ -368,14 +365,12 @@ if (empty($reshook)) if ($reshook < 0) $error++; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } } - else - { + else { $result = $object->create($user); if ($result > 0) { @@ -408,8 +403,7 @@ if (empty($reshook)) $idprod = 0; $tva_tx = (GETPOST('tva_tx', 'alpha') ? GETPOST('tva_tx', 'alpha') : 0); } - else - { + else { $idprod = GETPOST('idprod', 'int'); $tva_tx = ''; } @@ -514,8 +508,7 @@ if (empty($reshook)) { $pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU'); } - else - { + else { $pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU'); } } @@ -526,8 +519,7 @@ if (empty($reshook)) $fk_unit = $prod->fk_unit; } - else - { + else { $pu_ht = GETPOST('price_ht'); $price_base_type = 'HT'; $tva_tx = GETPOST('tva_tx') ?str_replace('*', '', GETPOST('tva_tx')) : 0; // tva_tx field may be disabled, so we use vat rate 0 @@ -543,8 +535,7 @@ if (empty($reshook)) $fk_fournprice = $_POST['fournprice']; if (!empty($_POST['buying_price'])) $pa_ht = $_POST['buying_price']; - else - $pa_ht = null; + else $pa_ht = null; $info_bits = 0; if ($tva_npr) $info_bits |= 0x01; @@ -555,8 +546,7 @@ if (empty($reshook)) $object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency)); $result = -1; } - else - { + else { // Insert line $result = $object->addline( $desc, @@ -630,8 +620,7 @@ if (empty($reshook)) unset($_POST['date_endmonth']); unset($_POST['date_endyear']); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -692,8 +681,7 @@ if (empty($reshook)) $fk_fournprice = $_POST['fournprice']; if (!empty($_POST['buying_price'])) $pa_ht = $_POST['buying_price']; - else - $pa_ht = null; + else $pa_ht = null; $fk_unit = GETPOST('unit', 'alpha'); @@ -745,8 +733,7 @@ if (empty($reshook)) { $db->commit(); } - else - { + else { $db->rollback(); } } @@ -760,8 +747,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -789,8 +775,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -832,8 +817,7 @@ if (empty($reshook)) header("Location: list.php?restore_lastsearch_values=1"); return; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -851,13 +835,11 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); return; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("RefNewContract")), null, 'errors'); } } @@ -1015,15 +997,13 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); setEventMessages($langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"), null, 'errors'); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1058,8 +1038,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } - else - { + else { if ($object->id > 0) { $result = $object->createFromClone($user, $socid); if ($result > 0) { @@ -1120,8 +1099,7 @@ if ($action == 'create') { $projectid = GETPOST('originid'); } - else - { + else { // For compatibility if ($element == 'order' || $element == 'commande') { $element = $subelement = 'commande'; } if ($element == 'propal') { $element = 'comm/propal'; $subelement = 'propal'; } @@ -1196,8 +1174,7 @@ if ($action == 'create') print ''; print ''; } - else - { + else { print ''; print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300'); print ' '.$langs->trans("AddThirdParty").''; @@ -1292,8 +1269,7 @@ if ($action == 'create') print "\n"; } -else -/* *************************************************************************** */ +else /* *************************************************************************** */ /* */ /* Mode vue et edition */ /* */ @@ -1600,8 +1576,7 @@ else print ''; } - else - { + else { print ''.img_object($langs->trans("ShowProductOrService"), ($objp->product_type ? 'service' : 'product')).' '.dol_htmlentitiesbr($objp->description)."\n"; } // VAT @@ -1623,8 +1598,7 @@ else { print ''.$objp->remise_percent."%\n"; } - else - { + else { print ' '; } @@ -1709,8 +1683,7 @@ else } } // Line in mode update - else - { + else { // Ligne carac print ''; print ''; @@ -1724,8 +1697,7 @@ else print $objp->label ? ' - '.dol_trunc($objp->label, 32) : ''; print '
'; } - else - { + else { print $objp->label ? $objp->label.'
' : ''; } @@ -1802,8 +1774,7 @@ else $db->free($result); } - else - { + else { dol_print_error($db); } @@ -1874,8 +1845,7 @@ else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEndReal")), null, 'errors'); } - else - { + else { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne', 'int')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService", dol_print_date($dateactend, "%A %d %B %Y")), "confirm_closeline", '', 0, 1); } print '
'; @@ -2112,8 +2082,7 @@ else if ($object->statut == 1) { if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { print '
'.$langs->trans('SendMail').'
'; - } else - print '
'.$langs->trans('SendMail').'
'; + } else print '
'.$langs->trans('SendMail').'
'; } } @@ -2153,8 +2122,7 @@ else { print '
'.$langs->trans("ActivateAllContracts").'
'; } - else - { + else { print '
'.$langs->trans("ActivateAllContracts").'
'; } } @@ -2164,8 +2132,7 @@ else { print '
'.$langs->trans("CloseAllContracts").'
'; } - else - { + else { print '
'.$langs->trans("CloseAllContracts").'
'; } @@ -2185,8 +2152,7 @@ else { print '
'.$langs->trans("Delete").'
'; } - else - { + else { print '
'.$langs->trans("Delete").'
'; } } diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index a35d3c871de..9caa33fca2d 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -465,8 +465,7 @@ class Contracts extends DolibarrApi if ($updateRes > 0) { return $this->get($id); } - else - { + else { throw new RestException(405, $this->contract->error); } } @@ -502,8 +501,7 @@ class Contracts extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->contract->error); } } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 1dec473edac..304628d97cc 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -299,15 +299,13 @@ class Contrat extends CommonObject { return $numref; } - else - { + else { $this->error = $obj->error; dol_print_error($db, get_class($this)."::getNextValue ".$obj->error); return ""; } } - else - { + else { $langs->load("errors"); print $langs->trans("Error")." ".$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Contract")); return ""; @@ -411,8 +409,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -468,8 +465,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -513,8 +509,7 @@ class Contrat extends CommonObject { $num = $this->getNextNumRef($this->thirdparty); } - else - { + else { $num = $this->ref; } $this->newref = dol_sanitizeFileName($num); @@ -592,8 +587,7 @@ class Contrat extends CommonObject $this->date_validation = $now; } } - else - { + else { $error++; } @@ -602,8 +596,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -667,8 +660,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -771,15 +763,13 @@ class Contrat extends CommonObject return $this->id; } } - else - { + else { dol_syslog(get_class($this)."::fetch Contract not found"); $this->error = "Contract not found"; return 0; } } - else - { + else { dol_syslog(get_class($this)."::fetch Error searching contract"); $this->error = $this->db->error(); return -1; @@ -940,8 +930,7 @@ class Contrat extends CommonObject } $this->db->free($result); } - else - { + else { dol_syslog(get_class($this)."::Fetch Error when reading lines of contracts linked to products"); return -3; } @@ -1082,7 +1071,7 @@ class Contrat extends CommonObject } } } - else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) + else // Old behaviour, if linked_object has only one link per type, so is something like array('contract'=>id1)) { $origin_id = $tmp_origin_id; $ret = $this->add_object_linked($origin, $origin_id); @@ -1146,23 +1135,20 @@ class Contrat extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { dol_syslog(get_class($this)."::create - 30 - ".$this->error, LOG_ERR); $this->db->rollback(); return -3; } } - else - { + else { $this->error = "Failed to add contract"; dol_syslog(get_class($this)."::create - 20 - ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $langs->trans("UnknownError: ".$this->db->error()." -", LOG_DEBUG); $this->db->rollback(); @@ -1332,8 +1318,7 @@ class Contrat extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); $this->db->rollback(); return -1; @@ -1427,8 +1412,7 @@ class Contrat extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -1506,8 +1490,7 @@ class Contrat extends CommonObject { $pu = $pu_ht; } - else - { + else { $pu = $pu_ttc; } @@ -1559,8 +1542,7 @@ class Contrat extends CommonObject { return $result; } - else - { + else { $pa_ht = $result; } } @@ -1632,21 +1614,18 @@ class Contrat extends CommonObject $this->db->rollback(); return -1; } - else - { + else { $this->db->commit(); return $contractlineid; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error()." sql=".$sql; return -1; } } - else - { + else { dol_syslog(get_class($this)."::addline ErrorTryToAddLineOnValidatedContract", LOG_ERR); return -2; } @@ -1699,8 +1678,7 @@ class Contrat extends CommonObject $remise = round(($pu * $remise_percent / 100), 2); $price = $pu - $remise; } - else - { + else { $remise_percent = 0; } @@ -1751,8 +1729,7 @@ class Contrat extends CommonObject { return $result; } - else - { + else { $pa_ht = $result; } } @@ -1826,15 +1803,13 @@ class Contrat extends CommonObject return 1; } } - else - { + else { $this->db->rollback(); dol_syslog(get_class($this)."::updateline Erreur -2"); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); dol_syslog(get_class($this)."::updateline Erreur -1"); @@ -1896,8 +1871,7 @@ class Contrat extends CommonObject return -1; } } - else - { + else { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } @@ -1994,8 +1968,7 @@ class Contrat extends CommonObject $text .= ($mode == 7 ? '' : ''); return $text; } - else - { + else { return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } } @@ -2114,8 +2087,7 @@ class Contrat extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -2151,8 +2123,7 @@ class Contrat extends CommonObject } return $tab; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2189,8 +2160,7 @@ class Contrat extends CommonObject } return $tab; } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -2291,8 +2261,7 @@ class Contrat extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2334,8 +2303,7 @@ class Contrat extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2960,8 +2928,7 @@ class ContratLigne extends CommonObjectLine return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -3047,8 +3014,7 @@ class ContratLigne extends CommonObjectLine { return $result; } - else - { + else { $this->pa_ht = $result; } } @@ -3196,8 +3162,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error(); $this->db->rollback(); return -2; @@ -3279,8 +3244,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error()." sql=".$sql; return -1; @@ -3334,8 +3298,7 @@ class ContratLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index 1da2416ce84..250d89e3e88 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -71,8 +71,7 @@ if ($action == 'addcontact' && $user->rights->contrat->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); $msg = $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); @@ -91,8 +90,7 @@ if ($action == 'swapstatut' && $user->rights->contrat->creer) { $result = $object->swapContactStatus(GETPOST('ligne')); } - else - { + else { dol_print_error($db, $object->error); } } diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index fd3b3f66e4a..e43db63826f 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -194,8 +194,7 @@ if ($object->id) $param = '&id='.$object->id; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } -else -{ +else { print $langs->trans("ErrorUnknown"); } diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 2a7c9c0d91a..4530d01a6af 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -141,8 +141,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } // Search by status (only expired) @@ -180,8 +179,7 @@ if ($resql) } $db->free($resql); } -else -{ +else { dol_print_error($db); } @@ -299,15 +297,13 @@ if (!empty($conf->contrat->enabled) && $user->rights->contrat->lire) $i++; } } - else - { + else { print ''.$langs->trans("NoContracts").''; } print "
"; $db->free($resql); } - else - { + else { dol_print_error($db); } } @@ -384,8 +380,7 @@ if ($result) print ""; } -else -{ +else { dol_print_error($db); } @@ -440,8 +435,7 @@ if ($resql) $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); } - else - { + else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -463,8 +457,7 @@ if ($resql) print ""; } -else -{ +else { dol_print_error($db); } @@ -520,8 +513,7 @@ if ($resql) $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); } - else - { + else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -542,8 +534,7 @@ if ($resql) print ""; } -else -{ +else { dol_print_error($db); } @@ -600,8 +591,7 @@ if ($resql) $productstatic->entity = $obj->pentity; print $productstatic->getNomUrl(1, '', 20); } - else - { + else { print ''.img_object($langs->trans("ShowService"), "service"); if ($obj->label) print ' '.dol_trunc($obj->label, 20).''; else print ' '.dol_trunc($obj->note, 20); @@ -622,8 +612,7 @@ if ($resql) print ""; } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index a7205730817..5053b703966 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -732,8 +732,7 @@ while ($i < min($num, $limit)) } //else print $langs->trans("NoSalesRepresentativeAffected"); } - else - { + else { print ' '; } print ''; diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 2b81ceff5fa..62a853270e1 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -98,14 +98,12 @@ if ($search_status != '') $tmp = explode('&', $search_status); $mode = $tmp[0]; if (empty($tmp[1])) $filter = ''; - else - { + else { if ($tmp[1] == 'filter=notexpired') $filter = 'notexpired'; if ($tmp[1] == 'filter=expired') $filter = 'expired'; } } -else -{ +else { $search_status = $mode; if ($filter == 'expired') $search_status .= '&filter=expired'; if ($filter == 'notexpired') $search_status .= '&filter=notexpired'; @@ -598,8 +596,7 @@ while ($i < min($num, $limit)) print $obj->label ? ' - '.dol_trunc($obj->label, 16) : ''; if (!empty($obj->description) && !empty($conf->global->PRODUCT_DESC_IN_LIST)) print '
'.dol_nl2br($obj->description); } - else - { + else { if ($obj->type == 0) print img_object($obj->description, 'product').' '.dol_trunc($obj->description, 24); if ($obj->type == 1) print img_object($obj->description, 'service').' '.dol_trunc($obj->description, 24); } @@ -725,8 +722,7 @@ while ($i < min($num, $limit)) // If contract is draft, we say line is also draft print $contractstatic->LibStatut(0, 5); } - else - { + else { print $staticcontratligne->LibStatut($obj->statut, 5, ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < $now) ? 1 : 0); } print ''; diff --git a/htdocs/cron/admin/cron.php b/htdocs/cron/admin/cron.php index b9c00885d69..fe5b015214a 100644 --- a/htdocs/cron/admin/cron.php +++ b/htdocs/cron/admin/cron.php @@ -51,8 +51,7 @@ if (!empty($actionsave)) $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - else - { + else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } @@ -97,8 +96,7 @@ if (empty($conf->global->CRON_DISABLE_KEY_CHANGE)) if (!empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); } -else -{ +else { print (!empty($conf->global->CRON_KEY) ? $conf->global->CRON_KEY : ''); print ''; } diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 9ebbcda6c44..0d2455ae620 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -66,15 +66,13 @@ if (!empty($cancel)) { $action = ''; } - else - { + else { if ($backtourl) { header("Location: ".$backtourl); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/cron/list.php'); exit; } @@ -91,8 +89,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->cron->del setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } - else - { + else { Header("Location: ".DOL_URL_ROOT.'/cron/list.php'); exit; } @@ -106,8 +103,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors'); $action = ''; } - else - { + else { $now = dol_now(); // Date we start $result = $object->run_jobs($user->login); @@ -117,8 +113,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } - else - { + else { $res = $object->reprogram_jobs($user->login, $now); if ($res > 0) { @@ -126,8 +121,7 @@ if ($action == 'confirm_execute' && $confirm == "yes" && $user->rights->cron->ex else setEventMessages($langs->trans("JobFinished"), null, 'mesgs'); $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -416,8 +410,7 @@ if (($action == "create") || ($action == "edit")) { print ""; } - else - { + else { print ""; } } @@ -473,8 +466,7 @@ if (($action == "create") || ($action == "edit")) { print $form->selectDate($object->datestart, 'datestart', 1, 1, '', "cronform"); } - else - { + else { print $form->selectDate('', 'datestart', 1, 1, '', "cronform"); } print ""; @@ -527,8 +519,7 @@ if (($action == "create") || ($action == "edit")) { print $form->selectDate($object->datenextrun, 'datenextrun', 1, 1, '', "cronform"); } - else - { + else { print $form->selectDate(-1, 'datenextrun', 1, 1, '', "cronform"); } print ""; @@ -548,8 +539,7 @@ if (($action == "create") || ($action == "edit")) print "\n"; } -else -{ +else { /* * view card */ @@ -622,8 +612,7 @@ else { print $langs->trans("AllEntities"); } - else - { + else { $mc->getInfo($object->entity); print $mc->label; } diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 92a132a6789..f3c02c72cbb 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -280,8 +280,7 @@ class Cronjob extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return $this->id; } @@ -378,8 +377,7 @@ class Cronjob extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -518,8 +516,7 @@ class Cronjob extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -655,8 +652,7 @@ class Cronjob extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -697,8 +693,7 @@ class Cronjob extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -753,8 +748,7 @@ class Cronjob extends CommonObject $this->db->commit(); return $object->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -895,8 +889,7 @@ class Cronjob extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -952,8 +945,7 @@ class Cronjob extends CommonObject $conf->entity = $savcurrententity; return -1; } - else - { + else { if (empty($user->id)) { $this->error = " User user login:".$userlogin." do not exists"; @@ -1057,8 +1049,7 @@ class Cronjob extends CommonObject { $result = call_user_func(array($object, $this->methodename), $this->params); } - else - { + else { $result = call_user_func_array(array($object, $this->methodename), $params_arr); } @@ -1079,8 +1070,7 @@ class Cronjob extends CommonObject $retval = $this->lastresult; $error++; } - else - { + else { dol_syslog(get_class($this)."::run_jobs END"); $this->lastoutput = $object->output; $this->lastresult = var_export($result, true); @@ -1117,8 +1107,7 @@ class Cronjob extends CommonObject { $result = call_user_func($this->methodename, $this->params); } - else - { + else { $result = call_user_func_array($this->methodename, $params_arr); } @@ -1132,8 +1121,7 @@ class Cronjob extends CommonObject $retval = $this->lastresult; $error++; } - else - { + else { $this->lastoutput = var_export($result, true); $this->lastresult = var_export($result, true); // Return code $retval = $this->lastresult; @@ -1202,8 +1190,7 @@ class Cronjob extends CommonObject dol_syslog(get_class($this)."::reprogram_jobs ".$this->error, LOG_ERR); return -1; } - else - { + else { if (empty($user->id)) { $this->error = " User user login:".$userlogin." do not exists"; @@ -1230,8 +1217,7 @@ class Cronjob extends CommonObject // TODO For exact frequency (every month, every year, ...), use instead a dol_time_plus_duree($time, $duration_value, $duration_unit) } } - else - { + else { //$this->datenextrun=$this->datenextrun + ($this->frequency * $this->unitfrequency); dol_syslog(get_class($this)."::reprogram_jobs datenextrun is already in future, we do not change it"); } diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index e9afad3b48b..a91dd4b9d66 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -133,8 +133,7 @@ if (empty($reshook)) setEventMessages('Security key '.$securitykey.' is wrong', null, 'errors'); $action = ''; } - else - { + else { $object = new Cronjob($db); $job = $object->fetch($id); @@ -156,8 +155,7 @@ if (empty($reshook)) } $action = ''; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } @@ -197,8 +195,7 @@ if (empty($reshook)) //else dol_print_error($db, 'Bad value for massaction'); if ($result < 0) setEventMessages($tmpcron->error, $tmpcron->errors, 'errors'); } - else - { + else { $error++; } } @@ -445,8 +442,7 @@ if ($num > 0) print $object->getNomUrl(0, '', 1); $object->ref = $obj->rowid; } - else - { + else { //print $langs->trans('CronNone'); } print ''; @@ -587,8 +583,7 @@ if ($num > 0) $i++; } } -else -{ +else { print ''.$langs->trans('CronNoJobs').''; } diff --git a/htdocs/dav/dav.class.php b/htdocs/dav/dav.class.php index 60912b86a8a..673c42e27a0 100644 --- a/htdocs/dav/dav.class.php +++ b/htdocs/dav/dav.class.php @@ -89,8 +89,7 @@ class CdavLib LEFT JOIN '.MAIN_DB_PREFIX.'socpeople AS sp ON (sp.fk_soc = sc.fk_soc AND sp.rowid = a.fk_contact) LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_cdav AS ac ON (a.id = ac.fk_object)'; } - else - { + else { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON (s.rowid = a.fk_soc) LEFT JOIN '.MAIN_DB_PREFIX.'socpeople AS sp ON (sp.rowid = a.fk_contact) LEFT JOIN '.MAIN_DB_PREFIX.'actioncomm_cdav AS ac ON (a.id = ac.fk_object)'; @@ -106,8 +105,7 @@ class CdavLib { $sql .= ' AND a.id = '.intval($oid); } - else - { + else { $sql .= ' AND (a.id = '.intval($oid).' OR ac.uuidext = \''.$this->db->escape($ouri).'\')'; } } @@ -161,8 +159,7 @@ class CdavLib if ($obj->percent == -1 && trim($obj->datep) != '') $type = 'VEVENT'; - else - $type = 'VTODO'; + else $type = 'VTODO'; $timezone = date_default_timezone_get(); @@ -176,8 +173,7 @@ class CdavLib $caldata .= "DTSTAMP:".gmdate('Ymd\THis', strtotime($obj->lastupd))."Z\n"; if ($obj->sourceuid == '') $caldata .= "UID:".$obj->id.'-ev-'.$calid.'-cal-'.constant('CDAV_URI_KEY')."\n"; - else - $caldata .= "UID:".$obj->sourceuid."\n"; + else $caldata .= "UID:".$obj->sourceuid."\n"; $caldata .= "SUMMARY:".$obj->label."\n"; $caldata .= "LOCATION:".$location."\n"; $caldata .= "PRIORITY:".$obj->priority."\n"; @@ -188,21 +184,18 @@ class CdavLib { if (trim($obj->datep2) != '') $caldata .= "DTEND;VALUE=DATE:".date('Ymd', strtotime($obj->datep2) + 1)."\n"; - else - $caldata .= "DTEND;VALUE=DATE:".date('Ymd', strtotime($obj->datep) + (25 * 3600))."\n"; + else $caldata .= "DTEND;VALUE=DATE:".date('Ymd', strtotime($obj->datep) + (25 * 3600))."\n"; } elseif (trim($obj->datep2) != '') $caldata .= "DUE;VALUE=DATE:".date('Ymd', strtotime($obj->datep2) + 1)."\n"; } - else - { + else { $caldata .= "DTSTART;TZID=".$timezone.":".strtr($obj->datep, array(" "=>"T", ":"=>"", "-"=>""))."\n"; if ($type == 'VEVENT') { if (trim($obj->datep2) != '') $caldata .= "DTEND;TZID=".$timezone.":".strtr($obj->datep2, array(" "=>"T", ":"=>"", "-"=>""))."\n"; - else - $caldata .= "DTEND;TZID=".$timezone.":".strtr($obj->datep, array(" "=>"T", ":"=>"", "-"=>""))."\n"; + else $caldata .= "DTEND;TZID=".$timezone.":".strtr($obj->datep, array(" "=>"T", ":"=>"", "-"=>""))."\n"; } elseif (trim($obj->datep2) != '') $caldata .= "DUE;TZID=".$timezone.":".strtr($obj->datep2, array(" "=>"T", ":"=>"", "-"=>""))."\n"; @@ -210,8 +203,7 @@ class CdavLib $caldata .= "CLASS:PUBLIC\n"; if ($obj->transparency == 1) $caldata .= "TRANSP:TRANSPARENT\n"; - else - $caldata .= "TRANSP:OPAQUE\n"; + else $caldata .= "TRANSP:OPAQUE\n"; if ($type == 'VEVENT') $caldata .= "STATUS:CONFIRMED\n"; @@ -219,8 +211,7 @@ class CdavLib $caldata .= "STATUS:NEEDS-ACTION\n"; elseif ($obj->percent == 100) $caldata .= "STATUS:COMPLETED\n"; - else - { + else { $caldata .= "STATUS:IN-PROCESS\n"; $caldata .= "PERCENT-COMPLETE:".$obj->percent."\n"; } @@ -285,8 +276,7 @@ class CdavLib 'component' => strpos($calendardata, 'BEGIN:VEVENT') > 0 ? 'vevent' : 'vtodo', ); } - else - { + else { $calevents[] = array( // 'calendardata' => $calendardata, not necessary because etag+size are present 'uri' => $obj->id.'-ev-'.constant('CDAV_URI_KEY'), diff --git a/htdocs/dav/dav.lib.php b/htdocs/dav/dav.lib.php index b306ec7161a..bb4835c4d52 100644 --- a/htdocs/dav/dav.lib.php +++ b/htdocs/dav/dav.lib.php @@ -26,8 +26,7 @@ if (!defined('CDAV_CONTACT_TAG')) { if (isset($conf->global->CDAV_CONTACT_TAG)) define('CDAV_CONTACT_TAG', $conf->global->CDAV_CONTACT_TAG); - else - define('CDAV_CONTACT_TAG', ''); + else define('CDAV_CONTACT_TAG', ''); } // define CDAV_URI_KEY if not @@ -35,8 +34,7 @@ if (!defined('CDAV_URI_KEY')) { if (isset($conf->global->CDAV_URI_KEY)) define('CDAV_URI_KEY', $conf->global->CDAV_URI_KEY); - else - define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8)); + else define('CDAV_URI_KEY', substr(md5($_SERVER['HTTP_HOST']), 0, 8)); } diff --git a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php index fd9f993e1e8..03d91fff140 100644 --- a/htdocs/debugbar/class/DataCollector/DolLogsCollector.php +++ b/htdocs/debugbar/class/DataCollector/DolLogsCollector.php @@ -78,8 +78,7 @@ class DolLogsCollector extends MessagesCollector { $this->getStorageLogs($this->path); } - else - { + else { $log_levels = $this->getLevels(); foreach ($conf->logbuffer as $line) { diff --git a/htdocs/ecm/ajax/ecmdatabase.php b/htdocs/ecm/ajax/ecmdatabase.php index 9f4820cd723..91564ec8f80 100644 --- a/htdocs/ecm/ajax/ecmdatabase.php +++ b/htdocs/ecm/ajax/ecmdatabase.php @@ -115,14 +115,12 @@ if (isset($action) && !empty($action)) $fk_parent = $parentdirisindatabase; //break; // We found parent, we can stop the while loop } - else - { + else { dol_syslog("No"); //print "No
\n"; } } - else - { + else { dol_syslog("Parent is root"); $fk_parent = 0; // Parent is root } @@ -149,8 +147,7 @@ if (isset($action) && !empty($action)) //var_dump($sqltree); $adirwascreated = 1; } - else - { + else { dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR); } } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 3bddd70bfaa..fc450e9864e 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -165,8 +165,7 @@ class EcmDirectory // extends CommonObject dol_syslog(get_class($this)."::create ".$this->error, LOG_WARNING); return -1; } - else - { + else { $this->db->begin(); // Insert request @@ -208,14 +207,12 @@ class EcmDirectory // extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = "Error ".$this->db->lasterror(); $this->db->rollback(); return -1; @@ -274,8 +271,7 @@ class EcmDirectory // extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } @@ -303,8 +299,7 @@ class EcmDirectory // extends CommonObject $this->error = "Error ".$this->db->lasterror(); return -1; } - else - { + else { if (preg_match('/[0-9]+/', $value)) $this->cachenbofdoc = (int) $value; elseif ($value == '+') $this->cachenbofdoc++; elseif ($value == '-') $this->cachenbofdoc--; @@ -359,8 +354,7 @@ class EcmDirectory // extends CommonObject return $obj ? 1 : 0; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -399,8 +393,7 @@ class EcmDirectory // extends CommonObject $this->error = "Error ".$this->db->lasterror(); return -2; } - else - { + else { // Call trigger $result = $this->call_trigger('MYECMDIR_DELETE', $user); if ($result < 0) @@ -418,8 +411,7 @@ class EcmDirectory // extends CommonObject { $result = @dol_delete_dir_recursive($file, 0, 0); } - else - { + else { $result = @dol_delete_dir($file, 0); } } @@ -428,8 +420,7 @@ class EcmDirectory // extends CommonObject { $this->db->commit(); } - else - { + else { $this->error = 'ErrorFailToDeleteDir'; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); @@ -565,8 +556,7 @@ class EcmDirectory // extends CommonObject } return 1; } - else - { + else { dol_print_error($this->db); return -1; } @@ -673,8 +663,7 @@ class EcmDirectory // extends CommonObject //print "this->cats[$i]['id_children'] est deja un tableau de $newelem elements
"; $this->cats[$obj->rowid]['id_children'][$newelempos] = $obj->rowid_fille; } - else - { + else { //print "this->cats[".$obj->rowid."]['id_children'] n'est pas encore un tableau
"; $this->cats[$obj->rowid]['id_children'] = array($obj->rowid_fille); } @@ -682,8 +671,7 @@ class EcmDirectory // extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); return -1; } @@ -723,8 +711,7 @@ class EcmDirectory // extends CommonObject $this->cats[$id_categ]['fulllabel'] = $this->cats[$this->cats[$id_categ]['id_mere']]['fulllabel']; $this->cats[$id_categ]['fulllabel'] .= ' >> '.$this->cats[$id_categ]['label']; } - else - { + else { $this->cats[$id_categ]['fullpath'] = '_'.$id_categ; $this->cats[$id_categ]['fullrelativename'] = $this->cats[$id_categ]['label']; $this->cats[$id_categ]['fulllabel'] = $this->cats[$id_categ]['label']; @@ -768,8 +755,7 @@ class EcmDirectory // extends CommonObject { $sql .= " WHERE rowid = ".$this->id; } - else - { + else { $sql .= " WHERE entity = ".$conf->entity; } @@ -780,8 +766,7 @@ class EcmDirectory // extends CommonObject $this->cachenbofdoc = count($filelist); return $this->cachenbofdoc; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -813,8 +798,7 @@ class EcmDirectory // extends CommonObject { $this->errors = array_merge($this->errors, $interface->errors); } - else - { + else { $this->errors = $interface->errors; } } diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 6921b8aabd6..e24af560143 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -200,15 +200,13 @@ class EcmFiles extends CommonObject $obj = $this->db->fetch_object($resql); $maxposition = (int) $obj->maxposition; } - else - { + else { $this->errors[] = 'Error '.$this->db->lasterror(); return --$error; } $maxposition = $maxposition + 1; } - else - { + else { $maxposition = $this->position; } diff --git a/htdocs/ecm/class/htmlecm.form.class.php b/htdocs/ecm/class/htmlecm.form.class.php index de9f289eb79..e1e7bf40873 100644 --- a/htdocs/ecm/class/htmlecm.form.class.php +++ b/htdocs/ecm/class/htmlecm.form.class.php @@ -81,8 +81,7 @@ class FormEcm if (is_array($cate_arbo)) { if (!count($cate_arbo)) $output .= ''; - else - { + else { $output .= ''; foreach ($cate_arbo as $key => $value) { @@ -91,8 +90,7 @@ class FormEcm { $add = 'selected '; } - else - { + else { $add = ''; } $output .= ''; diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 4d6f2bdce5a..9eb95c1f198 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -57,7 +57,7 @@ if ($module == 'ecm') { $upload_dir = $conf->ecm->dir_output.'/'.$urlsection; } -else // For example $module == 'medias' +else // For example $module == 'medias' { $upload_dir = $conf->medias->multidir_output[$conf->entity]; } @@ -116,8 +116,7 @@ if ($action == 'add' && $permtoadd) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager'.($module ? '&module='.$module : '')); exit; } @@ -156,7 +155,7 @@ if ($action == 'add' && $permtoadd) $action = 'create'; } } - else // For example $module == 'medias' + else // For example $module == 'medias' { $dirfornewdir = ''; if ($module == 'medias') @@ -178,8 +177,7 @@ if ($action == 'add' && $permtoadd) setEventMessages($langs->trans('ErrorFailToCreateDir', $label), null, 'errors'); $error++; } - else - { + else { setEventMessages($langs->trans("ECMSectionWasCreated", $label), null, 'mesgs'); } } @@ -193,8 +191,7 @@ if ($action == 'add' && $permtoadd) header("Location: ".$backtopage); exit; } - else - { + else { header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager'); exit; } @@ -302,8 +299,7 @@ if (empty($action) || $action == 'delete_section') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } print ''; diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 9b3da9d8aae..78b7d16bb5d 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -75,7 +75,7 @@ if ($module == 'ecm') $relativepath = $ecmdir->getRelativePath(); $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; } -else // For example $module == 'medias' +else // For example $module == 'medias' { $relativepath = $section; $upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath; @@ -111,8 +111,7 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) { $result = $ecmdir->changeNbOfFiles('+'); } - else - { + else { $langs->load("errors"); if ($resupload < 0) // Unknown error { @@ -121,14 +120,13 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) // Files infected by a virus setEventMessages($langs->trans("ErrorFileIsInfectedWithAVirus"), null, 'errors'); } - else // Known error + else // Known error { setEventMessages($langs->trans($resupload), null, 'errors'); } } } - else - { + else { // Failed transfer (exceeding the limit file?) $langs->load("errors"); setEventMessages($langs->trans("ErrorFailToCreateDir", $upload_dir), null, 'errors'); @@ -168,19 +166,16 @@ if ($action == 'confirm_deletedir' && $confirm == 'yes') setEventMessages($langs->trans($ecmdir->error, $ecmdir->label), null, 'errors'); } } - else - { + else { if ($deletedirrecursive) { $resbool = dol_delete_dir_recursive($upload_dir, 0, 1); } - else - { + else { $resbool = dol_delete_dir($upload_dir, 1); } if ($resbool) $result = 1; - else - { + else { $langs->load('errors'); setEventMessages($langs->trans("ErrorFailToDeleteDir", $upload_dir), null, 'errors'); $result = 0; @@ -204,8 +199,7 @@ if ($action == 'update' && !GETPOST('cancel', 'alpha')) $olddir = $ecmdir->getRelativePath(0); $olddir = $conf->ecm->dir_output.'/'.$olddir; } - else - { + else { $olddir = GETPOST('section', 'alpha'); $olddir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath; } @@ -243,19 +237,16 @@ if ($action == 'update' && !GETPOST('cancel', 'alpha')) $relativepath = $ecmdir->getRelativePath(); $upload_dir = $conf->ecm->dir_output.'/'.$relativepath; } - else - { + else { $db->rollback(); } } - else - { + else { $db->rollback(); setEventMessages($ecmdir->error, $ecmdir->errors, 'errors'); } } - else - { + else { $newdir = $conf->medias->multidir_output[$conf->entity].'/'.GETPOST('oldrelparentdir', 'alpha').'/'.GETPOST('label', 'alpha'); $result = @rename($olddir, $newdir); @@ -341,8 +332,7 @@ if ($module == 'ecm') $s = ' -> '.$s; $result = $tmpecmdir->fetch($tmpecmdir->fk_parent); } - else - { + else { $tmpecmdir = 0; } $i++; @@ -412,8 +402,7 @@ if ($module == 'ecm') { print dol_print_date($ecmdir->date_c, 'dayhour'); } -else -{ +else { //var_dump($upload_dir); print dol_print_date(dol_filemtime($upload_dir), 'dayhour'); } @@ -423,8 +412,7 @@ if ($module == 'ecm') { print '/ecm/'.$relativepath; } -else -{ +else { print '/'.$module.'/'.$relativepath; } print ''; @@ -478,8 +466,7 @@ if ($action != 'edit' && $action != 'delete') { print ''.$langs->trans('ECMAddSection').''; } - else - { + else { print ''.$langs->trans('ECMAddSection').''; } @@ -489,8 +476,7 @@ if ($action != 'edit' && $action != 'delete') { print ''.$langs->trans('Delete').''; } - else - { + else { print ''.$langs->trans('Delete').''; } /*} diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index 1c94fd1700b..bddbd0f6294 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -114,8 +114,7 @@ if ($cancel) header("Location: ".$backtopage); exit; } - else - { + else { header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section).($module ? '&module='.urlencode($module) : '')); exit; } @@ -171,8 +170,7 @@ if ($action == 'update') require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $object->share = getRandomPassword(true); } - else - { + else { $object->share = ''; } @@ -185,8 +183,7 @@ if ($action == 'update') setEventMessages($object->error, $object->errors, 'warnings'); } } - else - { + else { // Call create to insert record $object->entity = $conf->entity; $object->filepath = preg_replace('/[\\/]+$/', '', $newdirrelativetodocument); @@ -212,8 +209,7 @@ if ($action == 'update') header('Location: '.$_SERVER["PHP_SELF"].'?urlfile='.urlencode($urlfile).'§ion='.urlencode($section)); exit; } - else - { + else { $db->rollback(); } } @@ -258,8 +254,7 @@ while ($tmpecmdir && $result > 0) $s = ' -> '.$s; $result = $tmpecmdir->fetch($tmpecmdir->fk_parent); } - else - { + else { $tmpecmdir = 0; } $i++; @@ -299,8 +294,7 @@ if (!empty($object->label)) { print $object->label; } -else -{ +else { print img_warning().' '.$langs->trans("FileNotYetIndexedInDatabase"); } print ''; @@ -349,19 +343,16 @@ if (!empty($object->share)) else print $fulllink; if ($action != 'edit') print ' '.$langs->trans("Download").''; // No target here } - else - { + else { print 'share ? ' checked="checked"' : '').' /> '; } } -else -{ +else { if ($action != 'edit') { print ''.$langs->trans("FileNotShared").''; } - else - { + else { print 'share ? ' checked="checked"' : '').' /> '; } } diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 43b9ca6dcce..09350d2b245 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -136,8 +136,7 @@ if ($action == 'confirm_deletefile') setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile', 'alpha')), null, 'mesgs'); $result = $ecmdir->changeNbOfFiles('-'); } - else - { + else { setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile', 'alpha')), null, 'errors'); } @@ -159,8 +158,7 @@ if ($action == 'add' && $user->rights->ecm->setup) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors'); $action = "create"; } @@ -247,14 +245,12 @@ if ($action == 'refreshmanual') $fk_parent = $parentdirisindatabase; //break; // We found parent, we can stop the while loop } - else - { + else { dol_syslog("No"); //print "No
\n"; } } - else - { + else { dol_syslog("Parent is root"); $fk_parent = 0; // Parent is root } @@ -281,8 +277,7 @@ if ($action == 'refreshmanual') //var_dump($sqltree); $adirwascreated = 1; } - else - { + else { dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR); } } diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 39bdc9a1612..9b8c82ca05e 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -103,8 +103,7 @@ if ($action == 'add' && $user->rights->ecm->setup) header("Location: ".$_SERVER["PHP_SELF"]); exit; } - else - { + else { setEventMessages('Error '.$langs->trans($ecmdir->error), null, 'errors'); $action = "create"; } @@ -222,14 +221,12 @@ if ($action == 'refreshmanual') $fk_parent = $parentdirisindatabase; //break; // We found parent, we can stop the while loop } - else - { + else { dol_syslog("No"); //print "No
\n"; } } - else - { + else { dol_syslog("Parent is root"); $fk_parent = 0; // Parent is root } @@ -256,8 +253,7 @@ if ($action == 'refreshmanual') //var_dump($sqltree); $adirwascreated = 1; } - else - { + else { dol_syslog("Failed to create directory ".$ecmdirtmp->label, LOG_ERR); } } @@ -419,8 +415,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act print $val['label']; print ''; } - else - { + else { print ''; print $val['label']; print ''; diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index bf1a4e26de7..1cbd01d39e8 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -586,8 +586,7 @@ class EmailCollector extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } @@ -773,8 +772,7 @@ class EmailCollector extends CommonObject $tmpclass = $tmparray[0]; $tmpproperty = $tmparray[1]; } - else - { + else { $tmpproperty = $tmparray[0]; } if ($tmpclass && ($tmpclass != $object->element)) continue; // Property is for another type of object @@ -818,14 +816,12 @@ class EmailCollector extends CommonObject // Overwrite param $tmpproperty $object->$tmpproperty = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null; } - else - { + else { // Regex not found $object->$tmpproperty = null; } } - else - { + else { // Nothing can be done for this param $errorforthisaction++; $this->error = 'The extract rule to use has on an unknown source (must be HEADER, SUBJECT or BODY)'; @@ -863,8 +859,7 @@ class EmailCollector extends CommonObject else $object->$tmpproperty = $valuetouse; } } - else - { + else { $errorforthisaction++; $this->error = 'Bad syntax for description of action parameters: '.$actionparam; $this->errors[] = $this->error; @@ -1239,8 +1234,7 @@ class EmailCollector extends CommonObject $from = $reg[2]; $fromtext = $reg[1]; } - else - { + else { $from = $fromstring; $fromtext = ''; } @@ -1313,8 +1307,7 @@ class EmailCollector extends CommonObject { $result = $projectstatic->fetch($projectid); if ($result <= 0) $projectstatic->id = 0; - else - { + else { $projectid = $projectstatic->id; $projectfoundby = 'trackid ('.$trackid.')'; if (empty($contactid)) $contactid = $projectstatic->fk_contact; @@ -1326,8 +1319,7 @@ class EmailCollector extends CommonObject { $result = $contactstatic->fetch($contactid); if ($result <= 0) $contactstatic->id = 0; - else - { + else { $contactid = $contactstatic->id; $contactfoundby = 'trackid ('.$trackid.')'; if (empty($thirdpartyid)) $thirdpartyid = $contactstatic->fk_soc; @@ -1338,8 +1330,7 @@ class EmailCollector extends CommonObject { $result = $thirdpartystatic->fetch($thirdpartyid); if ($result <= 0) $thirdpartystatic->id = 0; - else - { + else { $thirdpartyid = $thirdpartystatic->id; $thirdpartyfoundby = 'trackid ('.$trackid.')'; } @@ -1409,8 +1400,7 @@ class EmailCollector extends CommonObject $this->error = "Action loadthirdparty or loadandcreatethirdparty has empty parameter. Must be 'SET:xxx' or 'EXTRACT:(body|subject):regex' to define how to extract data"; $this->errors[] = $this->error; } - else - { + else { $actionparam = $operation['actionparam']; $nametouseforthirdparty = ''; @@ -1445,15 +1435,13 @@ class EmailCollector extends CommonObject // Overwrite param $tmpproperty $nametouseforthirdparty = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null; } - else - { + else { // Regex not found $nametouseforthirdparty = null; } //var_dump($object->$tmpproperty);exit; } - else - { + else { // Nothing can be done for this param $errorforactions++; $this->error = 'The extract rule to use to load thirdparty has on an unknown source (must be HEADER, SUBJECT or BODY)'; @@ -1466,8 +1454,7 @@ class EmailCollector extends CommonObject //else $object->$tmpproperty = $reg[1]; $nametouseforthirdparty = $reg[2]; } - else - { + else { $errorforactions++; $this->error = 'Bad syntax for description of action parameters: '.$actionparam; $this->errors[] = $this->error; @@ -1511,8 +1498,7 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { $result = $thirdpartystatic->create($user); if ($result <= 0) { @@ -1598,8 +1584,7 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { $result = $actioncomm->create($user); if ($result <= 0) { @@ -1701,15 +1686,13 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { if (empty($projecttocreate->ref) || (is_numeric($projecttocreate->ref) && $projecttocreate->ref <= 0)) { $errorforactions++; $this->error = 'Failed to create project: Can\'t get a valid value for the field ref with numbering template = '.$modele.', thirdparty id = '.$thirdpartystatic->id; } - else - { + else { // Create project $result = $projecttocreate->create($user); if ($result <= 0) @@ -1849,15 +1832,13 @@ class EmailCollector extends CommonObject { $errorforactions++; } - else - { + else { if (is_numeric($tickettocreate->ref) && $tickettocreate->ref <= 0) { $errorforactions++; $this->error = 'Failed to create ticket: Can\'t get a valid value for the field ref with numbering template = '.$modele.', thirdparty id = '.$thirdpartystatic->id; } - else - { + else { // Create project $result = $tickettocreate->create($user); if ($result <= 0) @@ -1890,13 +1871,11 @@ class EmailCollector extends CommonObject dol_syslog(imap_last_error()); } } - else - { + else { dol_syslog("EmailCollector::doCollectOneCollector message ".$imapemail." to ".$connectstringtarget." was set to read", LOG_DEBUG); } } - else - { + else { $errorforemail++; } @@ -1921,8 +1900,7 @@ class EmailCollector extends CommonObject break; } } - else - { + else { $error++; $this->db->rollback(); @@ -1933,8 +1911,7 @@ class EmailCollector extends CommonObject dol_syslog("End of loop on emails", LOG_INFO, -1); } - else - { + else { $output = $langs->trans('NoNewEmailToProcess'); } @@ -2071,8 +2048,7 @@ class EmailCollector extends CommonObject // so append parts together with blank row. if (strtolower($p->subtype) == 'plain') $plainmsg .= trim($data)."\n\n"; - else - $htmlmsg .= $data."

"; + else $htmlmsg .= $data."

"; $charset = $params['charset']; // assume all parts are same charset } diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index d0d6239a7f2..b4fdf52ca5b 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -504,8 +504,7 @@ class EmailCollectorAction extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index 63521e81c3a..106d57c23c5 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -479,8 +479,7 @@ class EmailCollectorFilter extends CommonObject $this->db->free($result); } - else - { + else { dol_print_error($this->db); } } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 95b6f6208a5..cdc4da7fe51 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -266,8 +266,7 @@ if (empty($reshook)) $totalqty += $subtotalqty; } - else - { + else { // No detail were provided for lots if (!empty($_POST[$qty])) { @@ -296,8 +295,7 @@ if (empty($reshook)) $qty = "qtyl".$i.'_'.$j; } } - else - { + else { //var_dump(GETPOST($qty,'int')); var_dump($_POST); var_dump($batch);exit; //shipment line for product with no batch management and no multiple stock location if (GETPOST($qty, 'int') > 0) $totalqty += GETPOST($qty, 'int'); @@ -342,8 +340,7 @@ if (empty($reshook)) } } } - else - { + else { if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS)) { $ent = "entl".$i; @@ -361,8 +358,7 @@ if (empty($reshook)) } } } - else - { + else { // batch mode if ($batch_line[$i]['qty'] > 0) { @@ -389,8 +385,7 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("QtyToShip").'/'.$langs->transnoentitiesnoconv("Warehouse")), null, 'errors'); $error++; } @@ -401,8 +396,7 @@ if (empty($reshook)) header("Location: card.php?id=".$object->id); exit; } - else - { + else { $db->rollback(); $_GET["commande_id"] = GETPOST('commande_id', 'int'); $action = 'create'; @@ -420,8 +414,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/livraison/card.php?action=create_delivery&id='.$result); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -440,8 +433,7 @@ if (empty($reshook)) $langs->load("errors"); setEventMessages($langs->trans($object->error), $object->errors, 'errors'); } - else - { + else { // Define output language if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { @@ -470,8 +462,7 @@ if (empty($reshook)) { $result = $object->setStatut(-1); } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -485,8 +476,7 @@ if (empty($reshook)) header("Location: ".DOL_URL_ROOT.'/expedition/index.php'); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -601,8 +591,7 @@ if (empty($reshook)) } } } - else - { + else { // delete single warehouse line $line->id = $line_id; if (!$error && $line->delete($user) < 0) @@ -618,8 +607,7 @@ if (empty($reshook)) header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit(); } - else - { + else { setEventMessages($line->error, $line->errors, 'errors'); } } @@ -684,8 +672,7 @@ if (empty($reshook)) $error++; } } - else - { + else { setEventMessages($lotStock->error, $lotStock->errors, 'errors'); $error++; } @@ -738,14 +725,12 @@ if (empty($reshook)) $error++; } } - else - { + else { setEventMessages($line->error, $line->errors, 'errors'); $error++; } } - else - { + else { // create new line with new lot $line->origin_line_id = $lines[$i]->origin_line_id; $line->entrepot_id = $lotStock->warehouseid; @@ -761,15 +746,13 @@ if (empty($reshook)) } } } - else - { + else { setEventMessages($lotStock->error, $lotStock->errors, 'errors'); $error++; } } } - else - { + else { if ($lines[$i]->fk_product > 0) { // line without lot @@ -813,8 +796,7 @@ if (empty($reshook)) } } } - else - { + else { // Product no predefined $qty = "qtyl".$line_id; $line->id = $line_id; @@ -850,8 +832,7 @@ if (empty($reshook)) $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To redisplay the form being edited exit(); } @@ -1133,8 +1114,7 @@ if ($action == 'create') { print ''.$langs->trans("Warehouse").' ('.$langs->trans("Stock").')'; } - else - { + else { print ''.$langs->trans("Warehouse").' / '.$langs->trans("Batch").' ('.$langs->trans("Stock").')'; } } @@ -1195,8 +1175,7 @@ if ($action == 'create') print ''; } - else - { + else { print ""; if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -1232,8 +1211,7 @@ if ($action == 'create') { $quantityToBeDelivered = 0; } - else - { + else { $quantityToBeDelivered = $quantityAsked - $quantityDelivered; } $warehouse_id = GETPOST('entrepot_id', 'int'); @@ -1289,8 +1267,7 @@ if ($action == 'create') } } } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1321,8 +1298,7 @@ if ($action == 'create') } } } - else - { + else { // Product need lot print ''; // end line and start a new one for lot/serial print ''; @@ -1377,8 +1353,7 @@ if ($action == 'create') print ''; } } - else - { + else { print ''; print ''; print ' '; @@ -1390,8 +1365,7 @@ if ($action == 'create') } } } - else - { + else { // ship from multiple locations if (empty($conf->productbatch->enabled) || !$product->hasbatch()) { @@ -1440,8 +1414,7 @@ if ($action == 'create') print ''; print '('.$stock.')'; } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1480,8 +1453,7 @@ if ($action == 'create') } } } - else - { + else { print ''; print ''; // end line and start a new one for lot/serial @@ -1553,8 +1525,7 @@ if ($action == 'create') } print ' '; } - else - { + else { print $langs->trans("NA"); } print ''; @@ -1569,14 +1540,12 @@ if ($action == 'create') $warehouseObject->fetch($warehouse_selected_id); print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->label); } - else - { + else { if ($line->fk_product) print img_warning().' '.$langs->trans("StockTooLow"); else print ''; } } - else - { + else { print $langs->trans("Service"); } print ''; @@ -1617,8 +1586,7 @@ if ($action == 'create') print '
'; } - else - { + else { dol_print_error($db); } } @@ -1687,8 +1655,7 @@ elseif ($id || $ref) { $numref = $object->getNextNumRef($soc); } - else - { + else { $numref = $object->ref; } @@ -1834,8 +1801,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { print $object->date_delivery ? dol_print_date($object->date_delivery, 'dayhour') : ' '; } print ''; @@ -1858,8 +1824,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueWeight; print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; } @@ -1893,8 +1858,7 @@ elseif ($id || $ref) print ' '; print ''; } - else - { + else { print $object->trueHeight; print ($object->trueHeight && $object->height_units != '') ? ' '.measuringUnitString(0, "size", $object->height_units) : ''; } @@ -1971,8 +1935,7 @@ elseif ($id || $ref) print ''; print ''; } - else - { + else { if ($object->shipping_method_id > 0) { // Get code using getLabelFromKey @@ -2004,8 +1967,7 @@ elseif ($id || $ref) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -2065,8 +2027,7 @@ elseif ($id || $ref) { print $langs->trans("QtyToShip").' - '; } - else - { + else { print $langs->trans("QtyShipped").' - '; } if (!empty($conf->stock->enabled)) @@ -2079,14 +2040,12 @@ elseif ($id || $ref) } print ''; } - else - { + else { if ($object->statut <= 1) { print ''.$langs->trans("QtyToShip").''; } - else - { + else { print ''.$langs->trans("QtyShipped").''; } if (!empty($conf->stock->enabled)) @@ -2196,8 +2155,7 @@ elseif ($id || $ref) $prod->fetch($lines[$i]->fk_product); $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $lines[$i]->product_label; } - else - $label = (!empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label); + else $label = (!empty($lines[$i]->label) ? $lines[$i]->label : $lines[$i]->product_label); print ''; @@ -2231,8 +2189,7 @@ elseif ($id || $ref) } print "\n"; } - else - { + else { print ''; if ($lines[$i]->product_type == Product::TYPE_SERVICE) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -2343,14 +2300,12 @@ elseif ($id || $ref) print ''; } } - else - { + else { print ''; print ''.$langs->trans("NotEnoughStock").''; } } - else - { + else { print ''; print ''; // Qty to ship or shipped @@ -2365,8 +2320,7 @@ elseif ($id || $ref) print ''; } - else - { + else { // Qty to ship or shipped print ''.$lines[$i]->qty_shipped.''; @@ -2417,8 +2371,7 @@ elseif ($id || $ref) } print $form->textwithtooltip(img_picto('', 'object_barcode').' '.$langs->trans("DetailBatchNumber"), $detail); } - else - { + else { print $langs->trans("NA"); } print ''; @@ -2484,8 +2437,7 @@ elseif ($id || $ref) { print $lines[$i]->showOptionals($extrafields, 'edit', array('colspan'=>$colspan), $indiceAsked); } - else - { + else { print $lines[$i]->showOptionals($extrafields, 'view', array('colspan'=>$colspan), $indiceAsked); } } @@ -2526,8 +2478,7 @@ elseif ($id || $ref) { print ''.$langs->trans("Validate").''; } - else - { + else { print ''.$langs->trans("Validate").''; } } @@ -2540,8 +2491,7 @@ elseif ($id || $ref) { print ''.$langs->trans("ClassifyUnbilled").''; } - else - { + else { print ''.$langs->trans("ReOpen").''; } } diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index e337ee5ffb8..42cb273fbcd 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -399,8 +399,7 @@ class Shipments extends DolibarrApi if ($updateRes > 0) { return $this->get($id); } - else - { + else { throw new RestException(405, $this->shipment->error); } } @@ -436,8 +435,7 @@ class Shipments extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->shipment->error); } } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 1ccfe9944f7..3250ba8aa5e 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -252,14 +252,12 @@ class Expedition extends CommonObject { return $numref; } - else - { + else { dol_print_error($this->db, get_class($this)."::getNextNumRef ".$obj->error); return ""; } } - else - { + else { print $langs->trans("Error")." ".$langs->trans("Error_EXPEDITION_ADDON_NUMBER_NotDefined"); return ""; } @@ -366,8 +364,7 @@ class Expedition extends CommonObject $error++; } } - else - { // with batch management + else { // with batch management if (!$this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) > 0) { $error++; @@ -406,8 +403,7 @@ class Expedition extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); @@ -417,24 +413,21 @@ class Expedition extends CommonObject return -1 * $error; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $error++; $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $error++; $this->error = $this->db->error()." - sql=$sql"; $this->db->rollback(); @@ -504,8 +497,7 @@ class Expedition extends CommonObject { $error++; } - else - { + else { // create shipment batch lines for stockLocation foreach ($tab as $detbatch) { @@ -647,15 +639,13 @@ class Expedition extends CommonObject return 1; } - else - { + else { dol_syslog(get_class($this).'::Fetch no expedition found', LOG_ERR); $this->error = 'Delivery with id '.$id.' not found'; return 0; } } - else - { + else { $this->error = $this->db->error(); return -1; } @@ -707,8 +697,7 @@ class Expedition extends CommonObject { $numref = $this->getNextNumRef($soc); } - else - { + else { $numref = "EXP".$this->id; } $this->newref = dol_sanitizeFileName($numref); @@ -760,8 +749,7 @@ class Expedition extends CommonObject { $qty = $obj->qty; } - else - { + else { $qty = $obj->edbqty; } if ($qty <= 0) continue; @@ -784,8 +772,7 @@ class Expedition extends CommonObject break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record. @@ -800,8 +787,7 @@ class Expedition extends CommonObject } } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; @@ -876,8 +862,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1 * $error; } @@ -908,8 +893,7 @@ class Expedition extends CommonObject { return $result; } - else - { + else { $this->error = $delivery->error; return $result; } @@ -968,8 +952,7 @@ class Expedition extends CommonObject $product->load_stock('warehouseopen'); $product_stock = $product->stock_warehouse[$entrepot_id]->real; } - else - $product_stock = $product->stock_reel; + else $product_stock = $product->stock_reel; $product_type = $product->type; if ($product_type == 0 && $product_stock < $qty) @@ -1165,8 +1148,7 @@ class Expedition extends CommonObject $this->db->rollback(); return -1 * $error; } - else - { + else { $this->db->commit(); return 1; } @@ -1261,8 +1243,7 @@ class Expedition extends CommonObject break; } } - else - { + else { // We increment stock of batches // We use warehouse selected for each line foreach ($lotArray as $lot) @@ -1278,8 +1259,7 @@ class Expedition extends CommonObject } } } - else - { + else { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } @@ -1358,35 +1338,30 @@ class Expedition extends CommonObject return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; }//*/ } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; } } - else - { + else { $this->db->rollback(); return -1; } @@ -1481,8 +1456,7 @@ class Expedition extends CommonObject break; } } - else - { + else { // We increment stock of batches // We use warehouse selected for each line foreach ($lotArray as $lot) @@ -1498,8 +1472,7 @@ class Expedition extends CommonObject } } } - else - { + else { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } } @@ -1584,35 +1557,30 @@ class Expedition extends CommonObject return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -3; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror()." - sql=$sql"; $this->db->rollback(); return -1; } } - else - { + else { $this->db->rollback(); return -1; } @@ -1770,8 +1738,7 @@ class Expedition extends CommonObject { $line->detail_batch = $newdetailbatch; } - else - { + else { $line->detail_batch = array_merge($line->detail_batch, $newdetailbatch); } } @@ -1782,8 +1749,7 @@ class Expedition extends CommonObject $this->lines[$lineindex] = $line; $lineindex++; } - else - { + else { $line->total_ht += $tabprice[0]; $line->total_localtax1 += $tabprice[9]; $line->total_localtax2 += $tabprice[10]; @@ -1797,8 +1763,7 @@ class Expedition extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = $this->db->error(); return -3; } @@ -1831,14 +1796,12 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = 'ErrorDeleteLineNotAllowedByObjectStatus'; return -2; } @@ -2039,14 +2002,12 @@ class Expedition extends CommonObject $this->date_delivery = $date_livraison; return 1; } - else - { + else { $this->error = $this->db->error(); return -1; } } - else - { + else { return -2; } } @@ -2132,8 +2093,7 @@ class Expedition extends CommonObject $sql .= " VALUES ('".$this->db->escape($this->update['code'])."','".$this->db->escape($this->update['libelle'])."','".$this->db->escape($this->update['description'])."','".$this->db->escape($this->update['tracking'])."')"; $resql = $this->db->query($sql); } - else - { + else { $sql = "UPDATE ".MAIN_DB_PREFIX."c_shipment_mode SET"; $sql .= " code='".$this->db->escape($this->update['code'])."'"; $sql .= ",libelle='".$this->db->escape($this->update['libelle'])."'"; @@ -2208,8 +2168,7 @@ class Expedition extends CommonObject $url = str_replace('{TRACKID}', $value, $tracking); $this->tracking_url = sprintf(''.($value ? $value : 'url').'', $url, $url); } - else - { + else { $this->tracking_url = $value; } } @@ -2300,8 +2259,7 @@ class Expedition extends CommonObject { $qty = $obj->qty; } - else - { + else { $qty = $obj->edbqty; } if ($qty <= 0) continue; @@ -2322,8 +2280,7 @@ class Expedition extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -2336,8 +2293,7 @@ class Expedition extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -2352,8 +2308,7 @@ class Expedition extends CommonObject } } } - else - { + else { dol_print_error($this->db); $error++; } @@ -2363,8 +2318,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->statut = self::STATUS_VALIDATED; $this->db->rollback(); return -1; @@ -2408,8 +2362,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->statut = self::STATUS_VALIDATED; $this->billed = 0; $this->db->rollback(); @@ -2477,8 +2430,7 @@ class Expedition extends CommonObject { $qty = $obj->qty; } - else - { + else { $qty = $obj->edbqty; } if ($qty <= 0) continue; @@ -2500,8 +2452,7 @@ class Expedition extends CommonObject $error++; break; } } - else - { + else { // line with batch detail // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record @@ -2514,8 +2465,7 @@ class Expedition extends CommonObject } } } - else - { + else { $this->error = $this->db->lasterror(); $error++; } @@ -2538,8 +2488,7 @@ class Expedition extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->statut = self::STATUS_CLOSED; $this->billed = $oldbilled; $this->db->rollback(); @@ -2792,8 +2741,7 @@ class ExpeditionLigne extends CommonObjectLine return 1; } - else - { + else { $this->errors[] = $this->db->lasterror(); $this->error = $this->db->lasterror(); return -1; @@ -2886,8 +2834,7 @@ class ExpeditionLigne extends CommonObjectLine $this->db->rollback(); return -1 * $error; } - else - { + else { $error++; } } @@ -2947,8 +2894,7 @@ class ExpeditionLigne extends CommonObjectLine // End call triggers } } - else - { + else { $this->errors[] = $this->db->lasterror()." - sql=$sql"; $error++; } @@ -2957,8 +2903,7 @@ class ExpeditionLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR); @@ -3001,8 +2946,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[] = 'ErrorBadParameters'; $error++; } - else - { + else { $batch = $this->detail_batch[0]->batch; $batch_id = $this->detail_batch[0]->fk_origin_stock; $expedition_batch_id = $this->detail_batch[0]->id; @@ -3057,8 +3001,7 @@ class ExpeditionLigne extends CommonObjectLine $this->errors[] = $this->db->lasterror()." - ExpeditionLineBatch::fetchAll"; $error++; } - else - { + else { // caculate new total line qty foreach ($lotArray as $lot) { @@ -3156,8 +3099,7 @@ class ExpeditionLigne extends CommonObjectLine $this->db->commit(); return 1; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR); diff --git a/htdocs/expedition/class/expeditionbatch.class.php b/htdocs/expedition/class/expeditionbatch.class.php index 6c9942dd9a8..131d2abc261 100644 --- a/htdocs/expedition/class/expeditionbatch.class.php +++ b/htdocs/expedition/class/expeditionbatch.class.php @@ -91,8 +91,7 @@ class ExpeditionLineBatch extends CommonObject return 1; } - else - { + else { $this->error = "Error ".$this->db->lasterror(); return -1; } @@ -136,8 +135,7 @@ class ExpeditionLineBatch extends CommonObject $this->fk_expeditiondet = $id_line_expdet; return $this->id; } - else - { + else { foreach ($this->errors as $errmsg) { dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); @@ -167,8 +165,7 @@ class ExpeditionLineBatch extends CommonObject { return 1; } - else - { + else { return -1; } } @@ -231,8 +228,7 @@ class ExpeditionLineBatch extends CommonObject $db->free($resql); return $ret; } - else - { + else { dol_print_error($db); return -1; } diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 36d471b59d3..1ea47ea199b 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -88,8 +88,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } - else - { + else { if ($objectsrc->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php index d3fec260d95..15dc8168a54 100644 --- a/htdocs/expedition/index.php +++ b/htdocs/expedition/index.php @@ -120,8 +120,7 @@ if ($resql) print ''; $i++; } - } else - { + } else { print ''.$langs->trans("None").''; } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 999bde3fb32..b6de8adc74d 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -687,8 +687,7 @@ if ($resql) print showDimensionInBestUnit($tmparray['weight'], 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no'); print $form->textwithpicto('', $langs->trans('EstimatedWeight'), 1); } - else - { + else { print $object->trueWeight; print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : ''; } @@ -804,8 +803,7 @@ if ($resql) print $formfile->showdocuments('massfilesarea_sendings', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } -else -{ +else { dol_print_error($db); } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 75ee2ef4da3..1c874d402b5 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -377,8 +377,7 @@ if ($id > 0 || !empty($ref)) print ''; print ''; } - else - { + else { print dol_print_date($object->date_livraison, 'daytext'); if ($object->hasDelay() && !empty($object->date_livraison)) { print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); @@ -531,8 +530,7 @@ if ($id > 0 || !empty($ref)) { print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1); } - else - { + else { print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id); } print ''; @@ -644,8 +642,7 @@ if ($id > 0 || !empty($ref)) { print ''.$langs->trans("RealStock").''; } - else - { + else { print ' '; } print "\n"; @@ -697,8 +694,7 @@ if ($id > 0 || !empty($ref)) $label = (!empty($prod->multilangs[$outputlangs->defaultlang]["label"])) ? $prod->multilangs[$outputlangs->defaultlang]["label"] : $objp->product_label; } - else - $label = (!empty($objp->label) ? $objp->label : $objp->product_label); + else $label = (!empty($objp->label) ? $objp->label : $objp->product_label); print ''; print ''; // ancre pour retourner sur la ligne @@ -739,8 +735,7 @@ if ($id > 0 || !empty($ref)) print ''; } - else - { + else { print ""; if ($type == 1) $text = img_object($langs->trans('Service'), 'service'); else $text = img_object($langs->trans('Product'), 'product'); @@ -776,8 +771,7 @@ if ($id > 0 || !empty($ref)) $toBeShippedTotal += $toBeShipped[$objp->fk_product]; print $toBeShipped[$objp->fk_product]; } - else - { + else { print '0 ('.$langs->trans("Service").')'; } print ''; @@ -799,8 +793,7 @@ if ($id > 0 || !empty($ref)) } print ''; } - else - { + else { print ' '; } print "\n"; @@ -844,8 +837,7 @@ if ($id > 0 || !empty($ref)) print ""; } - else - { + else { dol_print_error($db); } @@ -871,8 +863,7 @@ if ($id > 0 || !empty($ref)) print ' '.img_warning($langs->trans("WarningNoQtyLeftToSend")); } } - else - { + else { print ''.$langs->trans("CreateShipment").''; } } @@ -935,8 +926,7 @@ if ($id > 0 || !empty($ref)) $somethingshown = 1; } - else - { + else { print '
'; print ''.$langs->trans("CreateShipment").''; print '
'; @@ -945,8 +935,7 @@ if ($id > 0 || !empty($ref)) show_list_sending_receive('commande', $object->id); } - else - { + else { /* Order not found */ setEventMessages($langs->trans("NonExistentOrder"), null, 'errors'); } diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index db28b094e65..ce305ea41bb 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -75,8 +75,7 @@ if (!$user->rights->societe->client->voir || $user->socid) { $filenamenb = $dir.'/shipmentsnbinyear-'.$user->id.'-'.$year.'.png'; } -else -{ +else { $filenamenb = $dir.'/shipmentsnbinyear-'.$year.'.png'; } diff --git a/htdocs/expensereport/ajax/ajaxik.php b/htdocs/expensereport/ajax/ajaxik.php index b2c89f68e41..413bc061fbf 100644 --- a/htdocs/expensereport/ajax/ajaxik.php +++ b/htdocs/expensereport/ajax/ajaxik.php @@ -52,22 +52,18 @@ $fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat'); if (empty($fk_expense) || $fk_expense < 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'))); elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'))); -else -{ +else { // @see ndfp.class.php:3576 (method: compute_total_km) $expense = new ExpenseReport($db); if ($expense->fetch($fk_expense) <= 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'fk_expense' => $fk_expense)); - else - { + else { $userauthor = new User($db); if ($userauthor->fetch($expense->fk_user_author) <= 0) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'fk_user_author' => $expense->fk_user_author)); - else - { + else { $range = ExpenseReportIk::getRangeByUser($userauthor, $fk_c_exp_tax_cat); if (empty($range)) echo json_encode(array('error' => $langs->transnoentitiesnoconv('ErrorRecordNotFound'), 'range' => $range)); - else - { + else { $ikoffset = price($range->ikoffset, 0, $langs, 1, -1, -1, $conf->currency); echo json_encode(array('up' => $range->coef, 'ikoffset' => $range->ikoffset, 'title' => $langs->transnoentitiesnoconv('ExpenseRangeOffset', $offset), 'comment' => 'offset should be apply on addline or updateline')); } diff --git a/htdocs/expensereport/ajax/ajaxprojet.php b/htdocs/expensereport/ajax/ajaxprojet.php index 2fdb0cd4fdb..57b86ac9c7f 100644 --- a/htdocs/expensereport/ajax/ajaxprojet.php +++ b/htdocs/expensereport/ajax/ajaxprojet.php @@ -77,12 +77,10 @@ if (GETPOST('fk_projet') != '') echo json_encode($return_arr); } - else - { + else { echo json_encode(array('nom'=>'Error', 'label'=>'Error', 'key'=>'Error', 'value'=>'Error')); } } -else -{ +else { echo json_encode(array('nom'=>'ErrorBadParameter', 'label'=>'ErrorBadParameter', 'key'=>'ErrorBadParameter', 'value'=>'ErrorBadParameter')); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 2a0f804b196..c4a2d176e59 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -178,8 +178,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors'); } - else - { + else { if ($object->id > 0) { // Because createFromClone modifies the object, we must clone it so that we can restore it later if it fails @@ -191,8 +190,7 @@ if (empty($reshook)) header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $object = $orig; $action = ''; @@ -211,8 +209,7 @@ if (empty($reshook)) header("Location: index.php"); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -265,8 +262,7 @@ if (empty($reshook)) Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $db->rollback(); $action = 'create'; @@ -298,8 +294,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_POST['id']); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -357,8 +352,7 @@ if (empty($reshook)) $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); $error++; } @@ -416,8 +410,7 @@ if (empty($reshook)) $mesg = $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($emailFrom, 2), $mailfile->getValidAddress($emailTo, 2)); setEventMessages($mesg, null, 'mesgs'); } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -426,20 +419,17 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } @@ -451,8 +441,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $db->rollback(); } } @@ -543,8 +532,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -553,26 +541,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -666,8 +650,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -676,26 +659,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedtoSetToApprove"), null, 'warnings'); $action = ''; } @@ -787,8 +766,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -797,26 +775,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedtoSetToDeny"), null, 'warnings'); $action = ''; } @@ -829,8 +803,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors'); } - else - { + else { $object = new ExpenseReport($db); $object->fetch($id); @@ -917,8 +890,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -927,32 +899,27 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedToSetToCancel"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -991,13 +958,11 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } - else - { + else { setEventMessages("NOT_AUTHOR", '', 'errors'); } } @@ -1132,8 +1097,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } - else - { + else { $langs->load("other"); if ($mailfile->error) { @@ -1142,26 +1106,22 @@ if (empty($reshook)) $mesg .= '
'.$mailfile->error; setEventMessages($mesg, null, 'errors'); } - else - { + else { setEventMessages('No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS', null, 'warnings'); } } } - else - { + else { setEventMessages($mailfile->error, $mailfile->errors, 'errors'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("NoEmailSentBadSenderOrRecipientEmail"), null, 'warnings'); $action = ''; } } - else - { + else { setEventMessages($langs->trans("FailedToSetPaid"), null, 'warnings'); $action = ''; } @@ -1313,8 +1273,7 @@ if (empty($reshook)) header("Location: ".$_SERVER["PHP_SELF"]."?id=".$_GET['id']); exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1408,8 +1367,7 @@ if (empty($reshook)) //header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); //exit; } - else - { + else { setEventMessages($object->error, $object->errors, 'errors'); } } @@ -1497,8 +1455,7 @@ if ($action == 'create') $object = new ExpenseReport($db); $include_users = $object->fetch_users_approver_expensereport(); if (empty($include_users)) print img_warning().' '.$langs->trans("NobodyHasPermissionToValidateExpenseReport"); - else - { + else { $defaultselectuser = (empty($user->fk_user_expense_validator) ? $user->fk_user : $user->fk_user_expense_validator); // Will work only if supervisor has permission to approve so is inside include_users if (!empty($conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR)) $defaultselectuser = $conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR; // Can force default approver if (GETPOST('fk_user_validator', 'int') > 0) $defaultselectuser = GETPOST('fk_user_validator', 'int'); @@ -1559,8 +1516,7 @@ if ($action == 'create') print ''; } -else -{ +else { if ($id > 0 || $ref) { $result = $object->fetch($id, $ref); @@ -1602,8 +1558,7 @@ else { print ''; } - else - { + else { print ''; } @@ -1661,8 +1616,7 @@ else print ''; print ''; } - else - { + else { print ''; print ''.$langs->trans("VALIDOR").''; print ''; @@ -1698,8 +1652,7 @@ else print ''; } - else - { + else { dol_fiche_head($head, 'card', $langs->trans("ExpenseReport"), -1, 'trip'); // Clone confirmation @@ -1894,8 +1847,7 @@ else print ''.dol_print_date($object->date_cancel, 'dayhour').''; print ''; } - else - { + else { print ''; print ''.$langs->trans("ApprovedBy").''; print ''; @@ -2093,8 +2045,7 @@ else $db->free($resql); } - else - { + else { dol_print_error($db); } print ""; @@ -2201,8 +2152,7 @@ else { print price($line->value_unit_ht); } - else - { + else { $tmpvat = price2num(preg_replace('/\s*\(.*\)/', '', $line->vatrate)); $pricenettoshow = price2num($line->value_unit / (1 + $tmpvat / 100), 'MU'); print $pricenettoshow; @@ -2246,8 +2196,7 @@ else print ''; print ''; } - else - { + else { $modulepart = 'expensereport'; $thumbshown = 0; if (preg_match('/\.pdf$/i', $ecmfilesstatic->filename)) @@ -2625,8 +2574,7 @@ else dol_fiche_end(); } // end edit or not edit } // end of if result - else - { + else { dol_print_error($db); } } //fin si id > 0 @@ -2749,8 +2697,7 @@ if ($action != 'create' && $action != 'edit') { print '
'.$langs->trans('DoPayment').'
'; } - else - { + else { print '
'.$langs->trans('DoPayment').'
'; } } diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index 18fef29e04c..050a7902a43 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -412,8 +412,7 @@ class ExpenseReports extends DolibarrApi { return $this->get($id); } - else - { + else { throw new RestException(500, $this->expensereport->error); } } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 70d8a3d9b59..124a1fe4e7d 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -352,27 +352,23 @@ class ExpenseReport extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -4; } } - else - { + else { $this->db->rollback(); return -3; } } - else - { + else { dol_syslog(get_class($this)."::create error ".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { $this->error = $this->db->lasterror()." sql=".$sql; $this->db->rollback(); return -1; @@ -441,8 +437,7 @@ class ExpenseReport extends CommonObject $this->db->commit(); return $this->id; } - else - { + else { $this->db->rollback(); return -1; } @@ -505,15 +500,13 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; @@ -606,13 +599,11 @@ class ExpenseReport extends CommonObject return $result; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -659,21 +650,18 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->commit(); return 0; } } - else - { + else { $this->db->rollback(); dol_print_error($this->db); return -1; @@ -781,8 +769,7 @@ class ExpenseReport extends CommonObject } $this->db->free($resql); } - else - { + else { dol_print_error($this->db); } } @@ -947,8 +934,7 @@ class ExpenseReport extends CommonObject print ' '; print ''; } - else - { + else { $this->error = $db->lasterror(); return -1; } @@ -992,14 +978,13 @@ class ExpenseReport extends CommonObject if ($result): $this->db->free($result); return 1; - else: + else : $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR); return -3; endif; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::recalculer: Error ".$this->error, LOG_ERR); return -3; @@ -1032,8 +1017,7 @@ class ExpenseReport extends CommonObject { $sql .= ' ORDER BY de.rang ASC, de.rowid ASC'; } - else - { + else { $sql .= ' ORDER BY de.rang ASC, de.date ASC'; } @@ -1083,8 +1067,7 @@ class ExpenseReport extends CommonObject $this->db->free($resql); return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::fetch_lines: Error ".$this->error, LOG_ERR); return -3; @@ -1114,16 +1097,14 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->error()." sql=".$sql; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); return -6; } } - else - { + else { $this->error = $this->db->error()." sql=".$sql; dol_syslog(get_class($this)."::delete ".$this->error, LOG_ERR); $this->db->rollback(); @@ -1159,8 +1140,7 @@ class ExpenseReport extends CommonObject { $num = $this->getNextNumRef(); } - else - { + else { $num = $this->ref; } if (empty($num) || $num < 0) return -1; @@ -1244,15 +1224,13 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; @@ -1294,14 +1272,12 @@ class ExpenseReport extends CommonObject { return 1; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_save_from_refuse expensereport already with save status", LOG_WARNING); } } @@ -1346,22 +1322,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::setApproved expensereport already with approve status", LOG_WARNING); } @@ -1413,22 +1386,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->lasterror(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::setDeny expensereport already with refuse status", LOG_WARNING); } } @@ -1474,22 +1444,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_unpaid expensereport already with unpaid status", LOG_WARNING); } } @@ -1538,22 +1505,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -2; } } - else - { + else { $this->db->rollback(); $this->error = $this->db->error(); return -1; } } - else - { + else { dol_syslog(get_class($this)."::set_cancel expensereport already with cancel status", LOG_WARNING); } } @@ -1597,16 +1561,14 @@ class ExpenseReport extends CommonObject { return $numref; } - else - { + else { $this->error = $obj->error; $this->errors = $obj->errors; //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); return -1; } } - else - { + else { $this->error = "Error_EXPENSEREPORT_ADDON_NotDefined"; return -2; } @@ -1703,7 +1665,7 @@ class ExpenseReport extends CommonObject $result = $this->db->query($sql); if ($result): return 1; - else: + else : $this->error = $this->db->error(); return -1; endif; @@ -1733,7 +1695,7 @@ class ExpenseReport extends CommonObject $result = $this->db->query($sql); if ($result): return 1; - else: + else : $this->error = $this->db->error(); return -1; endif; @@ -1823,22 +1785,19 @@ class ExpenseReport extends CommonObject $this->db->commit(); return $this->line->id; } - else - { + else { $this->db->rollback(); return -1; } } - else - { + else { $this->error = $this->line->error; dol_syslog(get_class($this)."::addline error=".$this->error, LOG_ERR); $this->db->rollback(); return -2; } } - else - { + else { dol_syslog(get_class($this)."::addline status of expense report must be Draft to allow use of ->addline()", LOG_ERR); $this->error = 'ErrorExpenseNotDraft'; return -3; @@ -1888,8 +1847,7 @@ class ExpenseReport extends CommonObject $new_current_total_ttc -= $amount_to_test - $rule->amount; // ex, entered 16€, limit 12€, subtracts 4€; $rule_warning_message_tab[] = $langs->trans('ExpenseReportConstraintViolationError', $rule->id, price($amount_to_test, 0, $langs, 1, -1, -1, $conf->currency), price($rule->amount, 0, $langs, 1, -1, -1, $conf->currency), $langs->trans('by'.$rule->code_expense_rules_type, price($new_current_total_ttc, 0, $langs, 1, -1, -1, $conf->currency))); } - else - { + else { $this->error = 'ExpenseReportConstraintViolationWarning'; $this->errors[] = $this->error; @@ -1985,8 +1943,7 @@ class ExpenseReport extends CommonObject $num = $this->db->num_rows($resql); if ($num > 0) return true; } - else - { + else { dol_print_error($this->db); } @@ -2106,8 +2063,7 @@ class ExpenseReport extends CommonObject $this->db->commit(); return 1; } - else - { + else { $this->error = $this->line->error; $this->errors = $this->line->errors; $this->db->rollback(); @@ -2188,13 +2144,11 @@ class ExpenseReport extends CommonObject if ($existe) return 1; else return 0; } - else - { + else { return 0; } } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::periode_existe Error ".$this->error, LOG_ERR); return -1; @@ -2236,8 +2190,7 @@ class ExpenseReport extends CommonObject } return $users_validator; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog(get_class($this)."::fetch_users_approver_expensereport Error ".$this->error, LOG_ERR); return -1; @@ -2302,8 +2255,7 @@ class ExpenseReport extends CommonObject $i++; } } - else - { + else { dol_print_error($this->db); } return $ret; @@ -2335,8 +2287,7 @@ class ExpenseReport extends CommonObject $this->db->free($resql); return 1; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2383,8 +2334,7 @@ class ExpenseReport extends CommonObject $response->labelShort = $langs->trans("ToApprove"); $response->url = DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=2'; } - else - { + else { $response->warning_delay = $conf->expensereport->payment->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("ExpenseReportsToPay"); $response->labelShort = $langs->trans("StatusToPay"); @@ -2402,8 +2352,7 @@ class ExpenseReport extends CommonObject $response->nbtodolate++; } } - else - { + else { if ($this->db->jdate($obj->date_valid) < ($now - $conf->expensereport->payment->warning_delay)) { $response->nbtodolate++; } @@ -2412,8 +2361,7 @@ class ExpenseReport extends CommonObject return $response; } - else - { + else { dol_print_error($this->db); $this->error = $this->db->error(); return -1; @@ -2439,8 +2387,7 @@ class ExpenseReport extends CommonObject { return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->approve->warning_delay); } - else - return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); + else return ($this->datevalid ? $this->datevalid : $this->date_valid) < ($now - $conf->expensereport->payment->warning_delay); } /** @@ -2464,8 +2411,7 @@ class ExpenseReport extends CommonObject $alreadydispatched = $obj->nb; } } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2499,8 +2445,7 @@ class ExpenseReport extends CommonObject $this->db->free($resql); return $obj->amount; } - else - { + else { $this->error = $this->db->lasterror(); return -1; } @@ -2695,8 +2640,7 @@ class ExpenseReportLine } } } - else - { + else { $error++; } @@ -2705,8 +2649,7 @@ class ExpenseReportLine $this->db->commit(); return $this->id; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog("ExpenseReportLine::insert Error ".$this->error, LOG_ERR); $this->db->rollback(); @@ -2748,8 +2691,7 @@ class ExpenseReportLine $amount = (double) $obj->total_amount; } } - else - { + else { dol_print_error($this->db); } @@ -2813,15 +2755,13 @@ class ExpenseReportLine $this->errors = $tmpparent->errors; } } - else - { + else { $error++; $this->error = $tmpparent->error; $this->errors = $tmpparent->errors; } } - else - { + else { $error++; dol_print_error($this->db); } @@ -2831,8 +2771,7 @@ class ExpenseReportLine $this->db->commit(); return 1; } - else - { + else { $this->error = $this->db->lasterror(); dol_syslog("ExpenseReportLine::update Error ".$this->error, LOG_ERR); $this->db->rollback(); @@ -2868,8 +2807,7 @@ function select_expensereport_statut($selected = '', $htmlname = 'fk_statut', $u { print '