@@ -202,12 +202,12 @@ discard block |
||
| 202 | 202 | $httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - $url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource; |
|
| 205 | + $url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource; |
|
| 206 | 206 | |
| 207 | 207 | $options['apikey'] = $this->dolistore_api_key; |
| 208 | 208 | |
| 209 | 209 | if ($options) { |
| 210 | - $url .= '?' . http_build_query($options); |
|
| 210 | + $url .= '?'.http_build_query($options); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | $url .= (preg_match('/\?/', $url) ? '&' : '?').'apikey='.$this->dolistore_api_key; |
@@ -235,13 +235,13 @@ discard block |
||
| 235 | 235 | $modules = array(); |
| 236 | 236 | |
| 237 | 237 | if (!empty($this->cache_file) && file_exists($this->cache_file)) { |
| 238 | - dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG); |
|
| 238 | + dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG); |
|
| 239 | 239 | |
| 240 | 240 | $content = file_get_contents($this->cache_file); |
| 241 | 241 | if ($content !== false) { |
| 242 | 242 | $modules = $this->readYaml($content); |
| 243 | 243 | } else { |
| 244 | - dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR); |
|
| 244 | + dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR); |
|
| 245 | 245 | } |
| 246 | 246 | } |
| 247 | 247 | |
@@ -269,20 +269,20 @@ discard block |
||
| 269 | 269 | if (isset($resCategories['response']) && is_array($resCategories['response'])) { |
| 270 | 270 | $organized_tree = $resCategories['response']; |
| 271 | 271 | } else { |
| 272 | - return $html ; |
|
| 272 | + return $html; |
|
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | $html = ''; |
| 276 | 276 | foreach ($organized_tree as $key => $value) { |
| 277 | 277 | if ($value['label'] != "Versions" && $value['label'] != "Specials") { |
| 278 | - $html .= '<li' . ($current == $value['rowid'] ? ' class="active"' : '') . '>'; |
|
| 279 | - $html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>'; |
|
| 278 | + $html .= '<li'.($current == $value['rowid'] ? ' class="active"' : '').'>'; |
|
| 279 | + $html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>'; |
|
| 280 | 280 | if (isset($value['children'])) { |
| 281 | 281 | $html .= '<ul>'; |
| 282 | 282 | usort($value['children'], $this->buildSorter('position')); |
| 283 | 283 | foreach ($value['children'] as $key_children => $value_children) { |
| 284 | - $html .= '<li' . ($current == $value_children['rowid'] ? ' class="active"' : '') . '>'; |
|
| 285 | - $html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>'; |
|
| 284 | + $html .= '<li'.($current == $value_children['rowid'] ? ' class="active"' : '').'>'; |
|
| 285 | + $html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>'; |
|
| 286 | 286 | $html .= '</li>'; |
| 287 | 287 | } |
| 288 | 288 | $html .= '</ul>'; |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | |
| 305 | 305 | $html = ""; |
| 306 | 306 | $last_month = dol_now() - (30 * 24 * 60 * 60); |
| 307 | - $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
| 307 | + $dolibarrversiontouse = DOL_VERSION; // full string with version |
|
| 308 | 308 | |
| 309 | 309 | $this->products = array(); |
| 310 | 310 | |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | $this->no_page = $options['no_page'] ?? 1; |
| 314 | 314 | $this->search = $options['search'] ?? ''; |
| 315 | 315 | |
| 316 | - $this->per_page = 11; // We fix number of products per page to 11 |
|
| 316 | + $this->per_page = 11; // We fix number of products per page to 11 |
|
| 317 | 317 | |
| 318 | 318 | // Length of $search must be at least 2 characters |
| 319 | 319 | if (!empty($this->search) && strlen(str_replace(' ', '', (string) $this->search)) < 2) { |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $fileProducts = array(); |
| 355 | 355 | $fileProductsTotal = 0; |
| 356 | 356 | if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) { |
| 357 | - $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
| 357 | + $fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data |
|
| 358 | 358 | |
| 359 | 359 | $fileProducts = $this->adaptData($fileProducts, 'githubcommunity'); |
| 360 | 360 | |
@@ -383,7 +383,7 @@ discard block |
||
| 383 | 383 | * @param array<string, mixed> $b Second product for comparison. |
| 384 | 384 | * @return int |
| 385 | 385 | */ |
| 386 | - static function ($a, $b) { |
|
| 386 | + static function($a, $b) { |
|
| 387 | 387 | return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); |
| 388 | 388 | } |
| 389 | 389 | ); |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | if ($product['source'] === 'githubcommunity') { |
| 423 | 423 | $download_link = '<a class="paddingleft paddingright" target="_blank" href="'.$product["link"].'"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/follow.png" /></a>'; |
| 424 | 424 | if (!empty($product['direct-download']) && $product['direct-download'] == 'yes') { |
| 425 | - $urldownload = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
| 425 | + $urldownload = $product["dolistore-download"]; // In a future, we will have the download to the zip file |
|
| 426 | 426 | $reg = array(); |
| 427 | 427 | if (preg_match('/https:.*\?id=(\d+)$/', $urldownload, $reg)) { |
| 428 | 428 | $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$reg[1]; |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | if ($product['source'] === 'dolistore') { |
| 435 | - $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p=' . $product['id']; |
|
| 435 | + $urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$product['id']; |
|
| 436 | 436 | $download_link = '<a class="paddingleft paddingright" target="_blank" href="'.$this->shop_url.'/product.php?id='.((int) $product["id"]).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/follow.png" /></a>'; |
| 437 | 437 | $download_link .= '<a class="paddingleft paddingright" target="_blank" href="'.$urldownload.'" rel="noopener noreferrer"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/Download-128.png" /></a>'; |
| 438 | 438 | } |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | $version = '<span class="notcompatible">'.$langs->trans( |
| 456 | 456 | 'NotCompatible', |
| 457 | 457 | $dolibarrversiontouse, |
| 458 | - (float) $product["dolibarr_min"], |
|
| 458 | + (float) $product["dolibarr_min"], |
|
| 459 | 459 | (float) $product["dolibarr_max"] |
| 460 | 460 | ).'</span>'; |
| 461 | 461 | $compatible = 'NotCompatible'; |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | $version = '<span class="notcompatible">'.$langs->trans( |
| 467 | 467 | 'NotCompatible', |
| 468 | 468 | $dolibarrversiontouse, |
| 469 | - (float) $product["dolibarr_min"], |
|
| 469 | + (float) $product["dolibarr_min"], |
|
| 470 | 470 | (float) $product["dolibarr_max"] |
| 471 | 471 | ).'</span>'; |
| 472 | 472 | $compatible = 'NotCompatible'; |
@@ -485,12 +485,12 @@ discard block |
||
| 485 | 485 | // Output the line |
| 486 | 486 | $html .= '<tr class="app oddeven nohover '.dol_escape_htmltag($compatible).'">'; |
| 487 | 487 | $html .= '<td class="center width150"><div class="newAppParent">'; |
| 488 | - $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
| 488 | + $html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html |
|
| 489 | 489 | $html .= '</div></td>'; |
| 490 | 490 | $html .= '<td class="margeCote"><h2 class="appTitle">'; |
| 491 | 491 | $html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"])); |
| 492 | 492 | $html .= '<br><small>'; |
| 493 | - $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
| 493 | + $html .= $version; // No dol_escape_htmltag, it is already escape html |
|
| 494 | 494 | $html .= '</small></h2>'; |
| 495 | 495 | $html .= '<small> '; |
| 496 | 496 | if (empty($product['tms'])) { |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | |
| 524 | 524 | $this->numberOfProducts = count($this->products); |
| 525 | 525 | |
| 526 | - return $html ; |
|
| 526 | + return $html; |
|
| 527 | 527 | } |
| 528 | 528 | |
| 529 | 529 | /** |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | * @param array<string, mixed> $b |
| 541 | 541 | * @return int |
| 542 | 542 | */ |
| 543 | - function (array $a, array $b) use ($key) { |
|
| 543 | + function(array $a, array $b) use ($key) { |
|
| 544 | 544 | $valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : ''; |
| 545 | 545 | $valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : ''; |
| 546 | 546 | |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | $pagelist .= '<li class="pagination">'; |
| 694 | 694 | $pagelist .= '<label for="page_input">Page </label>'; |
| 695 | 695 | if ($this->categorie != 0) { |
| 696 | - $pagelist .= '<input type="hidden" name="categorie" value="' . $this->categorie . '">'; |
|
| 696 | + $pagelist .= '<input type="hidden" name="categorie" value="'.$this->categorie.'">'; |
|
| 697 | 697 | } |
| 698 | 698 | $pagelist .= '<input type="text" id="page_input" name="no_page" value="'.($page).'" min="1" max="'.$nbpages.'" class="width40 page_input" oninput="if(this.value > '.$nbpages.') this.value='.$nbpages.'">'; |
| 699 | 699 | $pagelist .= ' / '.$nbpages; |
@@ -743,12 +743,12 @@ discard block |
||
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | // Get the predefined error message or use a default one |
| 746 | - $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code']; |
|
| 746 | + $error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code']; |
|
| 747 | 747 | |
| 748 | 748 | // Append error details if available |
| 749 | 749 | if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) { |
| 750 | 750 | foreach ($request['response']['errors'] as $error) { |
| 751 | - $error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message']; |
|
| 751 | + $error_message .= ' - (Code '.$error['code'].'): '.$error['message']; |
|
| 752 | 752 | } |
| 753 | 753 | } |
| 754 | 754 | |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | * |
| 975 | 975 | * @return int |
| 976 | 976 | */ |
| 977 | - static function ($a, $b) { |
|
| 977 | + static function($a, $b) { |
|
| 978 | 978 | return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0'); |
| 979 | 979 | } |
| 980 | 980 | ); |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | * |
| 990 | 990 | * @return bool |
| 991 | 991 | */ |
| 992 | - static function ($package) use ($options) { |
|
| 992 | + static function($package) use ($options) { |
|
| 993 | 993 | return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false; |
| 994 | 994 | } |
| 995 | 995 | ); |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | * |
| 1006 | 1006 | * @return bool |
| 1007 | 1007 | */ |
| 1008 | - static function ($package) use ($options) { |
|
| 1008 | + static function($package) use ($options) { |
|
| 1009 | 1009 | return in_array($options['categorieid'], $package['category']); |
| 1010 | 1010 | } |
| 1011 | 1011 | ); |
@@ -95,32 +95,32 @@ discard block |
||
| 95 | 95 | $h = 0; |
| 96 | 96 | $head = array(); |
| 97 | 97 | |
| 98 | - $head[$h][0] = DOL_URL_ROOT . '/asset/card.php?id=' . $object->id; |
|
| 98 | + $head[$h][0] = DOL_URL_ROOT.'/asset/card.php?id='.$object->id; |
|
| 99 | 99 | $head[$h][1] = $langs->trans("Asset"); |
| 100 | 100 | $head[$h][2] = 'card'; |
| 101 | 101 | $h++; |
| 102 | 102 | |
| 103 | 103 | if (empty($object->not_depreciated)) { |
| 104 | - $head[$h][0] = DOL_URL_ROOT . '/asset/depreciation_options.php?id=' . $object->id; |
|
| 104 | + $head[$h][0] = DOL_URL_ROOT.'/asset/depreciation_options.php?id='.$object->id; |
|
| 105 | 105 | $head[$h][1] = $langs->trans("AssetDepreciationOptions"); |
| 106 | 106 | $head[$h][2] = 'depreciation_options'; |
| 107 | 107 | $h++; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - $head[$h][0] = DOL_URL_ROOT . '/asset/accountancy_codes.php?id=' . $object->id; |
|
| 110 | + $head[$h][0] = DOL_URL_ROOT.'/asset/accountancy_codes.php?id='.$object->id; |
|
| 111 | 111 | $head[$h][1] = $langs->trans("AssetAccountancyCodes"); |
| 112 | 112 | $head[$h][2] = 'accountancy_codes'; |
| 113 | 113 | $h++; |
| 114 | 114 | |
| 115 | 115 | if (empty($object->not_depreciated)) { |
| 116 | - $head[$h][0] = DOL_URL_ROOT . '/asset/depreciation.php?id=' . $object->id; |
|
| 116 | + $head[$h][0] = DOL_URL_ROOT.'/asset/depreciation.php?id='.$object->id; |
|
| 117 | 117 | $head[$h][1] = $langs->trans("AssetDepreciation"); |
| 118 | 118 | $head[$h][2] = 'depreciation'; |
| 119 | 119 | $h++; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | if (isset($object->disposal_date) && $object->disposal_date !== "") { |
| 123 | - $head[$h][0] = DOL_URL_ROOT . '/asset/disposal.php?id=' . $object->id; |
|
| 123 | + $head[$h][0] = DOL_URL_ROOT.'/asset/disposal.php?id='.$object->id; |
|
| 124 | 124 | $head[$h][1] = $langs->trans("AssetDisposal"); |
| 125 | 125 | $head[$h][2] = 'disposal'; |
| 126 | 126 | $h++; |
@@ -134,29 +134,29 @@ discard block |
||
| 134 | 134 | if (!empty($object->note_public)) { |
| 135 | 135 | $nbNote++; |
| 136 | 136 | } |
| 137 | - $head[$h][0] = DOL_URL_ROOT . '/asset/note.php?id=' . $object->id; |
|
| 137 | + $head[$h][0] = DOL_URL_ROOT.'/asset/note.php?id='.$object->id; |
|
| 138 | 138 | $head[$h][1] = $langs->trans('Notes'); |
| 139 | 139 | if ($nbNote > 0) { |
| 140 | - $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">' . $nbNote . '</span>' : ''); |
|
| 140 | + $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : ''); |
|
| 141 | 141 | } |
| 142 | 142 | $head[$h][2] = 'note'; |
| 143 | 143 | $h++; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 147 | - require_once DOL_DOCUMENT_ROOT . '/core/class/link.class.php'; |
|
| 148 | - $upload_dir = $conf->asset->dir_output . "/asset/" . dol_sanitizeFileName($object->ref); |
|
| 146 | + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 147 | + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; |
|
| 148 | + $upload_dir = $conf->asset->dir_output."/asset/".dol_sanitizeFileName($object->ref); |
|
| 149 | 149 | $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); |
| 150 | 150 | $nbLinks = Link::count($db, $object->element, $object->id); |
| 151 | - $head[$h][0] = DOL_URL_ROOT . '/asset/document.php?id=' . $object->id; |
|
| 151 | + $head[$h][0] = DOL_URL_ROOT.'/asset/document.php?id='.$object->id; |
|
| 152 | 152 | $head[$h][1] = $langs->trans('Documents'); |
| 153 | 153 | if (($nbFiles + $nbLinks) > 0) { |
| 154 | - $head[$h][1] .= '<span class="badge marginleftonlyshort">' . ($nbFiles + $nbLinks) . '</span>'; |
|
| 154 | + $head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>'; |
|
| 155 | 155 | } |
| 156 | 156 | $head[$h][2] = 'document'; |
| 157 | 157 | $h++; |
| 158 | 158 | |
| 159 | - $head[$h][0] = DOL_URL_ROOT . '/asset/agenda.php?id=' . $object->id; |
|
| 159 | + $head[$h][0] = DOL_URL_ROOT.'/asset/agenda.php?id='.$object->id; |
|
| 160 | 160 | $head[$h][1] = $langs->trans("Events"); |
| 161 | 161 | $head[$h][2] = 'agenda'; |
| 162 | 162 | $h++; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $h = 0; |
| 192 | 192 | $head = array(); |
| 193 | 193 | |
| 194 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/card.php?id=' . $object->id; |
|
| 194 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/card.php?id='.$object->id; |
|
| 195 | 195 | $head[$h][1] = $langs->trans("Card"); |
| 196 | 196 | $head[$h][2] = 'card'; |
| 197 | 197 | $h++; |
@@ -204,16 +204,16 @@ discard block |
||
| 204 | 204 | if (!empty($object->note_public)) { |
| 205 | 205 | $nbNote++; |
| 206 | 206 | } |
| 207 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/note.php?id=' . $object->id; |
|
| 207 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/note.php?id='.$object->id; |
|
| 208 | 208 | $head[$h][1] = $langs->trans('Notes'); |
| 209 | 209 | if ($nbNote > 0) { |
| 210 | - $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">' . $nbNote . '</span>' : ''); |
|
| 210 | + $head[$h][1] .= (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') ? '<span class="badge marginleftonlyshort">'.$nbNote.'</span>' : ''); |
|
| 211 | 211 | } |
| 212 | 212 | $head[$h][2] = 'note'; |
| 213 | 213 | $h++; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - $head[$h][0] = DOL_URL_ROOT . '/asset/model/agenda.php?id=' . $object->id; |
|
| 216 | + $head[$h][0] = DOL_URL_ROOT.'/asset/model/agenda.php?id='.$object->id; |
|
| 217 | 217 | $head[$h][1] = $langs->trans("Events"); |
| 218 | 218 | $head[$h][2] = 'agenda'; |
| 219 | 219 | $h++; |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $mesCasesCochees = GETPOST('toselect', 'array'); |
| 67 | 67 | |
| 68 | 68 | // Search Getpost |
| 69 | -$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 69 | +$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 70 | 70 | $search_societe = GETPOST('search_societe', 'alpha'); |
| 71 | 71 | $search_ref = GETPOST('search_ref', 'alpha'); |
| 72 | 72 | $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 83 | 83 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 84 | 84 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 85 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 85 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 86 | 86 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 87 | 87 | $search_country = GETPOST('search_country', 'aZ09'); |
| 88 | 88 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -129,19 +129,19 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | $arrayfields = array( |
| 132 | - 'l.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 133 | - 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 134 | - 'f.libelle' => array('label' => "InvoiceLabel", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 135 | - 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, l.rowid |
|
| 136 | - 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 137 | - 'l.description' => array('label' => "ProducDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 138 | - 'l.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 139 | - 'l.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 140 | - 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 141 | - 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 142 | - 's.tva_intra' => array('label' => "VATIntraShort", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 143 | - 'aa.data_suggest' => array('label' => "DataUsedToSuggestAccount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // Seems not used in search. |
|
| 144 | - 'aa.account_number' => array('label' => "AccountAccountingSuggest", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 132 | + 'l.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 133 | + 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 134 | + 'f.libelle' => array('label' => "InvoiceLabel", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 135 | + 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, l.rowid |
|
| 136 | + 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 137 | + 'l.description' => array('label' => "ProducDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 138 | + 'l.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 139 | + 'l.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 140 | + 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 141 | + 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 142 | + 's.tva_intra' => array('label' => "VATIntraShort", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 143 | + 'aa.data_suggest' => array('label' => "DataUsedToSuggestAccount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // Seems not used in search. |
|
| 144 | + 'aa.account_number' => array('label' => "AccountAccountingSuggest", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 145 | 145 | ); |
| 146 | 146 | // @phpstan-ignore-next-line |
| 147 | 147 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -306,20 +306,20 @@ discard block |
||
| 306 | 306 | $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; |
| 307 | 307 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
| 308 | 308 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 309 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
| 309 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
| 310 | 310 | } |
| 311 | 311 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
| 312 | 312 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn"; |
| 313 | 313 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; |
| 314 | 314 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 315 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 315 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 316 | 316 | } |
| 317 | 317 | $alias_societe_perentity = !getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED') ? "s" : "spe"; |
| 318 | 318 | $alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe"; |
| 319 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
| 320 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
| 321 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
| 322 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
| 319 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON ".$alias_product_perentity.".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
| 320 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
| 321 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
| 322 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON ".$alias_societe_perentity.".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
| 323 | 323 | |
| 324 | 324 | $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; |
| 325 | 325 | $sql .= " AND l.product_type <= 2"; |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | $moreforfilter = ''; |
| 528 | 528 | |
| 529 | 529 | $varpage = $contextpage; |
| 530 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 530 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 531 | 531 | $selectedfields = $htmlofselectarray; |
| 532 | 532 | $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); |
| 533 | 533 | |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | $thirdpartystatic->email = $objp->email; |
| 746 | 746 | $thirdpartystatic->country_code = $objp->country_code; |
| 747 | 747 | $thirdpartystatic->tva_intra = $objp->tva_intra; |
| 748 | - $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
| 748 | + $thirdpartystatic->code_compta_product = $objp->company_code_buy; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
| 749 | 749 | |
| 750 | 750 | $product_static->ref = $objp->product_ref; |
| 751 | 751 | $product_static->id = $objp->product_id; |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | if ($conf->main_checkbox_left_column) { |
| 824 | 824 | print '<td class="nowrap center actioncolumn">'; |
| 825 | 825 | $selected = in_array($objp->rowid."_".$i, $toselect); |
| 826 | - print '<input type="checkbox" class="flat checkforselect checkforselect'.$facturefourn_static_det->id.'" name="toselect[]" value="'.$facturefourn_static_det->id."_".$i.'"'.($selected ? " checked" : "").'/>'; print '</td>'; |
|
| 826 | + print '<input type="checkbox" class="flat checkforselect checkforselect'.$facturefourn_static_det->id.'" name="toselect[]" value="'.$facturefourn_static_det->id."_".$i.'"'.($selected ? " checked" : "").'/>'; print '</td>'; |
|
| 827 | 827 | if (!$i) { |
| 828 | 828 | $totalarray['nbfield']++; |
| 829 | 829 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $changeaccount = GETPOST('changeaccount', 'array'); |
| 57 | 57 | // Search Getpost |
| 58 | 58 | $search_societe = GETPOST('search_societe', 'alpha'); |
| 59 | -$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 59 | +$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 60 | 60 | $search_ref = GETPOST('search_ref', 'alpha'); |
| 61 | 61 | $search_invoice = GETPOST('search_invoice', 'alpha'); |
| 62 | 62 | //$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 72 | 72 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 73 | 73 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 74 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 74 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 75 | 75 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 76 | 76 | $search_country = GETPOST('search_country', 'aZ09'); |
| 77 | 77 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -116,18 +116,18 @@ discard block |
||
| 116 | 116 | $formaccounting = new FormAccounting($db); |
| 117 | 117 | |
| 118 | 118 | $arrayfields = array( |
| 119 | - 'l.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 120 | - 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 121 | - 'f.libelle' => array('label' => "InvoiceLabel", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 122 | - 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, l.rowid |
|
| 123 | - 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 124 | - 'l.description' => array('label' => "ProductDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 125 | - 'l.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 126 | - 'l.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 127 | - 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 128 | - 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 129 | - 's.tva_intra' => array('label' => "VATIntra", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 130 | - 'aa.account_number' => array('label' => "AccountAccounting", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 119 | + 'l.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 120 | + 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 121 | + 'f.libelle' => array('label' => "InvoiceLabel", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 122 | + 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, l.rowid |
|
| 123 | + 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 124 | + 'l.description' => array('label' => "ProductDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 125 | + 'l.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 126 | + 'l.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 127 | + 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 128 | + 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 129 | + 's.tva_intra' => array('label' => "VATIntra", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 130 | + 'aa.account_number' => array('label' => "AccountAccounting", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 131 | 131 | ); |
| 132 | 132 | // @phpstan-ignore-next-line |
| 133 | 133 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -259,13 +259,13 @@ discard block |
||
| 259 | 259 | $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; |
| 260 | 260 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; |
| 261 | 261 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 262 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 262 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 263 | 263 | } |
| 264 | 264 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = l.fk_code_ventilation"; |
| 265 | 265 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON f.rowid = l.fk_facture_fourn"; |
| 266 | 266 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
| 267 | 267 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 268 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
| 268 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
| 269 | 269 | } |
| 270 | 270 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
| 271 | 271 | $sql .= " WHERE f.rowid = l.fk_facture_fourn and f.fk_statut >= 1 AND l.fk_code_ventilation <> 0 "; |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $moreforfilter = ''; |
| 436 | 436 | |
| 437 | 437 | $varpage = $contextpage; |
| 438 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 438 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 439 | 439 | $selectedfields = $htmlofselectarray; |
| 440 | 440 | $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); |
| 441 | 441 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | // Search Getpost |
| 68 | 68 | $search_societe = GETPOST('search_societe', 'alpha'); |
| 69 | -$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 69 | +$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 70 | 70 | $search_ref = GETPOST('search_ref', 'alpha'); |
| 71 | 71 | $search_invoice = GETPOST('search_invoice', 'alpha'); |
| 72 | 72 | $search_label = GETPOST('search_label', 'alpha'); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 81 | 81 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 82 | 82 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 83 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 83 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 84 | 84 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 85 | 85 | $search_country = GETPOST('search_country', 'aZ09'); |
| 86 | 86 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -132,18 +132,18 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | $arrayfields = array( |
| 135 | - 'l.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 136 | - 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 137 | - 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, l.rowid |
|
| 138 | - 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 139 | - 'l.description' => array('label' => "ProductDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 140 | - 'l.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 141 | - 'l.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 142 | - 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 143 | - 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 144 | - 's.tva_intra' => array('label' => "VATIntraShort", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 145 | - 'aa.data_suggest' => array('label' => "DataUsedToSuggestAccount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // Seems not used in search. |
|
| 146 | - 'aa.account_number' => array('label' => "AccountAccountingSuggest", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 135 | + 'l.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 136 | + 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 137 | + 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, l.rowid |
|
| 138 | + 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 139 | + 'l.description' => array('label' => "ProductDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 140 | + 'l.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 141 | + 'l.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 142 | + 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 143 | + 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 144 | + 's.tva_intra' => array('label' => "VATIntraShort", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 145 | + 'aa.data_suggest' => array('label' => "DataUsedToSuggestAccount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // Seems not used in search. |
|
| 146 | + 'aa.account_number' => array('label' => "AccountAccountingSuggest", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 147 | 147 | ); |
| 148 | 148 | // @phpstan-ignore-next-line |
| 149 | 149 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -303,20 +303,20 @@ discard block |
||
| 303 | 303 | $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; |
| 304 | 304 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
| 305 | 305 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 306 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
| 306 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
| 307 | 307 | } |
| 308 | 308 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
| 309 | 309 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facturedet as l ON f.rowid = l.fk_facture"; |
| 310 | 310 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product"; |
| 311 | 311 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 312 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 312 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 313 | 313 | } |
| 314 | 314 | $alias_societe_perentity = !getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED') ? "s" : "spe"; |
| 315 | 315 | $alias_product_perentity = !getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') ? "p" : "ppe"; |
| 316 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
| 317 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
| 318 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
| 319 | -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
| 316 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON ".$alias_product_perentity.".accountancy_code_sell = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity; |
|
| 317 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON ".$alias_product_perentity.".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity; |
|
| 318 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON ".$alias_product_perentity.".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity; |
|
| 319 | +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON ".$alias_societe_perentity.".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity; |
|
| 320 | 320 | |
| 321 | 321 | $sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0"; |
| 322 | 322 | $sql .= " AND l.product_type <= 2"; |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | $moreforfilter = ''; |
| 519 | 519 | |
| 520 | 520 | $varpage = $contextpage; |
| 521 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 521 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 522 | 522 | $selectedfields = $htmlofselectarray; |
| 523 | 523 | $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); |
| 524 | 524 | |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | |
| 702 | 702 | |
| 703 | 703 | $accountingaccount_codetotid_cache = array(); |
| 704 | - $suggestedaccountingaccountfor = ''; // Initialise (for static analysis) |
|
| 704 | + $suggestedaccountingaccountfor = ''; // Initialise (for static analysis) |
|
| 705 | 705 | $suggestedaccountingaccountbydefaultfor = ''; |
| 706 | 706 | |
| 707 | 707 | while ($i < min($num_lines, $limit)) { |
@@ -719,14 +719,14 @@ discard block |
||
| 719 | 719 | $thirdpartystatic->client = $objp->client; |
| 720 | 720 | $thirdpartystatic->fournisseur = $objp->fournisseur; |
| 721 | 721 | $thirdpartystatic->code_client = $objp->code_client; |
| 722 | - $thirdpartystatic->code_compta = $objp->code_compta_client; // For backward compatibility |
|
| 722 | + $thirdpartystatic->code_compta = $objp->code_compta_client; // For backward compatibility |
|
| 723 | 723 | $thirdpartystatic->code_compta_client = $objp->code_compta_client; |
| 724 | 724 | $thirdpartystatic->code_fournisseur = $objp->code_fournisseur; |
| 725 | 725 | $thirdpartystatic->code_compta_fournisseur = $objp->code_compta_fournisseur; |
| 726 | 726 | $thirdpartystatic->email = $objp->email; |
| 727 | 727 | $thirdpartystatic->country_code = $objp->country_code; |
| 728 | 728 | $thirdpartystatic->tva_intra = $objp->tva_intra; |
| 729 | - $thirdpartystatic->code_compta_product = $objp->company_code_sell; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
| 729 | + $thirdpartystatic->code_compta_product = $objp->company_code_sell; // The accounting account for product stored on thirdparty object (for level3 suggestion) |
|
| 730 | 730 | |
| 731 | 731 | $product_static->ref = $objp->product_ref; |
| 732 | 732 | $product_static->id = $objp->product_id; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 70 | 70 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 71 | 71 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 72 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 72 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 73 | 73 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 74 | 74 | $search_country = GETPOST('search_country', 'aZ09'); |
| 75 | 75 | $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); |
@@ -109,22 +109,22 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // Initialize technical objects |
| 111 | 111 | $contextpage = 'accountancycustomerlines'; |
| 112 | -$hookmanager->initHooks([$contextpage ]); |
|
| 112 | +$hookmanager->initHooks([$contextpage]); |
|
| 113 | 113 | $formaccounting = new FormAccounting($db); |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | $arrayfields = array( |
| 117 | - 'fd.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 118 | - 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 119 | - 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, fd.rowid |
|
| 120 | - 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 121 | - 'fd.description' => array('label' => "ProductDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 122 | - 'fd.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 123 | - 'fd.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 124 | - 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 125 | - 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 126 | - 's.tva_intra' => array('label' => "VATIntra", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 127 | - 'aa.account_number' => array('label' => "AccountAccounting", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 117 | + 'fd.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 118 | + 'f.ref' => array('label' => "Invoice", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 119 | + 'f.datef' => array('label' => "Date", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // f.datef, f.ref, fd.rowid |
|
| 120 | + 'p.ref' => array('label' => "ProductRef", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 121 | + 'fd.description' => array('label' => "ProductDescription", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 122 | + 'fd.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 123 | + 'fd.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 124 | + 's.nom' => array('label' => "ThirdParty", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 125 | + 'co.label' => array('label' => "Country", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 126 | + 's.tva_intra' => array('label' => "VATIntra", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 127 | + 'aa.account_number' => array('label' => "AccountAccounting", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 128 | 128 | ); |
| 129 | 129 | // @phpstan-ignore-next-line |
| 130 | 130 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -255,13 +255,13 @@ discard block |
||
| 255 | 255 | $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd"; |
| 256 | 256 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = fd.fk_product"; |
| 257 | 257 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
| 258 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity); |
|
| 258 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity); |
|
| 259 | 259 | } |
| 260 | 260 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.rowid = fd.fk_code_ventilation"; |
| 261 | 261 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture as f ON f.rowid = fd.fk_facture"; |
| 262 | 262 | $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; |
| 263 | 263 | if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) { |
| 264 | - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity); |
|
| 264 | + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = ".((int) $conf->entity); |
|
| 265 | 265 | } |
| 266 | 266 | $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays "; |
| 267 | 267 | $sql .= " WHERE fd.fk_code_ventilation > 0"; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | $moreforfilter = ''; |
| 428 | 428 | |
| 429 | 429 | $varpage = $contextpage; |
| 430 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 430 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 431 | 431 | $selectedfields = $htmlofselectarray; |
| 432 | 432 | $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); |
| 433 | 433 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear); |
| 97 | 97 | $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); |
| 98 | 98 | |
| 99 | -$pastmonth = null; // Initialise for static analysis (could be really unseg) |
|
| 99 | +$pastmonth = null; // Initialise for static analysis (could be really unseg) |
|
| 100 | 100 | $pastmonthyear = null; |
| 101 | 101 | |
| 102 | 102 | if (empty($date_startmonth)) { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $tabpay[$obj->rowid] = array( |
| 172 | 172 | 'id' => $obj->rowid, |
| 173 | 173 | 'date' => $db->jdate($obj->do), |
| 174 | - 'type_payment' => $obj->fk_type,// CHQ, VIR, LIQ, CB, ... |
|
| 174 | + 'type_payment' => $obj->fk_type, // CHQ, VIR, LIQ, CB, ... |
|
| 175 | 175 | 'ref' => $obj->label, // by default, not unique. May be changed later |
| 176 | 176 | 'fk_bank_account' => $obj->fk_account, |
| 177 | 177 | 'objects' => array(), |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $sql .= " AND fd.product_type IN (0,1)"; |
| 234 | 234 | $sql .= " AND f.type IN (".Facture::TYPE_STANDARD.",".Facture::TYPE_REPLACEMENT.",".Facture::TYPE_CREDIT_NOTE.",".(!getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS') ? Facture::TYPE_DEPOSIT."," : "").Facture::TYPE_SITUATION.")"; |
| 235 | 235 | $sql .= " AND bu.fk_bank IN (".$db->sanitize(implode(',', $ids)).")"; |
| 236 | - $sql .= " GROUP BY fd.rowid, bu.fk_bank, pf.amount, bu.url_id"; // TODO Must never have a GROUP BY on a field if field is not inside an aggregate function. |
|
| 236 | + $sql .= " GROUP BY fd.rowid, bu.fk_bank, pf.amount, bu.url_id"; // TODO Must never have a GROUP BY on a field if field is not inside an aggregate function. |
|
| 237 | 237 | $sql .= " ORDER BY aa.account_number"; |
| 238 | 238 | |
| 239 | 239 | $resql = $db->query($sql); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $static_invoice->ref = $obj->ref; |
| 270 | 270 | $tabobject[$object_key] = array( |
| 271 | 271 | 'id' => $obj->rowid, |
| 272 | - 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
| 272 | + 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
| 273 | 273 | 'total_ht' => $obj->invoice_total_ht, |
| 274 | 274 | 'total_ttc' => $obj->invoice_total_ttc, |
| 275 | 275 | 'url' => $static_invoice->getNomUrl(1), |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | $static_supplier_invoice->ref = $obj->ref; |
| 383 | 383 | $tabobject[$object_key] = array( |
| 384 | 384 | 'id' => $obj->rowid, |
| 385 | - 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
| 385 | + 'ref' => $obj->ref, // It would be better to have a doc_ref that is 'BankId '.$obj->fk_bank.' - Facture FAzzz' and not just 'FAzzz' to be protected against duplicate, where xxx = $obj->fk_bank |
|
| 386 | 386 | 'total_ht' => -$obj->supplier_invoice_total_ht, |
| 387 | 387 | 'total_ttc' => -$obj->supplier_invoice_total_ttc, |
| 388 | 388 | 'url' => $static_supplier_invoice->getNomUrl(1), |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | } else { |
| 916 | 916 | $sql .= " LEFT JOIN ".$db->prefix()."accounting_bookkeeping as ab ON ab.fk_doc=bu.fk_bank AND ab.fk_docdet=pv.rowid"; |
| 917 | 917 | } |
| 918 | - $sql .= " WHERE pv.entity IN (".getEntity('payment_various', 0).')'; // We don't share object for accountancy, we use source object sharing |
|
| 918 | + $sql .= " WHERE pv.entity IN (".getEntity('payment_various', 0).')'; // We don't share object for accountancy, we use source object sharing |
|
| 919 | 919 | $sql .= " AND bu.fk_bank IN (".$db->sanitize(implode(',', $ids)).")"; |
| 920 | 920 | // Not already in bookkeeping |
| 921 | 921 | if ($in_bookkeeping == 'notyet') { |
@@ -1308,7 +1308,7 @@ discard block |
||
| 1308 | 1308 | $error++; |
| 1309 | 1309 | |
| 1310 | 1310 | if ($error >= $MAXNBERRORS) { |
| 1311 | - break; // Break in the foreach |
|
| 1311 | + break; // Break in the foreach |
|
| 1312 | 1312 | } |
| 1313 | 1313 | } |
| 1314 | 1314 | } |
@@ -1322,7 +1322,7 @@ discard block |
||
| 1322 | 1322 | $MAXNBERRORS = 5; |
| 1323 | 1323 | if ($error >= $MAXNBERRORS) { |
| 1324 | 1324 | setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors'); |
| 1325 | - break; // Break in the foreach |
|
| 1325 | + break; // Break in the foreach |
|
| 1326 | 1326 | } |
| 1327 | 1327 | } |
| 1328 | 1328 | } |
@@ -1347,7 +1347,7 @@ discard block |
||
| 1347 | 1347 | $param .= '&date_endmonth='.$date_endmonth; |
| 1348 | 1348 | $param .= '&date_endyear='.$date_endyear; |
| 1349 | 1349 | $param .= '&in_bookkeeping='.$in_bookkeeping; |
| 1350 | - header("Location: " . $_SERVER['PHP_SELF'] . '?' . $param); |
|
| 1350 | + header("Location: ".$_SERVER['PHP_SELF'].'?'.$param); |
|
| 1351 | 1351 | exit; |
| 1352 | 1352 | } |
| 1353 | 1353 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 75 | 75 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 76 | 76 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 77 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 77 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 78 | 78 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 79 | 79 | |
| 80 | 80 | // Define begin binding date |
@@ -125,19 +125,19 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | $arrayfields = array( |
| 128 | - 'erd.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 129 | - 'u.login' => array('label' => "Employees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 130 | - 'er.ref' => array('label' => "ExpenseReport", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 131 | - 'erd.date' => array('label' => "DateOfLine", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 132 | - 'f.label' => array('label' => "TypeFees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 133 | - 'erd.comments' => array('label' => "Description", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 134 | - 'erd.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 135 | - 'erd.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 136 | - 'aa.data_suggest' => array('label' => "DataUsedToSuggestAccount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // Seems not used in search. |
|
| 137 | - 'aa.account_number' => array('label' => "AccountAccountingSuggest", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 128 | + 'erd.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 129 | + 'u.login' => array('label' => "Employees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 130 | + 'er.ref' => array('label' => "ExpenseReport", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 131 | + 'erd.date' => array('label' => "DateOfLine", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 132 | + 'f.label' => array('label' => "TypeFees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 133 | + 'erd.comments' => array('label' => "Description", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 134 | + 'erd.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 135 | + 'erd.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 136 | + 'aa.data_suggest' => array('label' => "DataUsedToSuggestAccount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), // Seems not used in search. |
|
| 137 | + 'aa.account_number' => array('label' => "AccountAccountingSuggest", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 138 | 138 | ); |
| 139 | 139 | if (getDolGlobalString('ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE')) { |
| 140 | - $arrayfields['er.date_valid'] = array('label' => "DateValidation", 'position' => 1, 'checked' => '1', 'enabled' => '1'); |
|
| 140 | + $arrayfields['er.date_valid'] = array('label' => "DateValidation", 'position' => 1, 'checked' => '1', 'enabled' => '1'); |
|
| 141 | 141 | } |
| 142 | 142 | // @phpstan-ignore-next-line |
| 143 | 143 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $permissiontoread = $user->hasRight('accounting', 'read'); |
| 193 | 193 | $permissiontodelete = $user->hasRight('accounting', 'delete'); |
| 194 | 194 | $uploaddir = $conf->expensereport->dir_output; |
| 195 | - include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php'; |
|
| 195 | + include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | |
@@ -425,7 +425,7 @@ discard block |
||
| 425 | 425 | $moreforfilter = ''; |
| 426 | 426 | |
| 427 | 427 | $varpage = $contextpage; |
| 428 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 428 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 429 | 429 | $selectedfields = $htmlofselectarray; |
| 430 | 430 | $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); |
| 431 | 431 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $account_parent = GETPOST('account_parent'); |
| 52 | 52 | $changeaccount = GETPOST('changeaccount', 'array'); |
| 53 | 53 | // Search Getpost |
| 54 | -$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 54 | +$search_lineid = GETPOST('search_lineid', 'alpha'); // Can be '> 100' |
|
| 55 | 55 | $search_login = GETPOST('search_login', 'alpha'); |
| 56 | 56 | $search_expensereport = GETPOST('search_expensereport', 'alpha'); |
| 57 | 57 | $search_label = GETPOST('search_label', 'alpha'); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $search_date_endday = GETPOSTINT('search_date_endday'); |
| 66 | 66 | $search_date_endmonth = GETPOSTINT('search_date_endmonth'); |
| 67 | 67 | $search_date_endyear = GETPOSTINT('search_date_endyear'); |
| 68 | -$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 68 | +$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver |
|
| 69 | 69 | $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); |
| 70 | 70 | |
| 71 | 71 | // Load variable for pagination |
@@ -108,18 +108,18 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | $arrayfields = array( |
| 111 | - 'erd.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 112 | - 'u.login' => array('label' => "Employees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 113 | - 'er.ref' => array('label' => "ExpenseReport", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 114 | - 'erd.date' => array('label' => "DateOfLine", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 115 | - 'f.label' => array('label' => "TypeFees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 116 | - 'erd.comments' => array('label' => "Description", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 117 | - 'erd.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 118 | - 'erd.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 119 | - 'aa.account_number' => array('label' => "AccountAccounting", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 111 | + 'erd.rowid' => array('label' => "LineId", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 112 | + 'u.login' => array('label' => "Employees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 113 | + 'er.ref' => array('label' => "ExpenseReport", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 114 | + 'erd.date' => array('label' => "DateOfLine", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 115 | + 'f.label' => array('label' => "TypeFees", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 116 | + 'erd.comments' => array('label' => "Description", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 117 | + 'erd.total_ht' => array('label' => "Amount", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 118 | + 'erd.tva_tx' => array('label' => "VATRate", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 119 | + 'aa.account_number' => array('label' => "AccountAccounting", 'position' => 1, 'checked' => '1', 'enabled' => '1'), |
|
| 120 | 120 | ); |
| 121 | 121 | if (getDolGlobalString('ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE')) { |
| 122 | - $arrayfields['er.date_valid'] = array('label' => "DateValidation", 'position' => 1, 'checked' => '1', 'enabled' => '1'); |
|
| 122 | + $arrayfields['er.date_valid'] = array('label' => "DateValidation", 'position' => 1, 'checked' => '1', 'enabled' => '1'); |
|
| 123 | 123 | } |
| 124 | 124 | // @phpstan-ignore-next-line |
| 125 | 125 | $arrayfields = dol_sort_array($arrayfields, 'position'); |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $moreforfilter = ''; |
| 355 | 355 | |
| 356 | 356 | $varpage = $contextpage; |
| 357 | - $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 357 | + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup |
|
| 358 | 358 | $selectedfields = $htmlofselectarray; |
| 359 | 359 | $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); |
| 360 | 360 | |