@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | } else { |
| 141 | 141 | dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); |
| 142 | 142 | } |
| 143 | - dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 143 | + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | $head[$h][1] .= '/'; |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $h = 0; |
| 256 | 256 | $head = array(); |
| 257 | 257 | |
| 258 | - $head[$h][0] = DOL_URL_ROOT . '/compta/facture/card-rec.php?id=' . $object->id; |
|
| 258 | + $head[$h][0] = DOL_URL_ROOT.'/compta/facture/card-rec.php?id='.$object->id; |
|
| 259 | 259 | $head[$h][1] = $langs->trans("RepeatableInvoice"); |
| 260 | 260 | $head[$h][2] = 'card'; |
| 261 | 261 | $h++; |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | } else { |
| 283 | 283 | dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR); |
| 284 | 284 | } |
| 285 | - dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 285 | + dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result. |
|
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | $head[$h][1] .= '/'; |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $h = 0; |
| 319 | 319 | $head = array(); |
| 320 | 320 | |
| 321 | - $head[$h][0] = DOL_URL_ROOT . '/fourn/facture/card-rec.php?id=' . $object->id; |
|
| 321 | + $head[$h][0] = DOL_URL_ROOT.'/fourn/facture/card-rec.php?id='.$object->id; |
|
| 322 | 322 | $head[$h][1] = $langs->trans("RepeatableSupplierInvoice"); |
| 323 | 323 | $head[$h][2] = 'card'; |
| 324 | 324 | $h++; |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $dolgraph->setShowPercent(1); |
| 450 | 450 | $dolgraph->SetType(array('bars', 'bars', 'bars', 'bars', 'bars', 'bars')); |
| 451 | 451 | //$dolgraph->SetType(array('pie')); |
| 452 | - $dolgraph->setHeight('160'); /* 160 min is required to show the 6 lines of legend */ |
|
| 452 | + $dolgraph->setHeight('160'); /* 160 min is required to show the 6 lines of legend */ |
|
| 453 | 453 | $dolgraph->setWidth('450'); |
| 454 | 454 | $dolgraph->setHideXValues(true); |
| 455 | 455 | if ($mode == 'customers') { |
@@ -200,7 +200,7 @@ |
||
| 200 | 200 | //Begin barcode with key: for barcode with key (EAN13...) calculate and substitute the last character (* or ?) used in the mask by the key |
| 201 | 201 | if ((substr($numFinal, -1) == '*') or (substr($numFinal, -1) == '?')) { // if last mask character is * or ? a joker, probably we have to calculate a key as last character (EAN13...) |
| 202 | 202 | $literaltype = ''; |
| 203 | - $literaltype = $this->literalBarcodeType($db, $type);//get literal_Barcode_Type |
|
| 203 | + $literaltype = $this->literalBarcodeType($db, $type); //get literal_Barcode_Type |
|
| 204 | 204 | switch ($literaltype) { |
| 205 | 205 | case 'EAN13': //EAN13 rowid = 2 |
| 206 | 206 | if (strlen($numFinal) == 13) {// be sure that the mask length is correct for EAN13 |
@@ -26,9 +26,9 @@ discard block |
||
| 26 | 26 | * \brief File of class with all html predefined components for WebPortal |
| 27 | 27 | */ |
| 28 | 28 | |
| 29 | -require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; |
|
| 30 | -require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php'; |
|
| 31 | -require_once DOL_DOCUMENT_ROOT . '/webportal/class/html.formwebportal.class.php'; |
|
| 29 | +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; |
|
| 30 | +require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; |
|
| 31 | +require_once DOL_DOCUMENT_ROOT.'/webportal/class/html.formwebportal.class.php'; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * Class to manage generation of HTML components |
@@ -135,10 +135,10 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // load module libraries |
| 138 | - dol_include_once('/webportal/class/webportal' . $elementEn . '.class.php'); |
|
| 138 | + dol_include_once('/webportal/class/webportal'.$elementEn.'.class.php'); |
|
| 139 | 139 | |
| 140 | 140 | // Initialize technical objects |
| 141 | - $objectclass = 'WebPortal' . ucfirst($elementEn); |
|
| 141 | + $objectclass = 'WebPortal'.ucfirst($elementEn); |
|
| 142 | 142 | $object = new $objectclass($this->db); |
| 143 | 143 | |
| 144 | 144 | // set form list |
@@ -148,18 +148,18 @@ discard block |
||
| 148 | 148 | $this->sortfield = GETPOST('sortfield', 'aZ09comma'); |
| 149 | 149 | $this->sortorder = GETPOST('sortorder', 'aZ09comma'); |
| 150 | 150 | $this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1; |
| 151 | - $this->titleKey = $objectclass . 'ListTitle'; |
|
| 151 | + $this->titleKey = $objectclass.'ListTitle'; |
|
| 152 | 152 | |
| 153 | 153 | // Initialize array of search criteria |
| 154 | 154 | //$search_all = GETPOST('search_all', 'alphanohtml'); |
| 155 | 155 | $search = array(); |
| 156 | 156 | foreach ($object->fields as $key => $val) { |
| 157 | - if (GETPOST('search_' . $key, 'alpha') !== '') { |
|
| 158 | - $search[$key] = GETPOST('search_' . $key, 'alpha'); |
|
| 157 | + if (GETPOST('search_'.$key, 'alpha') !== '') { |
|
| 158 | + $search[$key] = GETPOST('search_'.$key, 'alpha'); |
|
| 159 | 159 | } |
| 160 | 160 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 161 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 162 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 161 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 162 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 163 | 163 | // extract date YYYY-MM-DD for year, month and day |
| 164 | 164 | $dateStartArr = explode('-', $postDateStart); |
| 165 | 165 | $dateEndArr = explode('-', $postDateEnd); |
@@ -167,13 +167,13 @@ discard block |
||
| 167 | 167 | $dateStartYear = (int) $dateStartArr[0]; |
| 168 | 168 | $dateStartMonth = (int) $dateStartArr[1]; |
| 169 | 169 | $dateStartDay = (int) $dateStartArr[2]; |
| 170 | - $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 170 | + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, $dateStartMonth, $dateStartDay, $dateStartYear); |
|
| 171 | 171 | } |
| 172 | 172 | if (count($dateEndArr) == 3) { |
| 173 | 173 | $dateEndYear = (int) $dateEndArr[0]; |
| 174 | 174 | $dateEndMonth = (int) $dateEndArr[1]; |
| 175 | 175 | $dateEndDay = (int) $dateEndArr[2]; |
| 176 | - $search[$key . '_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 176 | + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, $dateEndMonth, $dateEndDay, $dateEndYear); |
|
| 177 | 177 | } |
| 178 | 178 | } |
| 179 | 179 | } |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | // If $val['visible']==0, then we never show the field |
| 189 | 189 | if (!empty($val['visible'])) { |
| 190 | 190 | $visible = (int) dol_eval($val['visible'], 1); |
| 191 | - $arrayfields['t.' . $key] = array( |
|
| 191 | + $arrayfields['t.'.$key] = array( |
|
| 192 | 192 | 'label' => $val['label'], |
| 193 | 193 | 'checked' => (($visible < 0) ? 0 : 1), |
| 194 | 194 | 'enabled' => (abs($visible) != 3 && (int) dol_eval($val['enabled'], 1)), |
@@ -224,8 +224,8 @@ discard block |
||
| 224 | 224 | foreach ($object->fields as $key => $val) { |
| 225 | 225 | $search[$key] = ''; |
| 226 | 226 | if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 227 | - $search[$key . '_dtstart'] = ''; |
|
| 228 | - $search[$key . '_dtend'] = ''; |
|
| 227 | + $search[$key.'_dtstart'] = ''; |
|
| 228 | + $search[$key.'_dtend'] = ''; |
|
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | $this->search = $search; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $offset = $limit * ($page - 1); |
| 281 | 281 | if (!$sortfield) { |
| 282 | 282 | reset($object->fields); // Reset is required to avoid key() to return null. |
| 283 | - $sortfield = 't.' . key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 283 | + $sortfield = 't.'.key($object->fields); // Set here default search field. By default 1st field in definition. |
|
| 284 | 284 | } |
| 285 | 285 | if (!$sortorder) { |
| 286 | 286 | $sortorder = 'DESC'; |
@@ -301,18 +301,18 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $sqlfields = $sql; // $sql fields to remove for count total |
| 303 | 303 | |
| 304 | - $sql .= " FROM " . $this->db->prefix() . $object->table_element . " as t"; |
|
| 304 | + $sql .= " FROM ".$this->db->prefix().$object->table_element." as t"; |
|
| 305 | 305 | // Add table from hooks |
| 306 | 306 | $parameters = array(); |
| 307 | 307 | $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook |
| 308 | 308 | $sql .= $hookmanager->resPrint; |
| 309 | 309 | if ($object->ismultientitymanaged == 1) { |
| 310 | - $sql .= " WHERE t.entity IN (" . getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)) . ")"; |
|
| 310 | + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; |
|
| 311 | 311 | } else { |
| 312 | 312 | $sql .= " WHERE 1 = 1"; |
| 313 | 313 | } |
| 314 | 314 | // filter on logged third-party |
| 315 | - $sql .= " AND t.fk_soc = " . ((int) $socid); |
|
| 315 | + $sql .= " AND t.fk_soc = ".((int) $socid); |
|
| 316 | 316 | // discard record with status draft |
| 317 | 317 | $sql .= " AND t.fk_statut <> 0"; |
| 318 | 318 | |
@@ -329,17 +329,17 @@ discard block |
||
| 329 | 329 | $mode_search = 2; |
| 330 | 330 | } |
| 331 | 331 | if ($search[$key] != '') { |
| 332 | - $sql .= natural_search("t." . $this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 332 | + $sql .= natural_search("t.".$this->db->escape($key), $search[$key], (($key == 'status' || $key == 'fk_statut') ? ($search[$key] < 0 ? 1 : 2) : $mode_search)); |
|
| 333 | 333 | } |
| 334 | 334 | } else { |
| 335 | 335 | if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { |
| 336 | 336 | $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); |
| 337 | 337 | if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { |
| 338 | 338 | if (preg_match('/_dtstart$/', $key)) { |
| 339 | - $sql .= " AND t." . $this->db->escape($columnName) . " >= '" . $this->db->idate($search[$key]) . "'"; |
|
| 339 | + $sql .= " AND t.".$this->db->escape($columnName)." >= '".$this->db->idate($search[$key])."'"; |
|
| 340 | 340 | } |
| 341 | 341 | if (preg_match('/_dtend$/', $key)) { |
| 342 | - $sql .= " AND t." . $this->db->escape($columnName) . " <= '" . $this->db->idate($search[$key]) . "'"; |
|
| 342 | + $sql .= " AND t.".$this->db->escape($columnName)." <= '".$this->db->idate($search[$key])."'"; |
|
| 343 | 343 | } |
| 344 | 344 | } |
| 345 | 345 | } |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | $nbtotalofrecords = 0; |
| 358 | 358 | if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { |
| 359 | 359 | /* The fast and low memory method to get and count full list converts the sql into a sql count */ |
| 360 | - $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 360 | + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); |
|
| 361 | 361 | $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); |
| 362 | 362 | $resql = $this->db->query($sqlforcount); |
| 363 | 363 | if ($resql) { |
@@ -410,21 +410,21 @@ discard block |
||
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | $param = ''; |
| 413 | - $param .= '&contextpage=' . urlencode($contextpage); |
|
| 414 | - $param .= '&limit=' . $limit; |
|
| 413 | + $param .= '&contextpage='.urlencode($contextpage); |
|
| 414 | + $param .= '&limit='.$limit; |
|
| 415 | 415 | foreach ($search as $key => $val) { |
| 416 | 416 | if (is_array($search[$key])) { |
| 417 | 417 | foreach ($search[$key] as $skey) { |
| 418 | 418 | if ($skey != '') { |
| 419 | - $param .= '&search_' . $key . '[]=' . urlencode($skey); |
|
| 419 | + $param .= '&search_'.$key.'[]='.urlencode($skey); |
|
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { |
| 423 | - $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); |
|
| 424 | - $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); |
|
| 425 | - $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); |
|
| 423 | + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); |
|
| 424 | + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); |
|
| 425 | + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); |
|
| 426 | 426 | } elseif ($search[$key] != '') { |
| 427 | - $param .= '&search_' . $key . '=' . urlencode($search[$key]); |
|
| 427 | + $param .= '&search_'.$key.'='.urlencode($search[$key]); |
|
| 428 | 428 | } |
| 429 | 429 | } |
| 430 | 430 | // Add $param from hooks |
@@ -433,29 +433,29 @@ discard block |
||
| 433 | 433 | $param .= $hookmanager->resPrint; |
| 434 | 434 | |
| 435 | 435 | $url_file = $context->getControllerUrl($context->controller); |
| 436 | - $html .= '<form method="POST" id="searchFormList" action="' . $url_file . '">' . "\n"; |
|
| 436 | + $html .= '<form method="POST" id="searchFormList" action="'.$url_file.'">'."\n"; |
|
| 437 | 437 | $html .= $context->getFormToken(); |
| 438 | 438 | $html .= '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; |
| 439 | 439 | $html .= '<input type="hidden" name="action" value="list">'; |
| 440 | - $html .= '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
| 441 | - $html .= '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
| 442 | - $html .= '<input type="hidden" name="page" value="' . $page . '">'; |
|
| 443 | - $html .= '<input type="hidden" name="contextpage" value="' . $contextpage . '">'; |
|
| 440 | + $html .= '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
| 441 | + $html .= '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
| 442 | + $html .= '<input type="hidden" name="page" value="'.$page.'">'; |
|
| 443 | + $html .= '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; |
|
| 444 | 444 | |
| 445 | 445 | // pagination |
| 446 | - $pagination_param = $param . '&sortfield=' . $sortfield . '&sortorder=' . $sortorder; |
|
| 447 | - $html .= '<nav id="webportal-' . $elementEn . '-pagination">'; |
|
| 446 | + $pagination_param = $param.'&sortfield='.$sortfield.'&sortorder='.$sortorder; |
|
| 447 | + $html .= '<nav id="webportal-'.$elementEn.'-pagination">'; |
|
| 448 | 448 | $html .= '<ul>'; |
| 449 | - $html .= '<li><strong>' . $langs->trans($titleKey) . '</strong> (' . $nbtotalofrecords . ')</li>'; |
|
| 449 | + $html .= '<li><strong>'.$langs->trans($titleKey).'</strong> ('.$nbtotalofrecords.')</li>'; |
|
| 450 | 450 | $html .= '</ul>'; |
| 451 | 451 | |
| 452 | 452 | /* Generate pagination list */ |
| 453 | - $html .= static::generatePageListNav($url_file . $pagination_param, $nbpages, $page); |
|
| 453 | + $html .= static::generatePageListNav($url_file.$pagination_param, $nbpages, $page); |
|
| 454 | 454 | |
| 455 | 455 | $html .= '</nav>'; |
| 456 | 456 | |
| 457 | 457 | // table with search filters and column titles |
| 458 | - $html .= '<table id="webportal-' . $elementEn . '-list" responsive="scroll" role="grid">'; |
|
| 458 | + $html .= '<table id="webportal-'.$elementEn.'-list" responsive="scroll" role="grid">'; |
|
| 459 | 459 | // title and desc for table |
| 460 | 460 | //if ($titleKey != '') { |
| 461 | 461 | // $html .= '<caption id="table-collapse-responsive">'; |
@@ -479,22 +479,22 @@ discard block |
||
| 479 | 479 | $html .= '</td>'; |
| 480 | 480 | // } |
| 481 | 481 | foreach ($object->fields as $key => $val) { |
| 482 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 483 | - $html .= '<td data-label="' . $arrayfields['t.' . $key]['label'] . '" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 482 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 483 | + $html .= '<td data-label="'.$arrayfields['t.'.$key]['label'].'" data-col="'.dol_escape_htmltag($key).'" >'; |
|
| 484 | 484 | if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { |
| 485 | - $html .= $this->form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 485 | + $html .= $this->form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', ''); |
|
| 486 | 486 | } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { |
| 487 | - $postDateStart = GETPOST('search_' . $key . '_dtstart', 'alphanohtml'); |
|
| 488 | - $postDateEnd = GETPOST('search_' . $key . '_dtend', 'alphanohtml'); |
|
| 487 | + $postDateStart = GETPOST('search_'.$key.'_dtstart', 'alphanohtml'); |
|
| 488 | + $postDateEnd = GETPOST('search_'.$key.'_dtend', 'alphanohtml'); |
|
| 489 | 489 | |
| 490 | 490 | $html .= '<div class="grid">'; |
| 491 | - $html .= $this->form->inputDate('search_' . $key . '_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 491 | + $html .= $this->form->inputDate('search_'.$key.'_dtstart', $postDateStart ? $postDateStart : '', $langs->trans('From')); |
|
| 492 | 492 | $html .= '</div>'; |
| 493 | 493 | $html .= '<div class="grid">'; |
| 494 | - $html .= $this->form->inputDate('search_' . $key . '_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 494 | + $html .= $this->form->inputDate('search_'.$key.'_dtend', $postDateEnd ? $postDateEnd : '', $langs->trans('to')); |
|
| 495 | 495 | $html .= '</div>'; |
| 496 | 496 | } else { |
| 497 | - $html .= '<input type="text" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">'; |
|
| 497 | + $html .= '<input type="text" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">'; |
|
| 498 | 498 | } |
| 499 | 499 | $html .= '</td>'; |
| 500 | 500 | } |
@@ -505,12 +505,12 @@ discard block |
||
| 505 | 505 | $html .= $hookmanager->resPrint; |
| 506 | 506 | // Remain to pay |
| 507 | 507 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 508 | - $html .= '<td data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 508 | + $html .= '<td data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 509 | 509 | $html .= '</td>'; |
| 510 | 510 | } |
| 511 | 511 | // Download link |
| 512 | 512 | if (!empty($arrayfields['download_link']['checked'])) { |
| 513 | - $html .= '<td data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 513 | + $html .= '<td data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 514 | 514 | $html .= '</td>'; |
| 515 | 515 | } |
| 516 | 516 | $html .= '</tr>'; |
@@ -528,16 +528,16 @@ discard block |
||
| 528 | 528 | $totalarray['nbfield']++; |
| 529 | 529 | // } |
| 530 | 530 | foreach ($object->fields as $key => $val) { |
| 531 | - $tableKey = 't.' . $key; |
|
| 531 | + $tableKey = 't.'.$key; |
|
| 532 | 532 | if (!empty($arrayfields[$tableKey]['checked'])) { |
| 533 | 533 | $tableOrder = ''; |
| 534 | 534 | if (array_key_exists($tableKey, $sortList)) { |
| 535 | 535 | $tableOrder = strtolower($sortList[$tableKey]); |
| 536 | 536 | } |
| 537 | - $url_param = $url_file . '&sortfield=' . $tableKey . '&sortorder=' . ($tableOrder == 'desc' ? 'asc' : 'desc') . $param; |
|
| 538 | - $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"' . ($tableOrder != '' ? ' table-order="' . $tableOrder . '"' : '') . '>'; |
|
| 539 | - $html .= '<a href="' . $url_param . '">'; |
|
| 540 | - $html .= $langs->trans($arrayfields['t.' . $key]['label']); |
|
| 537 | + $url_param = $url_file.'&sortfield='.$tableKey.'&sortorder='.($tableOrder == 'desc' ? 'asc' : 'desc').$param; |
|
| 538 | + $html .= '<th data-col="'.dol_escape_htmltag($key).'" scope="col"'.($tableOrder != '' ? ' table-order="'.$tableOrder.'"' : '').'>'; |
|
| 539 | + $html .= '<a href="'.$url_param.'">'; |
|
| 540 | + $html .= $langs->trans($arrayfields['t.'.$key]['label']); |
|
| 541 | 541 | $html .= '</a>'; |
| 542 | 542 | $html .= '</th>'; |
| 543 | 543 | $totalarray['nbfield']++; |
@@ -607,13 +607,13 @@ discard block |
||
| 607 | 607 | $remaintopay = 0; |
| 608 | 608 | } |
| 609 | 609 | if ($object->type == Facture::TYPE_CREDIT_NOTE && $obj->paye == 1 && $discount) { |
| 610 | - $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source=' . $object->id); |
|
| 610 | + $remaincreditnote = $discount->getAvailableDiscounts($companyStatic, '', 'rc.fk_facture_source='.$object->id); |
|
| 611 | 611 | $remaintopay = -$remaincreditnote; |
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | // Show line of result |
| 616 | - $html .= '<tr data-rowid="' . $object->id . '">'; |
|
| 616 | + $html .= '<tr data-rowid="'.$object->id.'">'; |
|
| 617 | 617 | // if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { |
| 618 | 618 | $html .= '<td class="nowraponall">'; |
| 619 | 619 | $html .= '</td>'; |
@@ -622,8 +622,8 @@ discard block |
||
| 622 | 622 | } |
| 623 | 623 | // } |
| 624 | 624 | foreach ($object->fields as $key => $val) { |
| 625 | - if (!empty($arrayfields['t.' . $key]['checked'])) { |
|
| 626 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['t.' . $key]['label'] . '">'; |
|
| 625 | + if (!empty($arrayfields['t.'.$key]['checked'])) { |
|
| 626 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['t.'.$key]['label'].'">'; |
|
| 627 | 627 | if ($key == 'status' || $key == 'fk_statut') { |
| 628 | 628 | if ($elementEn == 'invoice') { |
| 629 | 629 | // specific to get invoice status (depends on payment) |
@@ -644,21 +644,21 @@ discard block |
||
| 644 | 644 | } |
| 645 | 645 | if (!empty($val['isameasure']) && $val['isameasure'] == 1) { |
| 646 | 646 | if (!$i) { |
| 647 | - $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key; |
|
| 647 | + $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key; |
|
| 648 | 648 | } |
| 649 | 649 | if (!isset($totalarray['val'])) { |
| 650 | 650 | $totalarray['val'] = array(); |
| 651 | 651 | } |
| 652 | - if (!isset($totalarray['val']['t.' . $key])) { |
|
| 653 | - $totalarray['val']['t.' . $key] = 0; |
|
| 652 | + if (!isset($totalarray['val']['t.'.$key])) { |
|
| 653 | + $totalarray['val']['t.'.$key] = 0; |
|
| 654 | 654 | } |
| 655 | - $totalarray['val']['t.' . $key] += $object->$key; |
|
| 655 | + $totalarray['val']['t.'.$key] += $object->$key; |
|
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | } |
| 659 | 659 | // Remain to pay |
| 660 | 660 | if (!empty($arrayfields['remain_to_pay']['checked'])) { |
| 661 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['remain_to_pay']['label'] . '">'; |
|
| 661 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['remain_to_pay']['label'].'">'; |
|
| 662 | 662 | $html .= $this->form->showOutputFieldForObject($object, $arrayfields['remain_to_pay'], 'remain_to_pay', $remaintopay, ''); |
| 663 | 663 | //$html .= price($remaintopay); |
| 664 | 664 | $html .= '</td>'; |
@@ -669,9 +669,9 @@ discard block |
||
| 669 | 669 | // Download link |
| 670 | 670 | if (!empty($arrayfields['download_link']['checked'])) { |
| 671 | 671 | $element = $object->element; |
| 672 | - $html .= '<td class="nowraponall" data-label="' . $arrayfields['download_link']['label'] . '">'; |
|
| 672 | + $html .= '<td class="nowraponall" data-label="'.$arrayfields['download_link']['label'].'">'; |
|
| 673 | 673 | $filename = dol_sanitizeFileName($obj->ref); |
| 674 | - $filedir = $conf->{$element}->multidir_output[$obj->element_entity] . '/' . dol_sanitizeFileName($obj->ref); |
|
| 674 | + $filedir = $conf->{$element}->multidir_output[$obj->element_entity].'/'.dol_sanitizeFileName($obj->ref); |
|
| 675 | 675 | $html .= $this->form->getDocumentsLink($element, $filename, $filedir); |
| 676 | 676 | $html .= '</td>'; |
| 677 | 677 | if (!$i) { |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | $html .= '</td>'; |
| 709 | 709 | } else { |
| 710 | 710 | if ($i == 1) { |
| 711 | - $html .= '<td>' . $langs->trans("Total") . '</td>'; |
|
| 711 | + $html .= '<td>'.$langs->trans("Total").'</td>'; |
|
| 712 | 712 | } else { |
| 713 | 713 | $html .= '<td></td>'; |
| 714 | 714 | } |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | $colspan++; |
| 726 | 726 | } |
| 727 | 727 | } |
| 728 | - $html .= '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>'; |
|
| 728 | + $html .= '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>'; |
|
| 729 | 729 | } |
| 730 | 730 | |
| 731 | 731 | $html .= '</tbody>'; |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | $html = '<ul class="pages-nav-list">'; |
| 766 | 766 | |
| 767 | 767 | if ($currentPage > 1) { |
| 768 | - $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>'; |
|
| 768 | + $html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="'.$url.$pSep.'page='.($currentPage - 1).'" '.($currentPage <= 1 ? ' disabled' : '').'></a></li>'; |
|
| 769 | 769 | } |
| 770 | 770 | |
| 771 | 771 | $maxPaginItem = min($nbPages, 5); |
@@ -773,21 +773,21 @@ discard block |
||
| 773 | 773 | $maxPageNum = min($nbPages, $currentPage + 3); |
| 774 | 774 | |
| 775 | 775 | if ($minPageNum > 1) { |
| 776 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>'; |
|
| 776 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == 1 ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="'.$url.$pSep.'page=1" >1</a></li>'; |
|
| 777 | 777 | $html .= '<li>…</li>'; |
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | for ($p = $minPageNum; $p <= $maxPageNum; $p++) { |
| 781 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>'; |
|
| 781 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage === $p ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="'.$url.$pSep.'page='.$p.'">'.$p.'</a></li>'; |
|
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | if ($maxPaginItem < $nbPages) { |
| 785 | 785 | $html .= '<li>…</li>'; |
| 786 | - $html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>'; |
|
| 786 | + $html .= '<li><a class="pages-nav-list__link '.($currentPage == $nbPages ? '--active' : '').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="'.$url.$pSep.'page='.$nbPages.'">'.$nbPages.'</a></li>'; |
|
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | if ($currentPage < $nbPages) { |
| 790 | - $html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>'; |
|
| 790 | + $html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="'.$url.$pSep.'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>'; |
|
| 791 | 791 | } |
| 792 | 792 | |
| 793 | 793 | $html .= '</ul>'; |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | $permissiontoadd = $user->hasRight('projet', 'creer'); |
| 113 | 113 | $permissiontodelete = $user->hasRight('projet', 'supprimer'); |
| 114 | -$permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include of actions_dellink.inc.php |
|
| 114 | +$permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include of actions_dellink.inc.php |
|
| 115 | 115 | |
| 116 | 116 | |
| 117 | 117 | /* |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $action = ''; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
| 165 | + include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once |
|
| 166 | 166 | |
| 167 | 167 | // Action setdraft object |
| 168 | 168 | if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) { |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | $object->date_end_event = (!GETPOST('date_end_event')) ? '' : $date_end_event; |
| 323 | 323 | $object->location = $location; |
| 324 | 324 | if (GETPOSTISSET('opp_amount')) { |
| 325 | - $object->opp_amount = price2num(GETPOST('opp_amount', 'alpha')); |
|
| 325 | + $object->opp_amount = price2num(GETPOST('opp_amount', 'alpha')); |
|
| 326 | 326 | } |
| 327 | 327 | if (GETPOSTISSET('budget_amount')) { |
| 328 | 328 | $object->budget_amount = price2num(GETPOST('budget_amount', 'alpha')); |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { |
| 511 | 511 | $tmpurl = $_SESSION['pageforbacktolist']['project']; |
| 512 | 512 | $tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); |
| 513 | - $urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1'; |
|
| 513 | + $urlback = $tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1'; |
|
| 514 | 514 | } else { |
| 515 | 515 | $urlback = DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1'; |
| 516 | 516 | } |
@@ -1071,7 +1071,7 @@ discard block |
||
| 1071 | 1071 | print '<br>'; |
| 1072 | 1072 | } |
| 1073 | 1073 | if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { |
| 1074 | - print '<input type="checkbox" id="usage_task" name="usage_task"' . (GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')) . '> '; |
|
| 1074 | + print '<input type="checkbox" id="usage_task" name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_task ? ' checked="checked"' : '')).'> '; |
|
| 1075 | 1075 | $htmltext = $langs->trans("ProjectFollowTasks"); |
| 1076 | 1076 | print '<label for="usage_task">'.$form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext).'</label>'; |
| 1077 | 1077 | print '<script>'; |
@@ -1097,7 +1097,7 @@ discard block |
||
| 1097 | 1097 | print '<br>'; |
| 1098 | 1098 | } |
| 1099 | 1099 | if (!getDolGlobalString('PROJECT_HIDE_TASKS') && getDolGlobalString('PROJECT_BILL_TIME_SPENT')) { |
| 1100 | - print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"' . (GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')) . '> '; |
|
| 1100 | + print '<input type="checkbox" id="usage_bill_time" name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_bill_time ? ' checked="checked"' : '')).'> '; |
|
| 1101 | 1101 | $htmltext = $langs->trans("ProjectBillTimeDescription"); |
| 1102 | 1102 | print '<label for="usage_bill_time">'.$form->textwithpicto($langs->trans("BillTime"), $htmltext).'</label>'; |
| 1103 | 1103 | print '<script>'; |
@@ -1123,7 +1123,7 @@ discard block |
||
| 1123 | 1123 | print '<br>'; |
| 1124 | 1124 | } |
| 1125 | 1125 | if (isModEnabled('eventorganization')) { |
| 1126 | - print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'. (GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')) . '> '; |
|
| 1126 | + print '<input type="checkbox" id="usage_organize_event" name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($object->usage_organize_event ? ' checked="checked"' : '')).'> '; |
|
| 1127 | 1127 | $htmltext = $langs->trans("EventOrganizationDescriptionLong"); |
| 1128 | 1128 | print '<label for="usage_organize_event">'.$form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext).'</label>'; |
| 1129 | 1129 | print '<script>'; |
@@ -1302,7 +1302,7 @@ discard block |
||
| 1302 | 1302 | if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['project'])) { |
| 1303 | 1303 | $tmpurl = $_SESSION['pageforbacktolist']['project']; |
| 1304 | 1304 | $tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl); |
| 1305 | - $linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?'). 'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
|
| 1305 | + $linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
|
| 1306 | 1306 | } else { |
| 1307 | 1307 | $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; |
| 1308 | 1308 | } |
@@ -1390,8 +1390,8 @@ discard block |
||
| 1390 | 1390 | print '<a class="editfielda paddingtop" href="'.$_SERVER["PHP_SELF"].'?action=edit_opp_status&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('Edit'), 1).'</a>'; |
| 1391 | 1391 | } |
| 1392 | 1392 | print '</td><td>'; |
| 1393 | - $html_name_status = ($action == 'edit_opp_status') ? 'opp_status' : 'none'; |
|
| 1394 | - $html_name_percent = ($action == 'edit_opp_status') ? 'opp_percent' : 'none'; |
|
| 1393 | + $html_name_status = ($action == 'edit_opp_status') ? 'opp_status' : 'none'; |
|
| 1394 | + $html_name_percent = ($action == 'edit_opp_status') ? 'opp_percent' : 'none'; |
|
| 1395 | 1395 | $percent_value = (GETPOSTISSET('opp_percent') ? GETPOST('opp_percent') : (strcmp($object->opp_percent, '') ? vatrate($object->opp_percent) : '')); |
| 1396 | 1396 | $formproject->formOpportunityStatus($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->opp_status, $percent_value, $html_name_status, $html_name_percent); |
| 1397 | 1397 | print '</td></tr>'; |
@@ -1602,7 +1602,7 @@ discard block |
||
| 1602 | 1602 | if ($userWrite > 0) { |
| 1603 | 1603 | print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=confirm_setdraft&confirm=yes&token='.newToken().'&id='.$object->id, ''); |
| 1604 | 1604 | } else { |
| 1605 | - print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1605 | + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('SetToDraft'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1606 | 1606 | } |
| 1607 | 1607 | } |
| 1608 | 1608 | } |
@@ -1612,7 +1612,7 @@ discard block |
||
| 1612 | 1612 | if ($userWrite > 0) { |
| 1613 | 1613 | print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, ''); |
| 1614 | 1614 | } else { |
| 1615 | - print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1615 | + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Modify'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1616 | 1616 | } |
| 1617 | 1617 | } |
| 1618 | 1618 | |
@@ -1621,7 +1621,7 @@ discard block |
||
| 1621 | 1621 | if ($userWrite > 0) { |
| 1622 | 1622 | print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&token='.newToken().'&id='.$object->id, ''); |
| 1623 | 1623 | } else { |
| 1624 | - print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1624 | + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1625 | 1625 | } |
| 1626 | 1626 | } |
| 1627 | 1627 | |
@@ -1630,7 +1630,7 @@ discard block |
||
| 1630 | 1630 | if ($userWrite > 0) { |
| 1631 | 1631 | print dolGetButtonAction('', $langs->trans('Close'), 'default', $_SERVER["PHP_SELF"].'?action=close&token='.newToken().'&id='.$object->id, ''); |
| 1632 | 1632 | } else { |
| 1633 | - print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1633 | + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Close'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1634 | 1634 | } |
| 1635 | 1635 | } |
| 1636 | 1636 | |
@@ -1639,7 +1639,7 @@ discard block |
||
| 1639 | 1639 | if ($userWrite > 0) { |
| 1640 | 1640 | print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, ''); |
| 1641 | 1641 | } else { |
| 1642 | - print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1642 | + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ReOpen'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1643 | 1643 | } |
| 1644 | 1644 | } |
| 1645 | 1645 | |
@@ -1668,7 +1668,7 @@ discard block |
||
| 1668 | 1668 | if ($userWrite > 0) { |
| 1669 | 1669 | print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id, ''); |
| 1670 | 1670 | } else { |
| 1671 | - print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1671 | + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1672 | 1672 | } |
| 1673 | 1673 | } |
| 1674 | 1674 | |
@@ -1677,7 +1677,7 @@ discard block |
||
| 1677 | 1677 | if ($userDelete > 0 || ($object->statut == Project::STATUS_DRAFT && $user->hasRight('projet', 'creer'))) { |
| 1678 | 1678 | print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, ''); |
| 1679 | 1679 | } else { |
| 1680 | - print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false); |
|
| 1680 | + print dolGetButtonAction($langs->trans('NotOwnerOfProject'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false); |
|
| 1681 | 1681 | } |
| 1682 | 1682 | } |
| 1683 | 1683 | } |
@@ -145,38 +145,38 @@ discard block |
||
| 145 | 145 | $search_date_start_startmonth = GETPOSTINT('search_date_start_startmonth'); |
| 146 | 146 | $search_date_start_startyear = GETPOSTINT('search_date_start_startyear'); |
| 147 | 147 | $search_date_start_startday = GETPOSTINT('search_date_start_startday'); |
| 148 | -$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
| 148 | +$search_date_start_start = dol_mktime(0, 0, 0, $search_date_start_startmonth, $search_date_start_startday, $search_date_start_startyear); // Use tzserver |
|
| 149 | 149 | $search_date_start_endmonth = GETPOSTINT('search_date_start_endmonth'); |
| 150 | 150 | $search_date_start_endyear = GETPOSTINT('search_date_start_endyear'); |
| 151 | 151 | $search_date_start_endday = GETPOSTINT('search_date_start_endday'); |
| 152 | -$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
| 152 | +$search_date_start_end = dol_mktime(23, 59, 59, $search_date_start_endmonth, $search_date_start_endday, $search_date_start_endyear); // Use tzserver |
|
| 153 | 153 | |
| 154 | 154 | $search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth'); |
| 155 | 155 | $search_date_end_startyear = GETPOSTINT('search_date_end_startyear'); |
| 156 | 156 | $search_date_end_startday = GETPOSTINT('search_date_end_startday'); |
| 157 | -$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
| 157 | +$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver |
|
| 158 | 158 | $search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth'); |
| 159 | 159 | $search_date_end_endyear = GETPOSTINT('search_date_end_endyear'); |
| 160 | 160 | $search_date_end_endday = GETPOSTINT('search_date_end_endday'); |
| 161 | -$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
| 161 | +$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); // Use tzserver |
|
| 162 | 162 | |
| 163 | 163 | $search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); |
| 164 | 164 | $search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); |
| 165 | 165 | $search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); |
| 166 | -$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
| 166 | +$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver |
|
| 167 | 167 | $search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); |
| 168 | 168 | $search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); |
| 169 | 169 | $search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); |
| 170 | -$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
| 170 | +$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver |
|
| 171 | 171 | |
| 172 | 172 | $search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth'); |
| 173 | 173 | $search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear'); |
| 174 | 174 | $search_date_modif_startday = GETPOSTINT('search_date_modif_startday'); |
| 175 | -$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
| 175 | +$search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver |
|
| 176 | 176 | $search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth'); |
| 177 | 177 | $search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear'); |
| 178 | 178 | $search_date_modif_endday = GETPOSTINT('search_date_modif_endday'); |
| 179 | -$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
| 179 | +$search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver |
|
| 180 | 180 | |
| 181 | 181 | $search_category_array = array(); |
| 182 | 182 | |
@@ -262,14 +262,14 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | $object->fields = dol_sort_array($object->fields, 'position'); |
| 264 | 264 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
| 265 | -'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 265 | +'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan |
|
| 266 | 266 | |
| 267 | 267 | // Add a groupby field. Set $groupby and $groupbyvalues. |
| 268 | 268 | // TODO Move this into a inc file |
| 269 | 269 | if ($mode == 'kanban') { |
| 270 | 270 | $groupbyold = null; |
| 271 | 271 | $groupbyvalues = array(); |
| 272 | - $groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' |
|
| 272 | + $groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut' |
|
| 273 | 273 | $groupbyfield = preg_replace('/[a-z]\./', '', $groupby); |
| 274 | 274 | if (!empty($object->fields[$groupbyfield]['alias'])) { |
| 275 | 275 | $groupbyfield = $object->fields[$groupbyfield]['alias']; |
@@ -718,7 +718,7 @@ discard block |
||
| 718 | 718 | if ($searchCategoryProjectOperator == 0) { |
| 719 | 719 | $searchCategoryProjectSqlList[] = " EXISTS (SELECT ck.fk_project FROM ".MAIN_DB_PREFIX."categorie_project as ck WHERE p.rowid = ck.fk_project AND ck.fk_categorie = ".((int) $searchCategoryProject).")"; |
| 720 | 720 | } else { |
| 721 | - $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProject); |
|
| 721 | + $listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProject); |
|
| 722 | 722 | } |
| 723 | 723 | } |
| 724 | 724 | } |
@@ -921,7 +921,7 @@ discard block |
||
| 921 | 921 | $param .= '&search_date_end_endday='.urlencode((string) ($search_date_end_endday)); |
| 922 | 922 | } |
| 923 | 923 | if ($search_date_end_end) { |
| 924 | - $param .= '&search_date_end_end=' . urlencode($search_date_end_end); |
|
| 924 | + $param .= '&search_date_end_end='.urlencode($search_date_end_end); |
|
| 925 | 925 | } |
| 926 | 926 | if ($search_date_creation_startmonth) { |
| 927 | 927 | $param .= '&search_date_creation_startmonth='.urlencode((string) ($search_date_creation_startmonth)); |
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | $param .= '&search_date_modif_endday='.urlencode((string) ($search_date_modif_endday)); |
| 970 | 970 | } |
| 971 | 971 | if ($search_date_modif_end) { |
| 972 | - $param .= '&search_date_modif_end=' . urlencode($search_date_modif_end); |
|
| 972 | + $param .= '&search_date_modif_end='.urlencode($search_date_modif_end); |
|
| 973 | 973 | } |
| 974 | 974 | if (!empty($search_category_array)) { |
| 975 | 975 | foreach ($search_category_array as $tmpval) { |
@@ -1190,7 +1190,7 @@ discard block |
||
| 1190 | 1190 | } |
| 1191 | 1191 | |
| 1192 | 1192 | $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; |
| 1193 | -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 1193 | +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup |
|
| 1194 | 1194 | $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); |
| 1195 | 1195 | $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); |
| 1196 | 1196 | |
@@ -1651,18 +1651,18 @@ discard block |
||
| 1651 | 1651 | |
| 1652 | 1652 | if (!empty($groupby)) { |
| 1653 | 1653 | if (is_null($groupbyold)) { |
| 1654 | - print '<div class="box-flex-container-columns kanban">'; // Start div for all kanban columns |
|
| 1654 | + print '<div class="box-flex-container-columns kanban">'; // Start div for all kanban columns |
|
| 1655 | 1655 | } |
| 1656 | 1656 | // Start kanban column |
| 1657 | 1657 | if ($groupbyold !== $obj->$groupbyfield) { |
| 1658 | 1658 | if (!is_null($groupbyold)) { |
| 1659 | - print '</div>'; // We need a new kanban column - end box-flex-container |
|
| 1659 | + print '</div>'; // We need a new kanban column - end box-flex-container |
|
| 1660 | 1660 | } |
| 1661 | 1661 | // TODO Create kanban column for all values into $groupbyvalues, until we reach the new $obj->$groupbyfield |
| 1662 | 1662 | // |
| 1663 | 1663 | //var_dump($groupbyvalues); |
| 1664 | 1664 | //var_dump($obj->$groupbyfield); |
| 1665 | - print '<div class="box-flex-container-column kanban column" data-html="column_'.preg_replace('/[^a-z0-9]/', '', $obj->$groupbyfield).'">'; // Start new column |
|
| 1665 | + print '<div class="box-flex-container-column kanban column" data-html="column_'.preg_replace('/[^a-z0-9]/', '', $obj->$groupbyfield).'">'; // Start new column |
|
| 1666 | 1666 | } |
| 1667 | 1667 | $groupbyold = $obj->$groupbyfield; |
| 1668 | 1668 | } elseif ($i == 0) { |
@@ -1685,10 +1685,10 @@ discard block |
||
| 1685 | 1685 | if ($i == ($imaxinloop - 1)) { |
| 1686 | 1686 | // Close kanban column |
| 1687 | 1687 | if (!empty($groupby)) { |
| 1688 | - print '</div>'; // end box-flex-container |
|
| 1689 | - print '</div>'; // end box-flex-container-columns |
|
| 1688 | + print '</div>'; // end box-flex-container |
|
| 1689 | + print '</div>'; // end box-flex-container-columns |
|
| 1690 | 1690 | } else { |
| 1691 | - print '</div>'; // end box-flex-container |
|
| 1691 | + print '</div>'; // end box-flex-container |
|
| 1692 | 1692 | } |
| 1693 | 1693 | |
| 1694 | 1694 | print '</td></tr>'; |
@@ -582,8 +582,8 @@ discard block |
||
| 582 | 582 | $sql .= "ip"; |
| 583 | 583 | $sql .= ") VALUES ("; |
| 584 | 584 | $sql .= "'(PROV)', "; |
| 585 | - $sql .= "'".$this->db->idate($now)."', "; // date creation |
|
| 586 | - $sql .= "'".$this->db->idate($this->datep)."', "; // date start event |
|
| 585 | + $sql .= "'".$this->db->idate($now)."', "; // date creation |
|
| 586 | + $sql .= "'".$this->db->idate($this->datep)."', "; // date start event |
|
| 587 | 587 | $sql .= (strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : "null").", "; |
| 588 | 588 | $sql .= ((isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '') ? "'".$this->db->escape($this->durationp)."'" : "null").", "; // deprecated |
| 589 | 589 | $sql .= (isset($this->type_id) ? $this->type_id : "null").","; |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | $resql = $this->db->query($sql); |
| 658 | 658 | if (!$resql) { |
| 659 | 659 | $error++; |
| 660 | - dol_syslog('Error to process userassigned: ' . $this->db->lasterror(), LOG_ERR); |
|
| 660 | + dol_syslog('Error to process userassigned: '.$this->db->lasterror(), LOG_ERR); |
|
| 661 | 661 | $this->errors[] = $this->db->lasterror(); |
| 662 | 662 | } else { |
| 663 | 663 | $already_inserted[$val['id']] = true; |
@@ -682,7 +682,7 @@ discard block |
||
| 682 | 682 | $resql = $this->db->query($sql); |
| 683 | 683 | if (!$resql) { |
| 684 | 684 | $error++; |
| 685 | - dol_syslog('Error to process socpeopleassigned: ' . $this->db->lasterror(), LOG_ERR); |
|
| 685 | + dol_syslog('Error to process socpeopleassigned: '.$this->db->lasterror(), LOG_ERR); |
|
| 686 | 686 | $this->errors[] = $this->db->lasterror(); |
| 687 | 687 | } else { |
| 688 | 688 | $already_inserted[$id] = true; |
@@ -1196,7 +1196,7 @@ discard block |
||
| 1196 | 1196 | $sql = "UPDATE ".MAIN_DB_PREFIX."actioncomm"; |
| 1197 | 1197 | $sql .= " SET percent = '".$this->db->escape($this->percentage)."'"; |
| 1198 | 1198 | $sql .= ", fk_action = ".(int) $this->type_id; |
| 1199 | - $sql .= ", code = " . ($code ? "'".$this->db->escape($code)."'" : "null"); |
|
| 1199 | + $sql .= ", code = ".($code ? "'".$this->db->escape($code)."'" : "null"); |
|
| 1200 | 1200 | $sql .= ", label = ".($this->label ? "'".$this->db->escape($this->label)."'" : "null"); |
| 1201 | 1201 | $sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null'); |
| 1202 | 1202 | $sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null'); |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a"; |
| 1353 | 1353 | // Fields from hook |
| 1354 | 1354 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
| 1355 | - $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1355 | + $reshook = $hookmanager->executeHooks('getActionsListFrom', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1356 | 1356 | if (!empty($hookmanager->resPrint)) { |
| 1357 | 1357 | $sql .= $hookmanager->resPrint; |
| 1358 | 1358 | } |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | } |
| 1377 | 1377 | // Fields where hook |
| 1378 | 1378 | $parameters = array('sql' => &$sql, 'socid' => $socid, 'fk_element' => $fk_element, 'elementtype' => $elementtype); |
| 1379 | - $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1379 | + $reshook = $hookmanager->executeHooks('getActionsListWhere', $parameters); // Note that $action and $object may have been modified by hook |
|
| 1380 | 1380 | if (!empty($hookmanager->resPrint)) { |
| 1381 | 1381 | $sql .= $hookmanager->resPrint; |
| 1382 | 1382 | } |
@@ -1453,7 +1453,7 @@ discard block |
||
| 1453 | 1453 | |
| 1454 | 1454 | $resql = $this->db->query($sql); |
| 1455 | 1455 | if ($resql) { |
| 1456 | - $response = null; // Ensure the variable is defined |
|
| 1456 | + $response = null; // Ensure the variable is defined |
|
| 1457 | 1457 | if (empty($load_state_board)) { |
| 1458 | 1458 | $agenda_static = new ActionComm($this->db); |
| 1459 | 1459 | $response = new WorkboardResponse(); |
@@ -1665,9 +1665,9 @@ discard block |
||
| 1665 | 1665 | } |
| 1666 | 1666 | // show categories for this record only in ajax to not overload lists |
| 1667 | 1667 | if (isModEnabled('category') && !$nofetch) { |
| 1668 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1668 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1669 | 1669 | $form = new Form($this->db); |
| 1670 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); |
|
| 1670 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); |
|
| 1671 | 1671 | } |
| 1672 | 1672 | |
| 1673 | 1673 | return $datas; |
@@ -1757,8 +1757,8 @@ discard block |
||
| 1757 | 1757 | } |
| 1758 | 1758 | if (!empty($this->note_private)) { |
| 1759 | 1759 | $tooltip .= '<br><br><b>'.$langs->trans('Description').':</b><br>'; |
| 1760 | - $texttoshow = dolGetFirstLineOfText($this->note_private, 8); // Try to limit length of content |
|
| 1761 | - $tooltip .= '<div class="tenlinesmax">'; // Restrict height of content into the tooltip |
|
| 1760 | + $texttoshow = dolGetFirstLineOfText($this->note_private, 8); // Try to limit length of content |
|
| 1761 | + $tooltip .= '<div class="tenlinesmax">'; // Restrict height of content into the tooltip |
|
| 1762 | 1762 | $tooltip .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow)); |
| 1763 | 1763 | $tooltip .= '</div>'; |
| 1764 | 1764 | } |
@@ -2513,7 +2513,7 @@ discard block |
||
| 2513 | 2513 | */ |
| 2514 | 2514 | public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id) |
| 2515 | 2515 | { |
| 2516 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'actioncomm SET fk_element = ' . ((int) $dest_id) . ' WHERE elementtype="product" AND fk_element = '.((int) $origin_id); |
|
| 2516 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'actioncomm SET fk_element = '.((int) $dest_id).' WHERE elementtype="product" AND fk_element = '.((int) $origin_id); |
|
| 2517 | 2517 | // using $dbs, not $this->db because function is static |
| 2518 | 2518 | if (!$dbs->query($sql)) { |
| 2519 | 2519 | //$this->errors = $dbs->lasterror(); |
@@ -2638,7 +2638,7 @@ discard block |
||
| 2638 | 2638 | //Select all action comm reminders |
| 2639 | 2639 | $sql = "SELECT rowid as id FROM ".MAIN_DB_PREFIX."actioncomm_reminder"; |
| 2640 | 2640 | $sql .= " WHERE typeremind = 'email'"; |
| 2641 | - $sql .= " AND status = 0"; // 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors. |
|
| 2641 | + $sql .= " AND status = 0"; // 0=No yet sent, -1=Error. TODO Include reminder in error once we can count number of error, so we can try 5 times and not more on errors. |
|
| 2642 | 2642 | $sql .= " AND dateremind <= '".$this->db->idate($now)."'"; |
| 2643 | 2643 | $sql .= " AND entity IN (".getEntity('actioncomm').")"; |
| 2644 | 2644 | $sql .= $this->db->order("dateremind", "ASC"); |
@@ -2647,7 +2647,7 @@ discard block |
||
| 2647 | 2647 | if ($resql) { |
| 2648 | 2648 | require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; |
| 2649 | 2649 | $formmail = new FormMail($this->db); |
| 2650 | - $to = null; // Ensure 'to' is defined for static analysis |
|
| 2650 | + $to = null; // Ensure 'to' is defined for static analysis |
|
| 2651 | 2651 | |
| 2652 | 2652 | while ($obj = $this->db->fetch_object($resql)) { |
| 2653 | 2653 | $res = $actionCommReminder->fetch($obj->id); |
@@ -261,14 +261,14 @@ discard block |
||
| 261 | 261 | /** |
| 262 | 262 | * Status |
| 263 | 263 | */ |
| 264 | - const STATUS_NOT_READ = 0; // Draft. Not take into account yet. |
|
| 265 | - const STATUS_READ = 1; // Ticket was read. |
|
| 266 | - const STATUS_ASSIGNED = 2; // Ticket was just assigned to someone. Not in progress yet. |
|
| 267 | - const STATUS_IN_PROGRESS = 3; // In progress |
|
| 268 | - const STATUS_NEED_MORE_INFO = 5; // Waiting requester feedback |
|
| 269 | - const STATUS_WAITING = 7; // On hold |
|
| 270 | - const STATUS_CLOSED = 8; // Closed - Solved |
|
| 271 | - const STATUS_CANCELED = 9; // Closed - Not solved |
|
| 264 | + const STATUS_NOT_READ = 0; // Draft. Not take into account yet. |
|
| 265 | + const STATUS_READ = 1; // Ticket was read. |
|
| 266 | + const STATUS_ASSIGNED = 2; // Ticket was just assigned to someone. Not in progress yet. |
|
| 267 | + const STATUS_IN_PROGRESS = 3; // In progress |
|
| 268 | + const STATUS_NEED_MORE_INFO = 5; // Waiting requester feedback |
|
| 269 | + const STATUS_WAITING = 7; // On hold |
|
| 270 | + const STATUS_CLOSED = 8; // Closed - Solved |
|
| 271 | + const STATUS_CANCELED = 9; // Closed - Not solved |
|
| 272 | 272 | |
| 273 | 273 | |
| 274 | 274 | /** |
@@ -1586,9 +1586,9 @@ discard block |
||
| 1586 | 1586 | } |
| 1587 | 1587 | // show categories for this record only in ajax to not overload lists |
| 1588 | 1588 | if (isModEnabled('category') && !$nofetch) { |
| 1589 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1589 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1590 | 1590 | $form = new Form($this->db); |
| 1591 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_TICKET, 1); |
|
| 1591 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_TICKET, 1); |
|
| 1592 | 1592 | } |
| 1593 | 1593 | |
| 1594 | 1594 | return $datas; |
@@ -1818,7 +1818,7 @@ discard block |
||
| 1818 | 1818 | // Insert entry into agenda with code 'TICKET_MSG' |
| 1819 | 1819 | include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; |
| 1820 | 1820 | $actioncomm = new ActionComm($this->db); |
| 1821 | - $actioncomm->type_code = 'AC_OTH_AUTO'; // This is not an entry that must appears into manual calendar but only into CRM calendar |
|
| 1821 | + $actioncomm->type_code = 'AC_OTH_AUTO'; // This is not an entry that must appears into manual calendar but only into CRM calendar |
|
| 1822 | 1822 | $actioncomm->code = 'TICKET_MSG'; |
| 1823 | 1823 | if ($this->private) { |
| 1824 | 1824 | $actioncomm->code = 'TICKET_MSG_PRIVATE'; |
@@ -1832,7 +1832,7 @@ discard block |
||
| 1832 | 1832 | $actioncomm->socid = $this->socid; |
| 1833 | 1833 | $actioncomm->label = $this->subject; |
| 1834 | 1834 | $actioncomm->note_private = $this->message; |
| 1835 | - $actioncomm->userassigned = array($user->id => array('id' => $user->id,'transparency' => 0)); |
|
| 1835 | + $actioncomm->userassigned = array($user->id => array('id' => $user->id, 'transparency' => 0)); |
|
| 1836 | 1836 | $actioncomm->userownerid = $user->id; |
| 1837 | 1837 | $actioncomm->datep = $now; |
| 1838 | 1838 | $actioncomm->percentage = -1; // percentage is not relevant for punctual events |
@@ -2407,7 +2407,7 @@ discard block |
||
| 2407 | 2407 | 'email' => $obj->email, |
| 2408 | 2408 | 'rowid' => $obj->rowid, |
| 2409 | 2409 | 'code' => $obj->code, |
| 2410 | - 'libelle' => $labelType, // deprecated, replaced with labeltype |
|
| 2410 | + 'libelle' => $labelType, // deprecated, replaced with labeltype |
|
| 2411 | 2411 | 'labeltype' => $labelType, |
| 2412 | 2412 | 'status' => $obj->statuslink, |
| 2413 | 2413 | 'statuscontact' => $obj->statuscontact, |
@@ -2492,7 +2492,7 @@ discard block |
||
| 2492 | 2492 | if (is_resource($handle)) { |
| 2493 | 2493 | while (($file = readdir($handle)) !== false) { |
| 2494 | 2494 | if (!utf8_check($file)) { |
| 2495 | - $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory |
|
| 2495 | + $file = mb_convert_encoding($file, 'UTF-8', 'ISO-8859-1'); // To be sure data is stored in UTF8 in memory |
|
| 2496 | 2496 | } |
| 2497 | 2497 | if (dol_is_file($dir.$file)) { |
| 2498 | 2498 | return true; |
@@ -2530,7 +2530,7 @@ discard block |
||
| 2530 | 2530 | $formmail->trackid = (is_null($forcetrackid) ? 'tic'.$this->id : ''); |
| 2531 | 2531 | $attachedfiles = $formmail->get_attached_files(); |
| 2532 | 2532 | |
| 2533 | - $filepath = $attachedfiles['paths']; // path is for example user->dir_temp.'/'.$user->id.'/'... |
|
| 2533 | + $filepath = $attachedfiles['paths']; // path is for example user->dir_temp.'/'.$user->id.'/'... |
|
| 2534 | 2534 | $filename = $attachedfiles['names']; |
| 2535 | 2535 | $mimetype = $attachedfiles['mimes']; |
| 2536 | 2536 | |
@@ -2920,7 +2920,7 @@ discard block |
||
| 2920 | 2920 | |
| 2921 | 2921 | // If public interface is not enable, use link to internal page into mail |
| 2922 | 2922 | $url_public_ticket = (getDolGlobalInt('TICKET_ENABLE_PUBLIC_INTERFACE') ? |
| 2923 | - (getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id; |
|
| 2923 | + (getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE') !== '' ? getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE').'/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id; |
|
| 2924 | 2924 | |
| 2925 | 2925 | $message .= '<br>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$object->track_id.'</a><br>'; |
| 2926 | 2926 | |
@@ -2955,7 +2955,7 @@ discard block |
||
| 2955 | 2955 | if ($result) { |
| 2956 | 2956 | // update last_msg_sent date (for last message sent to external users) |
| 2957 | 2957 | $this->date_last_msg_sent = dol_now(); |
| 2958 | - $this->update($user, 1); // disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table. |
|
| 2958 | + $this->update($user, 1); // disable trigger when updating date_last_msg_sent. sendTicketMessageByEmail already create an event in actioncomm table. |
|
| 2959 | 2959 | } |
| 2960 | 2960 | } |
| 2961 | 2961 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public $price; |
| 144 | 144 | |
| 145 | - public $price_formated; // used by takepos/ajax/ajax.php |
|
| 145 | + public $price_formated; // used by takepos/ajax/ajax.php |
|
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * Selling price with tax |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | */ |
| 152 | 152 | public $price_ttc; |
| 153 | 153 | |
| 154 | - public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 154 | + public $price_ttc_formated; // used by takepos/ajax/ajax.php |
|
| 155 | 155 | |
| 156 | 156 | /** |
| 157 | 157 | * Minimum price net |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | public $packaging; |
| 232 | 232 | |
| 233 | 233 | |
| 234 | - public $lifetime; // In seconds |
|
| 234 | + public $lifetime; // In seconds |
|
| 235 | 235 | |
| 236 | 236 | public $qc_frequency; |
| 237 | 237 | |
@@ -392,20 +392,20 @@ discard block |
||
| 392 | 392 | |
| 393 | 393 | //! Metric of products |
| 394 | 394 | public $weight; |
| 395 | - public $weight_units; // scale -3, 0, 3, 6 |
|
| 395 | + public $weight_units; // scale -3, 0, 3, 6 |
|
| 396 | 396 | public $length; |
| 397 | - public $length_units; // scale -3, 0, 3, 6 |
|
| 397 | + public $length_units; // scale -3, 0, 3, 6 |
|
| 398 | 398 | public $width; |
| 399 | - public $width_units; // scale -3, 0, 3, 6 |
|
| 399 | + public $width_units; // scale -3, 0, 3, 6 |
|
| 400 | 400 | public $height; |
| 401 | - public $height_units; // scale -3, 0, 3, 6 |
|
| 401 | + public $height_units; // scale -3, 0, 3, 6 |
|
| 402 | 402 | public $surface; |
| 403 | - public $surface_units; // scale -3, 0, 3, 6 |
|
| 403 | + public $surface_units; // scale -3, 0, 3, 6 |
|
| 404 | 404 | public $volume; |
| 405 | - public $volume_units; // scale -3, 0, 3, 6 |
|
| 405 | + public $volume_units; // scale -3, 0, 3, 6 |
|
| 406 | 406 | |
| 407 | 407 | public $net_measure; |
| 408 | - public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 408 | + public $net_measure_units; // scale -3, 0, 3, 6 |
|
| 409 | 409 | |
| 410 | 410 | public $accountancy_code_sell; |
| 411 | 411 | public $accountancy_code_sell_intra; |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000), |
| 598 | 598 | //'tosell' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
| 599 | 599 | //'tobuy' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')), |
| 600 | - 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
| 600 | + 'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000), |
|
| 601 | 601 | ); |
| 602 | 602 | |
| 603 | 603 | /** |
@@ -901,9 +901,9 @@ discard block |
||
| 901 | 901 | |
| 902 | 902 | // update accountancy for this entity |
| 903 | 903 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 904 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
| 904 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
| 905 | 905 | |
| 906 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
| 906 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
| 907 | 907 | $sql .= " fk_product"; |
| 908 | 908 | $sql .= ", entity"; |
| 909 | 909 | $sql .= ", accountancy_code_buy"; |
@@ -914,13 +914,13 @@ discard block |
||
| 914 | 914 | $sql .= ", accountancy_code_sell_export"; |
| 915 | 915 | $sql .= ") VALUES ("; |
| 916 | 916 | $sql .= $this->id; |
| 917 | - $sql .= ", " . $conf->entity; |
|
| 918 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 919 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 920 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 921 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 922 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 923 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 917 | + $sql .= ", ".$conf->entity; |
|
| 918 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 919 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 920 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 921 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 922 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 923 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 924 | 924 | $sql .= ")"; |
| 925 | 925 | $result = $this->db->query($sql); |
| 926 | 926 | if (!$result) { |
@@ -1300,12 +1300,12 @@ discard block |
||
| 1300 | 1300 | $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); |
| 1301 | 1301 | $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; |
| 1302 | 1302 | if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 1303 | - $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1304 | - $sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 1305 | - $sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 1306 | - $sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1307 | - $sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 1308 | - $sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 1303 | + $sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1304 | + $sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 1305 | + $sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 1306 | + $sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1307 | + $sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 1308 | + $sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 1309 | 1309 | } |
| 1310 | 1310 | $sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null"); |
| 1311 | 1311 | $sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null'); |
@@ -1336,9 +1336,9 @@ discard block |
||
| 1336 | 1336 | |
| 1337 | 1337 | // update accountancy for this entity |
| 1338 | 1338 | if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 1339 | - $this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity)); |
|
| 1339 | + $this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity)); |
|
| 1340 | 1340 | |
| 1341 | - $sql = "INSERT INTO " . $this->db->prefix() . "product_perentity ("; |
|
| 1341 | + $sql = "INSERT INTO ".$this->db->prefix()."product_perentity ("; |
|
| 1342 | 1342 | $sql .= " fk_product"; |
| 1343 | 1343 | $sql .= ", entity"; |
| 1344 | 1344 | $sql .= ", accountancy_code_buy"; |
@@ -1349,13 +1349,13 @@ discard block |
||
| 1349 | 1349 | $sql .= ", accountancy_code_sell_export"; |
| 1350 | 1350 | $sql .= ") VALUES ("; |
| 1351 | 1351 | $sql .= $this->id; |
| 1352 | - $sql .= ", " . $conf->entity; |
|
| 1353 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'"; |
|
| 1354 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'"; |
|
| 1355 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'"; |
|
| 1356 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'"; |
|
| 1357 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'"; |
|
| 1358 | - $sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'"; |
|
| 1352 | + $sql .= ", ".$conf->entity; |
|
| 1353 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'"; |
|
| 1354 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'"; |
|
| 1355 | + $sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'"; |
|
| 1356 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'"; |
|
| 1357 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'"; |
|
| 1358 | + $sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'"; |
|
| 1359 | 1359 | $sql .= ")"; |
| 1360 | 1360 | $result = $this->db->query($sql); |
| 1361 | 1361 | if (!$result) { |
@@ -1726,7 +1726,7 @@ discard block |
||
| 1726 | 1726 | } |
| 1727 | 1727 | } elseif (isset($this->multilangs[$key])) { |
| 1728 | 1728 | if (empty($this->multilangs["$key"]["label"])) { |
| 1729 | - $this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
| 1729 | + $this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")); |
|
| 1730 | 1730 | return -1; |
| 1731 | 1731 | } |
| 1732 | 1732 | |
@@ -1921,7 +1921,7 @@ discard block |
||
| 1921 | 1921 | */ |
| 1922 | 1922 | private function getArrayForPriceCompare($level = 0) |
| 1923 | 1923 | { |
| 1924 | - $testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly'); |
|
| 1924 | + $testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly'); |
|
| 1925 | 1925 | |
| 1926 | 1926 | foreach ($testExit as $field) { |
| 1927 | 1927 | if (!isset($this->$field)) { |
@@ -2565,12 +2565,12 @@ discard block |
||
| 2565 | 2565 | |
| 2566 | 2566 | //For MultiCompany |
| 2567 | 2567 | //PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity |
| 2568 | - $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2569 | - $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
| 2568 | + $separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product. |
|
| 2569 | + $separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses. |
|
| 2570 | 2570 | $visibleWarehousesEntities = $conf->entity; |
| 2571 | 2571 | if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) { |
| 2572 | 2572 | if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) { |
| 2573 | - $checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
| 2573 | + $checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity); |
|
| 2574 | 2574 | if ($this->db->num_rows($checkPMPPerEntity) > 0) { |
| 2575 | 2575 | $separatedEntityPMP = true; |
| 2576 | 2576 | } |
@@ -2578,7 +2578,7 @@ discard block |
||
| 2578 | 2578 | global $mc; |
| 2579 | 2579 | $separatedStock = true; |
| 2580 | 2580 | if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) { |
| 2581 | - $visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']); |
|
| 2581 | + $visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']); |
|
| 2582 | 2582 | } |
| 2583 | 2583 | } |
| 2584 | 2584 | if ($separatedEntityPMP) { |
@@ -2596,10 +2596,10 @@ discard block |
||
| 2596 | 2596 | } |
| 2597 | 2597 | $sql .= " FROM ".$this->db->prefix()."product as p"; |
| 2598 | 2598 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) { |
| 2599 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 2599 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 2600 | 2600 | } |
| 2601 | 2601 | if ($separatedStock) { |
| 2602 | - $sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
| 2602 | + $sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))"; |
|
| 2603 | 2603 | } |
| 2604 | 2604 | |
| 2605 | 2605 | if ($id) { |
@@ -2758,15 +2758,15 @@ discard block |
||
| 2758 | 2758 | $sql .= " WHERE entity IN (".getEntity('productprice').")"; |
| 2759 | 2759 | $sql .= " AND price_level=".((int) $i); |
| 2760 | 2760 | $sql .= " AND fk_product = ".((int) $this->id); |
| 2761 | - $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2762 | - $sql .= " LIMIT 1"; // Only the first one |
|
| 2761 | + $sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line |
|
| 2762 | + $sql .= " LIMIT 1"; // Only the first one |
|
| 2763 | 2763 | $resql = $this->db->query($sql); |
| 2764 | 2764 | if ($resql) { |
| 2765 | 2765 | $result = $this->db->fetch_array($resql); |
| 2766 | 2766 | |
| 2767 | 2767 | $this->multiprices[$i] = $result ? $result["price"] : null; |
| 2768 | 2768 | $this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null; |
| 2769 | - $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2769 | + $this->multiprices_min[$i] = $result ? $result["price_min"] : null; |
|
| 2770 | 2770 | $this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null; |
| 2771 | 2771 | $this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null; |
| 2772 | 2772 | // Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on |
@@ -2990,7 +2990,7 @@ discard block |
||
| 2990 | 2990 | $obj = $this->db->fetch_object($result); |
| 2991 | 2991 | $this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0; |
| 2992 | 2992 | $this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0; |
| 2993 | - $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 2993 | + $this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM() |
|
| 2994 | 2994 | } else { |
| 2995 | 2995 | $this->error = $this->db->error(); |
| 2996 | 2996 | $error++; |
@@ -4496,7 +4496,7 @@ discard block |
||
| 4496 | 4496 | //Addition of a product with the highest rank +1 |
| 4497 | 4497 | $sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)"; |
| 4498 | 4498 | $sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".price2num($incdec, 'MS').", ".((int) $rank).")"; |
| 4499 | - if (! $this->db->query($sql)) { |
|
| 4499 | + if (!$this->db->query($sql)) { |
|
| 4500 | 4500 | dol_print_error($this->db); |
| 4501 | 4501 | return -1; |
| 4502 | 4502 | } else { |
@@ -4617,7 +4617,7 @@ discard block |
||
| 4617 | 4617 | $sql = "UPDATE ".$this->db->prefix()."product_association"; |
| 4618 | 4618 | $sql .= " SET rang = ".((int) $cpt); |
| 4619 | 4619 | $sql .= " WHERE rowid = ".((int) $objrank->rowid); |
| 4620 | - if (! $this->db->query($sql)) { |
|
| 4620 | + if (!$this->db->query($sql)) { |
|
| 4621 | 4621 | dol_print_error($this->db); |
| 4622 | 4622 | return -1; |
| 4623 | 4623 | } |
@@ -5053,7 +5053,7 @@ discard block |
||
| 5053 | 5053 | if (isset($this->sousprods) && is_array($this->sousprods)) { |
| 5054 | 5054 | foreach ($this->sousprods as $prod_name => $desc_product) { |
| 5055 | 5055 | if (is_array($desc_product)) { |
| 5056 | - $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
| 5056 | + $this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res |
|
| 5057 | 5057 | } |
| 5058 | 5058 | } |
| 5059 | 5059 | } |
@@ -5210,7 +5210,7 @@ discard block |
||
| 5210 | 5210 | $sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens |
| 5211 | 5211 | $sql .= " ORDER BY pa.rang"; |
| 5212 | 5212 | |
| 5213 | - dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
| 5213 | + dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); |
|
| 5214 | 5214 | |
| 5215 | 5215 | if ($level == 1) { |
| 5216 | 5216 | $alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately |
@@ -5301,7 +5301,7 @@ discard block |
||
| 5301 | 5301 | if (!empty($this->entity)) { |
| 5302 | 5302 | $tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, 1); |
| 5303 | 5303 | if ($this->nbphoto > 0) { |
| 5304 | - $datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>'; |
|
| 5304 | + $datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>'; |
|
| 5305 | 5305 | } |
| 5306 | 5306 | } |
| 5307 | 5307 | |
@@ -5311,7 +5311,7 @@ discard block |
||
| 5311 | 5311 | $datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>'; |
| 5312 | 5312 | } |
| 5313 | 5313 | if (isset($this->status) && isset($this->status_buy)) { |
| 5314 | - $datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1); |
|
| 5314 | + $datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1); |
|
| 5315 | 5315 | } |
| 5316 | 5316 | |
| 5317 | 5317 | if (!empty($this->ref)) { |
@@ -5359,7 +5359,7 @@ discard block |
||
| 5359 | 5359 | $labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units); |
| 5360 | 5360 | } |
| 5361 | 5361 | if ($labelsurfacevolume) { |
| 5362 | - $datas['surface'] = "<br>" . $labelsurfacevolume; |
|
| 5362 | + $datas['surface'] = "<br>".$labelsurfacevolume; |
|
| 5363 | 5363 | } |
| 5364 | 5364 | } |
| 5365 | 5365 | if ($this->type == Product::TYPE_SERVICE && !empty($this->duration_value)) { |
@@ -5401,9 +5401,9 @@ discard block |
||
| 5401 | 5401 | } |
| 5402 | 5402 | // show categories for this record only in ajax to not overload lists |
| 5403 | 5403 | if (isModEnabled('category') && !$nofetch) { |
| 5404 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 5404 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 5405 | 5405 | $form = new Form($this->db); |
| 5406 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
| 5406 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); |
|
| 5407 | 5407 | } |
| 5408 | 5408 | |
| 5409 | 5409 | return $datas; |
@@ -5924,7 +5924,7 @@ discard block |
||
| 5924 | 5924 | if (isModEnabled("supplier_order")) { |
| 5925 | 5925 | $filterStatus = !getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK') ? '3,4' : $conf->global->SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK; |
| 5926 | 5926 | if (isset($includedraftpoforvirtual)) { |
| 5927 | - $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
| 5927 | + $filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them |
|
| 5928 | 5928 | } |
| 5929 | 5929 | $result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock); |
| 5930 | 5930 | if ($result < 0) { |
@@ -6356,7 +6356,7 @@ discard block |
||
| 6356 | 6356 | if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) { |
| 6357 | 6357 | $dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']); |
| 6358 | 6358 | foreach ($dirsociete as $dirroot) { |
| 6359 | - $res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
| 6359 | + $res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php'); |
|
| 6360 | 6360 | if ($res) { |
| 6361 | 6361 | break; |
| 6362 | 6362 | } |
@@ -6684,7 +6684,7 @@ discard block |
||
| 6684 | 6684 | */ |
| 6685 | 6685 | public function getKanbanView($option = '', $arraydata = null) |
| 6686 | 6686 | { |
| 6687 | - global $langs,$conf; |
|
| 6687 | + global $langs, $conf; |
|
| 6688 | 6688 | |
| 6689 | 6689 | $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); |
| 6690 | 6690 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $now = dol_now(); |
| 286 | 286 | |
| 287 | 287 | // Clean parameters |
| 288 | - $this->titre = empty($this->titre) ? '' : $this->titre; // deprecated |
|
| 288 | + $this->titre = empty($this->titre) ? '' : $this->titre; // deprecated |
|
| 289 | 289 | $this->title = empty($this->title) ? '' : $this->title; |
| 290 | 290 | $keyforref = $this->table_ref_field; |
| 291 | 291 | $this->ref = $this->$keyforref; |
@@ -349,32 +349,32 @@ discard block |
||
| 349 | 349 | $sql .= ", '".$this->db->idate($now)."'"; |
| 350 | 350 | $sql .= ", ".((int) $this->suspended); |
| 351 | 351 | $sql .= ", '".$this->db->escape($this->libelle)."'"; |
| 352 | - $sql .= ", " .(!empty($facfourn_src->total_ttc) ? (float) $facfourn_src->total_ttc : '0'); // amount |
|
| 353 | - $sql .= ", " .((int) $user->id); |
|
| 354 | - $sql .= ", " .(!empty($this->fk_project) ? ((int) $this->fk_project) : 'NULL'); |
|
| 355 | - $sql .= ", " .(!empty($facfourn_src->fk_account) ? ((int) $facfourn_src->fk_account) : 'NULL'); |
|
| 356 | - $sql .= ", " .($this->cond_reglement_id > 0 ? (int) $this->cond_reglement_id : 'NULL'); |
|
| 357 | - $sql .= ", " .($this->mode_reglement_id > 0 ? (int) $this->mode_reglement_id : 'NULL'); |
|
| 358 | - $sql .= ", ".($facfourn_src->date_echeance > 0 ? "'".$this->db->idate($facfourn_src->date_echeance)."'" : 'NULL'); // date_lim_reglement |
|
| 359 | - $sql .= ", " .(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : 'NULL'); |
|
| 360 | - $sql .= ", " .(!empty($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'NULL'); |
|
| 361 | - $sql .= ", " .(!empty($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : 'NULL'); |
|
| 362 | - $sql .= ", " . (int) $facfourn_src->fk_multicurrency; |
|
| 352 | + $sql .= ", ".(!empty($facfourn_src->total_ttc) ? (float) $facfourn_src->total_ttc : '0'); // amount |
|
| 353 | + $sql .= ", ".((int) $user->id); |
|
| 354 | + $sql .= ", ".(!empty($this->fk_project) ? ((int) $this->fk_project) : 'NULL'); |
|
| 355 | + $sql .= ", ".(!empty($facfourn_src->fk_account) ? ((int) $facfourn_src->fk_account) : 'NULL'); |
|
| 356 | + $sql .= ", ".($this->cond_reglement_id > 0 ? (int) $this->cond_reglement_id : 'NULL'); |
|
| 357 | + $sql .= ", ".($this->mode_reglement_id > 0 ? (int) $this->mode_reglement_id : 'NULL'); |
|
| 358 | + $sql .= ", ".($facfourn_src->date_echeance > 0 ? "'".$this->db->idate($facfourn_src->date_echeance)."'" : 'NULL'); // date_lim_reglement |
|
| 359 | + $sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : 'NULL'); |
|
| 360 | + $sql .= ", ".(!empty($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'NULL'); |
|
| 361 | + $sql .= ", ".(!empty($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : 'NULL'); |
|
| 362 | + $sql .= ", ".(int) $facfourn_src->fk_multicurrency; |
|
| 363 | 363 | $sql .= ", '".$this->db->escape($facfourn_src->multicurrency_code)."'"; |
| 364 | - $sql .= ", " . (float) $facfourn_src->multicurrency_tx; |
|
| 365 | - $sql .= ", " . (int) $this->usenewprice; |
|
| 366 | - $sql .= ", " . (int) $this->frequency; |
|
| 364 | + $sql .= ", ".(float) $facfourn_src->multicurrency_tx; |
|
| 365 | + $sql .= ", ".(int) $this->usenewprice; |
|
| 366 | + $sql .= ", ".(int) $this->frequency; |
|
| 367 | 367 | $sql .= ", '".$this->db->escape($this->unit_frequency)."'"; |
| 368 | - $sql .= ", " .(!empty($this->date_when) ? "'".$this->db->idate($this->date_when)."'" : 'NULL'); |
|
| 369 | - $sql .= ", " .(!empty($this->date_last_gen) ? "'".$this->db->idate($this->date_last_gen)."'" : 'NULL'); |
|
| 370 | - $sql .= ", " . (int) $this->nb_gen_done; |
|
| 371 | - $sql .= ", " . (int) $this->nb_gen_max; |
|
| 372 | - $sql .= ", " . (int) $this->auto_validate; |
|
| 373 | - $sql .= ", " . (int) $this->generate_pdf; |
|
| 368 | + $sql .= ", ".(!empty($this->date_when) ? "'".$this->db->idate($this->date_when)."'" : 'NULL'); |
|
| 369 | + $sql .= ", ".(!empty($this->date_last_gen) ? "'".$this->db->idate($this->date_last_gen)."'" : 'NULL'); |
|
| 370 | + $sql .= ", ".(int) $this->nb_gen_done; |
|
| 371 | + $sql .= ", ".(int) $this->nb_gen_max; |
|
| 372 | + $sql .= ", ".(int) $this->auto_validate; |
|
| 373 | + $sql .= ", ".(int) $this->generate_pdf; |
|
| 374 | 374 | $sql .= ')'; |
| 375 | 375 | |
| 376 | 376 | if ($this->db->query($sql)) { |
| 377 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX. 'facture_fourn_rec'); |
|
| 377 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_rec'); |
|
| 378 | 378 | |
| 379 | 379 | // Fields used into addline later |
| 380 | 380 | $this->fk_multicurrency = $facfourn_src->fk_multicurrency; |
@@ -510,47 +510,47 @@ discard block |
||
| 510 | 510 | $error = 0; |
| 511 | 511 | |
| 512 | 512 | $sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_rec SET"; |
| 513 | - $sql .= " titre = '" . (!empty($this->title) ? $this->db->escape($this->title) : "")."'," ; |
|
| 513 | + $sql .= " titre = '".(!empty($this->title) ? $this->db->escape($this->title) : "")."',"; |
|
| 514 | 514 | $sql .= " subtype=".(isset($this->subtype) ? $this->db->escape($this->subtype) : "null").","; |
| 515 | - $sql .= " ref_supplier = '". (!empty($this->ref_supplier) ? $this->db->escape($this->ref_supplier) : "")."',"; |
|
| 516 | - $sql .= " entity = ". (!empty($this->entity) ? ((int) $this->entity) : 1) . ','; |
|
| 515 | + $sql .= " ref_supplier = '".(!empty($this->ref_supplier) ? $this->db->escape($this->ref_supplier) : "")."',"; |
|
| 516 | + $sql .= " entity = ".(!empty($this->entity) ? ((int) $this->entity) : 1).','; |
|
| 517 | 517 | if (!empty($this->socid) && $this->socid > 0) { |
| 518 | - $sql .= " fk_soc = ". ((int) $this->socid). ','; |
|
| 518 | + $sql .= " fk_soc = ".((int) $this->socid).','; |
|
| 519 | 519 | } elseif (!empty($this->fk_soc) && $this->fk_soc > 0) { // For backward compatibility |
| 520 | - $sql .= " fk_soc = ". ((int) $this->fk_soc). ','; |
|
| 520 | + $sql .= " fk_soc = ".((int) $this->fk_soc).','; |
|
| 521 | 521 | } |
| 522 | - $sql .= " suspended = ". (!empty($this->suspended) ? ((int) $this->suspended) : 0) . ','; |
|
| 523 | - $sql .= " libelle = ". (!empty($this->libelle) ? "'".$this->db->escape($this->libelle)."'" : 'NULL') . ","; |
|
| 524 | - $sql .= " vat_src_code = ". (!empty($this->vat_src_code) ? "'".$this->db->escape($this->vat_src_code)."'" : 'NULL') . ','; |
|
| 525 | - $sql .= " localtax1 = ". (!empty($this->localtax1) ? ((float) $this->localtax1) : 0.00) . ','; |
|
| 526 | - $sql .= " localtax2 = ". (!empty($this->localtax2) ? ((float) $this->localtax2) : 0.00) . ','; |
|
| 527 | - $sql .= " total_ht = ". (!empty($this->total_ht) ? ((float) $this->total_ht) : 0.00) . ','; |
|
| 528 | - $sql .= " total_tva = ". (!empty($this->total_tva) ? ((float) $this->total_tva) : 0.00) . ','; |
|
| 529 | - $sql .= " total_ttc = ". (!empty($this->total_ttc) ? ((float) $this->total_ttc) : 0.00) . ','; |
|
| 530 | - $sql .= " fk_user_modif = ". ((int) $user->id) . ','; |
|
| 531 | - $sql .= " fk_projet = ". (!empty($this->fk_project) ? ((int) $this->fk_project) : 'NULL') . ','; |
|
| 532 | - $sql .= " fk_account = ". (!empty($this->fk_account) ? ((int) $this->fk_account) : 'NULL') . ','; |
|
| 533 | - $sql .= " fk_mode_reglement = ". (!empty($this->mode_reglement_id) ? ((int) $this->mode_reglement_id) : 'NULL') . ','; |
|
| 534 | - $sql .= " fk_cond_reglement = ". (!empty($this->cond_reglement_id) ? ((int) $this->cond_reglement_id) : 'NULL') . ','; |
|
| 535 | - $sql .= " date_lim_reglement = ". (!empty($this->date_lim_reglement) ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'NULL') . ','; |
|
| 536 | - $sql .= " note_private = '". (!empty($this->note_private) ? $this->db->escape($this->note_private) : '') . "',"; |
|
| 537 | - $sql .= " note_public = '". (!empty($this->note_public) ? $this->db->escape($this->note_public) : '') . "',"; |
|
| 538 | - $sql .= " modelpdf = ". (!empty($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : 'NULL') . ","; |
|
| 539 | - $sql .= " fk_multicurrency = ". (!empty($this->fk_multicurrency) ? ((int) $this->fk_multicurrency) : 'NULL') . ','; |
|
| 540 | - $sql .= " multicurrency_code = ". (!empty($this->multicurrency_code) ? "'".$this->db->escape($this->multicurrency_code)."'" : 'NULL') . ","; |
|
| 541 | - $sql .= " multicurrency_tx = ". (!empty($this->multicurrency_tx) ? ((float) $this->multicurrency_tx) : 1) . ','; |
|
| 542 | - $sql .= " multicurrency_total_ht = ". (!empty($this->multicurrency_total_ht) ? ((float) $this->multicurrency_total_ht) : 0.00) . ','; |
|
| 543 | - $sql .= " multicurrency_total_tva = ". (!empty($this->multicurrency_total_tva) ? ((float) $this->multicurrency_total_tva) : 0.00) . ','; |
|
| 544 | - $sql .= " multicurrency_total_ttc = ". (!empty($this->multicurrency_total_ttc) ? ((float) $this->multicurrency_total_ttc) : 0.00) . ','; |
|
| 545 | - $sql .= " usenewprice = ". (!empty($this->usenewprice) ? ((int) $this->usenewprice) : 0) . ','; |
|
| 546 | - $sql .= " frequency = ". (!empty($this->frequency) ? ((int) $this->frequency) : 0). ','; |
|
| 547 | - $sql .= " unit_frequency = '". (!empty($this->unit_frequency) ? $this->db->escape($this->unit_frequency) : ''). "',"; |
|
| 548 | - $sql .= " date_when = ". (!empty($this->date_when) ? "'".$this->db->idate($this->date_when)."'" : 'NULL') . ','; |
|
| 549 | - $sql .= " date_last_gen = ". (!empty($this->date_last_gen) ? "'".$this->db->idate($this->date_last_gen)."'" : 'NULL') . ','; |
|
| 550 | - $sql .= " nb_gen_done = ". (!empty($this->nb_gen_done) ? ((int) $this->nb_gen_done) : 0) . ','; |
|
| 551 | - $sql .= " nb_gen_max = ". (!empty($this->nb_gen_max) ? ((int) $this->nb_gen_max) : 0) . ','; |
|
| 552 | - $sql .= " auto_validate = ". (!empty($this->auto_validate) ? ((int) $this->auto_validate) : 0); |
|
| 553 | - $sql .= " WHERE rowid = ". (int) $this->id; |
|
| 522 | + $sql .= " suspended = ".(!empty($this->suspended) ? ((int) $this->suspended) : 0).','; |
|
| 523 | + $sql .= " libelle = ".(!empty($this->libelle) ? "'".$this->db->escape($this->libelle)."'" : 'NULL').","; |
|
| 524 | + $sql .= " vat_src_code = ".(!empty($this->vat_src_code) ? "'".$this->db->escape($this->vat_src_code)."'" : 'NULL').','; |
|
| 525 | + $sql .= " localtax1 = ".(!empty($this->localtax1) ? ((float) $this->localtax1) : 0.00).','; |
|
| 526 | + $sql .= " localtax2 = ".(!empty($this->localtax2) ? ((float) $this->localtax2) : 0.00).','; |
|
| 527 | + $sql .= " total_ht = ".(!empty($this->total_ht) ? ((float) $this->total_ht) : 0.00).','; |
|
| 528 | + $sql .= " total_tva = ".(!empty($this->total_tva) ? ((float) $this->total_tva) : 0.00).','; |
|
| 529 | + $sql .= " total_ttc = ".(!empty($this->total_ttc) ? ((float) $this->total_ttc) : 0.00).','; |
|
| 530 | + $sql .= " fk_user_modif = ".((int) $user->id).','; |
|
| 531 | + $sql .= " fk_projet = ".(!empty($this->fk_project) ? ((int) $this->fk_project) : 'NULL').','; |
|
| 532 | + $sql .= " fk_account = ".(!empty($this->fk_account) ? ((int) $this->fk_account) : 'NULL').','; |
|
| 533 | + $sql .= " fk_mode_reglement = ".(!empty($this->mode_reglement_id) ? ((int) $this->mode_reglement_id) : 'NULL').','; |
|
| 534 | + $sql .= " fk_cond_reglement = ".(!empty($this->cond_reglement_id) ? ((int) $this->cond_reglement_id) : 'NULL').','; |
|
| 535 | + $sql .= " date_lim_reglement = ".(!empty($this->date_lim_reglement) ? "'".$this->db->idate($this->date_lim_reglement)."'" : 'NULL').','; |
|
| 536 | + $sql .= " note_private = '".(!empty($this->note_private) ? $this->db->escape($this->note_private) : '')."',"; |
|
| 537 | + $sql .= " note_public = '".(!empty($this->note_public) ? $this->db->escape($this->note_public) : '')."',"; |
|
| 538 | + $sql .= " modelpdf = ".(!empty($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : 'NULL').","; |
|
| 539 | + $sql .= " fk_multicurrency = ".(!empty($this->fk_multicurrency) ? ((int) $this->fk_multicurrency) : 'NULL').','; |
|
| 540 | + $sql .= " multicurrency_code = ".(!empty($this->multicurrency_code) ? "'".$this->db->escape($this->multicurrency_code)."'" : 'NULL').","; |
|
| 541 | + $sql .= " multicurrency_tx = ".(!empty($this->multicurrency_tx) ? ((float) $this->multicurrency_tx) : 1).','; |
|
| 542 | + $sql .= " multicurrency_total_ht = ".(!empty($this->multicurrency_total_ht) ? ((float) $this->multicurrency_total_ht) : 0.00).','; |
|
| 543 | + $sql .= " multicurrency_total_tva = ".(!empty($this->multicurrency_total_tva) ? ((float) $this->multicurrency_total_tva) : 0.00).','; |
|
| 544 | + $sql .= " multicurrency_total_ttc = ".(!empty($this->multicurrency_total_ttc) ? ((float) $this->multicurrency_total_ttc) : 0.00).','; |
|
| 545 | + $sql .= " usenewprice = ".(!empty($this->usenewprice) ? ((int) $this->usenewprice) : 0).','; |
|
| 546 | + $sql .= " frequency = ".(!empty($this->frequency) ? ((int) $this->frequency) : 0).','; |
|
| 547 | + $sql .= " unit_frequency = '".(!empty($this->unit_frequency) ? $this->db->escape($this->unit_frequency) : '')."',"; |
|
| 548 | + $sql .= " date_when = ".(!empty($this->date_when) ? "'".$this->db->idate($this->date_when)."'" : 'NULL').','; |
|
| 549 | + $sql .= " date_last_gen = ".(!empty($this->date_last_gen) ? "'".$this->db->idate($this->date_last_gen)."'" : 'NULL').','; |
|
| 550 | + $sql .= " nb_gen_done = ".(!empty($this->nb_gen_done) ? ((int) $this->nb_gen_done) : 0).','; |
|
| 551 | + $sql .= " nb_gen_max = ".(!empty($this->nb_gen_max) ? ((int) $this->nb_gen_max) : 0).','; |
|
| 552 | + $sql .= " auto_validate = ".(!empty($this->auto_validate) ? ((int) $this->auto_validate) : 0); |
|
| 553 | + $sql .= " WHERE rowid = ".(int) $this->id; |
|
| 554 | 554 | |
| 555 | 555 | $this->db->begin(); |
| 556 | 556 | |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as p ON f.fk_mode_reglement = p.id'; |
| 612 | 612 | $sql .= ' WHERE f.entity IN ('.getEntity('invoice').')'; |
| 613 | 613 | if ($rowid) { |
| 614 | - $sql .= ' AND f.rowid='. (int) $rowid; |
|
| 614 | + $sql .= ' AND f.rowid='.(int) $rowid; |
|
| 615 | 615 | } elseif ($ref) { |
| 616 | 616 | $sql .= " AND f.titre='".$this->db->escape($ref)."'"; |
| 617 | 617 | } else { |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | $this->id = $obj->rowid; |
| 629 | 629 | $this->titre = $obj->title; |
| 630 | 630 | $this->title = $obj->title; |
| 631 | - $this->subtype = $obj->subtype; |
|
| 631 | + $this->subtype = $obj->subtype; |
|
| 632 | 632 | $this->ref = $obj->title; |
| 633 | 633 | $this->ref_supplier = $obj->ref_supplier; |
| 634 | 634 | $this->entity = $obj->entity; |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | $sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; |
| 746 | 746 | $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det_rec as l'; |
| 747 | 747 | $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; |
| 748 | - $sql .= ' WHERE l.fk_facture_fourn = '. (int) $this->id; |
|
| 748 | + $sql .= ' WHERE l.fk_facture_fourn = '.(int) $this->id; |
|
| 749 | 749 | $sql .= ' ORDER BY l.rang'; |
| 750 | 750 | |
| 751 | 751 | dol_syslog('FactureFournisseurRec::fetch_lines', LOG_DEBUG); |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | $line->product_type = $objp->product_type; |
| 787 | 787 | $line->date_start = $objp->date_start; |
| 788 | 788 | $line->date_end = $objp->date_end; |
| 789 | - $line->info_bits = $objp->info_bits ; |
|
| 789 | + $line->info_bits = $objp->info_bits; |
|
| 790 | 790 | $line->special_code = $objp->special_code; |
| 791 | 791 | $line->rang = $objp->rang; |
| 792 | 792 | $line->fk_unit = $objp->fk_unit; |
@@ -836,11 +836,11 @@ discard block |
||
| 836 | 836 | $main = MAIN_DB_PREFIX.'facture_fourn_det_rec'; |
| 837 | 837 | $ef = $main."_extrafields"; |
| 838 | 838 | |
| 839 | - $sqlef = "DELETE FROM ".$ef." WHERE fk_object IN (SELECT rowid FROM ".$main." WHERE fk_facture_fourn = ". (int) $rowid .")"; |
|
| 840 | - $sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn_det_rec WHERE fk_facture_fourn = ". (int) $rowid; |
|
| 839 | + $sqlef = "DELETE FROM ".$ef." WHERE fk_object IN (SELECT rowid FROM ".$main." WHERE fk_facture_fourn = ".(int) $rowid.")"; |
|
| 840 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn_det_rec WHERE fk_facture_fourn = ".(int) $rowid; |
|
| 841 | 841 | |
| 842 | 842 | if ($this->db->query($sqlef) && $this->db->query($sql)) { |
| 843 | - $sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn_rec WHERE rowid = ". (int) $rowid; |
|
| 843 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."facture_fourn_rec WHERE rowid = ".(int) $rowid; |
|
| 844 | 844 | dol_syslog($sql); |
| 845 | 845 | if ($this->db->query($sql)) { |
| 846 | 846 | // Delete linked object |
@@ -869,7 +869,7 @@ discard block |
||
| 869 | 869 | } |
| 870 | 870 | // End call triggers |
| 871 | 871 | } |
| 872 | - if (! $error) { |
|
| 872 | + if (!$error) { |
|
| 873 | 873 | $this->db->commit(); |
| 874 | 874 | return 1; |
| 875 | 875 | } else { |
@@ -981,7 +981,7 @@ discard block |
||
| 981 | 981 | } |
| 982 | 982 | } |
| 983 | 983 | |
| 984 | - $sql = 'INSERT INTO ' . MAIN_DB_PREFIX . 'facture_fourn_det_rec ('; |
|
| 984 | + $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det_rec ('; |
|
| 985 | 985 | $sql .= 'fk_facture_fourn'; |
| 986 | 986 | $sql .= ', fk_product'; |
| 987 | 987 | $sql .= ', ref'; |
@@ -1013,46 +1013,46 @@ discard block |
||
| 1013 | 1013 | $sql .= ', fk_user_author'; |
| 1014 | 1014 | $sql .= ', fk_multicurrency, multicurrency_code, multicurrency_subprice, multicurrency_total_ht, multicurrency_total_tva, multicurrency_total_ttc'; |
| 1015 | 1015 | $sql .= ') VALUES ('; |
| 1016 | - $sql .= ' ' . (int) $facid; // source supplier invoice id |
|
| 1017 | - $sql .= ', ' . (!empty($fk_product) ? "'" . $this->db->escape($fk_product) . "'" : 'null'); |
|
| 1018 | - $sql .= ', ' . (!empty($ref) ? "'" . $this->db->escape($ref) . "'" : 'null'); |
|
| 1019 | - $sql .= ', ' . (!empty($label) ? "'" . $this->db->escape($label) . "'" : 'null'); |
|
| 1020 | - $sql .= ", '" . $this->db->escape($desc) . "'"; |
|
| 1021 | - $sql .= ', ' . price2num($pu_ht); |
|
| 1022 | - $sql .= ', ' . price2num($pu_ttc); |
|
| 1023 | - $sql .= ', ' . price2num($qty); |
|
| 1024 | - $sql .= ', ' . price2num($remise_percent); |
|
| 1016 | + $sql .= ' '.(int) $facid; // source supplier invoice id |
|
| 1017 | + $sql .= ', '.(!empty($fk_product) ? "'".$this->db->escape($fk_product)."'" : 'null'); |
|
| 1018 | + $sql .= ', '.(!empty($ref) ? "'".$this->db->escape($ref)."'" : 'null'); |
|
| 1019 | + $sql .= ', '.(!empty($label) ? "'".$this->db->escape($label)."'" : 'null'); |
|
| 1020 | + $sql .= ", '".$this->db->escape($desc)."'"; |
|
| 1021 | + $sql .= ', '.price2num($pu_ht); |
|
| 1022 | + $sql .= ', '.price2num($pu_ttc); |
|
| 1023 | + $sql .= ', '.price2num($qty); |
|
| 1024 | + $sql .= ', '.price2num($remise_percent); |
|
| 1025 | 1025 | $sql .= ', null'; |
| 1026 | - $sql .= ", '" . $this->db->escape($vat_src_code) . "'"; |
|
| 1027 | - $sql .= ', ' . price2num($txtva); |
|
| 1028 | - $sql .= ', ' . price2num($txlocaltax1); |
|
| 1029 | - $sql .= ", '" . $this->db->escape(isset($localtaxes_type[0]) ? $localtaxes_type[0] : '') . "'"; |
|
| 1030 | - $sql .= ', ' . price2num($txlocaltax2); |
|
| 1031 | - $sql .= ", '" . $this->db->escape(isset($localtaxes_type[2]) ? $localtaxes_type[2] : '') . "'"; |
|
| 1032 | - $sql .= ', ' . price2num($total_ht); |
|
| 1033 | - $sql .= ', ' . price2num($total_tva); |
|
| 1034 | - $sql .= ', ' . price2num($total_localtax1); |
|
| 1035 | - $sql .= ', ' . price2num($total_localtax2); |
|
| 1036 | - $sql .= ', ' . price2num($total_ttc); |
|
| 1037 | - $sql .= ', ' . (int) $product_type; |
|
| 1038 | - $sql .= ', ' . ($date_start > 0 ? (int) $date_start : 'NULL'); |
|
| 1039 | - $sql .= ', ' . ($date_end > 0 ? (int) $date_end : 'NULL'); |
|
| 1040 | - $sql .= ', ' . (int) $info_bits; |
|
| 1041 | - $sql .= ', ' . (int) $special_code; |
|
| 1042 | - $sql .= ', ' . (int) $rang; |
|
| 1043 | - $sql .= ', ' . ($fk_unit ? (int) $fk_unit : 'NULL'); |
|
| 1044 | - $sql .= ', ' . (int) $user->id; |
|
| 1045 | - $sql .= ', ' . (int) $this->fk_multicurrency; |
|
| 1046 | - $sql .= ", '" . $this->db->escape($this->multicurrency_code) . "'"; |
|
| 1047 | - $sql .= ', ' . price2num($pu_ht_devise, 'CU'); |
|
| 1048 | - $sql .= ', ' . price2num($multicurrency_total_ht, 'CT'); |
|
| 1049 | - $sql .= ', ' . price2num($multicurrency_total_tva, 'CT'); |
|
| 1050 | - $sql .= ', ' . price2num($multicurrency_total_ttc, 'CT'); |
|
| 1026 | + $sql .= ", '".$this->db->escape($vat_src_code)."'"; |
|
| 1027 | + $sql .= ', '.price2num($txtva); |
|
| 1028 | + $sql .= ', '.price2num($txlocaltax1); |
|
| 1029 | + $sql .= ", '".$this->db->escape(isset($localtaxes_type[0]) ? $localtaxes_type[0] : '')."'"; |
|
| 1030 | + $sql .= ', '.price2num($txlocaltax2); |
|
| 1031 | + $sql .= ", '".$this->db->escape(isset($localtaxes_type[2]) ? $localtaxes_type[2] : '')."'"; |
|
| 1032 | + $sql .= ', '.price2num($total_ht); |
|
| 1033 | + $sql .= ', '.price2num($total_tva); |
|
| 1034 | + $sql .= ', '.price2num($total_localtax1); |
|
| 1035 | + $sql .= ', '.price2num($total_localtax2); |
|
| 1036 | + $sql .= ', '.price2num($total_ttc); |
|
| 1037 | + $sql .= ', '.(int) $product_type; |
|
| 1038 | + $sql .= ', '.($date_start > 0 ? (int) $date_start : 'NULL'); |
|
| 1039 | + $sql .= ', '.($date_end > 0 ? (int) $date_end : 'NULL'); |
|
| 1040 | + $sql .= ', '.(int) $info_bits; |
|
| 1041 | + $sql .= ', '.(int) $special_code; |
|
| 1042 | + $sql .= ', '.(int) $rang; |
|
| 1043 | + $sql .= ', '.($fk_unit ? (int) $fk_unit : 'NULL'); |
|
| 1044 | + $sql .= ', '.(int) $user->id; |
|
| 1045 | + $sql .= ', '.(int) $this->fk_multicurrency; |
|
| 1046 | + $sql .= ", '".$this->db->escape($this->multicurrency_code)."'"; |
|
| 1047 | + $sql .= ', '.price2num($pu_ht_devise, 'CU'); |
|
| 1048 | + $sql .= ', '.price2num($multicurrency_total_ht, 'CT'); |
|
| 1049 | + $sql .= ', '.price2num($multicurrency_total_tva, 'CT'); |
|
| 1050 | + $sql .= ', '.price2num($multicurrency_total_ttc, 'CT'); |
|
| 1051 | 1051 | $sql .= ')'; |
| 1052 | 1052 | |
| 1053 | - dol_syslog(get_class($this). '::addline', LOG_DEBUG); |
|
| 1053 | + dol_syslog(get_class($this).'::addline', LOG_DEBUG); |
|
| 1054 | 1054 | if ($this->db->query($sql)) { |
| 1055 | - $lineId = $this->db->last_insert_id(MAIN_DB_PREFIX. 'facture_fourn_det_rec'); |
|
| 1055 | + $lineId = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det_rec'); |
|
| 1056 | 1056 | $this->update_price(); |
| 1057 | 1057 | $this->id = $facid; |
| 1058 | 1058 | $this->db->commit(); |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | |
| 1104 | 1104 | $facid = $this->id; |
| 1105 | 1105 | |
| 1106 | - dol_syslog(get_class($this). '::updateline facid=' .$facid." rowid=$rowid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, price_base_type=$price_base_type, pu_ttc=$pu_ttc, type=$type, fk_unit=$fk_unit, pu_ht_devise=$pu_ht_devise", LOG_DEBUG); |
|
| 1106 | + dol_syslog(get_class($this).'::updateline facid='.$facid." rowid=$rowid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, txlocaltax1=$txlocaltax1, txlocaltax2=$txlocaltax2, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, price_base_type=$price_base_type, pu_ttc=$pu_ttc, type=$type, fk_unit=$fk_unit, pu_ht_devise=$pu_ht_devise", LOG_DEBUG); |
|
| 1107 | 1107 | include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; |
| 1108 | 1108 | |
| 1109 | 1109 | // Check parameters |
@@ -1173,41 +1173,41 @@ discard block |
||
| 1173 | 1173 | $product_type = $product->type; |
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture_fourn_det_rec SET'; |
|
| 1177 | - $sql .= ' fk_facture_fourn = ' . ((int) $facid); |
|
| 1178 | - $sql .= ', fk_product = ' . ($fk_product > 0 ? ((int) $fk_product) : 'null'); |
|
| 1179 | - $sql .= ", ref = '" . $this->db->escape($ref) . "'"; |
|
| 1180 | - $sql .= ", label = '" . $this->db->escape($label) . "'"; |
|
| 1181 | - $sql .= ", description = '" . $this->db->escape($desc) . "'"; |
|
| 1182 | - $sql .= ', pu_ht = ' . price2num($pu_ht); |
|
| 1183 | - $sql .= ', qty = ' . price2num($qty); |
|
| 1184 | - $sql .= ", remise_percent = '" . price2num($remise_percent) . "'"; |
|
| 1185 | - $sql .= ", vat_src_code = '" . $this->db->escape($vat_src_code) . "'"; |
|
| 1186 | - $sql .= ', tva_tx = ' . price2num($txtva); |
|
| 1187 | - $sql .= ', localtax1_tx = ' . (float) $txlocaltax1; |
|
| 1188 | - $sql .= ", localtax1_type = '" . $this->db->escape($localtaxes_type[0]) . "'"; |
|
| 1189 | - $sql .= ', localtax2_tx = ' . (float) $txlocaltax2; |
|
| 1190 | - $sql .= ", localtax2_type = '" . $this->db->escape($localtaxes_type[2]) . "'"; |
|
| 1191 | - $sql .= ", total_ht = '" . price2num($total_ht) . "'"; |
|
| 1192 | - $sql .= ", total_tva = '" . price2num($total_tva) . "'"; |
|
| 1193 | - $sql .= ", total_localtax1 = '" . price2num($total_localtax1) . "'"; |
|
| 1194 | - $sql .= ", total_localtax2 = '" . price2num($total_localtax2) . "'"; |
|
| 1195 | - $sql .= ", total_ttc = '" . price2num($total_ttc) . "'"; |
|
| 1196 | - $sql .= ', product_type = ' . (int) $product_type; |
|
| 1197 | - $sql .= ', date_start = ' . (empty($date_start) ? 'NULL' : (int) $date_start); |
|
| 1198 | - $sql .= ', date_end = ' . (empty($date_end) ? 'NULL' : (int) $date_end); |
|
| 1199 | - $sql .= ', info_bits = ' . (int) $info_bits; |
|
| 1200 | - $sql .= ', special_code = ' . (int) $special_code; |
|
| 1201 | - $sql .= ', rang = ' . (int) $rang; |
|
| 1202 | - $sql .= ', fk_unit = ' . ($fk_unit ? "'" . $this->db->escape($fk_unit) . "'" : 'null'); |
|
| 1203 | - $sql .= ', fk_user_modif = ' . (int) $user; |
|
| 1176 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn_det_rec SET'; |
|
| 1177 | + $sql .= ' fk_facture_fourn = '.((int) $facid); |
|
| 1178 | + $sql .= ', fk_product = '.($fk_product > 0 ? ((int) $fk_product) : 'null'); |
|
| 1179 | + $sql .= ", ref = '".$this->db->escape($ref)."'"; |
|
| 1180 | + $sql .= ", label = '".$this->db->escape($label)."'"; |
|
| 1181 | + $sql .= ", description = '".$this->db->escape($desc)."'"; |
|
| 1182 | + $sql .= ', pu_ht = '.price2num($pu_ht); |
|
| 1183 | + $sql .= ', qty = '.price2num($qty); |
|
| 1184 | + $sql .= ", remise_percent = '".price2num($remise_percent)."'"; |
|
| 1185 | + $sql .= ", vat_src_code = '".$this->db->escape($vat_src_code)."'"; |
|
| 1186 | + $sql .= ', tva_tx = '.price2num($txtva); |
|
| 1187 | + $sql .= ', localtax1_tx = '.(float) $txlocaltax1; |
|
| 1188 | + $sql .= ", localtax1_type = '".$this->db->escape($localtaxes_type[0])."'"; |
|
| 1189 | + $sql .= ', localtax2_tx = '.(float) $txlocaltax2; |
|
| 1190 | + $sql .= ", localtax2_type = '".$this->db->escape($localtaxes_type[2])."'"; |
|
| 1191 | + $sql .= ", total_ht = '".price2num($total_ht)."'"; |
|
| 1192 | + $sql .= ", total_tva = '".price2num($total_tva)."'"; |
|
| 1193 | + $sql .= ", total_localtax1 = '".price2num($total_localtax1)."'"; |
|
| 1194 | + $sql .= ", total_localtax2 = '".price2num($total_localtax2)."'"; |
|
| 1195 | + $sql .= ", total_ttc = '".price2num($total_ttc)."'"; |
|
| 1196 | + $sql .= ', product_type = '.(int) $product_type; |
|
| 1197 | + $sql .= ', date_start = '.(empty($date_start) ? 'NULL' : (int) $date_start); |
|
| 1198 | + $sql .= ', date_end = '.(empty($date_end) ? 'NULL' : (int) $date_end); |
|
| 1199 | + $sql .= ', info_bits = '.(int) $info_bits; |
|
| 1200 | + $sql .= ', special_code = '.(int) $special_code; |
|
| 1201 | + $sql .= ', rang = '.(int) $rang; |
|
| 1202 | + $sql .= ', fk_unit = '.($fk_unit ? "'".$this->db->escape($fk_unit)."'" : 'null'); |
|
| 1203 | + $sql .= ', fk_user_modif = '.(int) $user; |
|
| 1204 | 1204 | $sql .= ', multicurrency_subprice = '.price2num($pu_ht_devise); |
| 1205 | 1205 | $sql .= ', multicurrency_total_ht = '.price2num($multicurrency_total_ht); |
| 1206 | 1206 | $sql .= ', multicurrency_total_tva = '.price2num($multicurrency_total_tva); |
| 1207 | 1207 | $sql .= ', multicurrency_total_ttc = '.price2num($multicurrency_total_ttc); |
| 1208 | - $sql .= ' WHERE rowid = ' . (int) $rowid; |
|
| 1208 | + $sql .= ' WHERE rowid = '.(int) $rowid; |
|
| 1209 | 1209 | |
| 1210 | - dol_syslog(get_class($this). '::updateline', LOG_DEBUG); |
|
| 1210 | + dol_syslog(get_class($this).'::updateline', LOG_DEBUG); |
|
| 1211 | 1211 | if ($this->db->query($sql)) { |
| 1212 | 1212 | $this->id = $facid; |
| 1213 | 1213 | $this->update_price(); |
@@ -1297,16 +1297,16 @@ discard block |
||
| 1297 | 1297 | $tmparray = dol_getdate($now); |
| 1298 | 1298 | $today = dol_mktime(23, 59, 59, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); // Today is last second of current day |
| 1299 | 1299 | |
| 1300 | - dol_syslog('createRecurringInvoices restrictioninvoiceid=' .$restrictioninvoiceid. ' forcevalidation=' .$forcevalidation); |
|
| 1300 | + dol_syslog('createRecurringInvoices restrictioninvoiceid='.$restrictioninvoiceid.' forcevalidation='.$forcevalidation); |
|
| 1301 | 1301 | |
| 1302 | 1302 | $sql = 'SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn_rec'; |
| 1303 | 1303 | $sql .= ' WHERE frequency > 0'; // A recurring supplier invoice is an invoice with a frequency |
| 1304 | 1304 | $sql .= " AND (date_when IS NULL OR date_when <= '".$this->db->idate($today)."')"; |
| 1305 | 1305 | $sql .= ' AND (nb_gen_done < nb_gen_max OR nb_gen_max = 0)'; |
| 1306 | 1306 | $sql .= ' AND suspended = 0'; |
| 1307 | - $sql .= ' AND entity = '. (int) $conf->entity; // MUST STAY = $conf->entity here |
|
| 1307 | + $sql .= ' AND entity = '.(int) $conf->entity; // MUST STAY = $conf->entity here |
|
| 1308 | 1308 | if ($restrictioninvoiceid > 0) { |
| 1309 | - $sql .= ' AND rowid = '. (int) $restrictioninvoiceid; |
|
| 1309 | + $sql .= ' AND rowid = '.(int) $restrictioninvoiceid; |
|
| 1310 | 1310 | } |
| 1311 | 1311 | $sql .= $this->db->order('entity', 'ASC'); |
| 1312 | 1312 | //print $sql;exit; |
@@ -1346,7 +1346,7 @@ discard block |
||
| 1346 | 1346 | // Set entity context |
| 1347 | 1347 | $conf->entity = $facturerec->entity; |
| 1348 | 1348 | |
| 1349 | - dol_syslog('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', ref=' .$facturerec->ref. ', entity=' .$facturerec->entity); |
|
| 1349 | + dol_syslog('createRecurringInvoices Process invoice template id='.$facturerec->id.', ref='.$facturerec->ref.', entity='.$facturerec->entity); |
|
| 1350 | 1350 | |
| 1351 | 1351 | $new_fac_fourn = new FactureFournisseur($this->db); |
| 1352 | 1352 | $new_fac_fourn->fac_rec = $facturerec->id; // We will create $facture from this recurring invoice |
@@ -1354,7 +1354,7 @@ discard block |
||
| 1354 | 1354 | |
| 1355 | 1355 | $new_fac_fourn->type = self::TYPE_STANDARD; |
| 1356 | 1356 | $new_fac_fourn->subtype = $facturerec->subtype; |
| 1357 | - $new_fac_fourn->statut = self::STATUS_DRAFT; // deprecated |
|
| 1357 | + $new_fac_fourn->statut = self::STATUS_DRAFT; // deprecated |
|
| 1358 | 1358 | $new_fac_fourn->status = self::STATUS_DRAFT; |
| 1359 | 1359 | $new_fac_fourn->date = empty($facturerec->date_when) ? $now : $facturerec->date_when; // We could also use dol_now here but we prefer date_when so invoice has real date when we would like even if we generate later. |
| 1360 | 1360 | $new_fac_fourn->socid = $facturerec->socid; |
@@ -1363,7 +1363,7 @@ discard block |
||
| 1363 | 1363 | $new_fac_fourn->model_pdf = $facturerec->model_pdf; |
| 1364 | 1364 | $new_fac_fourn->fk_project = $facturerec->fk_project; |
| 1365 | 1365 | $new_fac_fourn->label = $facturerec->label; |
| 1366 | - $new_fac_fourn->libelle = $facturerec->label; // deprecated |
|
| 1366 | + $new_fac_fourn->libelle = $facturerec->label; // deprecated |
|
| 1367 | 1367 | |
| 1368 | 1368 | $invoiceidgenerated = $new_fac_fourn->create($user); |
| 1369 | 1369 | $laststep = "Create invoiceidgenerated $invoiceidgenerated"; |
@@ -1396,9 +1396,9 @@ discard block |
||
| 1396 | 1396 | } |
| 1397 | 1397 | } else { |
| 1398 | 1398 | $error++; |
| 1399 | - $this->error = 'Failed to load invoice template with id=' .$line->rowid. ', entity=' .$conf->entity."\n"; |
|
| 1400 | - $this->errors[] = 'Failed to load invoice template with id=' .$line->rowid. ', entity=' .$conf->entity; |
|
| 1401 | - dol_syslog('createRecurringInvoices Failed to load invoice template with id=' .$line->rowid. ', entity=' .$conf->entity); |
|
| 1399 | + $this->error = 'Failed to load invoice template with id='.$line->rowid.', entity='.$conf->entity."\n"; |
|
| 1400 | + $this->errors[] = 'Failed to load invoice template with id='.$line->rowid.', entity='.$conf->entity; |
|
| 1401 | + dol_syslog('createRecurringInvoices Failed to load invoice template with id='.$line->rowid.', entity='.$conf->entity); |
|
| 1402 | 1402 | } |
| 1403 | 1403 | |
| 1404 | 1404 | if (!$error && $invoiceidgenerated >= 0) { |
@@ -1406,12 +1406,12 @@ discard block |
||
| 1406 | 1406 | $facturerec->date_last_gen = dol_now(); |
| 1407 | 1407 | $facturerec->date_when = $facturerec->getNextDate(); |
| 1408 | 1408 | $facturerec->update($user); |
| 1409 | - $this->db->commit('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->title); |
|
| 1410 | - dol_syslog('createRecurringInvoices Process invoice template ' .$facturerec->title. ' is finished with a success generation'); |
|
| 1409 | + $this->db->commit('createRecurringInvoices Process invoice template id='.$facturerec->id.', title='.$facturerec->title); |
|
| 1410 | + dol_syslog('createRecurringInvoices Process invoice template '.$facturerec->title.' is finished with a success generation'); |
|
| 1411 | 1411 | $nb_create++; |
| 1412 | 1412 | $this->output .= $langs->trans('InvoiceGeneratedFromTemplate', $new_fac_fourn->ref, $facturerec->title)."\n"; |
| 1413 | 1413 | } else { |
| 1414 | - $this->db->rollback('createRecurringInvoices Process invoice template error='.$error.' invoiceidgenerated='.$invoiceidgenerated.' LastStep='.$laststep.' id=' .$facturerec->id. ', title=' .$facturerec->title); |
|
| 1414 | + $this->db->rollback('createRecurringInvoices Process invoice template error='.$error.' invoiceidgenerated='.$invoiceidgenerated.' LastStep='.$laststep.' id='.$facturerec->id.', title='.$facturerec->title); |
|
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | $parameters = array( |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | } |
| 1505 | 1505 | $result .= $linkend; |
| 1506 | 1506 | global $action; |
| 1507 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
| 1507 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
| 1508 | 1508 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
| 1509 | 1509 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
| 1510 | 1510 | if ($reshook > 0) { |
@@ -1683,8 +1683,8 @@ discard block |
||
| 1683 | 1683 | $prodids = array(); |
| 1684 | 1684 | |
| 1685 | 1685 | $sql = 'SELECT rowid'; |
| 1686 | - $sql .= ' FROM ' .MAIN_DB_PREFIX. 'product'; |
|
| 1687 | - $sql .= ' WHERE entity IN (' .getEntity('product'). ')'; |
|
| 1686 | + $sql .= ' FROM '.MAIN_DB_PREFIX.'product'; |
|
| 1687 | + $sql .= ' WHERE entity IN ('.getEntity('product').')'; |
|
| 1688 | 1688 | $sql .= $this->db->plimit(100); |
| 1689 | 1689 | |
| 1690 | 1690 | $resql = $this->db->query($sql); |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | $xnbp = 0; |
| 1724 | 1724 | while ($xnbp < $nbp) { |
| 1725 | 1725 | $line = new FactureLigne($this->db); |
| 1726 | - $line->desc = $langs->trans('Description'). ' ' .$xnbp; |
|
| 1726 | + $line->desc = $langs->trans('Description').' '.$xnbp; |
|
| 1727 | 1727 | $line->qty = 1; |
| 1728 | 1728 | $line->subprice = 100; |
| 1729 | 1729 | $line->tva_tx = 19.6; |
@@ -1770,7 +1770,7 @@ discard block |
||
| 1770 | 1770 | |
| 1771 | 1771 | // Add a line "offered" |
| 1772 | 1772 | $line = new FactureLigne($this->db); |
| 1773 | - $line->desc = $langs->trans('Description'). ' (offered line)'; |
|
| 1773 | + $line->desc = $langs->trans('Description').' (offered line)'; |
|
| 1774 | 1774 | $line->qty = 1; |
| 1775 | 1775 | $line->subprice = 100; |
| 1776 | 1776 | $line->tva_tx = 19.6; |
@@ -1819,12 +1819,12 @@ discard block |
||
| 1819 | 1819 | public function setFrequencyAndUnit($frequency, $unit) |
| 1820 | 1820 | { |
| 1821 | 1821 | if (!$this->table_element) { |
| 1822 | - dol_syslog(get_class($this). '::setFrequencyAndUnit was called on object with property table_element not defined', LOG_ERR); |
|
| 1822 | + dol_syslog(get_class($this).'::setFrequencyAndUnit was called on object with property table_element not defined', LOG_ERR); |
|
| 1823 | 1823 | return -1; |
| 1824 | 1824 | } |
| 1825 | 1825 | |
| 1826 | 1826 | if (!empty($frequency) && empty($unit)) { |
| 1827 | - dol_syslog(get_class($this). '::setFrequencyAndUnit was called on object with params frequency defined but unit not defined', LOG_ERR); |
|
| 1827 | + dol_syslog(get_class($this).'::setFrequencyAndUnit was called on object with params frequency defined but unit not defined', LOG_ERR); |
|
| 1828 | 1828 | return -2; |
| 1829 | 1829 | } |
| 1830 | 1830 | |
@@ -1863,11 +1863,11 @@ discard block |
||
| 1863 | 1863 | return -1; |
| 1864 | 1864 | } |
| 1865 | 1865 | $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; |
| 1866 | - $sql .= " SET date_when = " .($date ? "'".$this->db->idate($date)."'" : "NULL"); |
|
| 1866 | + $sql .= " SET date_when = ".($date ? "'".$this->db->idate($date)."'" : "NULL"); |
|
| 1867 | 1867 | if ($increment_nb_gen_done > 0) { |
| 1868 | 1868 | $sql .= ", nb_gen_done = nb_gen_done + 1"; |
| 1869 | 1869 | } |
| 1870 | - $sql .= " WHERE rowid = " . (int) $this->id; |
|
| 1870 | + $sql .= " WHERE rowid = ".(int) $this->id; |
|
| 1871 | 1871 | |
| 1872 | 1872 | dol_syslog(get_class($this).'::setNextDate', LOG_DEBUG); |
| 1873 | 1873 | |
@@ -1901,8 +1901,8 @@ discard block |
||
| 1901 | 1901 | } |
| 1902 | 1902 | |
| 1903 | 1903 | $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; |
| 1904 | - $sql .= " SET nb_gen_max = ". (int) $nb; |
|
| 1905 | - $sql .= " WHERE rowid = " . (int) $this->id; |
|
| 1904 | + $sql .= " SET nb_gen_max = ".(int) $nb; |
|
| 1905 | + $sql .= " WHERE rowid = ".(int) $this->id; |
|
| 1906 | 1906 | |
| 1907 | 1907 | dol_syslog(get_class($this).'::setMaxPeriod', LOG_DEBUG); |
| 1908 | 1908 | |
@@ -1930,7 +1930,7 @@ discard block |
||
| 1930 | 1930 | |
| 1931 | 1931 | $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; |
| 1932 | 1932 | $sql .= " SET auto_validate = ".((int) $validate); |
| 1933 | - $sql .= " WHERE rowid = " . (int) $this->id; |
|
| 1933 | + $sql .= " WHERE rowid = ".(int) $this->id; |
|
| 1934 | 1934 | |
| 1935 | 1935 | dol_syslog(get_class($this).'::setAutoValidate', LOG_DEBUG); |
| 1936 | 1936 | |
@@ -1957,8 +1957,8 @@ discard block |
||
| 1957 | 1957 | } |
| 1958 | 1958 | |
| 1959 | 1959 | $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; |
| 1960 | - $sql .= " SET generate_pdf = ". (int) $validate; |
|
| 1961 | - $sql .= " WHERE rowid = " . (int) $this->id; |
|
| 1960 | + $sql .= " SET generate_pdf = ".(int) $validate; |
|
| 1961 | + $sql .= " WHERE rowid = ".(int) $this->id; |
|
| 1962 | 1962 | |
| 1963 | 1963 | dol_syslog(get_class($this).'::setGeneratePdf', LOG_DEBUG); |
| 1964 | 1964 | |
@@ -1986,7 +1986,7 @@ discard block |
||
| 1986 | 1986 | |
| 1987 | 1987 | $sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element; |
| 1988 | 1988 | $sql .= " SET modelpdf = '".$this->db->escape($model)."'"; |
| 1989 | - $sql .= " WHERE rowid = " . (int) $this->id; |
|
| 1989 | + $sql .= " WHERE rowid = ".(int) $this->id; |
|
| 1990 | 1990 | |
| 1991 | 1991 | dol_syslog(get_class($this).'::setModelPdf', LOG_DEBUG); |
| 1992 | 1992 | |
@@ -2066,8 +2066,8 @@ discard block |
||
| 2066 | 2066 | $error = 0; |
| 2067 | 2067 | $this->db->begin(); |
| 2068 | 2068 | |
| 2069 | - if (! $error) { |
|
| 2070 | - if (! $notrigger) { |
|
| 2069 | + if (!$error) { |
|
| 2070 | + if (!$notrigger) { |
|
| 2071 | 2071 | // Call triggers |
| 2072 | 2072 | $result = $this->call_trigger('LINESUPPLIERBILLREC_DELETE', $user); |
| 2073 | 2073 | if ($result < 0) { |
@@ -2077,15 +2077,15 @@ discard block |
||
| 2077 | 2077 | } |
| 2078 | 2078 | } |
| 2079 | 2079 | |
| 2080 | - if (! $error) { |
|
| 2080 | + if (!$error) { |
|
| 2081 | 2081 | $result = $this->deleteExtraFields(); |
| 2082 | 2082 | if ($result < 0) { |
| 2083 | 2083 | $error++; |
| 2084 | 2084 | } |
| 2085 | 2085 | } |
| 2086 | 2086 | |
| 2087 | - if (! $error) { |
|
| 2088 | - $sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element . ' WHERE rowid=' . (int) $this->id; |
|
| 2087 | + if (!$error) { |
|
| 2088 | + $sql = 'DELETE FROM '.MAIN_DB_PREFIX.$this->table_element.' WHERE rowid='.(int) $this->id; |
|
| 2089 | 2089 | |
| 2090 | 2090 | $res = $this->db->query($sql); |
| 2091 | 2091 | if ($res === false) { |
@@ -2125,7 +2125,7 @@ discard block |
||
| 2125 | 2125 | $sql .= ' p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc'; |
| 2126 | 2126 | $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn_det_rec as l'; |
| 2127 | 2127 | $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product = p.rowid'; |
| 2128 | - $sql .= ' WHERE l.rowid = '. (int) $rowid; |
|
| 2128 | + $sql .= ' WHERE l.rowid = '.(int) $rowid; |
|
| 2129 | 2129 | $sql .= ' ORDER BY l.rang'; |
| 2130 | 2130 | |
| 2131 | 2131 | dol_syslog('FactureRec::fetch', LOG_DEBUG); |
@@ -2140,7 +2140,7 @@ discard block |
||
| 2140 | 2140 | $this->ref_supplier = $objp->ref_supplier; |
| 2141 | 2141 | $this->label = $objp->label; |
| 2142 | 2142 | $this->description = $objp->line_desc; |
| 2143 | - $this->desc = $objp->line_desc; |
|
| 2143 | + $this->desc = $objp->line_desc; |
|
| 2144 | 2144 | $this->pu_ht = $objp->pu_ht; |
| 2145 | 2145 | $this->pu_ttc = $objp->pu_ttc; |
| 2146 | 2146 | $this->qty = $objp->qty; |
@@ -2198,44 +2198,44 @@ discard block |
||
| 2198 | 2198 | |
| 2199 | 2199 | include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; |
| 2200 | 2200 | |
| 2201 | - $sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture_fourn_det_rec SET'; |
|
| 2202 | - $sql .= ' fk_facture_fourn = ' . (int) $this->fk_facture_fourn; |
|
| 2203 | - $sql .= ', fk_parent_line = ' . (int) $this->fk_parent; |
|
| 2204 | - $sql .= ', fk_product = ' . (int) $this->fk_product; |
|
| 2205 | - $sql .= ', ref = ' . (!empty($this->ref) ? "'" . $this->db->escape($this->ref) . "'" : 'NULL'); |
|
| 2206 | - $sql .= ", label = " . (!empty($this->label) ? "'" . $this->db->escape($this->label) . "'" : 'NULL'); |
|
| 2207 | - $sql .= ", description = '" . $this->db->escape($this->desc ? $this->desc : $this->description) . "'"; |
|
| 2208 | - $sql .= ', pu_ht = ' . price2num($this->pu_ht); |
|
| 2209 | - $sql .= ', pu_ttc = ' . price2num($this->pu_ttc); |
|
| 2210 | - $sql .= ', qty = ' . price2num($this->qty); |
|
| 2211 | - $sql .= ", remise_percent = '" . price2num($this->remise_percent) . "'"; |
|
| 2212 | - $sql .= ', fk_remise_except = ' . (int) $this->fk_remise_except; |
|
| 2213 | - $sql .= ", vat_src_code = '" . $this->db->escape($this->vat_src_code) . "'"; |
|
| 2214 | - $sql .= ', tva_tx = ' . price2num($this->tva_tx); |
|
| 2215 | - $sql .= ', localtax1_tx = ' . price2num($this->localtax1_tx); |
|
| 2216 | - $sql .= ", localtax1_type = '" . $this->db->escape($this->localtax1_type) . "'"; |
|
| 2217 | - $sql .= ', localtax2_tx = ' . price2num($this->localtax2_tx); |
|
| 2218 | - $sql .= ", localtax2_type = '" . $this->db->escape($this->localtax2_type) . "'"; |
|
| 2201 | + $sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn_det_rec SET'; |
|
| 2202 | + $sql .= ' fk_facture_fourn = '.(int) $this->fk_facture_fourn; |
|
| 2203 | + $sql .= ', fk_parent_line = '.(int) $this->fk_parent; |
|
| 2204 | + $sql .= ', fk_product = '.(int) $this->fk_product; |
|
| 2205 | + $sql .= ', ref = '.(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'NULL'); |
|
| 2206 | + $sql .= ", label = ".(!empty($this->label) ? "'".$this->db->escape($this->label)."'" : 'NULL'); |
|
| 2207 | + $sql .= ", description = '".$this->db->escape($this->desc ? $this->desc : $this->description)."'"; |
|
| 2208 | + $sql .= ', pu_ht = '.price2num($this->pu_ht); |
|
| 2209 | + $sql .= ', pu_ttc = '.price2num($this->pu_ttc); |
|
| 2210 | + $sql .= ', qty = '.price2num($this->qty); |
|
| 2211 | + $sql .= ", remise_percent = '".price2num($this->remise_percent)."'"; |
|
| 2212 | + $sql .= ', fk_remise_except = '.(int) $this->fk_remise_except; |
|
| 2213 | + $sql .= ", vat_src_code = '".$this->db->escape($this->vat_src_code)."'"; |
|
| 2214 | + $sql .= ', tva_tx = '.price2num($this->tva_tx); |
|
| 2215 | + $sql .= ', localtax1_tx = '.price2num($this->localtax1_tx); |
|
| 2216 | + $sql .= ", localtax1_type = '".$this->db->escape($this->localtax1_type)."'"; |
|
| 2217 | + $sql .= ', localtax2_tx = '.price2num($this->localtax2_tx); |
|
| 2218 | + $sql .= ", localtax2_type = '".$this->db->escape($this->localtax2_type)."'"; |
|
| 2219 | 2219 | if (empty($this->skip_update_total)) { |
| 2220 | - $sql .= ', total_ht = ' . price2num($this->total_ht); |
|
| 2221 | - $sql .= ', total_tva = ' . price2num($this->total_tva); |
|
| 2222 | - $sql .= ', total_localtax1 = ' . price2num($this->total_localtax1); |
|
| 2223 | - $sql .= ', total_localtax2 = ' . price2num($this->total_localtax2); |
|
| 2224 | - $sql .= ', total_ttc = ' . price2num($this->total_ttc); |
|
| 2220 | + $sql .= ', total_ht = '.price2num($this->total_ht); |
|
| 2221 | + $sql .= ', total_tva = '.price2num($this->total_tva); |
|
| 2222 | + $sql .= ', total_localtax1 = '.price2num($this->total_localtax1); |
|
| 2223 | + $sql .= ', total_localtax2 = '.price2num($this->total_localtax2); |
|
| 2224 | + $sql .= ', total_ttc = '.price2num($this->total_ttc); |
|
| 2225 | 2225 | } |
| 2226 | - $sql .= ', product_type = ' . (int) $this->product_type; |
|
| 2227 | - $sql .= ', date_start = ' . (int) $this->date_start; |
|
| 2228 | - $sql .= ', date_end = ' . (int) $this->date_end; |
|
| 2229 | - $sql .= ", info_bits = " . ((int) $this->info_bits); |
|
| 2230 | - $sql .= ', special_code =' . (int) $this->special_code; |
|
| 2231 | - $sql .= ', rang = ' . (int) $this->rang; |
|
| 2232 | - $sql .= ', fk_unit = ' .($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : 'null'); |
|
| 2233 | - $sql .= ', fk_user_modif = ' . (int) $user->id; |
|
| 2234 | - $sql .= ' WHERE rowid = ' . (int) $this->id; |
|
| 2226 | + $sql .= ', product_type = '.(int) $this->product_type; |
|
| 2227 | + $sql .= ', date_start = '.(int) $this->date_start; |
|
| 2228 | + $sql .= ', date_end = '.(int) $this->date_end; |
|
| 2229 | + $sql .= ", info_bits = ".((int) $this->info_bits); |
|
| 2230 | + $sql .= ', special_code ='.(int) $this->special_code; |
|
| 2231 | + $sql .= ', rang = '.(int) $this->rang; |
|
| 2232 | + $sql .= ', fk_unit = '.($this->fk_unit ? "'".$this->db->escape($this->fk_unit)."'" : 'null'); |
|
| 2233 | + $sql .= ', fk_user_modif = '.(int) $user->id; |
|
| 2234 | + $sql .= ' WHERE rowid = '.(int) $this->id; |
|
| 2235 | 2235 | |
| 2236 | 2236 | $this->db->begin(); |
| 2237 | 2237 | |
| 2238 | - dol_syslog(get_class($this). '::updateline', LOG_DEBUG); |
|
| 2238 | + dol_syslog(get_class($this).'::updateline', LOG_DEBUG); |
|
| 2239 | 2239 | $resql = $this->db->query($sql); |
| 2240 | 2240 | if ($resql) { |
| 2241 | 2241 | if (!$error) { |