@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * \remarks To run this script as CLI: phpunit filename.php |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -global $conf,$user,$langs,$db; |
|
| 27 | +global $conf, $user, $langs, $db; |
|
| 28 | 28 | //define('TEST_DB_FORCE_TYPE','mysql'); // This is to force using mysql driver |
| 29 | 29 | //require_once 'PHPUnit/Autoload.php'; |
| 30 | 30 | require_once dirname(__FILE__).'/../../htdocs/master.inc.php'; |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | public static function setUpBeforeClass(): void |
| 58 | 58 | { |
| 59 | - global $conf,$user,$langs,$db; |
|
| 59 | + global $conf, $user, $langs, $db; |
|
| 60 | 60 | $db->begin(); // This is to have all actions inside a transaction even if test launched without suite. |
| 61 | 61 | |
| 62 | 62 | if (!isModEnabled('accounting')) { |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function testAccountingAccountCreate() |
| 77 | 77 | { |
| 78 | - global $conf,$user,$langs,$db; |
|
| 78 | + global $conf, $user, $langs, $db; |
|
| 79 | 79 | $conf = $this->savconf; |
| 80 | 80 | $user = $this->savuser; |
| 81 | 81 | $langs = $this->savlangs; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | public function testAccountingAccountFetch($id) |
| 111 | 111 | { |
| 112 | - global $conf,$user,$langs,$db; |
|
| 112 | + global $conf, $user, $langs, $db; |
|
| 113 | 113 | $conf = $this->savconf; |
| 114 | 114 | $user = $this->savuser; |
| 115 | 115 | $langs = $this->savlangs; |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | */ |
| 136 | 136 | public function testAccountingAccountUpdate($localobject) |
| 137 | 137 | { |
| 138 | - global $conf,$user,$langs,$db; |
|
| 138 | + global $conf, $user, $langs, $db; |
|
| 139 | 139 | $conf = $this->savconf; |
| 140 | 140 | $user = $this->savuser; |
| 141 | 141 | $langs = $this->savlangs; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | */ |
| 162 | 162 | public function testAccountingAccountDelete($id) |
| 163 | 163 | { |
| 164 | - global $conf,$user,$langs,$db; |
|
| 164 | + global $conf, $user, $langs, $db; |
|
| 165 | 165 | $conf = $this->savconf; |
| 166 | 166 | $user = $this->savuser; |
| 167 | 167 | $langs = $this->savlangs; |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | public function testGetCurrentPeriodOfFiscalYear() |
| 189 | 189 | { |
| 190 | - global $conf,$user,$langs,$db; |
|
| 190 | + global $conf, $user, $langs, $db; |
|
| 191 | 191 | $conf = $this->savconf; |
| 192 | 192 | $user = $this->savuser; |
| 193 | 193 | $langs = $this->savlangs; |
@@ -341,11 +341,11 @@ discard block |
||
| 341 | 341 | // Limit to superadmin |
| 342 | 342 | if (isModEnabled('multicompany') && !$user->entity) { |
| 343 | 343 | print '<td>'; |
| 344 | - print '<input type="text" class="flat" size="1" disabled name="entity" value="' . $conf->entity . '">'; // We see environment, but to change it we must switch on other entity |
|
| 344 | + print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity |
|
| 345 | 345 | print '</td>'; |
| 346 | 346 | } else { |
| 347 | 347 | print '<td class="center">'; |
| 348 | - print '<input type="hidden" name="entity" value="' . $conf->entity . '">'; |
|
| 348 | + print '<input type="hidden" name="entity" value="'.$conf->entity.'">'; |
|
| 349 | 349 | print '</td>'; |
| 350 | 350 | } |
| 351 | 351 | print '<td class="center">'; |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | print '</td>'."\n"; |
| 358 | 358 | print '</tr>'."\n"; |
| 359 | 359 | |
| 360 | -$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type' => $mode, 't.entity' => array($user->entity,$conf->entity))); |
|
| 360 | +$result = $object->fetchAll($sortorder, $sortfield, 0, 0, array('t.type' => $mode, 't.entity' => array($user->entity, $conf->entity))); |
|
| 361 | 361 | |
| 362 | 362 | if (!is_array($result) && $result < 0) { |
| 363 | 363 | setEventMessages($object->error, $object->errors, 'errors'); |
@@ -1172,7 +1172,7 @@ discard block |
||
| 1172 | 1172 | 'start' => isset($value['start']) ? $value['start'] : '', |
| 1173 | 1173 | 'end' => isset($value['end']) ? $value['end'] : '' |
| 1174 | 1174 | ); |
| 1175 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
| 1175 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
| 1176 | 1176 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); |
| 1177 | 1177 | $out .= '</div><div class="nowrap">'; |
| 1178 | 1178 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); |
@@ -1197,7 +1197,7 @@ discard block |
||
| 1197 | 1197 | 'start' => isset($value['start']) ? $value['start'] : '', |
| 1198 | 1198 | 'end' => isset($value['end']) ? $value['end'] : '' |
| 1199 | 1199 | ); |
| 1200 | - $out = '<div ' . ($moreparam ? $moreparam : '') . '><div class="nowrap">'; |
|
| 1200 | + $out = '<div '.($moreparam ? $moreparam : '').'><div class="nowrap">'; |
|
| 1201 | 1201 | $out .= $form->selectDate($prefill['start'], $keyprefix.$key.$keysuffix.'_start', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"), 'tzuserrel'); |
| 1202 | 1202 | $out .= '</div><div class="nowrap">'; |
| 1203 | 1203 | $out .= $form->selectDate($prefill['end'], $keyprefix.$key.$keysuffix.'_end', 1, 1, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"), 'tzuserrel'); |
@@ -1267,7 +1267,7 @@ discard block |
||
| 1267 | 1267 | } else { |
| 1268 | 1268 | $out = $form->selectyesno($keyprefix.$key.$keysuffix, $value, 1, false, 1, 1, 'width75 yesno'); |
| 1269 | 1269 | } |
| 1270 | - $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
| 1270 | + $out .= '<input type="hidden" name="'.$keyprefix.$key.$keysuffix.'_boolean" value="1">'; // A hidden field ending with "_boolean" that is always set to 1. |
|
| 1271 | 1271 | } elseif ($type == 'price') { |
| 1272 | 1272 | if (!empty($value)) { // $value in memory is a php numeric, we format it into user number format. |
| 1273 | 1273 | $value = price($value); |
@@ -1367,8 +1367,8 @@ discard block |
||
| 1367 | 1367 | // 7 : sort field (not used here but used into format for commobject) |
| 1368 | 1368 | |
| 1369 | 1369 | // If there is a filter, we extract it by taking all content inside parenthesis. |
| 1370 | - if (! empty($InfoFieldList[4])) { |
|
| 1371 | - $pos = 0; // $pos will be position of ending filter |
|
| 1370 | + if (!empty($InfoFieldList[4])) { |
|
| 1371 | + $pos = 0; // $pos will be position of ending filter |
|
| 1372 | 1372 | $parenthesisopen = 0; |
| 1373 | 1373 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
| 1374 | 1374 | if (substr($InfoFieldList[4], $pos, 1) == '(') { |
@@ -1455,9 +1455,9 @@ discard block |
||
| 1455 | 1455 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 1456 | 1456 | $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
| 1457 | 1457 | $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
| 1458 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1458 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1459 | 1459 | } else { |
| 1460 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1460 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1461 | 1461 | } |
| 1462 | 1462 | } else { |
| 1463 | 1463 | $sqlwhere .= ' WHERE 1=1'; |
@@ -1592,7 +1592,7 @@ discard block |
||
| 1592 | 1592 | // 7 : sort field (not used here but used into format for commobject) |
| 1593 | 1593 | |
| 1594 | 1594 | // If there is a filter, we extract it by taking all content inside parenthesis. |
| 1595 | - if (! empty($InfoFieldList[4])) { |
|
| 1595 | + if (!empty($InfoFieldList[4])) { |
|
| 1596 | 1596 | $pos = 0; |
| 1597 | 1597 | $parenthesisopen = 0; |
| 1598 | 1598 | while (substr($InfoFieldList[4], $pos, 1) !== '' && ($parenthesisopen || $pos == 0 || substr($InfoFieldList[4], $pos, 1) != ':')) { |
@@ -1728,9 +1728,9 @@ discard block |
||
| 1728 | 1728 | if (strpos($InfoFieldList[4], 'extra.') !== false) { |
| 1729 | 1729 | $sql .= ' as main, '.$this->db->sanitize($this->db->prefix().$InfoFieldList[0]).'_extrafields as extra'; |
| 1730 | 1730 | $sqlwhere .= " WHERE extra.fk_object = main.".$this->db->sanitize($InfoFieldList[2]); |
| 1731 | - $sqlwhere .= " AND " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1731 | + $sqlwhere .= " AND ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1732 | 1732 | } else { |
| 1733 | - $sqlwhere .= " WHERE " . forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1733 | + $sqlwhere .= " WHERE ".forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1); |
|
| 1734 | 1734 | } |
| 1735 | 1735 | } else { |
| 1736 | 1736 | $sqlwhere .= ' WHERE 1=1'; |
@@ -1845,7 +1845,7 @@ discard block |
||
| 1845 | 1845 | |
| 1846 | 1846 | $tmparray = explode(':', $param_list[0]); |
| 1847 | 1847 | |
| 1848 | - $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
| 1848 | + $element = $extrafieldsobjectkey; // $extrafieldsobjectkey comes from $object->table_element but we need $object->element |
|
| 1849 | 1849 | if ($element == 'socpeople') { |
| 1850 | 1850 | $element = 'contact'; |
| 1851 | 1851 | } elseif ($element == 'projet') { |
@@ -1853,8 +1853,8 @@ discard block |
||
| 1853 | 1853 | } |
| 1854 | 1854 | |
| 1855 | 1855 | //$objectdesc = $param_list[0]; // Example: 'ObjectName:classPath:1:(status:=:1)' Replaced by next line: this was propagated also a filter by ajax call that was blocked by some WAF |
| 1856 | - $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
| 1857 | - $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
| 1856 | + $objectdesc = $tmparray[0]; // Example: 'ObjectName:classPath' To not propagate any filter (selectForForms do ajax call and propagating SQL filter is blocked by some WAF). Also we should use the one into the definition in the ->fields of $elem if found. |
|
| 1857 | + $objectfield = $element.':options_'.$key; // Example: 'actioncomm:options_fff' To be used in priority to know object linked with all its definition (including filters) |
|
| 1858 | 1858 | |
| 1859 | 1859 | $out = $form->selectForForms($objectdesc, $keyprefix.$key.$keysuffix, $value, $showempty, '', '', $morecss, '', 0, 0, '', $objectfield); |
| 1860 | 1860 | } elseif (in_array($type, ['point', 'multipts', 'linestrg', 'polygon'])) { |
@@ -1959,7 +1959,7 @@ discard block |
||
| 1959 | 1959 | |
| 1960 | 1960 | $label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; |
| 1961 | 1961 | $type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; |
| 1962 | - $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1962 | + $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... |
|
| 1963 | 1963 | $default = $this->attributes[$extrafieldsobjectkey]['default'][$key]; |
| 1964 | 1964 | $computed = $this->attributes[$extrafieldsobjectkey]['computed'][$key]; |
| 1965 | 1965 | $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | if ($type == 'date') { |
| 1984 | 1984 | $showsize = 10; |
| 1985 | 1985 | if ($value !== '') { |
| 1986 | - $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1986 | + $value = dol_print_date($value, 'day'); // For date without hour, date is always GMT for storage and output |
|
| 1987 | 1987 | } |
| 1988 | 1988 | } elseif ($type == 'datetime') { |
| 1989 | 1989 | $showsize = 19; |
@@ -2108,9 +2108,9 @@ discard block |
||
| 2108 | 2108 | $translabel = $outputlangs->trans($obj->$field_toshow); |
| 2109 | 2109 | |
| 2110 | 2110 | if ($translabel != $obj->$field_toshow) { |
| 2111 | - $value .= dol_trunc($translabel, 24) . ' '; |
|
| 2111 | + $value .= dol_trunc($translabel, 24).' '; |
|
| 2112 | 2112 | } else { |
| 2113 | - $value .= $obj->$field_toshow . ' '; |
|
| 2113 | + $value .= $obj->$field_toshow.' '; |
|
| 2114 | 2114 | } |
| 2115 | 2115 | } |
| 2116 | 2116 | } |
@@ -2131,13 +2131,13 @@ discard block |
||
| 2131 | 2131 | $toprint = array(); |
| 2132 | 2132 | $obj = $this->db->fetch_object($resql); |
| 2133 | 2133 | if ($obj->rowid) { |
| 2134 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 2134 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 2135 | 2135 | $c = new Categorie($this->db); |
| 2136 | 2136 | $result = $c->fetch($obj->rowid); |
| 2137 | 2137 | if ($result > 0) { |
| 2138 | 2138 | $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text |
| 2139 | 2139 | foreach ($ways as $way) { |
| 2140 | - $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '</li>'; |
|
| 2140 | + $toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'</li>'; |
|
| 2141 | 2141 | } |
| 2142 | 2142 | } |
| 2143 | 2143 | } |
@@ -2290,7 +2290,7 @@ discard block |
||
| 2290 | 2290 | } else { |
| 2291 | 2291 | $value = ''; |
| 2292 | 2292 | } |
| 2293 | - } elseif (in_array($type, ['multipts','linestrg', 'polygon'])) { |
|
| 2293 | + } elseif (in_array($type, ['multipts', 'linestrg', 'polygon'])) { |
|
| 2294 | 2294 | if (!empty($value)) { |
| 2295 | 2295 | require_once DOL_DOCUMENT_ROOT.'/core/class/dolgeophp.class.php'; |
| 2296 | 2296 | $dolgeophp = new DolGeoPHP($this->db); |
@@ -2450,12 +2450,12 @@ discard block |
||
| 2450 | 2450 | if ($mode == 'create') { |
| 2451 | 2451 | // On create mode, force separator group to not be collapsible |
| 2452 | 2452 | $extrafield_collapse_display_value = 1; |
| 2453 | - $expand_display = true; // We force group to be shown expanded |
|
| 2453 | + $expand_display = true; // We force group to be shown expanded |
|
| 2454 | 2454 | $disabledcookiewrite = 1; // We keep status of group unchanged into the cookie |
| 2455 | 2455 | } |
| 2456 | 2456 | |
| 2457 | 2457 | $out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id) ? '_'.$object->id : '').'">'; |
| 2458 | - $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="' . $colspan . '"' : '').'>'; |
|
| 2458 | + $out .= '<'.$tagtype_dyn.' '.(!empty($colspan) ? 'colspan="'.$colspan.'"' : '').'>'; |
|
| 2459 | 2459 | // Some js code will be injected here to manage the collapsing of extrafields |
| 2460 | 2460 | // Output the picto |
| 2461 | 2461 | $out .= '<span class="'.($extrafield_collapse_display_value ? 'cursorpointer ' : '').($extrafield_collapse_display_value == 0 ? 'fas fa-square opacitymedium' : 'far fa-'.(($expand_display ? 'minus' : 'plus').'-square')).'"></span>'; |
@@ -2537,7 +2537,7 @@ discard block |
||
| 2537 | 2537 | continue; |
| 2538 | 2538 | } |
| 2539 | 2539 | |
| 2540 | - if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (! in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) { |
|
| 2540 | + if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key) && (!in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst', 'point', 'multipts', 'linestrg', 'polygon')))) { |
|
| 2541 | 2541 | //when unticking boolean field, it's not set in POST |
| 2542 | 2542 | continue; |
| 2543 | 2543 | } |
@@ -2566,7 +2566,7 @@ discard block |
||
| 2566 | 2566 | $onlykey === '@GETPOSTISSET' |
| 2567 | 2567 | && in_array($this->attributes[$object->table_element]['type'][$key], array('boolean', 'checkbox', 'chkbxlst')) |
| 2568 | 2568 | && in_array(abs($enabled), array(2, 5)) |
| 2569 | - && ! GETPOSTISSET('options_' . $key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2569 | + && !GETPOSTISSET('options_'.$key) // Update hidden checkboxes and multiselect only if they are provided |
|
| 2570 | 2570 | ) |
| 2571 | 2571 | ) { |
| 2572 | 2572 | continue; |
@@ -2703,17 +2703,17 @@ discard block |
||
| 2703 | 2703 | } |
| 2704 | 2704 | |
| 2705 | 2705 | if (in_array($key_type, array('date'))) { |
| 2706 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
| 2707 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
| 2706 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
| 2707 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
| 2708 | 2708 | |
| 2709 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
| 2709 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
| 2710 | 2710 | $value_key = array(); |
| 2711 | 2711 | // values provided as a component year, month, day, etc. |
| 2712 | - if (GETPOST($dateparamname_start . 'year')) { |
|
| 2713 | - $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year')); |
|
| 2712 | + if (GETPOST($dateparamname_start.'year')) { |
|
| 2713 | + $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year')); |
|
| 2714 | 2714 | } |
| 2715 | - if (GETPOST($dateparamname_end . 'year')) { |
|
| 2716 | - $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year')); |
|
| 2715 | + if (GETPOST($dateparamname_end.'year')) { |
|
| 2716 | + $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year')); |
|
| 2717 | 2717 | } |
| 2718 | 2718 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
| 2719 | 2719 | // Clean parameters |
@@ -2722,26 +2722,26 @@ discard block |
||
| 2722 | 2722 | continue; // Value was not provided, we should not set it. |
| 2723 | 2723 | } |
| 2724 | 2724 | } elseif (in_array($key_type, array('datetime', 'datetimegmt'))) { |
| 2725 | - $dateparamname_start = $keyprefix . 'options_' . $key . $keysuffix . '_start'; |
|
| 2726 | - $dateparamname_end = $keyprefix . 'options_' . $key . $keysuffix . '_end'; |
|
| 2725 | + $dateparamname_start = $keyprefix.'options_'.$key.$keysuffix.'_start'; |
|
| 2726 | + $dateparamname_end = $keyprefix.'options_'.$key.$keysuffix.'_end'; |
|
| 2727 | 2727 | |
| 2728 | - if (GETPOST($dateparamname_start . 'year') || GETPOST($dateparamname_end . 'year')) { |
|
| 2728 | + if (GETPOST($dateparamname_start.'year') || GETPOST($dateparamname_end.'year')) { |
|
| 2729 | 2729 | // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. |
| 2730 | - $dateparamname_start_hour = GETPOSTINT($dateparamname_start . 'hour') != '-1' ? GETPOSTINT($dateparamname_start . 'hour') : '00'; |
|
| 2731 | - $dateparamname_start_min = GETPOSTINT($dateparamname_start . 'min') != '-1' ? GETPOSTINT($dateparamname_start . 'min') : '00'; |
|
| 2732 | - $dateparamname_start_sec = GETPOSTINT($dateparamname_start . 'sec') != '-1' ? GETPOSTINT($dateparamname_start . 'sec') : '00'; |
|
| 2733 | - $dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23'; |
|
| 2734 | - $dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59'; |
|
| 2735 | - $dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59'; |
|
| 2730 | + $dateparamname_start_hour = GETPOSTINT($dateparamname_start.'hour') != '-1' ? GETPOSTINT($dateparamname_start.'hour') : '00'; |
|
| 2731 | + $dateparamname_start_min = GETPOSTINT($dateparamname_start.'min') != '-1' ? GETPOSTINT($dateparamname_start.'min') : '00'; |
|
| 2732 | + $dateparamname_start_sec = GETPOSTINT($dateparamname_start.'sec') != '-1' ? GETPOSTINT($dateparamname_start.'sec') : '00'; |
|
| 2733 | + $dateparamname_end_hour = GETPOSTINT($dateparamname_end.'hour') != '-1' ? GETPOSTINT($dateparamname_end.'hour') : '23'; |
|
| 2734 | + $dateparamname_end_min = GETPOSTINT($dateparamname_end.'min') != '-1' ? GETPOSTINT($dateparamname_end.'min') : '59'; |
|
| 2735 | + $dateparamname_end_sec = GETPOSTINT($dateparamname_end.'sec') != '-1' ? GETPOSTINT($dateparamname_end.'sec') : '59'; |
|
| 2736 | 2736 | if ($key_type == 'datetimegmt') { |
| 2737 | 2737 | $value_key = array( |
| 2738 | - 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'), |
|
| 2739 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt') |
|
| 2738 | + 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'gmt'), |
|
| 2739 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'gmt') |
|
| 2740 | 2740 | ); |
| 2741 | 2741 | } else { |
| 2742 | 2742 | $value_key = array( |
| 2743 | - 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'), |
|
| 2744 | - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel') |
|
| 2743 | + 'start' => dol_mktime($dateparamname_start_hour, $dateparamname_start_min, $dateparamname_start_sec, GETPOSTINT($dateparamname_start.'month'), GETPOSTINT($dateparamname_start.'day'), GETPOSTINT($dateparamname_start.'year'), 'tzuserrel'), |
|
| 2744 | + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end.'month'), GETPOSTINT($dateparamname_end.'day'), GETPOSTINT($dateparamname_end.'year'), 'tzuserrel') |
|
| 2745 | 2745 | ); |
| 2746 | 2746 | } |
| 2747 | 2747 | } elseif (GETPOST($keyprefix."options_".$key.$keysuffix."year")) { |
@@ -2864,6 +2864,6 @@ discard block |
||
| 2864 | 2864 | if ($type == 'sellist') { |
| 2865 | 2865 | return ($v == '0'); |
| 2866 | 2866 | } |
| 2867 | - return empty($v); // Note empty('0') is also true, tested 7.0 up to 8.3.12 |
|
| 2867 | + return empty($v); // Note empty('0') is also true, tested 7.0 up to 8.3.12 |
|
| 2868 | 2868 | } |
| 2869 | 2869 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $posy = 0; |
| 149 | 149 | $lines = explode("\n", $content); |
| 150 | 150 | $nblines = count($lines); |
| 151 | - for ($i = 0 ; $i < $nblines ; $i++) { |
|
| 151 | + for ($i = 0; $i < $nblines; $i++) { |
|
| 152 | 152 | if (preg_match('/'.$poscursor['find'].'/', $lines[$i])) { |
| 153 | 153 | $posy = $i; |
| 154 | 154 | break; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | define('REQUIRE_CKEDITOR', '1'); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $skin = getDolGlobalString('FCKEDITOR_SKIN', 'moono-lisa'); // default with ckeditor 4.6 : moono-lisa |
|
| 227 | + $skin = getDolGlobalString('FCKEDITOR_SKIN', 'moono-lisa'); // default with ckeditor 4.6 : moono-lisa |
|
| 228 | 228 | |
| 229 | 229 | $pluginstodisable = 'elementspath,save,flash,div,anchor'; |
| 230 | 230 | if (!getDolGlobalString('FCKEDITOR_ENABLE_SPECIALCHAR')) { |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $pluginstodisable .= ',exportpdf'; |
| 241 | 241 | } |
| 242 | 242 | if (getDolGlobalInt('MAIN_DISALLOW_URL_INTO_DESCRIPTIONS') == 2) { |
| 243 | - $this->uselocalbrowser = 0; // Can't use browser to navigate into files. Only links with "<img src=data:..." are allowed. |
|
| 243 | + $this->uselocalbrowser = 0; // Can't use browser to navigate into files. Only links with "<img src=data:..." are allowed. |
|
| 244 | 244 | } |
| 245 | 245 | $scaytautostartup = ''; |
| 246 | 246 | if (getDolGlobalString('FCKEDITOR_ENABLE_SCAYT_AUTOSTARTUP')) { |
@@ -329,10 +329,10 @@ discard block |
||
| 329 | 329 | filebrowserImageWindowWidth : \'900\', |
| 330 | 330 | filebrowserImageWindowHeight : \'500\''; |
| 331 | 331 | } |
| 332 | - $out .= ' })'.$morejs; // end CKEditor.replace |
|
| 332 | + $out .= ' })'.$morejs; // end CKEditor.replace |
|
| 333 | 333 | // Show the CKEditor javascript object once loaded is ready 'For debug) |
| 334 | 334 | //$out .= '; CKEDITOR.on(\'instanceReady\', function(ck) { ck.editor.removeMenuItem(\'maximize\'); ck.editor.removeMenuItem(\'Undo\'); ck.editor.removeMenuItem(\'undo\'); console.log(ck.editor); console.log(ck.editor.toolbar[0]); }); '; |
| 335 | - $out .= '});'."\n"; // end document.ready |
|
| 335 | + $out .= '});'."\n"; // end document.ready |
|
| 336 | 336 | $out .= '</script>'."\n"; |
| 337 | 337 | } |
| 338 | 338 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @var string|float |
| 65 | 65 | * @deprecated |
| 66 | 66 | */ |
| 67 | - public $amount_ht; // deprecated |
|
| 67 | + public $amount_ht; // deprecated |
|
| 68 | 68 | /** |
| 69 | 69 | * @var string|float |
| 70 | 70 | * @deprecated |
@@ -92,17 +92,17 @@ discard block |
||
| 92 | 92 | * @var string|float |
| 93 | 93 | * @deprecated |
| 94 | 94 | */ |
| 95 | - public $multicurrency_amount_ht; // deprecated |
|
| 95 | + public $multicurrency_amount_ht; // deprecated |
|
| 96 | 96 | /** |
| 97 | 97 | * @var string|float |
| 98 | 98 | * @deprecated |
| 99 | 99 | */ |
| 100 | - public $multicurrency_amount_tva; // deprecated |
|
| 100 | + public $multicurrency_amount_tva; // deprecated |
|
| 101 | 101 | /** |
| 102 | 102 | * @var string|float |
| 103 | 103 | * @deprecated |
| 104 | 104 | */ |
| 105 | - public $multicurrency_amount_ttc; // deprecated |
|
| 105 | + public $multicurrency_amount_ttc; // deprecated |
|
| 106 | 106 | |
| 107 | 107 | /** |
| 108 | 108 | * @var float |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | dol_syslog(get_class($this)."::delete Delete discount", LOG_DEBUG); |
| 438 | 438 | |
| 439 | - require_once DOL_DOCUMENT_ROOT. '/core/class/commoninvoice.class.php'; |
|
| 439 | + require_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; |
|
| 440 | 440 | $result = $this->db->query($sql); |
| 441 | 441 | if ($result) { |
| 442 | 442 | // If source of discount was a credit note or deposit, we change source statut. |
@@ -666,12 +666,12 @@ discard block |
||
| 666 | 666 | $sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount"; |
| 667 | 667 | $sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture as f"; |
| 668 | 668 | $sql .= " WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = ".((int) $invoice->id); |
| 669 | - $sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT; |
|
| 669 | + $sql .= " AND f.type = ".(int) $invoice::TYPE_DEPOSIT; |
|
| 670 | 670 | } elseif ($invoice->element == 'invoice_supplier') { |
| 671 | 671 | $sql = "SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount"; |
| 672 | 672 | $sql .= " FROM ".$this->db->prefix()."societe_remise_except as rc, ".$this->db->prefix()."facture_fourn as f"; |
| 673 | 673 | $sql .= " WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = ".((int) $invoice->id); |
| 674 | - $sql .= " AND f.type = ". (int) $invoice::TYPE_DEPOSIT; |
|
| 674 | + $sql .= " AND f.type = ".(int) $invoice::TYPE_DEPOSIT; |
|
| 675 | 675 | } else { |
| 676 | 676 | $this->error = get_class($this)."::getSumDepositsUsed was called with a bad object as a first parameter"; |
| 677 | 677 | dol_print_error($this->db, $this->error); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | $marginInfo = $this->getMarginInfosArray($object, $force_price); |
| 230 | 230 | |
| 231 | - print '<!-- displayMarginInfos() - Show margin table -->' . "\n"; |
|
| 231 | + print '<!-- displayMarginInfos() - Show margin table -->'."\n"; |
|
| 232 | 232 | |
| 233 | 233 | $parameters = array('marginInfo' => &$marginInfo); |
| 234 | 234 | $reshook = $hookmanager->executeHooks('displayMarginInfos', $parameters, $object, $action); |
@@ -237,10 +237,10 @@ discard block |
||
| 237 | 237 | } elseif (empty($reshook)) { |
| 238 | 238 | $hidemargininfos = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW'] ?? ''); // Clean cookie |
| 239 | 239 | |
| 240 | - $buttonToShowHideMargin = '<span id="showMarginInfos" class="linkobject valignmiddle ' . (!empty($hidemargininfos) ? '' : 'hideobject') . '">'; |
|
| 240 | + $buttonToShowHideMargin = '<span id="showMarginInfos" class="linkobject valignmiddle '.(!empty($hidemargininfos) ? '' : 'hideobject').'">'; |
|
| 241 | 241 | $buttonToShowHideMargin .= img_picto($langs->trans("ShowMarginInfos"), 'switch_off', '', 0, 0, 0, '', 'size15x'); |
| 242 | 242 | $buttonToShowHideMargin .= '</span>'; |
| 243 | - $buttonToShowHideMargin .= '<span id="hideMarginInfos" class="linkobject valignmiddle ' . (!empty($hidemargininfos) ? 'hideobject' : '') . '">'; |
|
| 243 | + $buttonToShowHideMargin .= '<span id="hideMarginInfos" class="linkobject valignmiddle '.(!empty($hidemargininfos) ? 'hideobject' : '').'">'; |
|
| 244 | 244 | $buttonToShowHideMargin .= img_picto($langs->trans("Hide"), 'switch_on_grey', '', 0, 0, 0, '', 'size15x opacitymedium'); |
| 245 | 245 | $buttonToShowHideMargin .= '</span>'; |
| 246 | 246 | |
@@ -256,64 +256,64 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | print '<table class="noborder margintable centpercent" id="margintable">'; |
| 258 | 258 | print '<tr class="liste_titre">'; |
| 259 | - print '<td class="liste_titre">' . $langs->trans('Margins') . ' ' . $buttonToShowHideMargin . '</td>'; |
|
| 260 | - print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">' . $langs->trans('SellingPrice') . '</td>'; |
|
| 259 | + print '<td class="liste_titre">'.$langs->trans('Margins').' '.$buttonToShowHideMargin.'</td>'; |
|
| 260 | + print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'.$langs->trans('SellingPrice').'</td>'; |
|
| 261 | 261 | if (getDolGlobalString('MARGIN_TYPE') == "1") { |
| 262 | - print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">' . $langs->trans('BuyingPrice') . '</td>'; |
|
| 262 | + print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'.$langs->trans('BuyingPrice').'</td>'; |
|
| 263 | 263 | } else { |
| 264 | - print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">' . $langs->trans('CostPrice') . '</td>'; |
|
| 264 | + print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'.$langs->trans('CostPrice').'</td>'; |
|
| 265 | 265 | } |
| 266 | - print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">' . $langs->trans('Margin') . '</td>'; |
|
| 266 | + print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'.$langs->trans('Margin').'</td>'; |
|
| 267 | 267 | if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { |
| 268 | - print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">' . $langs->trans('MarginRate') . '</td>'; |
|
| 268 | + print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'.$langs->trans('MarginRate').'</td>'; |
|
| 269 | 269 | } |
| 270 | 270 | if (getDolGlobalString('DISPLAY_MARK_RATES')) { |
| 271 | - print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">' . $langs->trans('MarkRate') . '</td>'; |
|
| 271 | + print '<td class="liste_titre right margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'.$langs->trans('MarkRate').'</td>'; |
|
| 272 | 272 | } |
| 273 | 273 | print '</tr>'; |
| 274 | 274 | |
| 275 | 275 | if (isModEnabled("product")) { |
| 276 | 276 | //if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) { |
| 277 | 277 | print '<tr class="oddeven margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'; |
| 278 | - print '<td>' . $langs->trans('MarginOnProducts') . '</td>'; |
|
| 279 | - print '<td class="right">' . price($marginInfo['pv_products']) . '</td>'; |
|
| 280 | - print '<td class="right">' . price($marginInfo['pa_products']) . '</td>'; |
|
| 281 | - print '<td class="right">' . price($marginInfo['margin_on_products']) . '</td>'; |
|
| 278 | + print '<td>'.$langs->trans('MarginOnProducts').'</td>'; |
|
| 279 | + print '<td class="right">'.price($marginInfo['pv_products']).'</td>'; |
|
| 280 | + print '<td class="right">'.price($marginInfo['pa_products']).'</td>'; |
|
| 281 | + print '<td class="right">'.price($marginInfo['margin_on_products']).'</td>'; |
|
| 282 | 282 | if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { |
| 283 | - print '<td class="right">' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], 0, '', 0, 0, 2) . '%') . '</td>'; |
|
| 283 | + print '<td class="right">'.(($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], 0, '', 0, 0, 2).'%').'</td>'; |
|
| 284 | 284 | } |
| 285 | 285 | if (getDolGlobalString('DISPLAY_MARK_RATES')) { |
| 286 | - print '<td class="right">' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], 0, '', 0, 0, 2) . '%') . '</td>'; |
|
| 286 | + print '<td class="right">'.(($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], 0, '', 0, 0, 2).'%').'</td>'; |
|
| 287 | 287 | } |
| 288 | 288 | print '</tr>'; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | if (isModEnabled("service")) { |
| 292 | 292 | print '<tr class="oddeven margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'; |
| 293 | - print '<td>' . $langs->trans('MarginOnServices') . '</td>'; |
|
| 294 | - print '<td class="right">' . price($marginInfo['pv_services']) . '</td>'; |
|
| 295 | - print '<td class="right">' . price($marginInfo['pa_services']) . '</td>'; |
|
| 296 | - print '<td class="right">' . price($marginInfo['margin_on_services']) . '</td>'; |
|
| 293 | + print '<td>'.$langs->trans('MarginOnServices').'</td>'; |
|
| 294 | + print '<td class="right">'.price($marginInfo['pv_services']).'</td>'; |
|
| 295 | + print '<td class="right">'.price($marginInfo['pa_services']).'</td>'; |
|
| 296 | + print '<td class="right">'.price($marginInfo['margin_on_services']).'</td>'; |
|
| 297 | 297 | if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { |
| 298 | - print '<td class="right">' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], 0, '', 0, 0, 2) . '%') . '</td>'; |
|
| 298 | + print '<td class="right">'.(($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], 0, '', 0, 0, 2).'%').'</td>'; |
|
| 299 | 299 | } |
| 300 | 300 | if (getDolGlobalString('DISPLAY_MARK_RATES')) { |
| 301 | - print '<td class="right">' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], 0, '', 0, 0, 2) . '%') . '</td>'; |
|
| 301 | + print '<td class="right">'.(($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], 0, '', 0, 0, 2).'%').'</td>'; |
|
| 302 | 302 | } |
| 303 | 303 | print '</tr>'; |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | if (isModEnabled("product") && isModEnabled("service")) { |
| 307 | 307 | print '<tr class="liste_total margininfo'.(empty($_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']) ? '' : ' hideobject').'">'; |
| 308 | - print '<td>' . $langs->trans('TotalMargin') . '</td>'; |
|
| 309 | - print '<td class="right">' . price($marginInfo['pv_total']) . '</td>'; |
|
| 310 | - print '<td class="right">' . price($marginInfo['pa_total']) . '</td>'; |
|
| 311 | - print '<td class="right">' . price($marginInfo['total_margin']) . '</td>'; |
|
| 308 | + print '<td>'.$langs->trans('TotalMargin').'</td>'; |
|
| 309 | + print '<td class="right">'.price($marginInfo['pv_total']).'</td>'; |
|
| 310 | + print '<td class="right">'.price($marginInfo['pa_total']).'</td>'; |
|
| 311 | + print '<td class="right">'.price($marginInfo['total_margin']).'</td>'; |
|
| 312 | 312 | if (getDolGlobalString('DISPLAY_MARGIN_RATES')) { |
| 313 | - print '<td class="right">' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, '', 0, 0, 2) . '%') . '</td>'; |
|
| 313 | + print '<td class="right">'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], 0, '', 0, 0, 2).'%').'</td>'; |
|
| 314 | 314 | } |
| 315 | 315 | if (getDolGlobalString('DISPLAY_MARK_RATES')) { |
| 316 | - print '<td class="right">' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, '', 0, 0, 2) . '%') . '</td>'; |
|
| 316 | + print '<td class="right">'.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], 0, '', 0, 0, 2).'%').'</td>'; |
|
| 317 | 317 | } |
| 318 | 318 | print '</tr>'; |
| 319 | 319 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $maxphptoshow = $maxfilesizearray['maxphptoshow']; |
| 160 | 160 | $maxphptoshowparam = $maxfilesizearray['maxphptoshowparam']; |
| 161 | 161 | if ($maxmin > 0) { |
| 162 | - $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 162 | + $out .= '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file |
|
| 163 | 163 | } |
| 164 | 164 | $out .= '<input class="flat minwidth400 maxwidth200onsmartphone" type="file"'; |
| 165 | 165 | $out .= ((getDolGlobalString('MAIN_DISABLE_MULTIPLE_FILEUPLOAD') || $disablemulti) ? ' name="userfile"' : ' name="userfile[]" multiple'); |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | |
| 869 | 869 | // Loop on each file found |
| 870 | 870 | if (is_array($file_list)) { |
| 871 | - '@phan-var-force array<array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string}> $file_list'; // phan limitations loose typing information with empty() tests, etc. Force again. |
|
| 871 | + '@phan-var-force array<array{name:string,path:string,level1name:string,relativename:string,fullname:string,date:string,size:int,perm:int,type:string}> $file_list'; // phan limitations loose typing information with empty() tests, etc. Force again. |
|
| 872 | 872 | // Defined relative dir to DOL_DATA_ROOT |
| 873 | 873 | $relativedir = ''; |
| 874 | 874 | if ($filedir) { |
@@ -1139,7 +1139,7 @@ discard block |
||
| 1139 | 1139 | |
| 1140 | 1140 | $this->infofiles['nboffiles']++; |
| 1141 | 1141 | $this->infofiles['files'][] = $file['fullname']; |
| 1142 | - $ext = (string) pathinfo($file['name'], PATHINFO_EXTENSION); // pathinfo returns a string here (cast for static analysis) |
|
| 1142 | + $ext = (string) pathinfo($file['name'], PATHINFO_EXTENSION); // pathinfo returns a string here (cast for static analysis) |
|
| 1143 | 1143 | if (!array_key_exists($ext, $this->infofiles['extensions'])) { |
| 1144 | 1144 | $this->infofiles['extensions'][$ext] = 1; |
| 1145 | 1145 | } else { |
@@ -1421,7 +1421,7 @@ discard block |
||
| 1421 | 1421 | $modulepart = basename(dirname($file['path'])); |
| 1422 | 1422 | } |
| 1423 | 1423 | if (empty($relativepath)) { |
| 1424 | - $relativepath = preg_replace('/\/(.+)/', '', $filepath) . '/'; |
|
| 1424 | + $relativepath = preg_replace('/\/(.+)/', '', $filepath).'/'; |
|
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | 1427 | $editline = 0; |
@@ -1699,7 +1699,7 @@ discard block |
||
| 1699 | 1699 | |
| 1700 | 1700 | if ($nboflines > 1 && is_object($object)) { |
| 1701 | 1701 | if (!empty($conf->use_javascript_ajax) && $permtoeditline) { |
| 1702 | - $table_element_line = 'ecm_files'; // used by ajaxrow.tpl.php |
|
| 1702 | + $table_element_line = 'ecm_files'; // used by ajaxrow.tpl.php |
|
| 1703 | 1703 | include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; |
| 1704 | 1704 | } |
| 1705 | 1705 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $this->atleastonediscount = 0; |
| 159 | 159 | |
| 160 | 160 | if ($mysoc === null) { |
| 161 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
| 161 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
| 162 | 162 | return; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
| 279 | 279 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
| 280 | 280 | } |
| 281 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 281 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 282 | 282 | $tplidx = $pdf->importPage(1); |
| 283 | 283 | } |
| 284 | 284 | |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | // Pied de page |
| 638 | 638 | $this->_pagefoot($pdf, $object, $outputlangs); |
| 639 | 639 | if (method_exists($pdf, 'AliasNbPages')) { |
| 640 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 640 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | $pdf->Close(); |
@@ -946,11 +946,11 @@ discard block |
||
| 946 | 946 | |
| 947 | 947 | // Total HT |
| 948 | 948 | $pdf->SetFillColor(255, 255, 255); |
| 949 | - $pdf->SetXY($col1x, $tab2_top+ $tab2_hl * $index); |
|
| 949 | + $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); |
|
| 950 | 950 | $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); |
| 951 | 951 | |
| 952 | 952 | $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); |
| 953 | - $pdf->SetXY($col2x, $tab2_top+ $tab2_hl * $index); |
|
| 953 | + $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); |
|
| 954 | 954 | $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); |
| 955 | 955 | |
| 956 | 956 | // Show VAT by rates and total |
@@ -1533,7 +1533,7 @@ discard block |
||
| 1533 | 1533 | |
| 1534 | 1534 | $carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs); |
| 1535 | 1535 | |
| 1536 | - $mode = 'target'; |
|
| 1536 | + $mode = 'target'; |
|
| 1537 | 1537 | $carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), ($usecontact ? 1 : 0), $mode, $object); |
| 1538 | 1538 | |
| 1539 | 1539 | // Show recipient |
@@ -1588,7 +1588,7 @@ discard block |
||
| 1588 | 1588 | if (!empty($carac_client_shipping)) { |
| 1589 | 1589 | $posy += $hautcadre; |
| 1590 | 1590 | |
| 1591 | - $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
| 1591 | + $hautcadre -= 10; // Height for the shipping address does not need to be as high as main box |
|
| 1592 | 1592 | |
| 1593 | 1593 | // Show shipping frame |
| 1594 | 1594 | $pdf->SetXY($posx + 2, $posy - 5); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * Dolibarr version of the loaded document |
| 79 | 79 | * @var string Version, possible values are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'''|'development'|'dolibarr'|'experimental' |
| 80 | 80 | */ |
| 81 | - public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
| 81 | + public $version = 'disabled'; // Disabled by default. Enabled in constructor if option INVOICE_USE_SITUATION is 2. |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * @var int height for info total |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | if ($mysoc === null) { |
| 250 | - dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'. getCallerInfoString(), LOG_ERR); |
|
| 250 | + dol_syslog(get_class($this).'::__construct() Global $mysoc should not be null.'.getCallerInfoString(), LOG_ERR); |
|
| 251 | 251 | return; |
| 252 | 252 | } |
| 253 | 253 | |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies", "compta")); |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | - if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
| 300 | + if (empty($object) || ($object->type != Facture::TYPE_SITUATION && ($object->type != Facture::TYPE_CREDIT_NOTE && !empty($object->situation_cycle_ref)))) { |
|
| 301 | 301 | setEventMessage($langs->trans('WarningsObjectIsNotASituation'), 'warnings'); |
| 302 | 302 | return 1; |
| 303 | 303 | } |
@@ -416,15 +416,15 @@ discard block |
||
| 416 | 416 | $pdf->SetAutoPageBreak(1, 0); |
| 417 | 417 | |
| 418 | 418 | // compute height for situation invoices |
| 419 | - $this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part |
|
| 419 | + $this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part |
|
| 420 | 420 | if (!getDolGlobalString('INVOICE_NO_PAYMENT_DETAILS') && $nbpayments > 0) { |
| 421 | 421 | $this->heightforinfotot += 4 * ($nbpayments + 3); |
| 422 | 422 | } |
| 423 | 423 | if ($nbprevsituation > 0) { |
| 424 | 424 | $this->heightforinfotot += 4 * ($nbprevsituation + 3); |
| 425 | 425 | } |
| 426 | - $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page |
|
| 427 | - $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
| 426 | + $this->heightforfreetext = (getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5)); // Height reserved to output the free text on last page |
|
| 427 | + $this->heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) |
|
| 428 | 428 | |
| 429 | 429 | if (class_exists('TCPDF')) { |
| 430 | 430 | $pdf->setPrintHeader(false); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | if (!empty($conf->mycompany->multidir_output[$object->entity])) { |
| 439 | 439 | $logodir = $conf->mycompany->multidir_output[$object->entity]; |
| 440 | 440 | } |
| 441 | - $pagecount = $pdf->setSourceFile($logodir.'/' . getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 441 | + $pagecount = $pdf->setSourceFile($logodir.'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND')); |
|
| 442 | 442 | $this->tplidx = $pdf->importPage(1); |
| 443 | 443 | } |
| 444 | 444 | |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | // $pdf->GetY() here can't be used. It is bottom of the second address box but first one may be higher |
| 531 | 531 | |
| 532 | 532 | // $this->tab_top is y where we must continue content (90 = 42 + 48: 42 is height of logo and ref, 48 is address blocks) |
| 533 | - $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 533 | + $this->tab_top = 90 + $top_shift + $shipp_shift; // top_shift is an addition for linked objects or addons (0 in most cases) |
|
| 534 | 534 | $this->tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); |
| 535 | 535 | |
| 536 | 536 | // You can add more thing under header here, if you increase $extra_under_address_shift too. |
@@ -1040,7 +1040,7 @@ discard block |
||
| 1040 | 1040 | if (!isset($this->tva[$vatrate])) { |
| 1041 | 1041 | $this->tva[$vatrate] = 0; |
| 1042 | 1042 | } |
| 1043 | - $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
| 1043 | + $this->tva[$vatrate] += $tvaligne; // ->tva is abandoned, we use now ->tva_array that is more complete |
|
| 1044 | 1044 | $vatcode = $object->lines[$i]->vat_src_code; |
| 1045 | 1045 | if (empty($this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'])) { |
| 1046 | 1046 | $this->tva_array[$vatrate.($vatcode ? ' ('.$vatcode.')' : '')]['amount'] = 0; |
@@ -1129,7 +1129,7 @@ discard block |
||
| 1129 | 1129 | // Pagefoot |
| 1130 | 1130 | $this->_pagefoot($pdf, $object, $outputlangs); |
| 1131 | 1131 | if (method_exists($pdf, 'AliasNbPages')) { |
| 1132 | - $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 1132 | + $pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod |
|
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | $this->resumeLastPage($pdf, $object, 0, $tab_top, $outputlangs, $outputlangsbis); |
@@ -1341,8 +1341,8 @@ discard block |
||
| 1341 | 1341 | $posy = $pdf->GetY() + 4; |
| 1342 | 1342 | } |
| 1343 | 1343 | |
| 1344 | - $posxval = 52; // Position of values of properties shown on left side |
|
| 1345 | - $posxend = 110; // End of x for text on left side |
|
| 1344 | + $posxval = 52; // Position of values of properties shown on left side |
|
| 1345 | + $posxend = 110; // End of x for text on left side |
|
| 1346 | 1346 | if ($this->page_largeur < 210) { // To work with US executive format |
| 1347 | 1347 | $posxend -= 10; |
| 1348 | 1348 | } |
@@ -1372,7 +1372,7 @@ discard block |
||
| 1372 | 1372 | |
| 1373 | 1373 | $pdf->SetFont('', '', $default_font_size - 2); |
| 1374 | 1374 | $pdf->SetXY($posxval, $posy); |
| 1375 | - $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 1375 | + $categoryOfOperationLabel = $outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 1376 | 1376 | $pdf->MultiCell($posxend - $posxval, 4, $categoryOfOperationLabel, 0, 'L'); |
| 1377 | 1377 | |
| 1378 | 1378 | $posy = $pdf->GetY() + 3; // for 2 lines |
@@ -1539,7 +1539,7 @@ discard block |
||
| 1539 | 1539 | include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; |
| 1540 | 1540 | $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); |
| 1541 | 1541 | |
| 1542 | - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0); |
|
| 1542 | + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": ".$outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0); |
|
| 1543 | 1543 | } |
| 1544 | 1544 | } |
| 1545 | 1545 | } |
@@ -1714,7 +1714,7 @@ discard block |
||
| 1714 | 1714 | if (($object->lines[$i]->info_bits & 0x01) == 0x01) { |
| 1715 | 1715 | $vatrate .= '*'; |
| 1716 | 1716 | } |
| 1717 | - if (! isset($tvas[$vatrate])) { |
|
| 1717 | + if (!isset($tvas[$vatrate])) { |
|
| 1718 | 1718 | $tvas[$vatrate] = 0; |
| 1719 | 1719 | } |
| 1720 | 1720 | $tvas[$vatrate] += $tvaligne; |
@@ -1982,7 +1982,7 @@ discard block |
||
| 1982 | 1982 | if (empty($hidetop)) { |
| 1983 | 1983 | // Show category of operations |
| 1984 | 1984 | if (getDolGlobalInt('INVOICE_CATEGORY_OF_OPERATION') == 1 && $this->categoryOfOperation >= 0) { |
| 1985 | - $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations") . ' : ' . $outputlangs->transnoentities("MentionCategoryOfOperations" . $this->categoryOfOperation); |
|
| 1985 | + $categoryOfOperations = $outputlangs->transnoentities("MentionCategoryOfOperations").' : '.$outputlangs->transnoentities("MentionCategoryOfOperations".$this->categoryOfOperation); |
|
| 1986 | 1986 | $pdf->SetXY($this->marge_gauche, $tab_top - 4); |
| 1987 | 1987 | $pdf->MultiCell(($pdf->GetStringWidth($categoryOfOperations)) + 4, 2, $categoryOfOperations); |
| 1988 | 1988 | } |
@@ -2002,7 +2002,7 @@ discard block |
||
| 2002 | 2002 | $pdf->SetFont('', '', $default_font_size - 1); |
| 2003 | 2003 | |
| 2004 | 2004 | // Output Rect |
| 2005 | - $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 2005 | + $this->printRoundedRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 2006 | 2006 | |
| 2007 | 2007 | // situation invoice |
| 2008 | 2008 | $pdf->SetFont('', '', $default_font_size - 2); |
@@ -2042,7 +2042,7 @@ discard block |
||
| 2042 | 2042 | $pdf->SetFont('', '', $default_font_size - 1); |
| 2043 | 2043 | |
| 2044 | 2044 | if (empty($hidetop)) { |
| 2045 | - $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param |
|
| 2045 | + $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); // line prend une position y en 2eme param et 4eme param |
|
| 2046 | 2046 | } |
| 2047 | 2047 | } |
| 2048 | 2048 | |
@@ -2619,7 +2619,7 @@ discard block |
||
| 2619 | 2619 | 'overtitle' => array( |
| 2620 | 2620 | 'textkey' => 'Chantier', // use lang key is useful in somme case with module |
| 2621 | 2621 | 'align' => 'C', |
| 2622 | - 'padding' => array(0.5,0.5,0.5,0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
| 2622 | + 'padding' => array(0.5, 0.5, 0.5, 0.5), // Like css 0 => top , 1 => right, 2 => bottom, 3 => left |
|
| 2623 | 2623 | 'width' => 18 |
| 2624 | 2624 | ), |
| 2625 | 2625 | ); |
@@ -2644,13 +2644,13 @@ discard block |
||
| 2644 | 2644 | ), |
| 2645 | 2645 | 'border-left' => true, // add left line separator |
| 2646 | 2646 | 'overtitle' => array( |
| 2647 | - 'textkey' => 'S'.$derniere_situation->situation_counter . ' - ' . dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
| 2647 | + 'textkey' => 'S'.$derniere_situation->situation_counter.' - '.dol_print_date($derniere_situation->date, "%d/%m/%Y"), |
|
| 2648 | 2648 | 'align' => 'C', |
| 2649 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2649 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2650 | 2650 | 'width' => 10 + 15 //current width + amount cell width |
| 2651 | 2651 | ), |
| 2652 | 2652 | ); |
| 2653 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2653 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2654 | 2654 | $this->cols['prev_progress']['status'] = true; |
| 2655 | 2655 | } |
| 2656 | 2656 | |
@@ -2665,7 +2665,7 @@ discard block |
||
| 2665 | 2665 | ), |
| 2666 | 2666 | 'border-left' => true, // add left line separator |
| 2667 | 2667 | ); |
| 2668 | - if ($this->situationinvoice && ! empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2668 | + if ($this->situationinvoice && !empty($this->TDataSituation['date_derniere_situation'])) { |
|
| 2669 | 2669 | $this->cols['prev_progress_amount']['status'] = true; |
| 2670 | 2670 | } |
| 2671 | 2671 | |
@@ -2680,9 +2680,9 @@ discard block |
||
| 2680 | 2680 | ), |
| 2681 | 2681 | 'border-left' => true, // add left line separator |
| 2682 | 2682 | 'overtitle' => array( |
| 2683 | - 'textkey' => 'S'.$object->situation_counter . ' - ' . dol_print_date($object->date, "%d/%m/%Y"), |
|
| 2683 | + 'textkey' => 'S'.$object->situation_counter.' - '.dol_print_date($object->date, "%d/%m/%Y"), |
|
| 2684 | 2684 | 'align' => 'C', |
| 2685 | - 'padding' => array(0.5,0.2,0.5,0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2685 | + 'padding' => array(0.5, 0.2, 0.5, 0.2), // Like css 0 => top, 1 => right, 2 => bottom, 3 => left |
|
| 2686 | 2686 | 'width' => 10 + 15 |
| 2687 | 2687 | ), |
| 2688 | 2688 | ); |
@@ -2807,7 +2807,7 @@ discard block |
||
| 2807 | 2807 | |
| 2808 | 2808 | // Output Rect |
| 2809 | 2809 | // KEEPTHIS => Affiche les bords extérieurs |
| 2810 | - $this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 2810 | + $this->printRoundedRectBtp($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $this->corner_radius, $hidetop, $hidebottom, 'D'); // Rect prend une longueur en 3eme param et 4eme param |
|
| 2811 | 2811 | |
| 2812 | 2812 | $pdf->line($this->posx_cumul_anterieur - 1, $tab_top, $this->posx_cumul_anterieur - 1, $tab_top + $tab_height); |
| 2813 | 2813 | if (empty($hidetop)) { |
@@ -2864,7 +2864,7 @@ discard block |
||
| 2864 | 2864 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 24 + $i); |
| 2865 | 2865 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("TotalHT").' '.$TVatInfo['label'], '', 'L'); |
| 2866 | 2866 | |
| 2867 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 2867 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 2868 | 2868 | $pdf->SetXY($this->marge_gauche + 10, $tab_top + 28 + $i); |
| 2869 | 2869 | $pdf->MultiCell(80, 2, $outputlangs->transnoentities("VAT").' '.$TVatInfo['label'], '', 'L'); |
| 2870 | 2870 | } else { |
@@ -2928,7 +2928,7 @@ discard block |
||
| 2928 | 2928 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['HT'], 0, '', 1, -1, 2), '', 'R'); |
| 2929 | 2929 | |
| 2930 | 2930 | // Total TVA |
| 2931 | - if (! empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 2931 | + if (!empty($this->TDataSituation['current'][$tva_tx_formated]['TVA'])) { |
|
| 2932 | 2932 | $pdf->SetXY($x, $tab_top + 28 + $i); |
| 2933 | 2933 | $pdf->MultiCell(32, 2, price($this->TDataSituation[$col][$tva_tx_formated]['TVA'], 0, '', 1, -1, 2), '', 'R'); |
| 2934 | 2934 | } else { |
@@ -3008,7 +3008,7 @@ discard block |
||
| 3008 | 3008 | |
| 3009 | 3009 | $TDataSituation = array(); |
| 3010 | 3010 | |
| 3011 | - if (! empty($facDerniereSituation)) { |
|
| 3011 | + if (!empty($facDerniereSituation)) { |
|
| 3012 | 3012 | $TDataSituation['derniere_situation'] = $facDerniereSituation; |
| 3013 | 3013 | $TDataSituation['date_derniere_situation'] = $facDerniereSituation->date; |
| 3014 | 3014 | } |
@@ -3017,9 +3017,9 @@ discard block |
||
| 3017 | 3017 | $retenue_garantie_anterieure = 0; |
| 3018 | 3018 | // Init tous les champs à 0 |
| 3019 | 3019 | $TDataSituation['cumul_anterieur'] = array( |
| 3020 | - 'HT' => 0, //montant HT normal |
|
| 3021 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3022 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3020 | + 'HT' => 0, //montant HT normal |
|
| 3021 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3022 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3023 | 3023 | 'retenue_garantie' => 0, |
| 3024 | 3024 | 'travaux_sup' => 0, |
| 3025 | 3025 | 'HTnet' => 0, //montant HT |
@@ -3049,7 +3049,7 @@ discard block |
||
| 3049 | 3049 | $isFirstSituation = false; |
| 3050 | 3050 | if (!empty($l->fk_prev_id)) { |
| 3051 | 3051 | $prevSituationPercent = $l->get_prev_progress($previousInvoice->id, true); |
| 3052 | - } elseif (! array_key_exists($i + 1, $TPreviousInvoices)) { |
|
| 3052 | + } elseif (!array_key_exists($i + 1, $TPreviousInvoices)) { |
|
| 3053 | 3053 | $isFirstSituation = true; |
| 3054 | 3054 | } |
| 3055 | 3055 | |
@@ -3059,7 +3059,7 @@ discard block |
||
| 3059 | 3059 | |
| 3060 | 3060 | //1ere ligne |
| 3061 | 3061 | $amounttva = $calc_ht * ($ltvatx / 100); |
| 3062 | - if (! isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
| 3062 | + if (!isset($TDataSituation['cumul_anterieur'][$ltvatx])) { |
|
| 3063 | 3063 | $TDataSituation['cumul_anterieur'][$ltvatx]['HT'] = $calc_ht; |
| 3064 | 3064 | $TDataSituation['cumul_anterieur'][$ltvatx]['TVA'] = $amounttva; |
| 3065 | 3065 | } else { |
@@ -3071,14 +3071,14 @@ discard block |
||
| 3071 | 3071 | //le grand total de TVA |
| 3072 | 3072 | // $TDataSituation['cumul_anterieur']['TVA'] += $amounttva; |
| 3073 | 3073 | |
| 3074 | - if (empty($l->fk_prev_id) && ! $isFirstSituation) { |
|
| 3074 | + if (empty($l->fk_prev_id) && !$isFirstSituation) { |
|
| 3075 | 3075 | // TODO: à clarifier, mais pour moi, un facture de situation précédente qui a des progressions à 0% c'est pas logique |
| 3076 | 3076 | $TDataSituation['cumul_anterieur']['travaux_sup'] += $calc_ht; |
| 3077 | 3077 | } |
| 3078 | 3078 | } |
| 3079 | 3079 | } |
| 3080 | 3080 | |
| 3081 | - if (! empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
| 3081 | + if (!empty($previousInvoice->retained_warranty) && !getDolGlobalString('USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL')) { |
|
| 3082 | 3082 | $retenue_garantie_anterieure += $previousInvoice->getRetainedWarrantyAmount(); |
| 3083 | 3083 | } |
| 3084 | 3084 | |
@@ -3092,7 +3092,7 @@ discard block |
||
| 3092 | 3092 | // print json_encode($facDerniereSituation->lines);exit; |
| 3093 | 3093 | $TDataSituation['current'] = $this->btpGetInvoiceAmounts($object->id); |
| 3094 | 3094 | |
| 3095 | - if (! empty($facDerniereSituation->lines)) { |
|
| 3095 | + if (!empty($facDerniereSituation->lines)) { |
|
| 3096 | 3096 | $TFacLinesKey = array_keys($facDerniereSituation->lines); |
| 3097 | 3097 | $TObjectLinesKey = array_keys($object->lines); |
| 3098 | 3098 | $TDiffKey = array_diff($TObjectLinesKey, $TFacLinesKey); |
@@ -3286,7 +3286,7 @@ discard block |
||
| 3286 | 3286 | */ |
| 3287 | 3287 | public function btpGetInvoiceAmounts($id, $forceReadFromDB = false) |
| 3288 | 3288 | { |
| 3289 | - global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes; |
|
| 3289 | + global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblignes; |
|
| 3290 | 3290 | |
| 3291 | 3291 | $object = new Facture($db); |
| 3292 | 3292 | $object->fetch($id); |
@@ -3304,16 +3304,16 @@ discard block |
||
| 3304 | 3304 | $facDerniereSituation = $TPreviousInvoices[0]; |
| 3305 | 3305 | |
| 3306 | 3306 | $ret = array( |
| 3307 | - 'HT' => 0, //montant HT normal |
|
| 3307 | + 'HT' => 0, //montant HT normal |
|
| 3308 | 3308 | 'HTnet' => 0, //montant HT |
| 3309 | - 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3310 | - 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3309 | + 'TVA' => 0, //montant de la TVA sur le HTnet |
|
| 3310 | + 'TTC' => 0, //montant TTC (HTnet + TVA) |
|
| 3311 | 3311 | 'retenue_garantie' => 0, |
| 3312 | 3312 | 'travaux_sup' => 0, |
| 3313 | 3313 | 'total_a_payer' => 0 //montant "a payer" sur la facture |
| 3314 | 3314 | ); |
| 3315 | 3315 | |
| 3316 | - if (! empty($facDerniereSituation)) { |
|
| 3316 | + if (!empty($facDerniereSituation)) { |
|
| 3317 | 3317 | $ret['derniere_situation'] = $facDerniereSituation; |
| 3318 | 3318 | $ret['date_derniere_situation'] = $facDerniereSituation->date; |
| 3319 | 3319 | } |
@@ -3445,7 +3445,7 @@ discard block |
||
| 3445 | 3445 | $label = $outputlangs->transnoentities("SituationInvoiceTotalProposal"); |
| 3446 | 3446 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', 0, 1, $posx, $posy + 1); |
| 3447 | 3447 | |
| 3448 | - $amount = price($sign * ($total_ht + (! empty($propal->remise) ? $propal->remise : 0))); |
|
| 3448 | + $amount = price($sign * ($total_ht + (!empty($propal->remise) ? $propal->remise : 0))); |
|
| 3449 | 3449 | $pdf->MultiCell($width2, 3, $amount, 0, 'R', 0, 1, $posx + $width, $posy + 1); |
| 3450 | 3450 | |
| 3451 | 3451 | $pdf->SetFont('', '', $default_font_size - 1); |
@@ -3488,7 +3488,7 @@ discard block |
||
| 3488 | 3488 | |
| 3489 | 3489 | $force_to_zero = false; |
| 3490 | 3490 | |
| 3491 | - $idinv = 0;//count($previousinvoices); |
|
| 3491 | + $idinv = 0; //count($previousinvoices); |
|
| 3492 | 3492 | while ($idinv < count($previousinvoices)) { |
| 3493 | 3493 | $invoice = $previousinvoices[$idinv]; |
| 3494 | 3494 | |
@@ -3510,7 +3510,7 @@ discard block |
||
| 3510 | 3510 | $force_to_zero = true; |
| 3511 | 3511 | } |
| 3512 | 3512 | |
| 3513 | - $ref .= ' - '. $invoice->ref; |
|
| 3513 | + $ref .= ' - '.$invoice->ref; |
|
| 3514 | 3514 | $ref .= ' ('.dol_print_date($invoice->date, "%d/%m/%Y", false, $outputlangs).')'; |
| 3515 | 3515 | $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', 0); |
| 3516 | 3516 | |
@@ -3541,7 +3541,7 @@ discard block |
||
| 3541 | 3541 | if (($invoice->lines[$i]->info_bits & 0x01) == 0x01) { |
| 3542 | 3542 | $vatrate .= '*'; |
| 3543 | 3543 | } |
| 3544 | - if (! isset($tvas[$vatrate])) { |
|
| 3544 | + if (!isset($tvas[$vatrate])) { |
|
| 3545 | 3545 | $tvas[$vatrate] = 0; |
| 3546 | 3546 | } |
| 3547 | 3547 | $tvas[$vatrate] += $tvaligne; |
@@ -3719,7 +3719,7 @@ discard block |
||
| 3719 | 3719 | $pdf->SetXY($posx + $width4, $posy + $height * $index + $y); |
| 3720 | 3720 | $pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', 0); |
| 3721 | 3721 | $pdf->SetXY($posx + $width4 * 2, $posy + $height * $index + $y); |
| 3722 | - $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $payment['type']); |
|
| 3722 | + $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$payment['type']); |
|
| 3723 | 3723 | |
| 3724 | 3724 | $pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', 0); |
| 3725 | 3725 | $pdf->SetXY($posx + $width4 * 3, $posy + $height * $index + $y); |
@@ -3750,7 +3750,7 @@ discard block |
||
| 3750 | 3750 | $this->_pagehead($pdf, $object, 0, $outputlangs); |
| 3751 | 3751 | } |
| 3752 | 3752 | $pdf->setPage($pageposafter + 1); |
| 3753 | - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 3753 | + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 3754 | 3754 | |
| 3755 | 3755 | $posy = $this->tab_top_newpage + 1; |
| 3756 | 3756 | } else { |
@@ -3782,7 +3782,7 @@ discard block |
||
| 3782 | 3782 | |
| 3783 | 3783 | $posy += 10; |
| 3784 | 3784 | |
| 3785 | - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 3785 | + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. |
|
| 3786 | 3786 | |
| 3787 | 3787 | $pdf->SetTextColor(0, 0, 60); |
| 3788 | 3788 | $pdf->SetFont('', '', $default_font_size - 1); |