diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml
index 21186cfbe5c..e99b8673981 100644
--- a/dev/setup/codesniffer/ruleset.xml
+++ b/dev/setup/codesniffer/ruleset.xml
@@ -215,7 +215,7 @@
-
+
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 754d01e3b78..bf0ad592e8e 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -215,8 +215,8 @@ if (empty($reshook)) {
}
}
}
- } // Delete proposal
- elseif ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) {
+ } elseif ($action == 'confirm_delete' && $confirm == 'yes' && $usercandelete) {
+ // Delete proposal
$result = $object->delete($user);
if ($result > 0) {
header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php?restore_lastsearch_values=1');
@@ -225,8 +225,8 @@ if (empty($reshook)) {
$langs->load("errors");
setEventMessages($object->error, $object->errors, 'errors');
}
- } // Remove line
- elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) {
+ } elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) {
+ // Remove line
$result = $object->deleteline($lineid);
// reorder lines
if ($result) {
@@ -250,8 +250,8 @@ if (empty($reshook)) {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit();
- } // Validation
- elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) {
+ } elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) {
+ // Validation
$idwarehouse = GETPOST('idwarehouse', 'int');
$result = $object->valid($user);
if ($result >= 0) {
@@ -308,17 +308,17 @@ if (empty($reshook)) {
if ($result < 0) {
dol_print_error($db, $object->error);
}
- } // Positionne ref client
- elseif ($action == 'setref_client' && $usercancreate) {
+ } elseif ($action == 'setref_client' && $usercancreate) {
+ // Positionne ref client
$result = $object->set_ref_client($user, GETPOST('ref_client'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
- } // Set incoterm
- elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled) && $usercancreate) {
+ } elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled) && $usercancreate) {
+ // Set incoterm
$result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha'));
- } // Create proposal
- elseif ($action == 'add' && $usercancreate) {
+ } elseif ($action == 'add' && $usercancreate) {
+ // Create proposal
$object->socid = $socid;
$object->fetch_thirdparty();
@@ -554,8 +554,8 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
- } // Standard creation
- else {
+ } else {
+ // Standard creation
$id = $object->create($user);
}
@@ -616,8 +616,8 @@ if (empty($reshook)) {
}
}
}
- } // Classify billed
- elseif ($action == 'classifybilled' && $usercanclose) {
+ } elseif ($action == 'classifybilled' && $usercanclose) {
+ // Classify billed
$db->begin();
$result = $object->cloture($user, $object::STATUS_BILLED, '');
@@ -631,8 +631,8 @@ if (empty($reshook)) {
} else {
$db->rollback();
}
- } // Close proposal
- elseif ($action == 'confirm_closeas' && $usercanclose && !GETPOST('cancel', 'alpha')) {
+ } elseif ($action == 'confirm_closeas' && $usercanclose && !GETPOST('cancel', 'alpha')) {
+ // Close proposal
if (!(GETPOST('statut', 'int') > 0)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
$action = 'closeas';
@@ -654,8 +654,8 @@ if (empty($reshook)) {
}
}
}
- } // Reopen proposal
- elseif ($action == 'confirm_reopen' && $usercanclose && !GETPOST('cancel', 'alpha')) {
+ } elseif ($action == 'confirm_reopen' && $usercanclose && !GETPOST('cancel', 'alpha')) {
+ // Reopen proposal
// prevent browser refresh from reopening proposal several times
if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) {
$db->begin();
@@ -672,11 +672,11 @@ if (empty($reshook)) {
$db->rollback();
}
}
- } // add lines from objectlinked
- elseif ($action == 'import_lines_from_object'
+ } elseif ($action == 'import_lines_from_object'
&& $user->rights->propal->creer
&& $object->statut == Propal::STATUS_DRAFT
) {
+ // add lines from objectlinked
$fromElement = GETPOST('fromelement');
$fromElementid = GETPOST('fromelementid');
$importLines = GETPOST('line_checkbox');
@@ -898,8 +898,8 @@ if (empty($reshook)) {
$tva_npr = $prod->multiprices_recuperableonly[$object->thirdparty->price_level];
}
}
- } // If price per customer
- elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
+ } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
+ // If price per customer
require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
$prodcustprice = new Productcustomerprice($db);
@@ -924,8 +924,8 @@ if (empty($reshook)) {
}
}
}
- } // If price per quantity
- elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
+ } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY)) {
+ // If price per quantity
if ($prod->prices_by_qty[0]) { // yes, this product has some prices per quantity
// Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp'].
$pqp = GETPOST('pbq', 'int');
@@ -945,8 +945,8 @@ if (empty($reshook)) {
break;
}
}
- } // If price per quantity and customer
- elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
+ } elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
+ // If price per quantity and customer
if ($prod->prices_by_qty[$object->thirdparty->price_level]) { // yes, this product has some prices per quantity
// Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp'].
$pqp = GETPOST('pbq', 'int');
@@ -975,9 +975,9 @@ if (empty($reshook)) {
if (!empty($price_ht) || $price_ht === '0') {
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
- } // On reevalue prix selon taux tva car taux tva transaction peut etre different
- // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
- elseif ($tmpvat != $tmpprodvat) {
+ } elseif ($tmpvat != $tmpprodvat) {
+ // On reevalue prix selon taux tva car taux tva transaction peut etre different
+ // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
if ($price_base_type != 'HT') {
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
} else {
@@ -1167,8 +1167,8 @@ if (empty($reshook)) {
}
}
}
- } // Update a line within proposal
- elseif ($action == 'updateline' && $usercancreate && GETPOST('save')) {
+ } elseif ($action == 'updateline' && $usercancreate && GETPOST('save')) {
+ // Update a line within proposal
// Define info_bits
$info_bits = 0;
if (preg_match('/\*/', GETPOST('tva_tx'))) {
@@ -1313,36 +1313,36 @@ if (empty($reshook)) {
} elseif ($action == 'classin' && $usercancreate) {
// Set project
$object->setProject(GETPOST('projectid', 'int'));
- } // Delivery time
- elseif ($action == 'setavailability' && $usercancreate) {
+ } elseif ($action == 'setavailability' && $usercancreate) {
+ // Delivery time
$result = $object->set_availability($user, GETPOST('availability_id', 'int'));
- } // Origin of the commercial proposal
- elseif ($action == 'setdemandreason' && $usercancreate) {
+ } elseif ($action == 'setdemandreason' && $usercancreate) {
+ // Origin of the commercial proposal
$result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int'));
- } // Terms of payment
- elseif ($action == 'setconditions' && $usercancreate) {
+ } elseif ($action == 'setconditions' && $usercancreate) {
+ // Terms of payment
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) {
$result = $object->set_remise_percent($user, $_POST['remise_percent']);
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
$result = $object->set_remise_absolue($user, $_POST['remise_absolue']);
- } // Payment choice
- elseif ($action == 'setmode' && $usercancreate) {
+ } elseif ($action == 'setmode' && $usercancreate) {
+ // Payment choice
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
- } // Multicurrency Code
- elseif ($action == 'setmulticurrencycode' && $usercancreate) {
+ } elseif ($action == 'setmulticurrencycode' && $usercancreate) {
+ // Multicurrency Code
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
- } // Multicurrency rate
- elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
+ } elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
+ // Multicurrency rate
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')));
- } // bank account
- elseif ($action == 'setbankaccount' && $usercancreate) {
+ } elseif ($action == 'setbankaccount' && $usercancreate) {
+ // bank account
$result = $object->setBankAccount(GETPOST('fk_account', 'int'));
- } // shipping method
- elseif ($action == 'setshippingmethod' && $usercancreate) {
+ } elseif ($action == 'setshippingmethod' && $usercancreate) {
+ // shipping method
$result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int'));
- }// warehouse
- elseif ($action == 'setwarehouse' && $usercancreate) {
+ } elseif ($action == 'setwarehouse' && $usercancreate) {
+ // warehouse
$result = $object->setWarehouse(GETPOST('warehouse_id', 'int'));
} elseif ($action == 'update_extras') {
$object->oldcopy = dol_clone($object);
@@ -1383,15 +1383,15 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- } // Toggle the status of a contact
- elseif ($action == 'swapstatut') {
+ } elseif ($action == 'swapstatut') {
+ // Toggle the status of a contact
if ($object->fetch($id) > 0) {
$result = $object->swapContactStatus(GETPOST('ligne'));
} else {
dol_print_error($db);
}
- } // Delete a contact
- elseif ($action == 'deletecontact') {
+ } elseif ($action == 'deletecontact') {
+ // Delete a contact
$object->fetch($id);
$result = $object->delete_contact($lineid);
@@ -1907,17 +1907,17 @@ if ($action == 'create') {
}
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
- } // Confirm delete
- elseif ($action == 'delete') {
+ } elseif ($action == 'delete') {
+ // Confirm delete
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
- } // Confirm reopen
- elseif ($action == 'reopen') {
+ } elseif ($action == 'reopen') {
+ // Confirm reopen
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
- } // Confirmation delete product/service line
- elseif ($action == 'ask_deleteline') {
+ } elseif ($action == 'ask_deleteline') {
+ // Confirmation delete product/service line
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
- } // Confirm validate proposal
- elseif ($action == 'validate') {
+ } elseif ($action == 'validate') {
+ // Confirm validate proposal
$error = 0;
// We verify whether the object is provisionally numbering
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 553362687b6..af77b56bc15 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1651,7 +1651,8 @@ class Propal extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -1891,7 +1892,8 @@ class Propal extends CommonObject
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'propale/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
@@ -2457,7 +2459,8 @@ class Propal extends CommonObject
dol_syslog(get_class($this)."::reopen", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
if (!$notrigger) {
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index c75589c1aa0..950d7438f07 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -222,7 +222,8 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php
index 326299448f7..e18891f3c60 100644
--- a/htdocs/comm/propal/stats/index.php
+++ b/htdocs/comm/propal/stats/index.php
@@ -123,7 +123,8 @@ $px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
$px1->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -158,7 +159,8 @@ $px2 = new DolGraph();
$mesg = $px2->isGraphKo();
if (!$mesg) {
$px2->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -202,7 +204,8 @@ $px3 = new DolGraph();
$mesg = $px3->isGraphKo();
if (!$mesg) {
$px3->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php
index 929a7a483bb..4f433a28ac4 100644
--- a/htdocs/compta/bank/account_statement_document.php
+++ b/htdocs/compta/bank/account_statement_document.php
@@ -186,7 +186,8 @@ if ($id > 0 || !empty($ref)) {
$permission = $user->rights->banque->modifier;
$permtoedit = $user->rights->banque->modifier;
$param = '&id='.$object->id.'&num='.urlencode($numref);
- $moreparam = '&num='.urlencode($numref); ;
+ $moreparam = '&num='.urlencode($numref);
+ ;
$relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/";
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 390972912c1..6ec8fed517f 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -182,7 +182,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -1188,8 +1189,8 @@ if ($resql) {
// If sort is desc,desc,desc then total of previous date + amount is the balancebefore of the previous line before the line to show
if ($sortfield == 'b.datev,b.dateo,b.rowid' && $sortorder == 'desc,desc,desc') {
$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 {
+ // If sort is asc,asc,asc then total of previous date is balance of line before the next line to show
$balance = $objforbalance->previoustotal;
}
}
diff --git a/htdocs/compta/bank/budget.php b/htdocs/compta/bank/budget.php
index dda8f13437d..d3ffbb37916 100644
--- a/htdocs/compta/bank/budget.php
+++ b/htdocs/compta/bank/budget.php
@@ -72,7 +72,9 @@ $sql .= " ORDER BY c.label";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
- $i = 0; $total = 0; $totalnb = 0;
+ $i = 0;
+ $total = 0;
+ $totalnb = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php
index 48976f8ba25..fb9fead3089 100644
--- a/htdocs/compta/bank/categ.php
+++ b/htdocs/compta/bank/categ.php
@@ -126,7 +126,8 @@ $sql .= " ORDER BY rowid";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
- $i = 0; $total = 0;
+ $i = 0;
+ $total = 0;
while ($i < $num) {
$objp = $db->fetch_object($result);
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index c2dd1c316a6..6dd588f51e1 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -795,13 +795,17 @@ print '';
// Graphs
if ($mode == 'standard') {
- $prevyear = $year; $nextyear = $year;
- $prevmonth = $month - 1; $nextmonth = $month + 1;
+ $prevyear = $year;
+ $nextyear = $year;
+ $prevmonth = $month - 1;
+ $nextmonth = $month + 1;
if ($prevmonth < 1) {
- $prevmonth = 12; $prevyear--;
+ $prevmonth = 12;
+ $prevyear--;
}
if ($nextmonth > 12) {
- $nextmonth = 1; $nextyear++;
+ $nextmonth = 1;
+ $nextyear++;
}
// For month
@@ -818,7 +822,8 @@ if ($mode == 'standard') {
print '';
// For year
- $prevyear = $year - 1; $nextyear = $year + 1;
+ $prevyear = $year - 1;
+ $nextyear = $year + 1;
$link = "".img_previous('', 'class="valignbottom"')." ".$langs->trans("Year")." ".img_next('', 'class="valignbottom"')."";
print '
'.$link.'
';
diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php
index 1f22b67ac7c..caca78033d6 100644
--- a/htdocs/compta/bank/line.php
+++ b/htdocs/compta/bank/line.php
@@ -272,7 +272,8 @@ $sql .= " WHERE rowid=".$rowid;
$sql .= " ORDER BY dateo ASC";
$result = $db->query($sql);
if ($result) {
- $i = 0; $total = 0;
+ $i = 0;
+ $total = 0;
if ($db->num_rows($result)) {
$objp = $db->fetch_object($result);
diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php
index 6c2e595e3d1..2882a4635fd 100644
--- a/htdocs/compta/bank/list.php
+++ b/htdocs/compta/bank/list.php
@@ -134,7 +134,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -490,7 +491,10 @@ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $
print "\n";
-$totalarray = array(); $found = 0; $i = 0; $lastcurrencycode = '';
+$totalarray = array();
+$found = 0;
+$i = 0;
+$lastcurrencycode = '';
foreach ($accounts as $key => $type) {
if ($i >= $limit) {
diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php
index d4bec1929ee..da018dd1f06 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_card.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_card.php
@@ -413,9 +413,11 @@ if ($action == "create" || $action == "start" || $action == 'close') {
for ($i = 1; $i <= $numterminals; $i++) {
$array[$i] = $i;
}
- $selectedposnumber = 0; $showempty = 1;
+ $selectedposnumber = 0;
+ $showempty = 1;
if ($conf->global->TAKEPOS_NUM_TERMINALS == '1') {
- $selectedposnumber = 1; $showempty = 0;
+ $selectedposnumber = 1;
+ $showempty = 0;
}
print $form->selectarray('posnumber', $array, GETPOSTISSET('posnumber') ?GETPOST('posnumber', 'int') : $selectedposnumber, $showempty);
//print '';
diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php
index a301caff80f..6c4141e4b6a 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_list.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_list.php
@@ -140,7 +140,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php
index 8f85f5779a0..f6c58aa858c 100644
--- a/htdocs/compta/cashcontrol/report.php
+++ b/htdocs/compta/cashcontrol/report.php
@@ -233,10 +233,9 @@ if ($resql) {
} else {
if ($conf->global->$var1 == $bankaccount->id) {
$cash += $objp->amount;
- }
- //elseif ($conf->global->$var2 == $bankaccount->id) $bank+=$objp->amount;
- //elseif ($conf->global->$var3 == $bankaccount->id) $cheque+=$objp->amount;
- else {
+ // } elseif ($conf->global->$var2 == $bankaccount->id) $bank+=$objp->amount;
+ //elseif ($conf->global->$var3 == $bankaccount->id) $cheque+=$objp->amount;
+ } else {
$other += $objp->amount;
}
}
diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php
index 7ca8a2d591e..1d294df8cff 100644
--- a/htdocs/compta/deplacement/card.php
+++ b/htdocs/compta/deplacement/card.php
@@ -134,8 +134,8 @@ if ($action == 'validate' && $user->rights->deplacement->creer) {
header("Location: index.php");
exit;
}
-} // Update record
-elseif ($action == 'update' && $user->rights->deplacement->creer) {
+} elseif ($action == 'update' && $user->rights->deplacement->creer) {
+ // Update record
if (!GETPOST('cancel', 'alpha')) {
$result = $object->fetch($id);
@@ -159,15 +159,15 @@ elseif ($action == 'update' && $user->rights->deplacement->creer) {
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
}
-} // Set into a project
-elseif ($action == 'classin' && $user->rights->deplacement->creer) {
+} elseif ($action == 'classin' && $user->rights->deplacement->creer) {
+ // Set into a project
$object->fetch($id);
$result = $object->setProject(GETPOST('projectid', 'int'));
if ($result < 0) {
dol_print_error($db, $object->error);
}
-} // Set fields
-elseif ($action == 'setdated' && $user->rights->deplacement->creer) {
+} elseif ($action == 'setdated' && $user->rights->deplacement->creer) {
+ // Set fields
$dated = dol_mktime(GETPOST('datedhour', 'int'), GETPOST('datedmin', 'int'), GETPOST('datedsec', 'int'), GETPOST('datedmonth', 'int'), GETPOST('datedday', 'int'), GETPOST('datedyear', 'int'));
$object->fetch($id);
$result = $object->setValueFrom('dated', $dated, '', '', 'date', '', $user, 'DEPLACEMENT_MODIFY');
diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php
index 4786e2ea1b5..892b2b86dff 100644
--- a/htdocs/compta/deplacement/stats/index.php
+++ b/htdocs/compta/deplacement/stats/index.php
@@ -110,7 +110,8 @@ $px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
$px1->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -140,7 +141,8 @@ $px2 = new DolGraph();
$mesg = $px2->isGraphKo();
if (!$mesg) {
$px2->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -184,7 +186,8 @@ $px3 = new DolGraph();
$mesg = $px3->isGraphKo();
if (!$mesg) {
$px3->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 988dea7e45e..ee5cd3e00f9 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -133,7 +133,8 @@ $error = 0;
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
@@ -279,14 +280,14 @@ if (empty($reshook)) {
// Set condition
if ($action == 'setconditions' && $user->rights->facture->creer) {
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
- } // Set mode
- elseif ($action == 'setmode' && $user->rights->facture->creer) {
+ } elseif ($action == 'setmode' && $user->rights->facture->creer) {
+ // Set mode
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
- } // Set project
- elseif ($action == 'classin' && $user->rights->facture->creer) {
+ } elseif ($action == 'classin' && $user->rights->facture->creer) {
+ // Set project
$object->setProject(GETPOST('projectid', 'int'));
- } // Set bank account
- elseif ($action == 'setref' && $user->rights->facture->creer) {
+ } elseif ($action == 'setref' && $user->rights->facture->creer) {
+ // Set bank account
//var_dump(GETPOST('ref', 'alpha'));exit;
$result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
if ($result > 0) {
@@ -302,32 +303,32 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- } // Set bank account
- elseif ($action == 'setbankaccount' && $user->rights->facture->creer) {
+ } elseif ($action == 'setbankaccount' && $user->rights->facture->creer) {
+ // Set bank account
$result = $object->setBankAccount(GETPOST('fk_account', 'int'));
- } // Set frequency and unit frequency
- elseif ($action == 'setfrequency' && $user->rights->facture->creer) {
+ } elseif ($action == 'setfrequency' && $user->rights->facture->creer) {
+ // Set frequency and unit frequency
$object->setFrequencyAndUnit(GETPOST('frequency', 'int'), GETPOST('unit_frequency', 'alpha'));
- } // Set next date of execution
- elseif ($action == 'setdate_when' && $user->rights->facture->creer) {
+ } elseif ($action == 'setdate_when' && $user->rights->facture->creer) {
+ // Set next date of execution
$date = dol_mktime(GETPOST('date_whenhour'), GETPOST('date_whenmin'), 0, GETPOST('date_whenmonth'), GETPOST('date_whenday'), GETPOST('date_whenyear'));
if (!empty($date)) {
$object->setNextDate($date);
}
- } // Set max period
- elseif ($action == 'setnb_gen_max' && $user->rights->facture->creer) {
+ } elseif ($action == 'setnb_gen_max' && $user->rights->facture->creer) {
+ // Set max period
$object->setMaxPeriod(GETPOST('nb_gen_max', 'int'));
- } // Set auto validate
- elseif ($action == 'setauto_validate' && $user->rights->facture->creer) {
+ } elseif ($action == 'setauto_validate' && $user->rights->facture->creer) {
+ // Set auto validate
$object->setAutoValidate(GETPOST('auto_validate', 'int'));
- } // Set generate pdf
- elseif ($action == 'setgenerate_pdf' && $user->rights->facture->creer) {
+ } elseif ($action == 'setgenerate_pdf' && $user->rights->facture->creer) {
+ // Set generate pdf
$object->setGeneratepdf(GETPOST('generate_pdf', 'int'));
- } // Set model pdf
- elseif ($action == 'setmodelpdf' && $user->rights->facture->creer) {
+ } elseif ($action == 'setmodelpdf' && $user->rights->facture->creer) {
+ // Set model pdf
$object->setModelpdf(GETPOST('modelpdf', 'alpha'));
- } // Set status disabled
- elseif ($action == 'disable' && $user->rights->facture->creer) {
+ } elseif ($action == 'disable' && $user->rights->facture->creer) {
+ // Set status disabled
$db->begin();
$object->fetch($id);
@@ -343,8 +344,8 @@ if (empty($reshook)) {
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
- } // Set status enabled
- elseif ($action == 'enable' && $user->rights->facture->creer) {
+ } elseif ($action == 'enable' && $user->rights->facture->creer) {
+ // Set status enabled
$db->begin();
$object->fetch($id);
@@ -360,11 +361,11 @@ if (empty($reshook)) {
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
}
- } // Multicurrency Code
- elseif ($action == 'setmulticurrencycode' && $usercancreate) {
+ } elseif ($action == 'setmulticurrencycode' && $usercancreate) {
+ // Multicurrency Code
$result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha'));
- } // Multicurrency rate
- elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
+ } elseif ($action == 'setmulticurrencyrate' && $usercancreate) {
+ // Multicurrency rate
$result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int'));
}
@@ -525,9 +526,9 @@ if (empty($reshook)) {
if (!empty($price_ht)) {
$pu_ht = price2num($price_ht, 'MU');
$pu_ttc = price2num($pu_ht * (1 + ($tmpvat / 100)), 'MU');
- } // On reevalue prix selon taux tva car taux tva transaction peut etre different
- // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
- elseif ($tmpvat != $tmpprodvat) {
+ } elseif ($tmpvat != $tmpprodvat) {
+ // On reevalue prix selon taux tva car taux tva transaction peut etre different
+ // de ceux du produit par defaut (par exemple si pays different entre vendeur et acheteur).
if ($price_base_type != 'HT') {
$pu_ht = price2num($pu_ttc / (1 + ($tmpvat / 100)), 'MU');
} else {
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index ba4e4e8e8d1..3598b678711 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -233,8 +233,8 @@ if (empty($reshook)) {
$action = '';
}
}
- } // Delete line
- elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) {
+ } elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $usercancreate) {
+ // Delete line
$object->fetch($id);
$object->fetch_thirdparty();
@@ -563,8 +563,8 @@ if (empty($reshook)) {
} elseif ($action == 'setref_client' && $usercancreate) {
$object->fetch($id);
$object->set_ref_client(GETPOST('ref_client'));
- } // Classify to validated
- elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) {
+ } elseif ($action == 'confirm_valid' && $confirm == 'yes' && $usercanvalidate) {
+ // Classify to validated
$idwarehouse = GETPOST('idwarehouse', 'int');
$object->fetch($id);
@@ -2770,15 +2770,15 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
- } // bascule du statut d'un contact
- elseif ($action == 'swapstatut') {
+ } elseif ($action == 'swapstatut') {
+ // bascule du statut d'un contact
if ($object->fetch($id)) {
$result = $object->swapContactStatus(GETPOST('ligne'));
} else {
dol_print_error($db);
}
- } // Efface un contact
- elseif ($action == 'deletecontact') {
+ } elseif ($action == 'deletecontact') {
+ // Efface un contact
$object->fetch($id);
$result = $object->delete_contact($lineid);
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 983e42f5ff5..4a6d767f6c6 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1972,7 +1972,8 @@ class Facture extends CommonInvoice
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -2807,7 +2808,8 @@ class Facture extends CommonInvoice
$sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'facture/".$this->db->escape($this->ref)."' and entity = ".$conf->entity;
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->error = $this->db->lasterror();
+ $error++;
+ $this->error = $this->db->lasterror();
}
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php
index 4795a9b2062..d9c0fa36c9a 100644
--- a/htdocs/compta/facture/class/paymentterm.class.php
+++ b/htdocs/compta/facture/class/paymentterm.class.php
@@ -145,7 +145,8 @@ class PaymentTerm // extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -317,7 +318,8 @@ class PaymentTerm // extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -355,7 +357,8 @@ class PaymentTerm // extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index d45439286fb..e419ed9260b 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -170,7 +170,8 @@ if ($socid > 0) {
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 9f5281dc20b..8f3a54fe4ba 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -248,7 +248,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
*/
if (GETPOST('cancel', 'alpha')) {
- $action = 'list'; $massaction = '';
+ $action = 'list';
+ $massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index b6cf7ec5c06..719c92ca6f0 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -576,7 +576,9 @@ if ($object->id > 0) {
print dol_get_fiche_end();
- $numopen = 0; $pending = 0; $numclosed = 0;
+ $numopen = 0;
+ $pending = 0;
+ $numclosed = 0;
// How many Direct debit opened requests ?
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index 536beff168d..2818fa5f3b9 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -133,7 +133,8 @@ $px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
$px1->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -168,7 +169,8 @@ $px2 = new DolGraph();
$mesg = $px2->isGraphKo();
if (!$mesg) {
$px2->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
@@ -212,7 +214,8 @@ $px3 = new DolGraph();
$mesg = $px3->isGraphKo();
if (!$mesg) {
$px3->SetData($data);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
$legend[] = $i;
$i++;
diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php
index 39faf295c45..46c56f3dca5 100644
--- a/htdocs/compta/journal/sellsjournal.php
+++ b/htdocs/compta/journal/sellsjournal.php
@@ -88,7 +88,8 @@ $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_starty
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
- $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false); $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
+ $date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
+ $date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
}
$name = $langs->trans("SellsJournal");
diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php
index 603e8564927..72155845b0c 100644
--- a/htdocs/compta/localtax/clients.php
+++ b/htdocs/compta/localtax/clients.php
@@ -51,7 +51,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$q = GETPOST("q");
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);
+ $date_start = dol_get_first_day($year_start, GETPOST("month"), false);
+ $date_end = dol_get_last_day($year_start, GETPOST("month"), false);
} 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) {
@@ -64,16 +65,20 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
}
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
}
@@ -206,7 +211,8 @@ if ($calc == 0 || $calc == 2) {
$reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if (is_array($coll_list)) {
- $total = 0; $totalamount = 0;
+ $total = 0;
+ $totalamount = 0;
$i = 1;
foreach ($coll_list as $coll) {
if (($min == 0 || ($min > 0 && $coll->amount > $min)) && ($local == 1 ? $coll->localtax1 : $coll->localtax2) != 0) {
@@ -270,7 +276,8 @@ if ($calc == 0 || $calc == 1) {
$reshook = $hookmanager->executeHooks('addVatLine', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if (is_array($coll_list)) {
- $total = 0; $totalamount = 0;
+ $total = 0;
+ $totalamount = 0;
$i = 1;
foreach ($coll_list as $coll) {
if (($min == 0 || ($min > 0 && $coll->amount > $min)) && ($local == 1 ? $coll->localtax1 : $coll->localtax2) != 0) {
diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php
index 051a98a4b3b..86fa3fe52f0 100644
--- a/htdocs/compta/localtax/index.php
+++ b/htdocs/compta/localtax/index.php
@@ -50,23 +50,28 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$q = GETPOST("q", "int");
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);
+ $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 {
$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 {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
}
@@ -286,8 +291,12 @@ $tmp = dol_getdate($date_end);
$yend = $tmp['year'];
$mend = $tmp['mon'];
-$total = 0; $subtotalcoll = 0; $subtotalpaye = 0; $subtotal = 0;
-$i = 0; $mcursor = 0;
+$total = 0;
+$subtotalcoll = 0;
+$subtotalpaye = 0;
+$subtotal = 0;
+$i = 0;
+$mcursor = 0;
while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) { // $mcursor is to avoid too large loop
//$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12);
if ($m == 13) {
@@ -537,7 +546,8 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) { // $
print " | \n";
print "\n";
- $i++; $m++;
+ $i++;
+ $m++;
if ($i > 2) {
print '';
print '| '.$langs->trans("SubTotal").': | ';
@@ -546,7 +556,9 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) { // $
print ''.price(price2num($subtotal, 'MT')).' | ';
print ' |
';
$i = 0;
- $subtotalcoll = 0; $subtotalpaye = 0; $subtotal = 0;
+ $subtotalcoll = 0;
+ $subtotalpaye = 0;
+ $subtotal = 0;
}
}
print '| '.$langs->trans("TotalToPay").': | '.price(price2num($total, 'MT')).' | ';
diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php
index aec90544e09..a2904c861f4 100644
--- a/htdocs/compta/localtax/quadri_detail.php
+++ b/htdocs/compta/localtax/quadri_detail.php
@@ -61,7 +61,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$q = GETPOST("q", "int");
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);
+ $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 {
$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) {
@@ -74,16 +75,20 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
}
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
}
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 0fcbf6a914a..7f03f4a569c 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -559,12 +559,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$alreadypayedlabel = $langs->trans('Received');
$multicurrencyalreadypayedlabel = $langs->trans('MulticurrencyReceived');
if ($facture->type == 2) {
- $alreadypayedlabel = $langs->trans("PaidBack"); $multicurrencyalreadypayedlabel = $langs->trans("MulticurrencyPaidBack");
+ $alreadypayedlabel = $langs->trans("PaidBack");
+ $multicurrencyalreadypayedlabel = $langs->trans("MulticurrencyPaidBack");
}
$remaindertopay = $langs->trans('RemainderToTake');
$multicurrencyremaindertopay = $langs->trans('MulticurrencyRemainderToTake');
if ($facture->type == 2) {
- $remaindertopay = $langs->trans("RemainderToPayBack"); $multicurrencyremaindertopay = $langs->trans("MulticurrencyRemainderToPayBack");
+ $remaindertopay = $langs->trans("RemainderToPayBack");
+ $multicurrencyremaindertopay = $langs->trans("MulticurrencyRemainderToPayBack");
}
$i = 0;
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index c8e6691afc6..e941f532efa 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -235,8 +235,8 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) {
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#builddoc'));
exit;
}
-} // Remove file in doc form
-elseif ($action == 'remove_file' && $user->rights->banque->cheque) {
+} elseif ($action == 'remove_file' && $user->rights->banque->cheque) {
+ // Remove file in doc form
if ($object->fetch($id) > 0) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 7db9ff922d9..06d13e78023 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -335,9 +335,8 @@ class Paiement extends CommonObject
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 ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more.");
+ } else {
// If invoice is a down payment, we also convert down payment to discount
if ($invoice->type == Facture::TYPE_DEPOSIT) {
$amount_ht = $amount_tva = $amount_ttc = array();
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index d9073488567..9c700f509f9 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -111,19 +111,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
} else {
$month_end = $month_start;
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php
index 3c1d6d3fb0d..228269d135e 100644
--- a/htdocs/compta/resultat/index.php
+++ b/htdocs/compta/resultat/index.php
@@ -79,19 +79,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
} else {
$month_end = $month_start;
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php
index 75d73eeca31..df3a82a4b7f 100644
--- a/htdocs/compta/resultat/result.php
+++ b/htdocs/compta/resultat/result.php
@@ -91,19 +91,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
} else {
$month_end = $month_start;
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index 3c2b26a83d8..18c8e9aa59d 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -612,7 +612,8 @@ if ($id > 0) {
$totalpaye = 0;
$num = $db->num_rows($resql);
- $i = 0; $total = 0;
+ $i = 0;
+ $total = 0;
print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
';
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index f718a9a48b7..91a0708c361 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -356,7 +356,8 @@ class ChargeSociales extends CommonObject
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
index 4fda644e1c0..bb9a48b4c4c 100644
--- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
+++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php
@@ -369,7 +369,8 @@ class PaymentSocialContribution extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -420,7 +421,8 @@ class PaymentSocialContribution extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php
index 1f4de217bac..e2047d00738 100644
--- a/htdocs/compta/stats/byratecountry.php
+++ b/htdocs/compta/stats/byratecountry.php
@@ -74,19 +74,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$year_end++;
}
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
}
@@ -175,17 +180,21 @@ if ($modetax == 2) {
$calcmode .= '
('.$langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT.'/admin/taxes.php').')';
// Set period
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
-$prevyear = $year_start; $prevquarter = $q;
+$prevyear = $year_start;
+$prevquarter = $q;
if ($prevquarter > 1) {
$prevquarter--;
} else {
- $prevquarter = 4; $prevyear--;
+ $prevquarter = 4;
+ $prevyear--;
}
-$nextyear = $year_start; $nextquarter = $q;
+$nextyear = $year_start;
+$nextquarter = $q;
if ($nextquarter < 4) {
$nextquarter++;
} else {
- $nextquarter = 1; $nextyear++;
+ $nextquarter = 1;
+ $nextyear++;
}
$description .= $fsearch;
$builddate = dol_now();
diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index eb678900112..c6c0e8e0816 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -119,19 +119,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$year_end++;
}
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
} else {
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index 494786bd8a2..62e6fb3135d 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -100,19 +100,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$year_end++;
}
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
} else {
// TODO We define q
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index 829e196a82e..c8c13ca8b27 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -120,19 +120,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$year_end++;
}
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
} else {
// TODO We define q
diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php
index eb039a63f92..083230da668 100644
--- a/htdocs/compta/stats/index.php
+++ b/htdocs/compta/stats/index.php
@@ -73,19 +73,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
} else {
$month_end = $month_start;
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php
index a6adf2a2440..b199dcbeb9c 100644
--- a/htdocs/compta/stats/supplier_turnover.php
+++ b/htdocs/compta/stats/supplier_turnover.php
@@ -69,19 +69,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
} else {
$month_end = $month_start;
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php
index 553bd62899e..bdf4e5e0f85 100644
--- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php
+++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php
@@ -114,19 +114,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$year_end++;
}
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
} else {
diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
index 0e653d542f6..fbfb0994e4a 100644
--- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
+++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
@@ -114,19 +114,24 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$year_end++;
}
}
- $date_start = dol_get_first_day($year_start, $month_start, false); $date_end = dol_get_last_day($year_end, $month_end, false);
+ $date_start = dol_get_first_day($year_start, $month_start, false);
+ $date_end = dol_get_last_day($year_end, $month_end, false);
}
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
} else {
// TODO We define q
diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php
index 87805ebf947..4421178a507 100644
--- a/htdocs/compta/tva/card.php
+++ b/htdocs/compta/tva/card.php
@@ -630,7 +630,8 @@ if ($id) {
$totalpaye = 0;
$num = $db->num_rows($resql);
- $i = 0; $total = 0;
+ $i = 0;
+ $total = 0;
print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
';
diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php
index ff1c8b46040..4f816164db0 100644
--- a/htdocs/compta/tva/class/paymentvat.class.php
+++ b/htdocs/compta/tva/class/paymentvat.class.php
@@ -372,7 +372,8 @@ class PaymentVAT extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -423,7 +424,8 @@ class PaymentVAT extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
}
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index e0801ba1db2..7ec5ad5b4f1 100644
--- a/htdocs/compta/tva/clients.php
+++ b/htdocs/compta/tva/clients.php
@@ -66,7 +66,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$q = GETPOST("q", "int");
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);
+ $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 {
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');
@@ -90,16 +91,20 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
}
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
}
diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php
index c831d5fe61c..2602d00a216 100644
--- a/htdocs/compta/tva/index.php
+++ b/htdocs/compta/tva/index.php
@@ -59,7 +59,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$q = GETPOST("q", "int");
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);
+ $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 {
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');
@@ -83,16 +84,20 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
}
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
}
@@ -301,8 +306,12 @@ $tmp = dol_getdate($date_end);
$yend = $tmp['year'];
$mend = $tmp['mon'];
//var_dump($m);
-$total = 0; $subtotalcoll = 0; $subtotalpaye = 0; $subtotal = 0;
-$i = 0; $mcursor = 0;
+$total = 0;
+$subtotalcoll = 0;
+$subtotalpaye = 0;
+$subtotal = 0;
+$i = 0;
+$mcursor = 0;
while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) { // $mcursor is to avoid too large loop
//$m = $conf->global->SOCIETE_FISCAL_MONTH_START + ($mcursor % 12);
@@ -535,7 +544,8 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) { // $
print "| | \n";
print "\n";
- $i++; $m++;
+ $i++;
+ $m++;
if ($i > 2) {
print '';
print '| '.$langs->trans("SubTotal").': | ';
@@ -544,7 +554,9 @@ while ((($y < $yend) || ($y == $yend && $m <= $mend)) && $mcursor < 1000) { // $
print ''.price(price2num($subtotal, 'MT')).' | ';
print ' |
';
$i = 0;
- $subtotalcoll = 0; $subtotalpaye = 0; $subtotal = 0;
+ $subtotalcoll = 0;
+ $subtotalpaye = 0;
+ $subtotal = 0;
}
}
print '| '.$langs->trans("TotalToPay").': | '.price(price2num($total, 'MT')).' | ';
diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php
index 04f90ba02f9..788067ec696 100644
--- a/htdocs/compta/tva/quadri_detail.php
+++ b/htdocs/compta/tva/quadri_detail.php
@@ -66,7 +66,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
$q = GETPOST("q", "int");
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);
+ $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 {
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');
@@ -90,16 +91,20 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e
}
} else {
if ($q == 1) {
- $date_start = dol_get_first_day($year_start, 1, false); $date_end = dol_get_last_day($year_start, 3, false);
+ $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);
+ $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);
+ $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);
+ $date_start = dol_get_first_day($year_start, 10, false);
+ $date_end = dol_get_last_day($year_start, 12, false);
}
}
}
@@ -179,7 +184,8 @@ if ($modetax == 2) {
$calcmode .= ' ('.$langs->trans("TaxModuleSetupToModifyRules", DOL_URL_ROOT.'/admin/taxes.php').')';
// Set period
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
-$prevyear = $year_start; $prevquarter = $q;
+$prevyear = $year_start;
+$prevquarter = $q;
if ($prevquarter > 1) {
$prevquarter--;
} else {
diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php
index 1bea255bda2..d05985b1aa3 100644
--- a/htdocs/core/actions_sendmails.inc.php
+++ b/htdocs/core/actions_sendmails.inc.php
@@ -108,7 +108,9 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
$trackid = GETPOST('trackid', 'aZ09');
}
- $subject = ''; $actionmsg = ''; $actionmsg2 = '';
+ $subject = '';
+ $actionmsg = '';
+ $actionmsg2 = '';
$langs->load('mails');
diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php
index e56c4a95dcd..5f0d6823978 100644
--- a/htdocs/core/actions_setmoduleoptions.inc.php
+++ b/htdocs/core/actions_setmoduleoptions.inc.php
@@ -84,7 +84,8 @@ if ($action == 'setModuleOptions') {
$tmpdir = trim($tmpdir);
$tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
if (!$tmpdir) {
- unset($listofdir[$key]); continue;
+ unset($listofdir[$key]);
+ continue;
}
if (!is_dir($tmpdir)) {
if (empty($nomessageinsetmoduleoptions)) {
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 43438c66dc4..cf619f70de6 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -284,9 +284,8 @@ if ($type == 'directory') {
$perm = $user->rights->ecm->upload;
$formfile->list_of_autoecmfiles($upload_dir, $filearray, $module, $param, 1, '', $perm, 1, $textifempty, $maxlengthname, $url, 1);
- }
- // Manual list
- else {
+ } else {
+ // Manual list
if ($module == 'medias') {
/*
$_POST is array like
diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php
index 52182e2205d..432a0e628db 100644
--- a/htdocs/core/ajax/ajaxdirtree.php
+++ b/htdocs/core/ajax/ajaxdirtree.php
@@ -237,17 +237,14 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_
// If directory is son of expanded directory, we show line
if (in_array($val['id_mere'], $expandedsectionarray)) {
$showline = 4;
- }
- // If directory is brother of selected directory, we show line
- elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) {
+ } elseif ($val['id'] != $section && $val['id_mere'] == $ecmdirstatic->motherof[$section]) {
+ // If directory is brother of selected directory, we show line
$showline = 3;
- }
- // If directory is parent of selected directory or is selected directory, we show line
- elseif (preg_match('/'.$val['fullpath'].'_/i', $fullpathselected.'_')) {
+ } elseif (preg_match('/'.$val['fullpath'].'_/i', $fullpathselected.'_')) {
+ // If directory is parent of selected directory or is selected directory, we show line
$showline = 2;
- }
- // If we are level one we show line
- elseif ($val['level'] < 2) {
+ } elseif ($val['level'] < 2) {
+ // If we are level one we show line
$showline = 1;
}
diff --git a/htdocs/core/ajax/pingresult.php b/htdocs/core/ajax/pingresult.php
index 990c3f6f858..4398a3e8d4c 100644
--- a/htdocs/core/ajax/pingresult.php
+++ b/htdocs/core/ajax/pingresult.php
@@ -71,9 +71,8 @@ if ($action == 'firstpingok') {
dolibarr_set_const($db, 'MAIN_FIRST_PING_OK_ID', $hash_unique_id);
print 'First ping OK saved for entity '.$conf->entity;
-}
-// If ko
-elseif ($action == 'firstpingko') {
+} elseif ($action == 'firstpingko') {
+ // If ko
// Note: pings are by installation, done on entity 1.
dolibarr_set_const($db, 'MAIN_LAST_PING_KO_DATE', dol_print_date($now, 'dayhourlog'), 'gmt'); // erase last value
print 'First ping KO saved for entity '.$conf->entity;
diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php
index ab39a14e2cd..ca77fec51e4 100644
--- a/htdocs/core/boxes/box_graph_invoices_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_permonth.php
@@ -122,7 +122,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
}
if (empty($shownb) && empty($showtot)) {
- $shownb = 1; $showtot = 1;
+ $shownb = 1;
+ $showtot = 1;
}
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) {
@@ -154,7 +155,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px1->SetData($data1);
unset($data1);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
if ($startmonth != 1) {
$legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
@@ -197,7 +199,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
$px2->SetData($data2);
unset($data2);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
if ($startmonth != 1) {
$legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
index 75b58a28de1..21931b1a071 100644
--- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php
@@ -119,7 +119,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
}
if (empty($shownb) && empty($showtot)) {
- $shownb = 1; $showtot = 1;
+ $shownb = 1;
+ $showtot = 1;
}
$nowarray = dol_getdate(dol_now(), true);
if (empty($year)) {
@@ -197,7 +198,8 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
$px2->SetData($data2);
unset($data2);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
if ($startmonth != 1) {
$legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php
index 3fafa464993..ec11d07a28f 100644
--- a/htdocs/core/boxes/box_graph_orders_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_permonth.php
@@ -122,7 +122,8 @@ class box_graph_orders_permonth extends ModeleBoxes
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
}
if (empty($shownb) && empty($showtot)) {
- $shownb = 1; $showtot = 1;
+ $shownb = 1;
+ $showtot = 1;
}
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) {
@@ -193,7 +194,8 @@ class box_graph_orders_permonth extends ModeleBoxes
if (!$mesg) {
$px2->SetData($data2);
unset($data2);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
if ($startmonth != 1) {
$legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
index 419e3afba83..a6dfead80f0 100644
--- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php
@@ -121,7 +121,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
}
if (empty($shownb) && empty($showtot)) {
- $shownb = 1; $showtot = 1;
+ $shownb = 1;
+ $showtot = 1;
}
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) {
@@ -192,7 +193,8 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
if (!$mesg) {
$px2->SetData($data2);
unset($data2);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
if ($startmonth != 1) {
$legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index 91a5f598347..5c3e55fcc2f 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -101,7 +101,9 @@ class box_graph_product_distribution extends ModeleBoxes
$showordernb = (!empty($tmparray['showordernb']) ? $tmparray['showordernb'] : '');
}
if (empty($showinvoicenb) && empty($showpropalnb) && empty($showordernb)) {
- $showpropalnb = 1; $showinvoicenb = 1; $showordernb = 1;
+ $showpropalnb = 1;
+ $showinvoicenb = 1;
+ $showordernb = 1;
}
if (empty($conf->facture->enabled) || empty($user->rights->facture->lire)) {
$showinvoicenb = 0;
@@ -154,7 +156,8 @@ class box_graph_product_distribution extends ModeleBoxes
$langs->load("propal");
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php';
- $showpointvalue = 1; $nocolor = 0;
+ $showpointvalue = 1;
+ $nocolor = 0;
$stats_proposal = new PropaleStats($this->db, $socid, ($userid > 0 ? $userid : 0));
$data2 = $stats_proposal->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5);
if (empty($data2)) {
@@ -169,7 +172,8 @@ class box_graph_product_distribution extends ModeleBoxes
$px2 = new DolGraph();
$mesg = $px2->isGraphKo();
if (!$mesg) {
- $i = 0; $legend = array();
+ $i = 0;
+ $legend = array();
foreach ($data2 as $key => $val) {
$data2[$key][0] = dol_trunc($data2[$key][0], 32);
@@ -210,7 +214,8 @@ class box_graph_product_distribution extends ModeleBoxes
$langs->load("orders");
include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php';
- $showpointvalue = 1; $nocolor = 0;
+ $showpointvalue = 1;
+ $nocolor = 0;
$mode = 'customer';
$stats_order = new CommandeStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0));
$data3 = $stats_order->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5);
@@ -226,7 +231,8 @@ class box_graph_product_distribution extends ModeleBoxes
$px3 = new DolGraph();
$mesg = $px3->isGraphKo();
if (!$mesg) {
- $i = 0; $legend = array();
+ $i = 0;
+ $legend = array();
foreach ($data3 as $key => $val) {
$data3[$key][0] = dol_trunc($data3[$key][0], 32);
@@ -268,7 +274,8 @@ class box_graph_product_distribution extends ModeleBoxes
$langs->load("bills");
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
- $showpointvalue = 1; $nocolor = 0;
+ $showpointvalue = 1;
+ $nocolor = 0;
$mode = 'customer';
$stats_invoice = new FactureStats($this->db, $socid, $mode, ($userid > 0 ? $userid : 0));
$data1 = $stats_invoice->getAllByProductEntry($year, (GETPOST('action', 'aZ09') == $refreshaction ?-1 : (3600 * 24)), 5);
@@ -284,7 +291,8 @@ class box_graph_product_distribution extends ModeleBoxes
$px1 = new DolGraph();
$mesg = $px1->isGraphKo();
if (!$mesg) {
- $i = 0; $legend = array();
+ $i = 0;
+ $legend = array();
foreach ($data1 as $key => $val) {
$data1[$key][0] = dol_trunc($data1[$key][0], 32);
diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php
index 8193e81d060..f8028e3bdb8 100644
--- a/htdocs/core/boxes/box_graph_propales_permonth.php
+++ b/htdocs/core/boxes/box_graph_propales_permonth.php
@@ -122,7 +122,8 @@ class box_graph_propales_permonth extends ModeleBoxes
$showtot = (!empty($tmparray['showtot']) ? $tmparray['showtot'] : '');
}
if (empty($shownb) && empty($showtot)) {
- $shownb = 1; $showtot = 1;
+ $shownb = 1;
+ $showtot = 1;
}
$nowarray = dol_getdate(dol_now(), true);
if (empty($endyear)) {
@@ -149,7 +150,8 @@ class box_graph_propales_permonth extends ModeleBoxes
$px1->SetType($datatype1);
$px1->SetData($data1);
unset($data1);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
if ($startmonth != 1) {
$legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
@@ -195,7 +197,8 @@ class box_graph_propales_permonth extends ModeleBoxes
$px2->SetType($datatype2);
$px2->SetData($data2);
unset($data2);
- $i = $startyear; $legend = array();
+ $i = $startyear;
+ $legend = array();
while ($i <= $endyear) {
if ($startmonth != 1) {
$legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 0d235a21798..863bb9a6794 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -578,7 +578,8 @@ class CMailFile
$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('mail'));
- $parameters = array(); $action = '';
+ $parameters = array();
+ $action = '';
$reshook = $hookmanager->executeHooks('sendMail', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->error = "Error in hook maildao sendMail ".$reshook;
@@ -815,7 +816,8 @@ class CMailFile
$this->smtps->setHost($server);
$this->smtps->setPort($port); // 25, 465...;
- $loginid = ''; $loginpass = '';
+ $loginid = '';
+ $loginpass = '';
if (!empty($conf->global->$keyforsmtpid)) {
$loginid = $conf->global->$keyforsmtpid;
$this->smtps->setID($loginid);
@@ -946,7 +948,8 @@ class CMailFile
return 'Bad value for sendmode';
}
- $parameters = array(); $action = '';
+ $parameters = array();
+ $action = '';
$reshook = $hookmanager->executeHooks('sendMailAfter', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
$this->error = "Error in hook maildao sendMailAfter ".$reshook;
diff --git a/htdocs/core/class/CSMSFile.class.php b/htdocs/core/class/CSMSFile.class.php
index 65cf7091d39..ca221a366ed 100644
--- a/htdocs/core/class/CSMSFile.class.php
+++ b/htdocs/core/class/CSMSFile.class.php
@@ -151,7 +151,8 @@ class CSMSFile
}
} elseif (!empty($conf->global->MAIN_SMS_SENDMODE)) { // $conf->global->MAIN_SMS_SENDMODE looks like a value 'class@module'
$tmp = explode('@', $conf->global->MAIN_SMS_SENDMODE);
- $classfile = $tmp[0]; $module = (empty($tmp[1]) ? $tmp[0] : $tmp[1]);
+ $classfile = $tmp[0];
+ $module = (empty($tmp[1]) ? $tmp[0] : $tmp[1]);
dol_include_once('/'.$module.'/class/'.$classfile.'.class.php');
try {
$classname = ucfirst($classfile);
diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php
index 1c886a526ed..ad088002caf 100644
--- a/htdocs/core/class/ccountry.class.php
+++ b/htdocs/core/class/ccountry.class.php
@@ -130,7 +130,8 @@ class Ccountry // extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -246,7 +247,8 @@ class Ccountry // extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -284,7 +286,8 @@ class Ccountry // extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php
index 3f9ca42e136..a8da44b0d79 100644
--- a/htdocs/core/class/comment.class.php
+++ b/htdocs/core/class/comment.class.php
@@ -141,7 +141,8 @@ class Comment extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -268,7 +269,8 @@ class Comment extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -318,7 +320,8 @@ class Comment extends CommonObject
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php
index fc4e2058273..d951807976f 100644
--- a/htdocs/core/class/commoninvoice.class.php
+++ b/htdocs/core/class/commoninvoice.class.php
@@ -632,9 +632,8 @@ abstract class CommonInvoice extends CommonObject
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
$datelim += ($cdr_decalage * 3600 * 24);
- }
- // 1 : application of the "end of the month" rule
- elseif ($cdr_type == 1) {
+ } elseif ($cdr_type == 1) {
+ // 1 : application of the "end of the month" rule
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
$mois = date('m', $datelim);
@@ -650,9 +649,8 @@ abstract class CommonInvoice extends CommonObject
$datelim -= (3600 * 24);
$datelim += ($cdr_decalage * 3600 * 24);
- }
- // 2 : application of the rule, the N of the current or next month
- elseif ($cdr_type == 2 && !empty($cdr_decalage)) {
+ } elseif ($cdr_type == 2 && !empty($cdr_decalage)) {
+ // 2 : application of the rule, the N of the current or next month
include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$datelim = $this->date + ($cdr_nbjour * 3600 * 24);
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 1500595d74e..3140b06b23b 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -762,7 +762,8 @@ abstract class CommonObject
$out .= img_picto($langs->trans("Address"), 'map-marker-alt');
$out .= ' ';
}
- $out .= dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', '); $outdone++;
+ $out .= dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', ');
+ $outdone++;
$outdone++;
// List of extra languages
@@ -1181,7 +1182,8 @@ abstract class CommonObject
if (!$notrigger) {
$result = $this->call_trigger(strtoupper($this->element).'_DELETE_CONTACT', $user);
if ($result < 0) {
- $this->db->rollback(); return -1;
+ $this->db->rollback();
+ return -1;
}
}
@@ -3154,9 +3156,8 @@ abstract class CommonObject
return $this->getRangOfLine($fk_parent_line);
}
}
- }
- // If not, search the last rang of element
- else {
+ } else {
+ // If not, search the last rang of element
$sql = 'SELECT max('.$positionfield.') FROM '.MAIN_DB_PREFIX.$this->table_element_line;
$sql .= ' WHERE '.$this->fk_element.' = '.$this->id;
@@ -3745,42 +3746,60 @@ abstract class CommonObject
if ($objecttype == 'facture') {
$classpath = 'compta/facture/class';
} elseif ($objecttype == 'facturerec') {
- $classpath = 'compta/facture/class'; $module = 'facture';
+ $classpath = 'compta/facture/class';
+ $module = 'facture';
} elseif ($objecttype == 'propal') {
$classpath = 'comm/propal/class';
} elseif ($objecttype == 'supplier_proposal') {
$classpath = 'supplier_proposal/class';
} elseif ($objecttype == 'shipping') {
- $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
+ $classpath = 'expedition/class';
+ $subelement = 'expedition';
+ $module = 'expedition_bon';
} elseif ($objecttype == 'delivery') {
- $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'delivery_note';
+ $classpath = 'delivery/class';
+ $subelement = 'delivery';
+ $module = 'delivery_note';
} elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
- $classpath = 'fourn/class'; $module = 'fournisseur';
+ $classpath = 'fourn/class';
+ $module = 'fournisseur';
} elseif ($objecttype == 'fichinter') {
- $classpath = 'fichinter/class'; $subelement = 'fichinter'; $module = 'ficheinter';
+ $classpath = 'fichinter/class';
+ $subelement = 'fichinter';
+ $module = 'ficheinter';
} elseif ($objecttype == 'subscription') {
- $classpath = 'adherents/class'; $module = 'adherent';
+ $classpath = 'adherents/class';
+ $module = 'adherent';
} elseif ($objecttype == 'contact') {
$module = 'societe';
}
// Set classfile
- $classfile = strtolower($subelement); $classname = ucfirst($subelement);
+ $classfile = strtolower($subelement);
+ $classname = ucfirst($subelement);
if ($objecttype == 'order') {
- $classfile = 'commande'; $classname = 'Commande';
+ $classfile = 'commande';
+ $classname = 'Commande';
} elseif ($objecttype == 'invoice_supplier') {
- $classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur';
+ $classfile = 'fournisseur.facture';
+ $classname = 'FactureFournisseur';
} elseif ($objecttype == 'order_supplier') {
- $classfile = 'fournisseur.commande'; $classname = 'CommandeFournisseur';
+ $classfile = 'fournisseur.commande';
+ $classname = 'CommandeFournisseur';
} elseif ($objecttype == 'supplier_proposal') {
- $classfile = 'supplier_proposal'; $classname = 'SupplierProposal';
+ $classfile = 'supplier_proposal';
+ $classname = 'SupplierProposal';
} elseif ($objecttype == 'facturerec') {
- $classfile = 'facture-rec'; $classname = 'FactureRec';
+ $classfile = 'facture-rec';
+ $classname = 'FactureRec';
} elseif ($objecttype == 'subscription') {
- $classfile = 'subscription'; $classname = 'Subscription';
+ $classfile = 'subscription';
+ $classname = 'Subscription';
} elseif ($objecttype == 'project' || $objecttype == 'projet') {
- $classpath = 'projet/class'; $classfile = 'project'; $classname = 'Project';
+ $classpath = 'projet/class';
+ $classfile = 'project';
+ $classname = 'Project';
}
// Here $module, $classfile and $classname are set
@@ -4618,7 +4637,8 @@ abstract class CommonObject
$element = $this->element;
- $text = ''; $description = '';
+ $text = '';
+ $description = '';
// Line in view mode
if ($action != 'editline' || $selected != $line->id) {
@@ -4985,7 +5005,8 @@ abstract class CommonObject
if (!$notrigger) {
$result = $this->call_trigger(strtoupper($element).'_DELETE_RESOURCE', $user);
if ($result < 0) {
- $this->db->rollback(); return -1;
+ $this->db->rollback();
+ return -1;
}
}
$this->db->commit();
@@ -5106,7 +5127,8 @@ abstract class CommonObject
$tmpdir = trim($tmpdir);
$tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
if (!$tmpdir) {
- unset($listofdir[$key]); continue;
+ unset($listofdir[$key]);
+ continue;
}
if (is_dir($tmpdir)) {
$tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0);
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 19555adf3fb..b73f7ae3257 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -196,13 +196,13 @@ class Conf
$this->modules_parts[$partname] = array();
}
$this->modules_parts[$partname][$params[0]][] = $value; // $value may be a string or an array
- }
- // If this is constant for all generic part activated by a module. It initializes
- // modules_parts['login'], modules_parts['menus'], modules_parts['substitutions'], modules_parts['triggers'], modules_parts['tpl'],
- // modules_parts['models'], modules_parts['theme']
- // modules_parts['sms'],
- // modules_parts['css'], ...
- elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
+ } elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)_([A-Z]+)$/i', $key, $reg)) {
+ // If this is constant for all generic part activated by a module. It initializes
+ // modules_parts['login'], modules_parts['menus'], modules_parts['substitutions'], modules_parts['triggers'], modules_parts['tpl'],
+ // modules_parts['models'], modules_parts['theme']
+ // modules_parts['sms'],
+ // modules_parts['css'], ...
+
$modulename = strtolower($reg[1]);
$partname = strtolower($reg[2]);
if (!isset($this->modules_parts[$partname]) || !is_array($this->modules_parts[$partname])) {
@@ -221,9 +221,8 @@ class Conf
$value = '/'.$modulename.'/core/modules/'.$partname.'/'; // ex: partname = societe
}
$this->modules_parts[$partname] = array_merge($this->modules_parts[$partname], array($modulename => $value)); // $value may be a string or an array
- }
- // If this is a module constant (must be at end)
- elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
+ } elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
+ // If this is a module constant (must be at end)
$modulename = strtolower($reg[1]);
if ($modulename == 'propale') {
$modulename = 'propal';
diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php
index acddb09d547..66ee803d41a 100644
--- a/htdocs/core/class/cstate.class.php
+++ b/htdocs/core/class/cstate.class.php
@@ -123,7 +123,8 @@ class Cstate // extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -229,7 +230,8 @@ class Cstate // extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -266,7 +268,8 @@ class Cstate // extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php
index ff2bcc58f40..01a6eb5e697 100644
--- a/htdocs/core/class/ctypent.class.php
+++ b/htdocs/core/class/ctypent.class.php
@@ -130,7 +130,8 @@ class Ctypent // extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -244,7 +245,8 @@ class Ctypent // extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -282,7 +284,8 @@ class Ctypent // extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
diff --git a/htdocs/core/class/cunits.class.php b/htdocs/core/class/cunits.class.php
index 757e3fb0e66..e55d227de0e 100644
--- a/htdocs/core/class/cunits.class.php
+++ b/htdocs/core/class/cunits.class.php
@@ -133,7 +133,8 @@ class CUnits // extends CommonObject
dol_syslog(get_class($this)."::create", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
if (!$error) {
@@ -351,7 +352,8 @@ class CUnits // extends CommonObject
dol_syslog(get_class($this)."::update", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
@@ -389,7 +391,8 @@ class CUnits // extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
$resql = $this->db->query($sql);
if (!$resql) {
- $error++; $this->errors[] = "Error ".$this->db->lasterror();
+ $error++;
+ $this->errors[] = "Error ".$this->db->lasterror();
}
// Commit or rollback
diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php
index 0eecbbf6d36..2427b2da1e4 100644
--- a/htdocs/core/class/dolgeoip.class.php
+++ b/htdocs/core/class/dolgeoip.class.php
@@ -61,7 +61,8 @@ class DolGeoIP
require_once DOL_DOCUMENT_ROOT.'/includes/geoip2/geoip2.phar';
}
} else {
- print 'ErrorBadParameterInConstructor'; return 0;
+ print 'ErrorBadParameterInConstructor';
+ return 0;
}
// Here, function exists (embedded into PHP or exists because we made include)
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 607993dc325..3672f7faa07 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -908,9 +908,8 @@ class DolGraph
$this->stringtoshow .= 'legend: {show: ' . ($showlegend ? 'true' : 'false') . ', position: \'ne\' }
});
}' . "\n";
- }
- // Other cases, graph of type 'bars', 'lines'
- else {
+ } else {
+ // Other cases, graph of type 'bars', 'lines'
// Add code to support tooltips
// TODO: remove js css and use graph-tooltip-inner class instead by adding css in each themes
$this->stringtoshow .= '
@@ -1262,9 +1261,8 @@ class DolGraph
$this->stringtoshow .= ']' . "\n";
$this->stringtoshow .= '}' . "\n";
$this->stringtoshow .= '});' . "\n";
- }
- // Other cases, graph of type 'bars', 'lines', 'linesnopoint'
- else {
+ } else {
+ // Other cases, graph of type 'bars', 'lines', 'linesnopoint'
$type = 'bar';
if (!isset($this->type[$firstlot]) || $this->type[$firstlot] == 'bars') {
diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php
index 6f674c0b600..980c8c53dde 100644
--- a/htdocs/core/class/events.class.php
+++ b/htdocs/core/class/events.class.php
@@ -147,7 +147,8 @@ class Events // extends CommonObject
// Check parameters
if (empty($this->description)) {
- $this->error = 'ErrorBadValueForParameterCreateEventDesc'; return -1;
+ $this->error = 'ErrorBadValueForParameterCreateEventDesc';
+ return -1;
}
// Insert request
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 35747920ec5..5a5b06054ff 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -251,7 +251,8 @@ class ExtraFields
}
if ($type == 'separate') {
- $unique = 0; $required = 0;
+ $unique = 0;
+ $required = 0;
} // Force unique and not required if this is a separator field to avoid troubles.
if ($elementtype == 'thirdparty') {
$elementtype = 'societe';
diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php
index 21d948b2160..45bc622b9db 100644
--- a/htdocs/core/class/fileupload.class.php
+++ b/htdocs/core/class/fileupload.class.php
@@ -70,7 +70,8 @@ class FileUpload
$element = $pathname = 'projet';
$dir_output = $conf->$element->dir_output;
} elseif ($element == 'project_task') {
- $pathname = 'projet'; $filename = 'task';
+ $pathname = 'projet';
+ $filename = 'task';
$dir_output = $conf->projet->dir_output;
$parentForeignKey = 'fk_project';
$parentClass = 'Project';
@@ -80,20 +81,24 @@ class FileUpload
$element = 'ficheinter';
$dir_output = $conf->$element->dir_output;
} elseif ($element == 'order_supplier') {
- $pathname = 'fourn'; $filename = 'fournisseur.commande';
+ $pathname = 'fourn';
+ $filename = 'fournisseur.commande';
$dir_output = $conf->fournisseur->commande->dir_output;
} elseif ($element == 'invoice_supplier') {
- $pathname = 'fourn'; $filename = 'fournisseur.facture';
+ $pathname = 'fourn';
+ $filename = 'fournisseur.facture';
$dir_output = $conf->fournisseur->facture->dir_output;
} elseif ($element == 'product') {
$dir_output = $conf->product->multidir_output[$conf->entity];
} elseif ($element == 'productbatch') {
$dir_output = $conf->productbatch->multidir_output[$conf->entity];
} elseif ($element == 'action') {
- $pathname = 'comm/action'; $filename = 'actioncomm';
+ $pathname = 'comm/action';
+ $filename = 'actioncomm';
$dir_output = $conf->agenda->dir_output;
} elseif ($element == 'chargesociales') {
- $pathname = 'compta/sociales'; $filename = 'chargesociales';
+ $pathname = 'compta/sociales';
+ $filename = 'chargesociales';
$dir_output = $conf->tax->dir_output;
} else {
$dir_output = $conf->$element->dir_output;
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index 8b211a34864..9d3ea8f39d6 100644
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -228,11 +228,14 @@ class HookManager
}
// Init return properties
- $this->resPrint = ''; $this->resArray = array(); $this->resNbOfHooks = 0;
+ $this->resPrint = '';
+ $this->resArray = array();
+ $this->resNbOfHooks = 0;
// Loop on each hook to qualify modules that have declared context
$modulealreadyexecuted = array();
- $resaction = 0; $error = 0;
+ $resaction = 0;
+ $error = 0;
foreach ($this->hooks as $context => $modules) { // $this->hooks is an array with context as key and value is an array of modules that handle this context
if (!empty($modules)) {
foreach ($modules as $module => $actionclassinstance) {
@@ -265,7 +268,8 @@ class HookManager
$resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)
if ($resaction < 0 || !empty($actionclassinstance->error) || (!empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) {
$error++;
- $this->error = $actionclassinstance->error; $this->errors = array_merge($this->errors, (array) $actionclassinstance->errors);
+ $this->error = $actionclassinstance->error;
+ $this->errors = array_merge($this->errors, (array) $actionclassinstance->errors);
dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error) ? '' : " ".$this->error).(empty($this->errors) ? '' : " ".join(",", $this->errors)), LOG_ERR);
}
@@ -275,9 +279,8 @@ class HookManager
if (!empty($actionclassinstance->resprints)) {
$this->resPrint .= $actionclassinstance->resprints;
}
- }
- // Generic hooks that return a string or array (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...)
- else {
+ } else {
+ // Generic hooks that return a string or array (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...)
// TODO. this test should be done into the method of hook by returning nothing
if (is_array($parameters) && !empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) {
continue;
@@ -294,14 +297,16 @@ class HookManager
}
if (is_numeric($resaction) && $resaction < 0) {
$error++;
- $this->error = $actionclassinstance->error; $this->errors = array_merge($this->errors, (array) $actionclassinstance->errors);
+ $this->error = $actionclassinstance->error;
+ $this->errors = array_merge($this->errors, (array) $actionclassinstance->errors);
dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error) ? '' : " ".$this->error).(empty($this->errors) ? '' : " ".join(",", $this->errors)), LOG_ERR);
}
// TODO dead code to remove (do not enable this, but fix hook instead): result must not be a string but an int. you must use $actionclassinstance->resprints to return a string
if (!is_array($resaction) && !is_numeric($resaction)) {
dol_syslog('Error: Bug into hook '.$method.' of module class '.get_class($actionclassinstance).'. Method must not return a string but an int (0=OK, 1=Replace, -1=KO) and set string into ->resprints', LOG_ERR);
if (empty($actionclassinstance->resprints)) {
- $this->resPrint .= $resaction; $resaction = 0;
+ $this->resPrint .= $resaction;
+ $resaction = 0;
}
}
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 5f2497a5827..42be90ac4e9 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -488,7 +488,8 @@ class Form
$out .= ''."\n"; // Use for timestamp format
} elseif (preg_match('/^(select|autocomplete)/', $inputType)) {
$tmp = explode(':', $inputType);
- $inputType = $tmp[0]; $loadmethod = $tmp[1];
+ $inputType = $tmp[0];
+ $loadmethod = $tmp[1];
if (!empty($tmp[2])) {
$savemethod = $tmp[2];
}
@@ -502,7 +503,8 @@ class Form
$cols = (empty($tmp[2]) ? '80' : $tmp[2]);
} elseif (preg_match('/^ckeditor/', $inputType)) {
$tmp = explode(':', $inputType);
- $inputType = $tmp[0]; $toolbar = $tmp[1];
+ $inputType = $tmp[0];
+ $toolbar = $tmp[1];
if (!empty($tmp[2])) {
$width = $tmp[2];
}
@@ -594,15 +596,18 @@ class Form
$extrastyle = '';
if ($direction < 0) {
- $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); $extrastyle = 'padding: 0px; padding-left: 3px !important;';
+ $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
+ $extrastyle = 'padding: 0px; padding-left: 3px !important;';
}
if ($direction > 0) {
- $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : ''); $extrastyle = 'padding: 0px; padding-right: 3px !important;';
+ $extracss = ($extracss ? $extracss.' ' : '').($notabs != 3 ? 'inline-block' : '');
+ $extrastyle = 'padding: 0px; padding-right: 3px !important;';
}
$classfortooltip = 'classfortooltip';
- $s = ''; $textfordialog = '';
+ $s = '';
+ $textfordialog = '';
if ($tooltiptrigger == '') {
$htmltext = str_replace('"', '"', $htmltext);
@@ -2084,7 +2089,8 @@ class Form
if ($nbassignetouser) {
$out .= '';
}
- $i = 0; $ownerid = 0;
+ $i = 0;
+ $ownerid = 0;
foreach ($assignedtouser as $key => $value) {
if ($value['id'] == $ownerid) {
continue;
@@ -2094,7 +2100,8 @@ class Form
$userstatic->fetch($value['id']);
$out .= $userstatic->getNomUrl(-1);
if ($i == 0) {
- $ownerid = $value['id']; $out .= ' ('.$langs->trans("Owner").')';
+ $ownerid = $value['id'];
+ $out .= ' ('.$langs->trans("Owner").')';
}
if ($nbassignetouser > 1 && $action != 'view') {
$out .= ' ';
@@ -5811,7 +5818,8 @@ class Form
}
// Disabled if seller is not subject to VAT
- $disabled = false; $title = '';
+ $disabled = false;
+ $title = '';
if (is_object($societe_vendeuse) && $societe_vendeuse->id == $mysoc->id && $societe_vendeuse->tva_assuj == "0") {
// Override/enable VAT for expense report regardless of global setting - needed if expense report used for business expenses instead
// of using supplier invoices (this is a very bad idea !)
@@ -5991,10 +5999,12 @@ class Form
$stepminutes = 1;
}
if ($empty == 1) {
- $emptydate = 1; $emptyhours = 1;
+ $emptydate = 1;
+ $emptyhours = 1;
}
if ($empty == 2) {
- $emptydate = 0; $emptyhours = 1;
+ $emptydate = 0;
+ $emptyhours = 1;
}
$orig_set_time = $set_time;
@@ -6149,9 +6159,8 @@ class Form
} else {
$retstring .= "Bad value of MAIN_POPUP_CALENDAR";
}
- }
- // Show date with combo selects
- else {
+ } else {
+ // Show date with combo selects
// Day
$retstring .= '