@@ -23,7 +23,7 @@ |
||
| 23 | 23 | * \ingroup stocktransfer |
| 24 | 24 | * \brief File of class to manage StockTransfer numbering rules standard |
| 25 | 25 | */ |
| 26 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/stocktransfer/modules_stocktransfer.php'; |
|
| 26 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/stocktransfer/modules_stocktransfer.php'; |
|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -134,8 +134,11 @@ discard block |
||
| 134 | 134 | $resql = $db->query($sql); |
| 135 | 135 | if ($resql) { |
| 136 | 136 | $obj = $db->fetch_object($resql); |
| 137 | - if ($obj) $max = intval($obj->max); |
|
| 138 | - else $max = 0; |
|
| 137 | + if ($obj) { |
|
| 138 | + $max = intval($obj->max); |
|
| 139 | + } else { |
|
| 140 | + $max = 0; |
|
| 141 | + } |
|
| 139 | 142 | } else { |
| 140 | 143 | dol_syslog("mod_stocktransfer_standard::getNextValue", LOG_DEBUG); |
| 141 | 144 | return -1; |
@@ -145,8 +148,13 @@ discard block |
||
| 145 | 148 | $date = $object->date_creation; |
| 146 | 149 | $yymm = strftime("%y%m", $date); |
| 147 | 150 | |
| 148 | - if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is |
|
| 149 | - else $num = sprintf("%04s", $max + 1); |
|
| 151 | + if ($max >= (pow(10, 4) - 1)) { |
|
| 152 | + $num = $max + 1; |
|
| 153 | + } |
|
| 154 | + // If counter > 9999, we do not format on 4 chars, we take number as it is |
|
| 155 | + else { |
|
| 156 | + $num = sprintf("%04s", $max + 1); |
|
| 157 | + } |
|
| 150 | 158 | |
| 151 | 159 | dol_syslog("mod_stocktransfer_standard::getNextValue return ".$this->prefix.$yymm."-".$num); |
| 152 | 160 | return $this->prefix.$yymm."-".$num; |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | * \brief File containing class for advanced numbering model of StockTransfer |
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/modules/stocktransfer/modules_stocktransfer.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/modules/stocktransfer/modules_stocktransfer.php'; |
|
| 31 | 31 | |
| 32 | 32 | |
| 33 | 33 | /** |
@@ -434,7 +434,7 @@ |
||
| 434 | 434 | $invoicecredits[] = $facavoir->getNomUrl(1); |
| 435 | 435 | } |
| 436 | 436 | print ' <span class="opacitymediumbycolor paddingleft">'.$langs->transnoentities("InvoiceHasAvoir"); |
| 437 | - print ' '. (count($invoicecredits) ? ' ' : '') . implode(',', $invoicecredits); |
|
| 437 | + print ' '.(count($invoicecredits) ? ' ' : '').implode(',', $invoicecredits); |
|
| 438 | 438 | print '</span>'; |
| 439 | 439 | } |
| 440 | 440 | /* |
@@ -394,7 +394,7 @@ |
||
| 394 | 394 | print '<tr class="oddeven" height="24">'; |
| 395 | 395 | print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&mode='.$mode.($socid > 0 ? '&socid='.$socid : '').($userid > 0 ? '&userid='.$userid : '').'">'.$year.'</a></td>'; |
| 396 | 396 | print '<td class="right">'.$val['nb'].'</td>'; |
| 397 | - print '<td class="right opacitylow" style="'.((!isset($val['nb_diff']) || $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['nb_diff']) ? round($val['nb_diff']): "0").'%</td>'; |
|
| 397 | + print '<td class="right opacitylow" style="'.((!isset($val['nb_diff']) || $val['nb_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['nb_diff']) ? round($val['nb_diff']) : "0").'%</td>'; |
|
| 398 | 398 | print '<td class="right">'.price(price2num($val['total'], 'MT'), 1).'</td>'; |
| 399 | 399 | print '<td class="right opacitylow" style="'.((!isset($val['total_diff']) || $val['total_diff'] >= 0) ? 'color: green;' : 'color: red;').'">'.(isset($val['total_diff']) ? round($val['total_diff']) : "0").'%</td>'; |
| 400 | 400 | print '<td class="right">'.price(price2num($val['avg'], 'MT'), 1).'</td>'; |
@@ -66,26 +66,26 @@ |
||
| 66 | 66 | $rep = new stdClass(); |
| 67 | 67 | $rep->response_status = 0; |
| 68 | 68 | $rep->data = null; |
| 69 | -$rep->error = '';//@todo deprecated use error_message instead |
|
| 69 | +$rep->error = ''; //@todo deprecated use error_message instead |
|
| 70 | 70 | $rep->errorMessage = ''; |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | if (empty($fk_expense) || $fk_expense < 0) { |
| 74 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'); |
|
| 74 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'); |
|
| 75 | 75 | } elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) { |
| 76 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'); |
|
| 76 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'); |
|
| 77 | 77 | |
| 78 | 78 | $rep->response_status = 'error'; |
| 79 | 79 | } else { |
| 80 | 80 | // @see ndfp.class.php:3576 (method: compute_total_km) |
| 81 | 81 | $expense = new ExpenseReport($db); |
| 82 | 82 | if ($expense->fetch($fk_expense) <= 0) { |
| 83 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 83 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 84 | 84 | $rep->response_status = 'error'; |
| 85 | 85 | } else { |
| 86 | 86 | $userauthor = new User($db); |
| 87 | 87 | if ($userauthor->fetch($expense->fk_user_author) <= 0) { |
| 88 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 88 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 89 | 89 | $rep->response_status = 'error'; |
| 90 | 90 | } else { |
| 91 | 91 | $expense = new ExpenseReport($db); |
@@ -77,8 +77,12 @@ |
||
| 77 | 77 | //if ($user->socid > 0) $socid = $user->socid; |
| 78 | 78 | //$isdraft = (isset($object->status) && ($object->status == $object::STATUS_DRAFT) ? 1 : 0); |
| 79 | 79 | //restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft); |
| 80 | -if (empty($conf->intracommreport->enabled)) accessforbidden(); |
|
| 81 | -if (!$permissiontoread) accessforbidden(); |
|
| 80 | +if (empty($conf->intracommreport->enabled)) { |
|
| 81 | + accessforbidden(); |
|
| 82 | +} |
|
| 83 | +if (!$permissiontoread) { |
|
| 84 | + accessforbidden(); |
|
| 85 | +} |
|
| 82 | 86 | |
| 83 | 87 | |
| 84 | 88 | |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | if ($action == 'add' && $permissiontoadd) { |
| 119 | 119 | $object->label = trim($label); |
| 120 | 120 | $object->type = trim($exporttype); |
| 121 | - $object->type_declaration = $type_declaration; |
|
| 121 | + $object->type_declaration = $type_declaration; |
|
| 122 | 122 | //$object->subscription = (int) $subscription; |
| 123 | 123 | |
| 124 | 124 | // Fill array 'array_options' with data from add form |
@@ -615,7 +615,7 @@ |
||
| 615 | 615 | |
| 616 | 616 | $ref = dol_sanitizeFileName($newref); |
| 617 | 617 | $pdf_path = $dir_output."/".$ref.".pdf"; |
| 618 | - if (!dol_is_file($pdf_path)||(is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { |
|
| 618 | + if (!dol_is_file($pdf_path) || (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0 && !$arraydefaultmessage->joinfiles)) { |
|
| 619 | 619 | // We can't add PDF as it is not generated yet. |
| 620 | 620 | $filepdf = ''; |
| 621 | 621 | } else { |
@@ -214,8 +214,8 @@ |
||
| 214 | 214 | // Total debit-credit |
| 215 | 215 | print '<tr class="liste_total"><td><b>'.$langs->trans("Total")."</b></td>"; |
| 216 | 216 | for ($annee = $year_start; $annee <= $year_end; $annee++) { |
| 217 | - print '<td class="right nowraponall"><b>'. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .'</b></td>'; |
|
| 218 | - print '<td class="right nowraponall"><b>'. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .'</b></td>'; |
|
| 217 | + print '<td class="right nowraponall"><b>'.(isset($totsorties[$annee]) ? price($totsorties[$annee]) : '').'</b></td>'; |
|
| 218 | + print '<td class="right nowraponall"><b>'.(isset($totentrees[$annee]) ? price($totentrees[$annee]) : '').'</b></td>'; |
|
| 219 | 219 | } |
| 220 | 220 | print "</tr>\n"; |
| 221 | 221 | |
@@ -76,13 +76,13 @@ |
||
| 76 | 76 | * Boolean that indicates whether the product is available for sale '1' or not '0' |
| 77 | 77 | * @var int |
| 78 | 78 | */ |
| 79 | - public $product_tosell=0; |
|
| 79 | + public $product_tosell = 0; |
|
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * Boolean that indicates whether the product is available for purchase '1' or not '0' |
| 83 | 83 | * @var int |
| 84 | 84 | */ |
| 85 | - public $product_tobuy=0; |
|
| 85 | + public $product_tobuy = 0; |
|
| 86 | 86 | |
| 87 | 87 | /** |
| 88 | 88 | * Product description |