@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function __toString() |
71 | 71 | { |
72 | - require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductAttributeValue.class.php'; |
|
73 | - require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductAttribute.class.php'; |
|
72 | + require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttributeValue.class.php'; |
|
73 | + require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php'; |
|
74 | 74 | |
75 | 75 | $prodattr = new ProductAttribute($this->db); |
76 | 76 | $prodattrval = new ProductAttributeValue($this->db); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $prodattr->fetch($this->fk_prod_attr); |
79 | 79 | $prodattrval->fetch($this->fk_prod_attr_val); |
80 | 80 | |
81 | - return $prodattr->label . ': ' . $prodattrval->value; |
|
81 | + return $prodattr->label.': '.$prodattrval->value; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function create($user) |
91 | 91 | { |
92 | - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_attribute_combination2val |
|
92 | + $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_attribute_combination2val |
|
93 | 93 | (fk_prod_combination, fk_prod_attr, fk_prod_attr_val) |
94 | - VALUES(" . (int) $this->fk_prod_combination . ", " . (int) $this->fk_prod_attr . ", " . (int) $this->fk_prod_attr_val . ")"; |
|
94 | + VALUES(" . (int) $this->fk_prod_combination.", ".(int) $this->fk_prod_attr.", ".(int) $this->fk_prod_attr_val.")"; |
|
95 | 95 | |
96 | 96 | $query = $this->db->query($sql); |
97 | 97 | |
98 | 98 | if ($query) { |
99 | - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . 'product_attribute_combination2val'); |
|
99 | + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'product_attribute_combination2val'); |
|
100 | 100 | |
101 | 101 | return 1; |
102 | 102 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | c2v.fk_prod_attr_val, |
118 | 118 | c2v.fk_prod_attr, |
119 | 119 | c2v.fk_prod_combination |
120 | - FROM " . MAIN_DB_PREFIX . "product_attribute c LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination2val c2v ON c.rowid = c2v.fk_prod_attr |
|
120 | + FROM " . MAIN_DB_PREFIX."product_attribute c LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val c2v ON c.rowid = c2v.fk_prod_attr |
|
121 | 121 | WHERE c2v.fk_prod_combination = " . (int) $fk_combination; |
122 | 122 | |
123 | 123 | $sql .= $this->db->order('c.position', 'asc'); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function deleteByFkCombination($fk_combination) |
153 | 153 | { |
154 | - $sql = "DELETE FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val WHERE fk_prod_combination = " . (int) $fk_combination; |
|
154 | + $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute_combination2val WHERE fk_prod_combination = ".(int) $fk_combination; |
|
155 | 155 | |
156 | 156 | if ($this->db->query($sql)) { |
157 | 157 | return 1; |
@@ -31,8 +31,9 @@ discard block |
||
31 | 31 | $langs->loadLangs(array("admin", "products", "productbatch")); |
32 | 32 | |
33 | 33 | // Security check |
34 | -if (!$user->admin || (empty($conf->productbatch->enabled))) |
|
34 | +if (!$user->admin || (empty($conf->productbatch->enabled))) { |
|
35 | 35 | accessforbidden(); |
36 | +} |
|
36 | 37 | |
37 | 38 | $action = GETPOST('action', 'alpha'); |
38 | 39 | $value = GETPOST('value', 'alpha'); |
@@ -52,7 +53,9 @@ discard block |
||
52 | 53 | |
53 | 54 | if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) { |
54 | 55 | $res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity); |
55 | - if ($res <= 0) $error++; |
|
56 | + if ($res <= 0) { |
|
57 | + $error++; |
|
58 | + } |
|
56 | 59 | } |
57 | 60 | |
58 | 61 | if (!$error) { |
@@ -66,7 +69,9 @@ discard block |
||
66 | 69 | |
67 | 70 | if ($maskconstbatch && preg_match('/_MASK$/', $maskconstbatch)) { |
68 | 71 | $res = dolibarr_set_const($db, $maskconstbatch, $maskbatch, 'chaine', 0, '', $conf->entity); |
69 | - if ($res <= 0) $error++; |
|
72 | + if ($res <= 0) { |
|
73 | + $error++; |
|
74 | + } |
|
70 | 75 | } |
71 | 76 | |
72 | 77 | if (!$error) { |
@@ -147,8 +152,12 @@ discard block |
||
147 | 152 | $module = new $file($db); |
148 | 153 | |
149 | 154 | // Show modules according to features level |
150 | - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; |
|
151 | - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; |
|
155 | + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { |
|
156 | + continue; |
|
157 | + } |
|
158 | + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { |
|
159 | + continue; |
|
160 | + } |
|
152 | 161 | |
153 | 162 | if ($module->isEnabled()) { |
154 | 163 | print '<tr class="oddeven"><td>'.$module->name."</td><td>\n"; |
@@ -158,9 +167,13 @@ discard block |
||
158 | 167 | // Show example of numbering model |
159 | 168 | print '<td class="nowrap">'; |
160 | 169 | $tmp = $module->getExample(); |
161 | - if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
162 | - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); |
|
163 | - else print $tmp; |
|
170 | + if (preg_match('/^Error/', $tmp)) { |
|
171 | + print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
172 | + } elseif ($tmp == 'NotConfigured') { |
|
173 | + print $langs->trans($tmp); |
|
174 | + } else { |
|
175 | + print $tmp; |
|
176 | + } |
|
164 | 177 | print '</td>'."\n"; |
165 | 178 | |
166 | 179 | print '<td class="center">'; |
@@ -183,8 +196,9 @@ discard block |
||
183 | 196 | if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval |
184 | 197 | $htmltooltip .= ''.$langs->trans("NextValue").': '; |
185 | 198 | if ($nextval) { |
186 | - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') |
|
187 | - $nextval = $langs->trans($nextval); |
|
199 | + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { |
|
200 | + $nextval = $langs->trans($nextval); |
|
201 | + } |
|
188 | 202 | $htmltooltip .= $nextval.'<br>'; |
189 | 203 | } else { |
190 | 204 | $htmltooltip .= $langs->trans($module->error).'<br>'; |
@@ -239,8 +253,12 @@ discard block |
||
239 | 253 | $module = new $file($db); |
240 | 254 | |
241 | 255 | // Show modules according to features level |
242 | - if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue; |
|
243 | - if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue; |
|
256 | + if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { |
|
257 | + continue; |
|
258 | + } |
|
259 | + if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) { |
|
260 | + continue; |
|
261 | + } |
|
244 | 262 | |
245 | 263 | if ($module->isEnabled()) { |
246 | 264 | print '<tr class="oddeven"><td>'.$module->name."</td><td>\n"; |
@@ -250,9 +268,13 @@ discard block |
||
250 | 268 | // Show example of numbering model |
251 | 269 | print '<td class="nowrap">'; |
252 | 270 | $tmp = $module->getExample(); |
253 | - if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
254 | - elseif ($tmp == 'NotConfigured') print $langs->trans($tmp); |
|
255 | - else print $tmp; |
|
271 | + if (preg_match('/^Error/', $tmp)) { |
|
272 | + print '<div class="error">'.$langs->trans($tmp).'</div>'; |
|
273 | + } elseif ($tmp == 'NotConfigured') { |
|
274 | + print $langs->trans($tmp); |
|
275 | + } else { |
|
276 | + print $tmp; |
|
277 | + } |
|
256 | 278 | print '</td>'."\n"; |
257 | 279 | |
258 | 280 | print '<td class="center">'; |
@@ -275,8 +297,9 @@ discard block |
||
275 | 297 | if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval |
276 | 298 | $htmltooltip .= ''.$langs->trans("NextValue").': '; |
277 | 299 | if ($nextval) { |
278 | - if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') |
|
279 | - $nextval = $langs->trans($nextval); |
|
300 | + if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') { |
|
301 | + $nextval = $langs->trans($nextval); |
|
302 | + } |
|
280 | 303 | $htmltooltip .= $nextval.'<br>'; |
281 | 304 | } else { |
282 | 305 | $htmltooltip .= $langs->trans($module->error).'<br>'; |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | $filefound = 0; |
114 | 114 | $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); |
115 | 115 | foreach ($dirmodels as $reldir) { |
116 | - $file = dol_buildpath($reldir . "core/modules/product_batch/doc/pdf_" . $modele . ".modules.php", 0); |
|
116 | + $file = dol_buildpath($reldir."core/modules/product_batch/doc/pdf_".$modele.".modules.php", 0); |
|
117 | 117 | if (file_exists($file)) { |
118 | 118 | $filefound = 1; |
119 | - $classname = "pdf_" . $modele; |
|
119 | + $classname = "pdf_".$modele; |
|
120 | 120 | break; |
121 | 121 | } |
122 | 122 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $module = new $classname($db); |
128 | 128 | |
129 | 129 | if ($module->write_file($product_batch, $langs) > 0) { |
130 | - header("Location: " . DOL_URL_ROOT . "/document.php?modulepart=product_batch&file=SPECIMEN.pdf"); |
|
130 | + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=product_batch&file=SPECIMEN.pdf"); |
|
131 | 131 | return; |
132 | 132 | } else { |
133 | 133 | setEventMessages($module->error, $module->errors, 'errors'); |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | // Module to build doc |
365 | 365 | $def = array(); |
366 | 366 | $sql = "SELECT nom"; |
367 | -$sql .= " FROM " . MAIN_DB_PREFIX . "document_model"; |
|
368 | -$sql .= " WHERE type = '" . $db->escape($type) . "'"; |
|
369 | -$sql .= " AND entity = " . $conf->entity; |
|
367 | +$sql .= " FROM ".MAIN_DB_PREFIX."document_model"; |
|
368 | +$sql .= " WHERE type = '".$db->escape($type)."'"; |
|
369 | +$sql .= " AND entity = ".$conf->entity; |
|
370 | 370 | $resql = $db->query($sql); |
371 | 371 | if ($resql) { |
372 | 372 | $i = 0; |
@@ -387,19 +387,19 @@ discard block |
||
387 | 387 | print '<div class="div-table-responsive-no-min">'; |
388 | 388 | print '<table class="noborder centpercent">'; |
389 | 389 | print '<tr class="liste_titre">'; |
390 | -print '<td>' . $langs->trans("Name") . '</td>'; |
|
391 | -print '<td>' . $langs->trans("Description") . '</td>'; |
|
392 | -print '<td class="center" width="60">' . $langs->trans("Status") . "</td>\n"; |
|
393 | -print '<td class="center" width="60">' . $langs->trans("Default") . "</td>\n"; |
|
390 | +print '<td>'.$langs->trans("Name").'</td>'; |
|
391 | +print '<td>'.$langs->trans("Description").'</td>'; |
|
392 | +print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n"; |
|
393 | +print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n"; |
|
394 | 394 | print '<td class="center"></td>'; |
395 | -print '<td class="center" width="80">' . $langs->trans("Preview") . '</td>'; |
|
395 | +print '<td class="center" width="80">'.$langs->trans("Preview").'</td>'; |
|
396 | 396 | print "</tr>\n"; |
397 | 397 | |
398 | 398 | clearstatcache(); |
399 | 399 | |
400 | 400 | foreach ($dirmodels as $reldir) { |
401 | 401 | foreach (array('', '/doc') as $valdir) { |
402 | - $dir = dol_buildpath($reldir . "core/modules/product_batch" . $valdir); |
|
402 | + $dir = dol_buildpath($reldir."core/modules/product_batch".$valdir); |
|
403 | 403 | if (is_dir($dir)) { |
404 | 404 | $handle = opendir($dir); |
405 | 405 | if (is_resource($handle)) { |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | |
412 | 412 | foreach ($filelist as $file) { |
413 | 413 | if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { |
414 | - if (file_exists($dir . '/' . $file)) { |
|
414 | + if (file_exists($dir.'/'.$file)) { |
|
415 | 415 | $name = substr($file, 4, dol_strlen($file) - 16); |
416 | 416 | $classname = substr($file, 0, dol_strlen($file) - 12); |
417 | 417 | |
418 | - require_once $dir . '/' . $file; |
|
418 | + require_once $dir.'/'.$file; |
|
419 | 419 | $module = new $classname($db); |
420 | 420 | |
421 | 421 | $modulequalified = 1; |
@@ -439,14 +439,14 @@ discard block |
||
439 | 439 | |
440 | 440 | // Active |
441 | 441 | if (in_array($name, $def)) { |
442 | - print '<td class="center">' . "\n"; |
|
443 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=del&token=' . newToken() . '&value=' . urlencode($name) . '">'; |
|
442 | + print '<td class="center">'."\n"; |
|
443 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">'; |
|
444 | 444 | print img_picto($langs->trans("Enabled"), 'switch_on'); |
445 | 445 | print '</a>'; |
446 | 446 | print '</td>'; |
447 | 447 | } else { |
448 | - print '<td class="center">' . "\n"; |
|
449 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=set&token=' . newToken() . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</a>'; |
|
448 | + print '<td class="center">'."\n"; |
|
449 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; |
|
450 | 450 | print "</td>"; |
451 | 451 | } |
452 | 452 | |
@@ -455,19 +455,19 @@ discard block |
||
455 | 455 | if (getDolGlobalString('PRODUCT_BATCH_ADDON_PDF') == $name) { |
456 | 456 | print img_picto($langs->trans("Default"), 'on'); |
457 | 457 | } else { |
458 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=setdoc&token=' . newToken() . '&value=' . urlencode($name) . '&scan_dir=' . urlencode($module->scandir) . '&label=' . urlencode($module->name) . '" alt="' . $langs->trans("Default") . '">' . img_picto($langs->trans("Disabled"), 'off') . '</a>'; |
|
458 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>'; |
|
459 | 459 | } |
460 | 460 | print '</td>'; |
461 | 461 | |
462 | 462 | // Info |
463 | - $htmltooltip = '' . $langs->trans("Name") . ': ' . $module->name; |
|
464 | - $htmltooltip .= '<br>' . $langs->trans("Type") . ': ' . ($module->type ? $module->type : $langs->trans("Unknown")); |
|
463 | + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; |
|
464 | + $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown")); |
|
465 | 465 | if ($module->type == 'pdf') { |
466 | - $htmltooltip .= '<br>' . $langs->trans("Width") . '/' . $langs->trans("Height") . ': ' . $module->page_largeur . '/' . $module->page_hauteur; |
|
466 | + $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; |
|
467 | 467 | } |
468 | - $htmltooltip .= '<br><br><u>' . $langs->trans("FeaturesSupported") . ':</u>'; |
|
469 | - $htmltooltip .= '<br>' . $langs->trans("Logo") . ': ' . yn($module->option_logo, 1, 1); |
|
470 | - $htmltooltip .= '<br>' . $langs->trans("MultiLanguage") . ': ' . yn($module->option_multilang, 1, 1); |
|
468 | + $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>'; |
|
469 | + $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); |
|
470 | + $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); |
|
471 | 471 | |
472 | 472 | |
473 | 473 | print '<td class="center">'; |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | // Preview |
478 | 478 | print '<td class="center">'; |
479 | 479 | if ($module->type == 'pdf') { |
480 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?action=specimen&module=' . $name . '">' . img_object($langs->trans("Preview"), 'contract') . '</a>'; |
|
480 | + print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>'; |
|
481 | 481 | } else { |
482 | 482 | print img_object($langs->trans("PreviewNotAvailable"), 'generic'); |
483 | 483 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | $action = GETPOST('action', 'aZ09'); |
40 | 40 | $value = GETPOST('value', 'alpha'); |
41 | -$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
41 | +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php |
|
42 | 42 | |
43 | 43 | $label = GETPOST('label', 'alpha'); |
44 | 44 | $scandir = GETPOST('scan_dir', 'alpha'); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; |
57 | 57 | |
58 | -$error=0; |
|
58 | +$error = 0; |
|
59 | 59 | |
60 | 60 | if ($action == 'updateMask') { |
61 | 61 | $maskconst = GETPOST('maskconstcontract', 'aZ09'); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | setEventMessages($langs->trans('Error'), null, 'errors'); |
174 | 174 | } else { |
175 | 175 | setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); |
176 | - header("Location: " . $_SERVER["PHP_SELF"]); |
|
176 | + header("Location: ".$_SERVER["PHP_SELF"]); |
|
177 | 177 | exit(); |
178 | 178 | } |
179 | 179 | } elseif (preg_match('/del_(.*)/', $action, $reg)) { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | setEventMessages($langs->trans('Error'), null, 'errors'); |
189 | 189 | } else { |
190 | 190 | setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); |
191 | - header("Location: " . $_SERVER["PHP_SELF"]); |
|
191 | + header("Location: ".$_SERVER["PHP_SELF"]); |
|
192 | 192 | exit(); |
193 | 193 | } |
194 | 194 | } |
@@ -256,7 +256,7 @@ |
||
256 | 256 | |
257 | 257 | $param = ''; |
258 | 258 | if (!empty($mode)) { |
259 | - $param .='&mode='.urlencode($mode); |
|
259 | + $param .= '&mode='.urlencode($mode); |
|
260 | 260 | } |
261 | 261 | if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { |
262 | 262 | $param .= '&contextpage='.urlencode($contextpage); |
@@ -245,12 +245,12 @@ discard block |
||
245 | 245 | |
246 | 246 | print '<table class="noborder centpercent">'; |
247 | 247 | print '<tr class="liste_titre">'; |
248 | - print '<td width="30%">' . $langs->trans("Year") . '</td>'; |
|
249 | - print '<td class="right">' . $langs->trans("VATToPay") . '</td>'; |
|
250 | - print '<td class="right">' . $langs->trans("VATToCollect") . '</td>'; |
|
251 | - print '<td class="right">' . $langs->trans("Balance") . '</td>'; |
|
252 | - print '<td> </td>' . "\n"; |
|
253 | - print '</tr>' . "\n"; |
|
248 | + print '<td width="30%">'.$langs->trans("Year").'</td>'; |
|
249 | + print '<td class="right">'.$langs->trans("VATToPay").'</td>'; |
|
250 | + print '<td class="right">'.$langs->trans("VATToCollect").'</td>'; |
|
251 | + print '<td class="right">'.$langs->trans("Balance").'</td>'; |
|
252 | + print '<td> </td>'."\n"; |
|
253 | + print '</tr>'."\n"; |
|
254 | 254 | |
255 | 255 | $tmp = dol_getdate($date_start); |
256 | 256 | $y = $tmp['year']; |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | |
395 | 395 | |
396 | 396 | print '<tr class="oddeven">'; |
397 | - print '<td class="nowrap"><a href="' . DOL_URL_ROOT . '/compta/tva/quadri_detail.php?leftmenu=tax_vat&month=' . $m . '&year=' . $y . '">' . dol_print_date(dol_mktime(0, 0, 0, $m, 1, $y), "%b %Y") . '</a></td>'; |
|
397 | + print '<td class="nowrap"><a href="'.DOL_URL_ROOT.'/compta/tva/quadri_detail.php?leftmenu=tax_vat&month='.$m.'&year='.$y.'">'.dol_print_date(dol_mktime(0, 0, 0, $m, 1, $y), "%b %Y").'</a></td>'; |
|
398 | 398 | |
399 | 399 | $x_coll_sum = 0; |
400 | 400 | foreach (array_keys($x_coll) as $rate) { |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | $x_coll_sum += $temp_vat; |
435 | 435 | } |
436 | 436 | } |
437 | - print '<td class="nowrap right"><span class="amount">' . price(price2num($x_coll_sum, 'MT')) . '</span></td>'; |
|
437 | + print '<td class="nowrap right"><span class="amount">'.price(price2num($x_coll_sum, 'MT')).'</span></td>'; |
|
438 | 438 | |
439 | 439 | $x_paye_sum = 0; |
440 | 440 | foreach (array_keys($x_paye) as $rate) { |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $x_paye_sum += $temp_vat; |
475 | 475 | } |
476 | 476 | } |
477 | - print '<td class="nowrap right"><span class="amount">' . price(price2num($x_paye_sum, 'MT')) . '</span></td>'; |
|
477 | + print '<td class="nowrap right"><span class="amount">'.price(price2num($x_paye_sum, 'MT')).'</span></td>'; |
|
478 | 478 | |
479 | 479 | $subtotalcoll = $subtotalcoll + $x_coll_sum; |
480 | 480 | $subtotalpaid = $subtotalpaid + $x_paye_sum; |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | $total = $total + $diff; |
484 | 484 | $subtotal = price2num($subtotal + $diff, 'MT'); |
485 | 485 | |
486 | - print '<td class="nowrap right"><span class="amount">' . price(price2num($diff, 'MT')) . '</span></td>' . "\n"; |
|
486 | + print '<td class="nowrap right"><span class="amount">'.price(price2num($diff, 'MT')).'</span></td>'."\n"; |
|
487 | 487 | print "<td> </td>\n"; |
488 | 488 | print "</tr>\n"; |
489 | 489 | |
@@ -492,10 +492,10 @@ discard block |
||
492 | 492 | $m++; |
493 | 493 | if ($i > 2) { |
494 | 494 | print '<tr class="liste_total">'; |
495 | - print '<td class="right"><a href="quadri_detail.php?leftmenu=tax_vat&q=' . round($m / 3) . '&year=' . $y . '">' . $langs->trans("SubTotal") . '</a>:</td>'; |
|
496 | - print '<td class="nowrap right">' . price(price2num($subtotalcoll, 'MT')) . '</td>'; |
|
497 | - print '<td class="nowrap right">' . price(price2num($subtotalpaid, 'MT')) . '</td>'; |
|
498 | - print '<td class="nowrap right">' . price(price2num($subtotal, 'MT')) . '</td>'; |
|
495 | + print '<td class="right"><a href="quadri_detail.php?leftmenu=tax_vat&q='.round($m / 3).'&year='.$y.'">'.$langs->trans("SubTotal").'</a>:</td>'; |
|
496 | + print '<td class="nowrap right">'.price(price2num($subtotalcoll, 'MT')).'</td>'; |
|
497 | + print '<td class="nowrap right">'.price(price2num($subtotalpaid, 'MT')).'</td>'; |
|
498 | + print '<td class="nowrap right">'.price(price2num($subtotal, 'MT')).'</td>'; |
|
499 | 499 | print '<td> </td></tr>'; |
500 | 500 | $i = 0; |
501 | 501 | $subtotalcoll = 0; |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $subtotal = 0; |
504 | 504 | } |
505 | 505 | } |
506 | - print '<tr class="liste_total"><td class="right" colspan="3">' . $langs->trans("TotalToPay") . ':</td><td class="nowrap right">' . price(price2num($total, 'MT')) . '</td>'; |
|
506 | + print '<tr class="liste_total"><td class="right" colspan="3">'.$langs->trans("TotalToPay").':</td><td class="nowrap right">'.price(price2num($total, 'MT')).'</td>'; |
|
507 | 507 | print "<td> </td>\n"; |
508 | 508 | print '</tr>'; |
509 | 509 | |
@@ -521,18 +521,18 @@ discard block |
||
521 | 521 | $sql = ''; |
522 | 522 | |
523 | 523 | $sql .= "SELECT SUM(amount) as mm, date_format(tva.datev,'%Y-%m') as dm, 'claimed' as mode"; |
524 | - $sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva"; |
|
525 | - $sql .= " WHERE tva.entity = " . $conf->entity; |
|
526 | - $sql .= " AND (tva.datev >= '" . $db->idate($date_start) . "' AND tva.datev <= '" . $db->idate($date_end) . "')"; |
|
524 | + $sql .= " FROM ".MAIN_DB_PREFIX."tva as tva"; |
|
525 | + $sql .= " WHERE tva.entity = ".$conf->entity; |
|
526 | + $sql .= " AND (tva.datev >= '".$db->idate($date_start)."' AND tva.datev <= '".$db->idate($date_end)."')"; |
|
527 | 527 | $sql .= " GROUP BY dm"; |
528 | 528 | |
529 | 529 | $sql .= " UNION "; |
530 | 530 | |
531 | 531 | $sql .= "SELECT SUM(ptva.amount) as mm, date_format(tva.datev,'%Y-%m') as dm, 'paid' as mode"; |
532 | - $sql .= " FROM " . MAIN_DB_PREFIX . "tva as tva"; |
|
533 | - $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "payment_vat as ptva ON (tva.rowid = ptva.fk_tva)"; |
|
534 | - $sql .= " WHERE tva.entity = " . $conf->entity; |
|
535 | - $sql .= " AND (tva.datev >= '" . $db->idate($date_start) . "' AND tva.datev <= '" . $db->idate($date_end) . "')"; |
|
532 | + $sql .= " FROM ".MAIN_DB_PREFIX."tva as tva"; |
|
533 | + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."payment_vat as ptva ON (tva.rowid = ptva.fk_tva)"; |
|
534 | + $sql .= " WHERE tva.entity = ".$conf->entity; |
|
535 | + $sql .= " AND (tva.datev >= '".$db->idate($date_start)."' AND tva.datev <= '".$db->idate($date_end)."')"; |
|
536 | 536 | $sql .= " GROUP BY dm"; |
537 | 537 | |
538 | 538 | $sql .= " ORDER BY dm ASC, mode ASC"; |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function formFilter() |
122 | 122 | { |
123 | - global $conf,$langs; |
|
123 | + global $conf, $langs; |
|
124 | 124 | |
125 | 125 | // Load translation files required by the page |
126 | 126 | $langs->loadLangs(array("commercial", "companies", "suppliers", "categories")); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $sql = "SELECT sp.poste, count(distinct(sp.email)) AS nb"; |
132 | 132 | $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as sp"; |
133 | 133 | $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
134 | - $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
134 | + $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
135 | 135 | $sql .= " AND sp.statut = 1"; |
136 | 136 | $sql .= " AND (sp.poste IS NOT NULL AND sp.poste <> '')"; |
137 | 137 | $sql .= " GROUP BY sp.poste"; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $sql .= " ".MAIN_DB_PREFIX."categorie as c,"; |
167 | 167 | $sql .= " ".MAIN_DB_PREFIX."categorie_contact as cs"; |
168 | 168 | $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
169 | - $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
169 | + $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
170 | 170 | $sql .= " AND sp.statut = 1"; |
171 | 171 | $sql .= " AND cs.fk_categorie = c.rowid"; |
172 | 172 | $sql .= " AND cs.fk_socpeople = sp.rowid"; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $sql .= " ".MAIN_DB_PREFIX."categorie as c,"; |
240 | 240 | $sql .= " ".MAIN_DB_PREFIX."categorie_societe as cs"; |
241 | 241 | $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
242 | - $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
242 | + $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
243 | 243 | $sql .= " AND sp.statut = 1"; |
244 | 244 | $sql .= " AND cs.fk_categorie = c.rowid"; |
245 | 245 | $sql .= " AND cs.fk_soc = sp.fk_soc"; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $sql .= " ".MAIN_DB_PREFIX."categorie as c,"; |
277 | 277 | $sql .= " ".MAIN_DB_PREFIX."categorie_fournisseur as cs"; |
278 | 278 | $sql .= " WHERE sp.entity IN (".getEntity('contact').")"; |
279 | - $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
279 | + $sql .= " AND sp.email <> ''"; // Note that null != '' is false |
|
280 | 280 | $sql .= " AND sp.statut = 1"; |
281 | 281 | $sql .= " AND cs.fk_categorie = c.rowid"; |
282 | 282 | $sql .= " AND cs.fk_soc = sp.fk_soc"; |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | |
435 | 435 | // Filter on job position |
436 | 436 | $key = $filter_jobposition; |
437 | - if (!empty($key) && $key != 'all' && $key != '-1') { |
|
437 | + if (!empty($key) && $key != 'all' && $key != '-1') { |
|
438 | 438 | $sql .= " AND sp.poste = '".$this->db->escape($key)."'"; |
439 | 439 | } |
440 | 440 |
@@ -535,7 +535,9 @@ discard block |
||
535 | 535 | // Type |
536 | 536 | if (!empty($arrayfields['t.fk_typepayment']['checked'])) { |
537 | 537 | print '<td>'; |
538 | - if (!empty($obj->payment_code)) print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
538 | + if (!empty($obj->payment_code)) { |
|
539 | + print $langs->trans("PaymentTypeShort".$obj->payment_code); |
|
540 | + } |
|
539 | 541 | print '</td>'; |
540 | 542 | if (!$i) { |
541 | 543 | $totalarray['nbfield']++; |
@@ -562,7 +564,9 @@ discard block |
||
562 | 564 | print $bankstatic->getNomUrl(1); |
563 | 565 | } |
564 | 566 | print '</td>'; |
565 | - if (!$i) $totalarray['nbfield']++; |
|
567 | + if (!$i) { |
|
568 | + $totalarray['nbfield']++; |
|
569 | + } |
|
566 | 570 | } |
567 | 571 | |
568 | 572 | // Amount |
@@ -45,13 +45,13 @@ discard block |
||
45 | 45 | $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation |
46 | 46 | $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button |
47 | 47 | $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list |
48 | -$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist'; |
|
48 | +$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'salestaxeslist'; |
|
49 | 49 | $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page |
50 | 50 | $optioncss = GETPOST('optioncss', 'alpha'); |
51 | 51 | $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') |
52 | 52 | $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) |
53 | 53 | |
54 | -$search_ref = GETPOST('search_ref', 'alpha'); |
|
54 | +$search_ref = GETPOST('search_ref', 'alpha'); |
|
55 | 55 | $search_label = GETPOST('search_label', 'alpha'); |
56 | 56 | $search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int')); |
57 | 57 | $search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int')); |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | // Build and execute select |
173 | 173 | // -------------------------------------------------------------------- |
174 | 174 | $sql = 'SELECT t.rowid, t.amount, t.label, t.datev, t.datep, t.paye as status, t.fk_typepayment as type, t.fk_account,'; |
175 | -$sql.= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,'; |
|
176 | -$sql.= ' t.num_payment, pst.code as payment_code,'; |
|
175 | +$sql .= ' ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,'; |
|
176 | +$sql .= ' t.num_payment, pst.code as payment_code,'; |
|
177 | 177 | $sql .= ' SUM(ptva.amount) as alreadypayed'; |
178 | 178 | |
179 | 179 | $sqlfields = $sql; // $sql fields to remove for count total |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | |
707 | 707 | // Amount |
708 | 708 | if (!empty($arrayfields['t.amount']['checked'])) { |
709 | - print '<td class="nowrap right"><span class="amount">' . price($obj->amount) . '</span></td>'; |
|
709 | + print '<td class="nowrap right"><span class="amount">'.price($obj->amount).'</span></td>'; |
|
710 | 710 | if (!$i) { |
711 | 711 | $totalarray['nbfield']++; |
712 | 712 | } |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | } |
720 | 720 | |
721 | 721 | if (!empty($arrayfields['t.status']['checked'])) { |
722 | - print '<td class="nowrap right">' . $tva_static->getLibStatut(5, $obj->alreadypayed) . '</td>'; |
|
722 | + print '<td class="nowrap right">'.$tva_static->getLibStatut(5, $obj->alreadypayed).'</td>'; |
|
723 | 723 | if (!$i) { |
724 | 724 | $totalarray['nbfield']++; |
725 | 725 | } |
@@ -426,7 +426,7 @@ |
||
426 | 426 | $linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentcandidature_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
427 | 427 | |
428 | 428 | $morehtmlref = '<div class="refidno">'; |
429 | - $morehtmlref.= $object->getFullName('', 1); |
|
429 | + $morehtmlref .= $object->getFullName('', 1); |
|
430 | 430 | /* |
431 | 431 | // Ref customer |
432 | 432 | $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); |
@@ -143,7 +143,7 @@ |
||
143 | 143 | $linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentcandidature_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>'; |
144 | 144 | |
145 | 145 | $morehtmlref = '<div class="refidno">'; |
146 | - $morehtmlref.= $object->getFullName('', 1); |
|
146 | + $morehtmlref .= $object->getFullName('', 1); |
|
147 | 147 | /* |
148 | 148 | // Ref customer |
149 | 149 | $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1); |