@@ -40,7 +40,9 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | global $filtertype; |
43 | -if (empty($filtertype)) $filtertype = 0; |
|
43 | +if (empty($filtertype)) { |
|
44 | + $filtertype = 0; |
|
45 | +} |
|
44 | 46 | |
45 | 47 | print "<!-- BEGIN PHP TEMPLATE objectline_title.tpl.php -->\n"; |
46 | 48 | |
@@ -85,7 +87,9 @@ discard block |
||
85 | 87 | } else { |
86 | 88 | print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
87 | 89 | |
88 | - if (isModEnabled('workstation')) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
90 | + if (isModEnabled('workstation')) { |
|
91 | + print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
92 | + } |
|
89 | 93 | |
90 | 94 | // Cost |
91 | 95 | print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>'; |
@@ -68,24 +68,24 @@ |
||
68 | 68 | |
69 | 69 | if ($filtertype != 1) { |
70 | 70 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
71 | - print '<td class="linecoluseunit left">' . $langs->trans('Unit') . '</td>'; |
|
71 | + print '<td class="linecoluseunit left">'.$langs->trans('Unit').'</td>'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | // Qty frozen |
75 | - print '<td class="linecolqtyfrozen right">' . $form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")) . '</td>'; |
|
75 | + print '<td class="linecolqtyfrozen right">'.$form->textwithpicto($langs->trans('QtyFrozen'), $langs->trans("QuantityConsumedInvariable")).'</td>'; |
|
76 | 76 | |
77 | 77 | // Disable stock change |
78 | - print '<td class="linecoldisablestockchange right">' . $form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')) . '</td>'; |
|
78 | + print '<td class="linecoldisablestockchange right">'.$form->textwithpicto($langs->trans('DisableStockChange'), $langs->trans('DisableStockChangeHelp')).'</td>'; |
|
79 | 79 | |
80 | 80 | // Efficiency |
81 | - print '<td class="linecolefficiency right">' . $form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')) . '</td>'; |
|
81 | + print '<td class="linecolefficiency right">'.$form->textwithpicto($langs->trans('ManufacturingEfficiency'), $langs->trans('ValueOfMeansLoss')).'</td>'; |
|
82 | 82 | |
83 | 83 | // Cost |
84 | 84 | print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCost")).'</td>'; |
85 | 85 | } else { |
86 | - print '<td class="linecolunit right">' . $form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
86 | + print '<td class="linecolunit right">'.$form->textwithpicto($langs->trans('Unit'), '').'</td>'; |
|
87 | 87 | |
88 | - if (isModEnabled('workstation')) print '<td class="linecolworkstation right">' . $form->textwithpicto($langs->trans('DefaultWorkstation'), '') . '</td>'; |
|
88 | + if (isModEnabled('workstation')) print '<td class="linecolworkstation right">'.$form->textwithpicto($langs->trans('DefaultWorkstation'), '').'</td>'; |
|
89 | 89 | |
90 | 90 | // Cost |
91 | 91 | print '<td class="linecolcost right">'.$form->textwithpicto($langs->trans("TotalCost"), $langs->trans("BOMTotalCostService")).'</td>'; |
@@ -77,7 +77,9 @@ |
||
77 | 77 | $k = 0; |
78 | 78 | if ($resql) { |
79 | 79 | $obj = $db->fetch_object($resql); |
80 | - if ($obj->rowid && $obj->rowid > 0) $k = $obj->rowid; |
|
80 | + if ($obj->rowid && $obj->rowid > 0) { |
|
81 | + $k = $obj->rowid; |
|
82 | + } |
|
81 | 83 | } |
82 | 84 | echo '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=dellink&token=' . newToken() . '&dellinkid=' . $k . '">' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . '</a>'; |
83 | 85 | echo '</td>'; |
@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | |
54 | 54 | $trclass = 'oddeven'; |
55 | 55 | |
56 | - echo '<tr class="' . $trclass . '" >'; |
|
57 | - echo '<td class="linkedcol-element tdoverflowmax100">' . $langs->trans("ManufacturingOrder"); |
|
56 | + echo '<tr class="'.$trclass.'" >'; |
|
57 | + echo '<td class="linkedcol-element tdoverflowmax100">'.$langs->trans("ManufacturingOrder"); |
|
58 | 58 | if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) { |
59 | - print '<a class="objectlinked_importbtn" href="' . $objectlink->getNomUrl(0, '', 0, 1) . '&action=selectlines" data-element="' . $objectlink->element . '" data-id="' . $objectlink->id . '" > <i class="fa fa-indent"></i> </a'; |
|
59 | + print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a'; |
|
60 | 60 | } |
61 | 61 | echo '</td>'; |
62 | - echo '<td class="linkedcol-name nowraponall" >' . $objectlink->getNomUrl(1) . '</td>'; |
|
62 | + echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>'; |
|
63 | 63 | |
64 | 64 | echo '<td class="linkedcol-ref center">'; |
65 | 65 | // $result = $product_static->fetch($objectlink->fk_product); |
66 | 66 | print '</td>'; |
67 | - echo '<td class="linkedcol-date center">' . dol_print_date($objectlink->date_creation, 'day') . '</td>'; |
|
67 | + echo '<td class="linkedcol-date center">'.dol_print_date($objectlink->date_creation, 'day').'</td>'; |
|
68 | 68 | echo '<td class="linkedcol-amount right">-</td>'; |
69 | - echo '<td class="linkedcol-statut right">' . $objectlink->getLibStatut(3) . '</td>'; |
|
69 | + echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>'; |
|
70 | 70 | echo '<td class="linkedcol-action right">'; |
71 | 71 | |
72 | 72 | // we want to make the link via element_element for delete action |
73 | - $sql = " Select rowid from " . MAIN_DB_PREFIX . "element_element"; |
|
74 | - $sql .= " WHERE fk_source = " . (int) $object->id . " and fk_target = '" . dol_escape_htmltag($key) . "'"; |
|
73 | + $sql = " Select rowid from ".MAIN_DB_PREFIX."element_element"; |
|
74 | + $sql .= " WHERE fk_source = ".(int) $object->id." and fk_target = '".dol_escape_htmltag($key)."'"; |
|
75 | 75 | |
76 | 76 | $resql = $db->query($sql); |
77 | 77 | $k = 0; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $obj = $db->fetch_object($resql); |
80 | 80 | if ($obj->rowid && $obj->rowid > 0) $k = $obj->rowid; |
81 | 81 | } |
82 | - echo '<a class="reposition" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=dellink&token=' . newToken() . '&dellinkid=' . $k . '">' . img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink') . '</a>'; |
|
82 | + echo '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$k.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>'; |
|
83 | 83 | echo '</td>'; |
84 | 84 | echo "</tr>\n"; |
85 | 85 | } |
@@ -393,7 +393,7 @@ |
||
393 | 393 | print '<td class="right">'.$val['nb'].'</td>'; |
394 | 394 | print '<td class="right opacitylow" style="'.($greennb ? 'color: green;' : 'color: red;').'">'.(!empty($val['nb_diff']) && $val['nb_diff'] < 0 ? '' : '+').round(!empty($val['nb_diff']) ? $val['nb_diff'] : 0).'%</td>'; |
395 | 395 | print '<td class="right"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>'; |
396 | - print '<td class="right opacitylow" style="'.($greentotal ? 'color: green;' : 'color: red;').'">'.( !empty($val['total_diff']) && $val['total_diff'] < 0 ? '' : '+').round(!empty($val['total_diff']) ? $val['total_diff'] : 0).'%</td>'; |
|
396 | + print '<td class="right opacitylow" style="'.($greentotal ? 'color: green;' : 'color: red;').'">'.(!empty($val['total_diff']) && $val['total_diff'] < 0 ? '' : '+').round(!empty($val['total_diff']) ? $val['total_diff'] : 0).'%</td>'; |
|
397 | 397 | print '<td class="right"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>'; |
398 | 398 | print '<td class="right opacitylow" style="'.($greenavg ? 'color: green;' : 'color: red;').'">'.(!empty($val['avg_diff']) && $val['avg_diff'] < 0 ? '' : '+').round(!empty($val['avg_diff']) ? $val['avg_diff'] : 0).'%</td>'; |
399 | 399 | print '</tr>'; |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | $month_current = dol_print_date(dol_now(), '%m'); |
90 | 90 | $year_start = $year; |
91 | 91 | } |
92 | -$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
93 | -$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
92 | +$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
93 | +$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere |
|
94 | 94 | // Quarter |
95 | 95 | if (empty($date_start) || empty($date_end)) { // We define date_start and date_end |
96 | 96 | $q = GETPOST("q", "int") ?GETPOST("q", "int") : 0; |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | $address_town[$obj->socid] = $obj->town; |
337 | 337 | $address_pays[$obj->socid] = getCountry($obj->fk_pays); |
338 | 338 | |
339 | - $catotal_ht += (empty($obj->amount) ? 0 : $obj->amount); |
|
339 | + $catotal_ht += (empty($obj->amount) ? 0 : $obj->amount); |
|
340 | 340 | $catotal += $obj->amount_ttc; |
341 | 341 | |
342 | 342 | $i++; |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | |
56 | 56 | $id = GETPOST('rowid', 'int'); |
57 | 57 | $rowid = GETPOST("rowid", 'int'); |
58 | -$accountoldid = GETPOST('account', 'int'); // GETPOST('account') is old account id |
|
59 | -$accountid = GETPOST('accountid', 'int'); // GETPOST('accountid') is new account id |
|
58 | +$accountoldid = GETPOST('account', 'int'); // GETPOST('account') is old account id |
|
59 | +$accountid = GETPOST('accountid', 'int'); // GETPOST('accountid') is new account id |
|
60 | 60 | $ref = GETPOST('ref', 'alpha'); |
61 | 61 | $action = GETPOST('action', 'aZ09'); |
62 | 62 | $confirm = GETPOST('confirm', 'alpha'); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | |
131 | 131 | $result = $object->fetch($rowid); |
132 | 132 | if ($result <= 0) { |
133 | - dol_syslog('Failed to read bank line with id '.$rowid, LOG_WARNING); // This happens due to old bug that has set fk_account to null. |
|
133 | + dol_syslog('Failed to read bank line with id '.$rowid, LOG_WARNING); // This happens due to old bug that has set fk_account to null. |
|
134 | 134 | $object->id = $rowid; |
135 | 135 | } |
136 | 136 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | |
53 | 53 | $result = restrictedArea($user, 'commande', $id, ''); |
54 | 54 | |
55 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
55 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
56 | 56 | |
57 | 57 | $permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php |
58 | 58 |
@@ -73,7 +73,7 @@ |
||
73 | 73 | |
74 | 74 | $object = new Commande($db); |
75 | 75 | |
76 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
76 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
77 | 77 | $permissiontoadd = $usercancreate; |
78 | 78 | |
79 | 79 | // Security check |
@@ -47,7 +47,7 @@ |
||
47 | 47 | } |
48 | 48 | $result = restrictedArea($user, 'commande', $id, ''); |
49 | 49 | |
50 | -$usercancreate = $user->hasRight("commande", "creer"); |
|
50 | +$usercancreate = $user->hasRight("commande", "creer"); |
|
51 | 51 | |
52 | 52 | $object = new Commande($db); |
53 | 53 |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | if (empty($reshook)) { |
53 | - if (isModEnabled('accounting')) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; |
|
53 | + if (isModEnabled('accounting')) require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; |
|
54 | 54 | |
55 | 55 | foreach ($assetaccountancycodes->accountancy_codes_fields as $mode_key => $mode_info) { |
56 | 56 | //if (empty($object->enabled_modes[$mode_key])) continue; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | print '<div class="underbanner clearboth"></div>'; |
61 | 61 | print '<table class="border centpercent tableforfield">'; |
62 | 62 | foreach ($mode_info['fields'] as $field_key => $field_info) { |
63 | - print '<tr><td class="titlefieldcreate">' . $langs->trans($field_info['label']) . '</td><td colspan="3">'; |
|
63 | + print '<tr><td class="titlefieldcreate">'.$langs->trans($field_info['label']).'</td><td colspan="3">'; |
|
64 | 64 | if (!empty($assetaccountancycodes->accountancy_codes[$mode_key][$field_key])) { |
65 | 65 | $accountancy_code = $assetaccountancycodes->accountancy_codes[$mode_key][$field_key]; |
66 | 66 | if (isModEnabled('accounting')) { |
@@ -50,7 +50,9 @@ |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | if (empty($reshook)) { |
53 | - if (isModEnabled('accounting')) require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; |
|
53 | + if (isModEnabled('accounting')) { |
|
54 | + require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; |
|
55 | + } |
|
54 | 56 | |
55 | 57 | foreach ($assetaccountancycodes->accountancy_codes_fields as $mode_key => $mode_info) { |
56 | 58 | //if (empty($object->enabled_modes[$mode_key])) continue; |