@@ -386,8 +386,12 @@ discard block |
||
386 | 386 | global $hookmanager; |
387 | 387 | |
388 | 388 | // Clean parameters |
389 | - if (empty($type)) $type = 'view'; |
|
390 | - if (empty($in_bookkeeping)) $in_bookkeeping = 'notyet'; |
|
389 | + if (empty($type)) { |
|
390 | + $type = 'view'; |
|
391 | + } |
|
392 | + if (empty($in_bookkeeping)) { |
|
393 | + $in_bookkeeping = 'notyet'; |
|
394 | + } |
|
391 | 395 | |
392 | 396 | $data = array(); |
393 | 397 | |
@@ -661,7 +665,9 @@ discard block |
||
661 | 665 | |
662 | 666 | $disposal_amount_vat = $disposal_subject_to_vat ? (double) price2num($disposal_amount * $disposal_vat / 100, 'MT') : 0; |
663 | 667 | $lines[1][$accountancy_code_receivable_on_assignment] = -($disposal_amount + $disposal_amount_vat); |
664 | - if ($disposal_subject_to_vat) $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat; |
|
668 | + if ($disposal_subject_to_vat) { |
|
669 | + $lines[1][$accountancy_code_vat_collected] = $disposal_amount_vat; |
|
670 | + } |
|
665 | 671 | $lines[1][$accountancy_code_proceeds_from_sales] = $disposal_amount; |
666 | 672 | |
667 | 673 | foreach ($lines as $lines_block) { |
@@ -925,7 +931,9 @@ discard block |
||
925 | 931 | { |
926 | 932 | global $conf, $langs, $hookmanager; |
927 | 933 | |
928 | - if (empty($sep)) $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; |
|
934 | + if (empty($sep)) { |
|
935 | + $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; |
|
936 | + } |
|
929 | 937 | $out = ''; |
930 | 938 | |
931 | 939 | // Hook |
@@ -976,7 +984,9 @@ discard block |
||
976 | 984 | ); |
977 | 985 | } |
978 | 986 | |
979 | - if (!empty($header)) $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n"; |
|
987 | + if (!empty($header)) { |
|
988 | + $out .= '"' . implode('"' . $sep . '"', $header) . '"' . "\n"; |
|
989 | + } |
|
980 | 990 | foreach ($journal_data as $element_id => $element) { |
981 | 991 | foreach ($element['blocks'] as $lines) { |
982 | 992 | foreach ($lines as $line) { |
@@ -468,9 +468,15 @@ discard block |
||
468 | 468 | $group_error++; |
469 | 469 | break; |
470 | 470 | } |
471 | - if (!isset($lettering_code)) $lettering_code = (string) $line_infos['lettering_code']; |
|
472 | - if (!empty($line_infos['lettering_code'])) $do_it = true; |
|
473 | - } elseif (!empty($line_infos['lettering_code'])) $do_it = false; |
|
471 | + if (!isset($lettering_code)) { |
|
472 | + $lettering_code = (string) $line_infos['lettering_code']; |
|
473 | + } |
|
474 | + if (!empty($line_infos['lettering_code'])) { |
|
475 | + $do_it = true; |
|
476 | + } |
|
477 | + } elseif (!empty($line_infos['lettering_code'])) { |
|
478 | + $do_it = false; |
|
479 | + } |
|
474 | 480 | } |
475 | 481 | |
476 | 482 | // Check balance amount |
@@ -481,8 +487,11 @@ discard block |
||
481 | 487 | |
482 | 488 | // Lettering/Unlettering the group of bookkeeping lines |
483 | 489 | if (!$group_error && $do_it) { |
484 | - if ($unlettering) $result = $this->deleteLettering($bookkeeping_lines); |
|
485 | - else $result = $this->updateLettering($bookkeeping_lines); |
|
490 | + if ($unlettering) { |
|
491 | + $result = $this->deleteLettering($bookkeeping_lines); |
|
492 | + } else { |
|
493 | + $result = $this->updateLettering($bookkeeping_lines); |
|
494 | + } |
|
486 | 495 | if ($result < 0) { |
487 | 496 | $group_error++; |
488 | 497 | } elseif ($result > 0) { |
@@ -533,7 +542,9 @@ discard block |
||
533 | 542 | $sql .= " AND pn.piece_num = ab.piece_num"; |
534 | 543 | $sql .= " )"; |
535 | 544 | } |
536 | - if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''"; |
|
545 | + if ($only_has_subledger_account) { |
|
546 | + $sql .= " AND ab.subledger_account != ''"; |
|
547 | + } |
|
537 | 548 | |
538 | 549 | dol_syslog(__METHOD__ . " - Get all bookkeeping lines", LOG_DEBUG); |
539 | 550 | $resql = $this->db->query($sql); |
@@ -607,7 +618,9 @@ discard block |
||
607 | 618 | $sql .= " AND dpn.piece_num = ab.piece_num"; |
608 | 619 | $sql .= " )"; |
609 | 620 | $sql .= ")"; |
610 | - if ($only_has_subledger_account) $sql .= " AND ab.subledger_account != ''"; |
|
621 | + if ($only_has_subledger_account) { |
|
622 | + $sql .= " AND ab.subledger_account != ''"; |
|
623 | + } |
|
611 | 624 | |
612 | 625 | dol_syslog(__METHOD__ . " - Get all bookkeeping lines linked", LOG_DEBUG); |
613 | 626 | $resql = $this->db->query($sql); |
@@ -628,7 +641,9 @@ discard block |
||
628 | 641 | } |
629 | 642 | $this->db->free($resql); |
630 | 643 | |
631 | - if (!empty($group)) $grouped_lines[] = $group; |
|
644 | + if (!empty($group)) { |
|
645 | + $grouped_lines[] = $group; |
|
646 | + } |
|
632 | 647 | } |
633 | 648 | } |
634 | 649 | |
@@ -830,7 +845,9 @@ discard block |
||
830 | 845 | |
831 | 846 | foreach ($element_ids as $element_id) { |
832 | 847 | // Continue if element id in not found |
833 | - if (!isset($link_by_element[$element_id])) continue; |
|
848 | + if (!isset($link_by_element[$element_id])) { |
|
849 | + continue; |
|
850 | + } |
|
834 | 851 | |
835 | 852 | // Set the element in the current group |
836 | 853 | $current_group[$element_id] = $element_id; |
@@ -512,8 +512,10 @@ |
||
512 | 512 | ); |
513 | 513 | if ($result > 0) { |
514 | 514 | $lineid = $result; |
515 | - if (!empty($createbills_onebythird)) //increment rang to keep order |
|
515 | + if (!empty($createbills_onebythird)) { |
|
516 | + //increment rang to keep order |
|
516 | 517 | $TFactThirdNbLines[$cmd->socid]++; |
518 | + } |
|
517 | 519 | } else { |
518 | 520 | $lineid = 0; |
519 | 521 | $error++; |
@@ -499,8 +499,11 @@ discard block |
||
499 | 499 | print '<td class="left">' . dol_print_date($fields['datef'], 'day') . '</td>'; |
500 | 500 | |
501 | 501 | // Payment date |
502 | - if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
503 | - else print '<td></td>'; |
|
502 | + if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_SELL_SERVICE') == 'payment') { |
|
503 | + print '<td class="left">' . dol_print_date($fields['datep'], 'day') . '</td>'; |
|
504 | + } else { |
|
505 | + print '<td></td>'; |
|
506 | + } |
|
504 | 507 | |
505 | 508 | // Company name |
506 | 509 | print '<td class="tdmaxoverflow150">'; |
@@ -630,8 +633,11 @@ discard block |
||
630 | 633 | print '<tr class="liste_titre liste_titre_topborder">'; |
631 | 634 | print '<td class="left">' . $elementsup . '</td>'; |
632 | 635 | print '<td class="left">' . $langs->trans("DateInvoice") . '</td>'; |
633 | - if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') print '<td class="left">' . $langs->trans("DatePayment") . '</td>'; |
|
634 | - else print '<td></td>'; |
|
636 | + if (getDolGlobalString('TAX_MODE_BUY_PRODUCT') == 'payment' || getDolGlobalString('TAX_MODE_BUY_SERVICE') == 'payment') { |
|
637 | + print '<td class="left">' . $langs->trans("DatePayment") . '</td>'; |
|
638 | + } else { |
|
639 | + print '<td></td>'; |
|
640 | + } |
|
635 | 641 | print '<td class="left">' . $namesup . '</td>'; |
636 | 642 | print '<td class="left">' . $productsup . '</td>'; |
637 | 643 | if ($modetax != 1) { |
@@ -112,7 +112,9 @@ |
||
112 | 112 | global $user; |
113 | 113 | |
114 | 114 | $error = 0; |
115 | - if (!is_object($f_user)) $f_user = $user; |
|
115 | + if (!is_object($f_user)) { |
|
116 | + $f_user = $user; |
|
117 | + } |
|
116 | 118 | |
117 | 119 | $id_line_expdet = (int) $id_line_expdet; |
118 | 120 |
@@ -1032,7 +1032,9 @@ |
||
1032 | 1032 | // Get code using getLabelFromKey |
1033 | 1033 | $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); |
1034 | 1034 | print '<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans("SendingMethod".strtoupper($code))).'">'; |
1035 | - if ($shipment->shipping_method_id > 0) print $langs->trans("SendingMethod".strtoupper($code)); |
|
1035 | + if ($shipment->shipping_method_id > 0) { |
|
1036 | + print $langs->trans("SendingMethod".strtoupper($code)); |
|
1037 | + } |
|
1036 | 1038 | print '</td>'; |
1037 | 1039 | if (!$i) { |
1038 | 1040 | $totalarray['nbfield']++; |
@@ -369,8 +369,9 @@ |
||
369 | 369 | |
370 | 370 | // Clear all fields out of interrest |
371 | 371 | foreach ($object as $key => $value) { |
372 | - if ($key == "id" || $key == "rate" || $key == "date_sync") |
|
373 | - continue; |
|
372 | + if ($key == "id" || $key == "rate" || $key == "date_sync") { |
|
373 | + continue; |
|
374 | + } |
|
374 | 375 | unset($object->$key); |
375 | 376 | } |
376 | 377 |
@@ -84,7 +84,9 @@ |
||
84 | 84 | $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks |
85 | 85 | if ($reshook < 0) { |
86 | 86 | $message = $hookmanager->error; |
87 | -} else $message = ''; |
|
87 | +} else { |
|
88 | + $message = ''; |
|
89 | +} |
|
88 | 90 | |
89 | 91 | if (empty($reshook)) { |
90 | 92 | // Validate new password |
@@ -37,7 +37,9 @@ discard block |
||
37 | 37 | $langs->loadLangs(array("admin", "stocks")); |
38 | 38 | |
39 | 39 | // Access control |
40 | -if (!$user->admin) accessforbidden(); |
|
40 | +if (!$user->admin) { |
|
41 | + accessforbidden(); |
|
42 | +} |
|
41 | 43 | |
42 | 44 | // Parameters |
43 | 45 | $action = GETPOST('action', 'alpha'); |
@@ -69,7 +71,9 @@ discard block |
||
69 | 71 | |
70 | 72 | if ($maskconststocktransfer && preg_match('/_MASK$/', $maskconststocktransfer)) { |
71 | 73 | $res = dolibarr_set_const($db, $maskconststocktransfer, $maskstocktransfer, 'chaine', 0, '', $conf->entity); |
72 | - if ($res <= 0) $error++; |
|
74 | + if ($res <= 0) { |
|
75 | + $error++; |
|
76 | + } |
|
73 | 77 | } |
74 | 78 | |
75 | 79 | if (!$error) { |
@@ -230,7 +234,9 @@ discard block |
||
230 | 234 | $myTmpObjects[$moduledir]=array('includerefgeneration'=>1, 'includedocgeneration'=>1, 'class'=>'StockTransfer'); |
231 | 235 | |
232 | 236 | foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) { |
233 | - if ($myTmpObjectKey == 'MyObject') continue; |
|
237 | + if ($myTmpObjectKey == 'MyObject') { |
|
238 | + continue; |
|
239 | + } |
|
234 | 240 | if ($myTmpObjectArray['includerefgeneration']) { |
235 | 241 | /* |
236 | 242 | * Orders Numbering model |
@@ -265,8 +271,12 @@ discard block |
||
265 | 271 | $module = new $file($db); |
266 | 272 | |
267 | 273 | // Show modules according to features level |
268 | - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; |
|
269 | - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; |
|
274 | + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { |
|
275 | + continue; |
|
276 | + } |
|
277 | + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { |
|
278 | + continue; |
|
279 | + } |
|
270 | 280 | |
271 | 281 | if ($module->isEnabled()) { |
272 | 282 | dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php'); |
@@ -278,9 +288,13 @@ discard block |
||
278 | 288 | // Show example of numbering model |
279 | 289 | print '<td class="nowrap">'; |
280 | 290 | $tmp = $module->getExample(); |
281 | - if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
282 | - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); |
|
283 | - else print $tmp; |
|
291 | + if (preg_match('/^Error/', $tmp)) { |
|
292 | + print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
293 | + } elseif ($tmp == 'NotConfigured') { |
|
294 | + print $langs->trans($tmp); |
|
295 | + } else { |
|
296 | + print $tmp; |
|
297 | + } |
|
284 | 298 | print '</td>'."\n"; |
285 | 299 | |
286 | 300 | print '<td class="center">'; |
@@ -306,8 +320,9 @@ discard block |
||
306 | 320 | if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval |
307 | 321 | $htmltooltip .= ''.$langs->trans("NextValue").': '; |
308 | 322 | if ($nextval) { |
309 | - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') |
|
310 | - $nextval = $langs->trans($nextval); |
|
323 | + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { |
|
324 | + $nextval = $langs->trans($nextval); |
|
325 | + } |
|
311 | 326 | $htmltooltip .= $nextval.'<br>'; |
312 | 327 | } else { |
313 | 328 | $htmltooltip .= $langs->trans($module->error).'<br>'; |
@@ -393,15 +408,22 @@ discard block |
||
393 | 408 | $module = new $classname($db); |
394 | 409 | |
395 | 410 | $modulequalified = 1; |
396 | - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0; |
|
397 | - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0; |
|
411 | + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { |
|
412 | + $modulequalified = 0; |
|
413 | + } |
|
414 | + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { |
|
415 | + $modulequalified = 0; |
|
416 | + } |
|
398 | 417 | |
399 | 418 | if ($modulequalified) { |
400 | 419 | print '<tr class="oddeven"><td>'; |
401 | 420 | print (empty($module->name) ? $name : $module->name); |
402 | 421 | print "</td><td>\n"; |
403 | - if (method_exists($module, 'info')) print $module->info($langs); |
|
404 | - else print $module->description; |
|
422 | + if (method_exists($module, 'info')) { |
|
423 | + print $module->info($langs); |
|
424 | + } else { |
|
425 | + print $module->description; |
|
426 | + } |
|
405 | 427 | print '</td>'; |
406 | 428 | |
407 | 429 | // Active |