Completed
Branch develop (68404b)
by
unknown
20:11
created
htdocs/variants/class/ProductAttributeValue.class.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	/**
79 79
 	 * @var array  Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
80 80
 	 */
81
-	public $fields=array(
81
+	public $fields = array(
82 82
 		'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
83 83
 		'fk_product_attribute' => array('type'=>'integer:ProductAttribute:variants/class/ProductAttribute.class.php', 'label'=>'ProductAttribute', 'enabled'=>1, 'visible'=>0, 'position'=>10, 'notnull'=>1, 'index'=>1,),
84 84
 		'ref' => array('type'=>'varchar(255)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", 'css'=>''),
@@ -160,32 +160,32 @@  discard block
 block discarded – undo
160 160
 			$error++;
161 161
 		}
162 162
 		if ($error) {
163
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
163
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
164 164
 			return -1;
165 165
 		}
166 166
 
167 167
 		$this->db->begin();
168 168
 
169
-		$sql = "INSERT INTO " . MAIN_DB_PREFIX . $this->table_element . " (";
169
+		$sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element." (";
170 170
 		$sql .= " fk_product_attribute, ref, value, entity, position";
171 171
 		$sql .= ")";
172 172
 		$sql .= " VALUES (";
173
-		$sql .= "  " . ((int) $this->fk_product_attribute);
174
-		$sql .= ", '" . $this->db->escape($this->ref) . "'";
175
-		$sql .= ", '" . $this->db->escape($this->value) . "'";
176
-		$sql .= ", " . ((int) $this->entity);
177
-		$sql .= ", " . ((int) $this->position);
173
+		$sql .= "  ".((int) $this->fk_product_attribute);
174
+		$sql .= ", '".$this->db->escape($this->ref)."'";
175
+		$sql .= ", '".$this->db->escape($this->value)."'";
176
+		$sql .= ", ".((int) $this->entity);
177
+		$sql .= ", ".((int) $this->position);
178 178
 		$sql .= ")";
179 179
 
180 180
 		dol_syslog(__METHOD__, LOG_DEBUG);
181 181
 		$resql = $this->db->query($sql);
182 182
 		if (!$resql) {
183
-			$this->errors[] = "Error " . $this->db->lasterror();
183
+			$this->errors[] = "Error ".$this->db->lasterror();
184 184
 			$error++;
185 185
 		}
186 186
 
187 187
 		if (!$error) {
188
-			$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
188
+			$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
189 189
 		}
190 190
 
191 191
 		if (!$error && !$notrigger) {
@@ -226,20 +226,20 @@  discard block
 block discarded – undo
226 226
 			$error++;
227 227
 		}
228 228
 		if ($error) {
229
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
229
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
230 230
 			return -1;
231 231
 		}
232 232
 
233 233
 		$sql = "SELECT rowid, fk_product_attribute, ref, value";
234
-		$sql .= " FROM " . MAIN_DB_PREFIX . $this->table_element;
235
-		$sql .= " WHERE rowid = " . ((int) $id);
236
-		$sql .= " AND entity IN (" . getEntity('product') . ")";
234
+		$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
235
+		$sql .= " WHERE rowid = ".((int) $id);
236
+		$sql .= " AND entity IN (".getEntity('product').")";
237 237
 
238 238
 		dol_syslog(__METHOD__, LOG_DEBUG);
239 239
 		$resql = $this->db->query($sql);
240 240
 		if (!$resql) {
241
-			$this->errors[] = "Error " . $this->db->lasterror();
242
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
241
+			$this->errors[] = "Error ".$this->db->lasterror();
242
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
243 243
 			return -1;
244 244
 		}
245 245
 
@@ -274,15 +274,15 @@  discard block
 block discarded – undo
274 274
 			$sql .= "DISTINCT ";
275 275
 		}
276 276
 
277
-		$sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM " . MAIN_DB_PREFIX . "product_attribute_value v ";
277
+		$sql .= "v.fk_product_attribute, v.rowid, v.ref, v.value FROM ".MAIN_DB_PREFIX."product_attribute_value v ";
278 278
 
279 279
 		if ($only_used) {
280
-			$sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid ";
281
-			$sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product_attribute_combination c ON c.rowid = c2v.fk_prod_combination ";
282
-			$sql .= "LEFT JOIN " . MAIN_DB_PREFIX . "product p ON p.rowid = c.fk_product_child ";
280
+			$sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination2val c2v ON c2v.fk_prod_attr_val = v.rowid ";
281
+			$sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product_attribute_combination c ON c.rowid = c2v.fk_prod_combination ";
282
+			$sql .= "LEFT JOIN ".MAIN_DB_PREFIX."product p ON p.rowid = c.fk_product_child ";
283 283
 		}
284 284
 
285
-		$sql .= "WHERE v.fk_product_attribute = " . ((int) $prodattr_id);
285
+		$sql .= "WHERE v.fk_product_attribute = ".((int) $prodattr_id);
286 286
 
287 287
 		if ($only_used) {
288 288
 			$sql .= " AND c2v.rowid IS NOT NULL AND p.tosell = 1";
@@ -334,25 +334,25 @@  discard block
 block discarded – undo
334 334
 			$error++;
335 335
 		}
336 336
 		if ($error) {
337
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
337
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
338 338
 			return -1;
339 339
 		}
340 340
 
341 341
 		$this->db->begin();
342 342
 
343
-		$sql = "UPDATE " . MAIN_DB_PREFIX . $this->table_element . " SET";
343
+		$sql = "UPDATE ".MAIN_DB_PREFIX.$this->table_element." SET";
344 344
 
345
-		$sql .= "  fk_product_attribute = " . ((int) $this->fk_product_attribute);
346
-		$sql .= ", ref = '" . $this->db->escape($this->ref) . "'";
347
-		$sql .= ", value = '" . $this->db->escape($this->value) . "'";
348
-		$sql .= ", position = " . ((int) $this->position);
345
+		$sql .= "  fk_product_attribute = ".((int) $this->fk_product_attribute);
346
+		$sql .= ", ref = '".$this->db->escape($this->ref)."'";
347
+		$sql .= ", value = '".$this->db->escape($this->value)."'";
348
+		$sql .= ", position = ".((int) $this->position);
349 349
 
350
-		$sql .= " WHERE rowid = " . ((int) $this->id);
350
+		$sql .= " WHERE rowid = ".((int) $this->id);
351 351
 
352 352
 		dol_syslog(__METHOD__, LOG_DEBUG);
353 353
 		$resql = $this->db->query($sql);
354 354
 		if (!$resql) {
355
-			$this->errors[] = "Error " . $this->db->lasterror();
355
+			$this->errors[] = "Error ".$this->db->lasterror();
356 356
 			$error++;
357 357
 		}
358 358
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 			$error++;
396 396
 		}
397 397
 		if ($error) {
398
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
398
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
399 399
 			return -1;
400 400
 		}
401 401
 
@@ -419,12 +419,12 @@  discard block
 block discarded – undo
419 419
 		}
420 420
 
421 421
 		if (!$error) {
422
-			$sql = "DELETE FROM " . MAIN_DB_PREFIX . $this->table_element . " WHERE rowid = " . ((int) $this->id);
422
+			$sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".((int) $this->id);
423 423
 
424 424
 			dol_syslog(__METHOD__, LOG_DEBUG);
425 425
 			$resql = $this->db->query($sql);
426 426
 			if (!$resql) {
427
-				$this->errors[] = "Error " . $this->db->lasterror();
427
+				$this->errors[] = "Error ".$this->db->lasterror();
428 428
 				$error++;
429 429
 			}
430 430
 		}
@@ -457,16 +457,16 @@  discard block
 block discarded – undo
457 457
 			$error++;
458 458
 		}
459 459
 		if ($error) {
460
-			dol_syslog(__METHOD__ . ' ' . $this->errorsToString(), LOG_ERR);
460
+			dol_syslog(__METHOD__.' '.$this->errorsToString(), LOG_ERR);
461 461
 			return -1;
462 462
 		}
463 463
 
464
-		$sql = "SELECT COUNT(*) AS nb FROM " . MAIN_DB_PREFIX . "product_attribute_combination2val WHERE fk_prod_attr_val = " . ((int) $this->id);
464
+		$sql = "SELECT COUNT(*) AS nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val WHERE fk_prod_attr_val = ".((int) $this->id);
465 465
 
466 466
 		dol_syslog(__METHOD__, LOG_DEBUG);
467 467
 		$resql = $this->db->query($sql);
468 468
 		if (!$resql) {
469
-			$this->errors[] = "Error " . $this->db->lasterror();
469
+			$this->errors[] = "Error ".$this->db->lasterror();
470 470
 			return -1;
471 471
 		}
472 472
 
Please login to merge, or discard this patch.
htdocs/compta/stats/casoc.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,9 @@
 block discarded – undo
57 57
 
58 58
 // Category
59 59
 $selected_cat = (int) GETPOST('search_categ', 'int');
60
-if ($selected_cat == -1) $selected_cat = '';
60
+if ($selected_cat == -1) {
61
+	$selected_cat = '';
62
+}
61 63
 $subcat = false;
62 64
 if (GETPOST('subcat', 'alpha') === 'yes') {
63 65
 	$subcat = true;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 	$month_current = dol_print_date(dol_now(), '%m');
100 100
 	$year_start = $year;
101 101
 }
102
-$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver');	// We use timezone of server so report is same from everywhere
103
-$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver');		// We use timezone of server so report is same from everywhere
102
+$date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
103
+$date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere
104 104
 // Quarter
105 105
 if (empty($date_start) || empty($date_end)) { // We define date_start and date_end
106 106
 	$q = GETPOST("q", "int") ?GETPOST("q", "int") : 0;
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 $headerparams = array_merge($commonparams, $headerparams);
180 180
 $tableparams = array_merge($commonparams, $tableparams);
181 181
 
182
-$paramslink="";
182
+$paramslink = "";
183 183
 foreach ($allparams as $key => $value) {
184 184
 	$paramslink .= '&'.$key.'='.$value;
185 185
 }
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 	$modecompta = "RECETTES-DEPENSES";
204 204
 }
205 205
 
206
-$exportlink="";
207
-$namelink="";
206
+$exportlink = "";
207
+$namelink = "";
208 208
 
209 209
 // Show report header
210 210
 if ($modecompta == "CREANCES-DETTES") {
Please login to merge, or discard this patch.
htdocs/core/class/commonstickergenerator.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -289,7 +289,7 @@
 block discarded – undo
289 289
 		// phpcs:enable
290 290
 		$this->_Metric = $format['metric'];
291 291
 		$this->_Avery_Name = $format['name'];
292
-		$this->_Avery_Code = empty($format['code'])?'':$format['code'];
292
+		$this->_Avery_Code = empty($format['code']) ? '' : $format['code'];
293 293
 		$this->_Margin_Left = $this->convertMetric($format['marginLeft'], $this->_Metric, $this->_Metric_Doc);
294 294
 		$this->_Margin_Top = $this->convertMetric($format['marginTop'], $this->_Metric, $this->_Metric_Doc);
295 295
 		$this->_X_Space = $this->convertMetric($format['SpaceX'], $this->_Metric, $this->_Metric_Doc);
Please login to merge, or discard this patch.
htdocs/compta/facture/class/facture.class.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -813,7 +813,9 @@
 block discarded – undo
813 813
 
814 814
 						// Complete vat rate with code
815 815
 						$vatrate = $newinvoiceline->tva_tx;
816
-						if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')';
816
+						if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) {
817
+							$vatrate.=' ('.$newinvoiceline->vat_src_code.')';
818
+						}
817 819
 
818 820
 						$newinvoiceline->fk_parent_line = $fk_parent_line;
819 821
 
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 			$this->mode_reglement_id = 0;
476 476
 		}
477 477
 		$this->status = self::STATUS_DRAFT;
478
-		$this->statut = self::STATUS_DRAFT;	// deprecated
478
+		$this->statut = self::STATUS_DRAFT; // deprecated
479 479
 
480 480
 		if (!empty($this->multicurrency_code)) {
481 481
 			// Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate)
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
 
557 557
 			// Fields always coming from template
558 558
 			$this->remise_absolue    = $_facrec->remise_absolue;
559
-			$this->remise_percent    = $_facrec->remise_percent;	// TODO deprecated
559
+			$this->remise_percent    = $_facrec->remise_percent; // TODO deprecated
560 560
 			$this->fk_incoterms = $_facrec->fk_incoterms;
561 561
 			$this->location_incoterms = $_facrec->location_incoterms;
562 562
 
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 				$this->mode_reglement_id = 0;
577 577
 			}
578 578
 			$this->status = self::STATUS_DRAFT;
579
-			$this->statut = self::STATUS_DRAFT;	// deprecated
579
+			$this->statut = self::STATUS_DRAFT; // deprecated
580 580
 
581 581
 			$this->linked_objects = $_facrec->linkedObjectsIds;
582 582
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
 		$sql .= ", fk_soc";
659 659
 		$sql .= ", datec";
660 660
 		$sql .= ", remise_absolue";
661
-		$sql .= ", remise_percent";	// TODO deprecated
661
+		$sql .= ", remise_percent"; // TODO deprecated
662 662
 		$sql .= ", datef";
663 663
 		$sql .= ", date_pointoftax";
664 664
 		$sql .= ", note_private";
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 		$sql .= ", ".((int) $socid);
685 685
 		$sql .= ", '".$this->db->idate($now)."'";
686 686
 		$sql .= ", ".($this->remise_absolue > 0 ? $this->remise_absolue : 'NULL');
687
-		$sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL');	// TODO deprecated
687
+		$sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL'); // TODO deprecated
688 688
 		$sql .= ", '".$this->db->idate($this->date)."'";
689 689
 		$sql .= ", ".(empty($this->date_pointoftax) ? "null" : "'".$this->db->idate($this->date_pointoftax)."'");
690 690
 		$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
 						// Complete vat rate with code
825 825
 						$vatrate = $newinvoiceline->tva_tx;
826
-						if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')';
826
+						if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$newinvoiceline->vat_src_code.')';
827 827
 
828 828
 						$newinvoiceline->fk_parent_line = $fk_parent_line;
829 829
 
@@ -1052,7 +1052,7 @@  discard block
 block discarded – undo
1052 1052
 						$buyprice,
1053 1053
 						$_facrec->lines[$i]->label,
1054 1054
 						empty($_facrec->lines[$i]->array_options) ?null:$_facrec->lines[$i]->array_options,
1055
-						100,	// situation percent is undefined on recurring invoice lines
1055
+						100, // situation percent is undefined on recurring invoice lines
1056 1056
 						'',
1057 1057
 						$_facrec->lines[$i]->fk_unit,
1058 1058
 						$_facrec->lines[$i]->multicurrency_subprice,
@@ -1160,11 +1160,11 @@  discard block
 block discarded – undo
1160 1160
 		$facture->cond_reglement_id = $this->cond_reglement_id;
1161 1161
 		$facture->mode_reglement_id = $this->mode_reglement_id;
1162 1162
 		$facture->remise_absolue    = $this->remise_absolue;
1163
-		$facture->remise_percent    = $this->remise_percent;	// TODO deprecated
1163
+		$facture->remise_percent    = $this->remise_percent; // TODO deprecated
1164 1164
 
1165 1165
 		$facture->origin            = $this->origin;
1166 1166
 		$facture->origin_id         = $this->origin_id;
1167
-		$facture->fk_account         = $this->fk_account;
1167
+		$facture->fk_account = $this->fk_account;
1168 1168
 
1169 1169
 		$facture->lines = $this->lines; // Array of lines of invoice
1170 1170
 		$facture->situation_counter = $this->situation_counter;
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
 	{
1638 1638
 		global $conf, $langs, $hookmanager, $action;
1639 1639
 
1640
-		if (! in_array($origin->element, array('propal', 'commande'))) {
1640
+		if (!in_array($origin->element, array('propal', 'commande'))) {
1641 1641
 			$origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder';
1642 1642
 			return null;
1643 1643
 		}
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
 			return null;
1648 1648
 		}
1649 1649
 
1650
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
1650
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
1651 1651
 
1652 1652
 		if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
1653 1653
 			$origin->error = 'ErrorDateIsInFuture';
@@ -1691,7 +1691,7 @@  discard block
 block discarded – undo
1691 1691
 		$deposit->pos_source = $origin->pos_source;
1692 1692
 		$deposit->model_pdf = 'crabe';
1693 1693
 
1694
-		$modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type;
1694
+		$modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type;
1695 1695
 
1696 1696
 		if (!empty($conf->global->$modelByTypeConfName)) {
1697 1697
 			$deposit->model_pdf = $conf->global->$modelByTypeConfName;
@@ -1746,10 +1746,10 @@  discard block
 block discarded – undo
1746 1746
 					continue;
1747 1747
 				}
1748 1748
 				$TTotalByTva[$line->tva_tx] += $line->total_ttc;
1749
-				$descriptions[$line->tva_tx] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' :  '');
1750
-				$descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label . ' - ' : '');
1751
-				$descriptions[$line->tva_tx] .= $langs->trans('Qty') . ' : ' . $line->qty;
1752
-				$descriptions[$line->tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>';
1749
+				$descriptions[$line->tva_tx] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : '');
1750
+				$descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label.' - ' : '');
1751
+				$descriptions[$line->tva_tx] .= $langs->trans('Qty').' : '.$line->qty;
1752
+				$descriptions[$line->tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>';
1753 1753
 			}
1754 1754
 
1755 1755
 			foreach ($TTotalByTva as $tva => &$total) {
@@ -1773,10 +1773,10 @@  discard block
 block discarded – undo
1773 1773
 				$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
1774 1774
 				$tva_tx = $lines[$i]->tva_tx;
1775 1775
 				$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $origin->deposit_percent) / 100;
1776
-				$descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' :  '');
1777
-				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : '');
1778
-				$descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty;
1779
-				$descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>';
1776
+				$descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : '');
1777
+				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : '');
1778
+				$descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty;
1779
+				$descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>';
1780 1780
 			}
1781 1781
 
1782 1782
 			if ($totalamount == 0) {
@@ -1791,11 +1791,11 @@  discard block
 block discarded – undo
1791 1791
 				continue;
1792 1792
 			}
1793 1793
 
1794
-			$descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref;
1794
+			$descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref;
1795 1795
 
1796 1796
 			// Hidden conf
1797 1797
 			if (!empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && !empty($descriptions[$tva])) {
1798
-				$descline .= '<ul>' . $descriptions[$tva] . '</ul>';
1798
+				$descline .= '<ul>'.$descriptions[$tva].'</ul>';
1799 1799
 			}
1800 1800
 
1801 1801
 			$addlineResult = $deposit->addline(
@@ -2057,7 +2057,7 @@  discard block
 block discarded – undo
2057 2057
 				$label = $langs->trans("Invoice");
2058 2058
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
2059 2059
 			}
2060
-			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' :  ' title="tocomplete"');
2060
+			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
2061 2061
 			$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
2062 2062
 		}
2063 2063
 
@@ -2169,10 +2169,10 @@  discard block
 block discarded – undo
2169 2169
 				$this->id = $obj->rowid;
2170 2170
 				$this->entity = $obj->entity;
2171 2171
 
2172
-				$this->ref					= $obj->ref;
2173
-				$this->ref_client			= $obj->ref_client;
2174
-				$this->ref_customer			= $obj->ref_client;
2175
-				$this->ref_ext				= $obj->ref_ext;
2172
+				$this->ref = $obj->ref;
2173
+				$this->ref_client = $obj->ref_client;
2174
+				$this->ref_customer = $obj->ref_client;
2175
+				$this->ref_ext = $obj->ref_ext;
2176 2176
 				$this->type					= $obj->type;
2177 2177
 				$this->date					= $this->db->jdate($obj->df);
2178 2178
 				$this->date_pointoftax		= $this->db->jdate($obj->date_pointoftax);
@@ -2180,7 +2180,7 @@  discard block
 block discarded – undo
2180 2180
 				$this->date_validation		= $this->db->jdate($obj->datev);
2181 2181
 				$this->date_modification = $this->db->jdate($obj->datem);
2182 2182
 				$this->datem = $this->db->jdate($obj->datem);
2183
-				$this->remise_percent		= $obj->remise_percent;	// TODO deprecated
2183
+				$this->remise_percent		= $obj->remise_percent; // TODO deprecated
2184 2184
 				$this->remise_absolue		= $obj->remise_absolue;
2185 2185
 				$this->total_ht				= $obj->total_ht;
2186 2186
 				$this->total_tva			= $obj->total_tva;
@@ -2198,7 +2198,7 @@  discard block
 block discarded – undo
2198 2198
 				$this->fk_project = $obj->fk_project;
2199 2199
 				$this->project = null; // Clear if another value was already set by fetch_projet
2200 2200
 
2201
-				$this->statut = $obj->status;	// deprecated
2201
+				$this->statut = $obj->status; // deprecated
2202 2202
 				$this->status = $obj->status;
2203 2203
 
2204 2204
 				$this->date_lim_reglement = $this->db->jdate($obj->dlr);
@@ -2331,7 +2331,7 @@  discard block
 block discarded – undo
2331 2331
 				$line->ref              = $objp->product_ref; // Ref product
2332 2332
 				$line->product_ref      = $objp->product_ref; // Ref product
2333 2333
 				$line->libelle          = $objp->product_label; // deprecated
2334
-				$line->product_label 	= $objp->product_label; // Label product
2334
+				$line->product_label = $objp->product_label; // Label product
2335 2335
 				$line->product_desc     = $objp->product_desc; // Description product
2336 2336
 				$line->fk_product_type  = $objp->fk_product_type; // Type of product
2337 2337
 				$line->qty              = $objp->qty;
@@ -2510,7 +2510,7 @@  discard block
 block discarded – undo
2510 2510
 		$sql .= " date_pointoftax=".(strval($this->date_pointoftax) != '' ? "'".$this->db->idate($this->date_pointoftax)."'" : 'null').",";
2511 2511
 		$sql .= " date_valid=".(strval($this->date_validation) != '' ? "'".$this->db->idate($this->date_validation)."'" : 'null').",";
2512 2512
 		$sql .= " paye=".(isset($this->paye) ? $this->db->escape($this->paye) : 0).",";
2513
-		$sql .= " remise_percent=".(isset($this->remise_percent) ? $this->db->escape($this->remise_percent) : "null").",";	// TODO deprecated
2513
+		$sql .= " remise_percent=".(isset($this->remise_percent) ? $this->db->escape($this->remise_percent) : "null").","; // TODO deprecated
2514 2514
 		$sql .= " remise_absolue=".(isset($this->remise_absolue) ? $this->db->escape($this->remise_absolue) : "null").",";
2515 2515
 		$sql .= " close_code=".(isset($this->close_code) ? "'".$this->db->escape($this->close_code)."'" : "null").",";
2516 2516
 		$sql .= " close_note=".(isset($this->close_note) ? "'".$this->db->escape($this->close_note)."'" : "null").",";
@@ -2624,7 +2624,7 @@  discard block
 block discarded – undo
2624 2624
 				$facligne->rang = 1;
2625 2625
 				$linecount = count($this->lines);
2626 2626
 				for ($ii = 1; $ii <= $linecount; $ii++) {
2627
-					$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1);
2627
+					$this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1);
2628 2628
 				}
2629 2629
 			}
2630 2630
 
@@ -3540,7 +3540,7 @@  discard block
 block discarded – undo
3540 3540
 			// Set new ref and define current status
3541 3541
 			if (!$error) {
3542 3542
 				$this->ref = $num;
3543
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
3543
+				$this->statut = self::STATUS_VALIDATED; // deprecated
3544 3544
 				$this->status = self::STATUS_VALIDATED;
3545 3545
 				$this->date_validation = $now;
3546 3546
 				$i = 0;
@@ -3685,7 +3685,7 @@  discard block
 block discarded – undo
3685 3685
 
3686 3686
 			if ($error == 0) {
3687 3687
 				$old_statut = $this->status;
3688
-				$this->statut = self::STATUS_DRAFT;	// deprecated
3688
+				$this->statut = self::STATUS_DRAFT; // deprecated
3689 3689
 				$this->status = self::STATUS_DRAFT;
3690 3690
 
3691 3691
 				// Call trigger
@@ -4016,7 +4016,7 @@  discard block
 block discarded – undo
4016 4016
 				return -2;
4017 4017
 			}
4018 4018
 		} else {
4019
-			$this->errors[]='status of invoice must be Draft to allow use of ->addline()';
4019
+			$this->errors[] = 'status of invoice must be Draft to allow use of ->addline()';
4020 4020
 			dol_syslog(get_class($this)."::addline status of invoice must be Draft to allow use of ->addline()", LOG_ERR);
4021 4021
 			return -3;
4022 4022
 		}
@@ -5663,14 +5663,14 @@  discard block
 block discarded – undo
5663 5663
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5664 5664
 			$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
5665 5665
 		}
5666
-		$sql .= " WHERE f.paye = 0";	// Only unpaid
5667
-		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED;	// Only validated status
5666
+		$sql .= " WHERE f.paye = 0"; // Only unpaid
5667
+		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status
5668 5668
 		if ($datetouse == 'invoicedate') {
5669 5669
 			$sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'";
5670 5670
 		} else {
5671 5671
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
5672 5672
 		}
5673
-		$sql .= " AND f.entity IN (".getEntity('facture', 0).")";	// One batch process only one company (no sharing)
5673
+		$sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing)
5674 5674
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5675 5675
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
5676 5676
 		}
@@ -5878,7 +5878,7 @@  discard block
 block discarded – undo
5878 5878
 								$actioncomm->create($user);
5879 5879
 							}
5880 5880
 
5881
-							$this->db->commit();	// We always commit
5881
+							$this->db->commit(); // We always commit
5882 5882
 						}
5883 5883
 
5884 5884
 						if ($errormesg) {
@@ -5914,7 +5914,7 @@  discard block
 block discarded – undo
5914 5914
 		// get date of last validated invoices of same type
5915 5915
 		$sql  = "SELECT datef";
5916 5916
 		$sql .= " FROM ".MAIN_DB_PREFIX."facture";
5917
-		$sql .= " WHERE type = " . (int) $this->type ;
5917
+		$sql .= " WHERE type = ".(int) $this->type;
5918 5918
 		$sql .= " AND date_valid IS NOT NULL";
5919 5919
 		$sql .= " AND entity IN (".getEntity('invoice').")";
5920 5920
 		$sql .= " ORDER BY datef DESC LIMIT 1";
@@ -6095,7 +6095,7 @@  discard block
 block discarded – undo
6095 6095
 			$objp = $this->db->fetch_object($result);
6096 6096
 
6097 6097
 			if (!$objp) {
6098
-				$this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql;
6098
+				$this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql;
6099 6099
 				return 0;
6100 6100
 			}
6101 6101
 
Please login to merge, or discard this patch.
htdocs/projet/activity/perday.php 1 patch
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,8 +96,14 @@
 block discarded – undo
96 96
 }
97 97
 
98 98
 $daytoparsegmt = dol_now('gmt');
99
-if ($yearofday && $monthofday && $dayofday) $daytoparsegmt = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday, 'gmt'); // xxxofday is value of day after submit action 'addtime'
100
-elseif ($year && $month && $day) $daytoparsegmt = dol_mktime(0, 0, 0, $month, $day, $year, 'gmt'); // this are value submited after submit of action 'submitdateselect'
99
+if ($yearofday && $monthofday && $dayofday) {
100
+	$daytoparsegmt = dol_mktime(0, 0, 0, $monthofday, $dayofday, $yearofday, 'gmt');
101
+}
102
+// xxxofday is value of day after submit action 'addtime'
103
+elseif ($year && $month && $day) {
104
+	$daytoparsegmt = dol_mktime(0, 0, 0, $month, $day, $year, 'gmt');
105
+}
106
+// this are value submited after submit of action 'submitdateselect'
101 107
 
102 108
 if (empty($search_usertoprocessid) || $search_usertoprocessid == $user->id) {
103 109
 	$usertoprocess = $user;
Please login to merge, or discard this patch.
htdocs/expensereport/payment/list.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -53,20 +53,20 @@  discard block
 block discarded – undo
53 53
 // Security check
54 54
 if ($user->socid) $socid = $user->socid;
55 55
 
56
-$search_ref				= GETPOST('search_ref', 'alpha');
57
-$search_date_startday	= GETPOST('search_date_startday', 'int');
58
-$search_date_startmonth	= GETPOST('search_date_startmonth', 'int');
59
-$search_date_startyear	= GETPOST('search_date_startyear', 'int');
56
+$search_ref = GETPOST('search_ref', 'alpha');
57
+$search_date_startday = GETPOST('search_date_startday', 'int');
58
+$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
59
+$search_date_startyear = GETPOST('search_date_startyear', 'int');
60 60
 $search_date_endday		= GETPOST('search_date_endday', 'int');
61
-$search_date_endmonth	= GETPOST('search_date_endmonth', 'int');
61
+$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
62 62
 $search_date_endyear	= GETPOST('search_date_endyear', 'int');
63
-$search_date_start		= dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);	// Use tzserver
64
-$search_date_end		= dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65
-$search_user			= GETPOST('search_user', 'alpha');
63
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
64
+$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
65
+$search_user = GETPOST('search_user', 'alpha');
66 66
 $search_payment_type	= GETPOST('search_payment_type');
67
-$search_cheque_num		= GETPOST('search_cheque_num', 'alpha');
67
+$search_cheque_num = GETPOST('search_cheque_num', 'alpha');
68 68
 $search_bank_account	= GETPOST('search_bank_account', 'int');
69
-$search_amount			= GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
69
+$search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be able to search on '< x'
70 70
 
71 71
 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
72 72
 $sortfield				= GETPOST('sortfield', 'aZ09comma');
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
 	$sql .= natural_search('pndf.rowid', $search_ref);
199 199
 }
200 200
 if ($search_date_start) {
201
-	$sql .= " AND pndf.datep >= '" . $db->idate($search_date_start) . "'";
201
+	$sql .= " AND pndf.datep >= '".$db->idate($search_date_start)."'";
202 202
 }
203 203
 if ($search_date_end) {
204
-	$sql .=" AND pndf.datep <= '" . $db->idate($search_date_end) . "'";
204
+	$sql .= " AND pndf.datep <= '".$db->idate($search_date_end)."'";
205 205
 }
206 206
 
207 207
 if ($search_user) {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,9 @@
 block discarded – undo
49 49
 $socid = GETPOST('socid', 'int');
50 50
 
51 51
 // Security check
52
-if ($user->socid) $socid = $user->socid;
52
+if ($user->socid) {
53
+	$socid = $user->socid;
54
+}
53 55
 
54 56
 $search_ref				= GETPOST('search_ref', 'alpha');
55 57
 $search_date_startday	= GETPOST('search_date_startday', 'int');
Please login to merge, or discard this patch.
htdocs/takepos/admin/setup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 print '<tr class="oddeven"><td>';
260 260
 print $langs->trans("NumberOfTerminals");
261 261
 print '<td colspan="2">';
262
-print '<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" value="' . (empty($conf->global->TAKEPOS_NUM_TERMINALS) ? '1' : $conf->global->TAKEPOS_NUM_TERMINALS)  . '">';
262
+print '<input type="number" name="TAKEPOS_NUM_TERMINALS" min="1" value="'.(empty($conf->global->TAKEPOS_NUM_TERMINALS) ? '1' : $conf->global->TAKEPOS_NUM_TERMINALS).'">';
263 263
 print "</td></tr>\n";
264 264
 
265 265
 // Services
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 	print '<tr class="oddeven"><td>';
393 393
 	print $form->textwithpicto($langs->trans("TakeposBarcodeRuleToInsertProduct"), $langs->trans("TakeposBarcodeRuleToInsertProductDesc"));
394 394
 	print '<td colspan="2">';
395
-	print '<input type="text" name="TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT" value="' . (getDolGlobalString('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT')) . '">';
395
+	print '<input type="text" name="TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT" value="'.(getDolGlobalString('TAKEPOS_BARCODE_RULE_TO_INSERT_PRODUCT')).'">';
396 396
 	print "</td></tr>\n";
397 397
 }
398 398
 
Please login to merge, or discard this patch.
htdocs/core/modules/stock/doc/pdf_standard.modules.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
 		$pdf->SetFont('', 'B', $default_font_size - 3);
686 686
 
687 687
 		// Output Rect
688
-		$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom);	// Rect takes a length in 3rd parameter and 4th parameter
688
+		$this->printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect takes a length in 3rd parameter and 4th parameter
689 689
 
690 690
 		$pdf->SetLineStyle(array('dash'=>'0', 'color'=>array(200, 200, 200)));
691 691
 		$pdf->SetDrawColor(200, 200, 200);
@@ -696,24 +696,24 @@  discard block
 block discarded – undo
696 696
 
697 697
 
698 698
 		if (empty($hidetop)) {
699
-			$pdf->line($this->marge_gauche, $tab_top+11, $this->page_largeur-$this->marge_droite, $tab_top+11);	// line takes a position y in 2nd parameter and 4th parameter
699
+			$pdf->line($this->marge_gauche, $tab_top + 11, $this->page_largeur - $this->marge_droite, $tab_top + 11); // line takes a position y in 2nd parameter and 4th parameter
700 700
 			$pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
701 701
 			$pdf->MultiCell($this->wref, 3, $outputlangs->transnoentities("Ref"), '', 'L');
702 702
 		}
703 703
 
704
-		$pdf->line($this->posxlabel-1, $tab_top, $this->posxlabel-1, $tab_top + $tab_height);
704
+		$pdf->line($this->posxlabel - 1, $tab_top, $this->posxlabel - 1, $tab_top + $tab_height);
705 705
 		if (empty($hidetop)) {
706 706
 			$pdf->SetXY($this->posxlabel - 1, $tab_top + 1);
707 707
 			$pdf->MultiCell($this->posxqty - $this->posxlabel - 1, 2, $outputlangs->transnoentities("Label"), '', 'C');
708 708
 		}
709 709
 
710
-		$pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
710
+		$pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
711 711
 		if (empty($hidetop)) {
712 712
 			$pdf->SetXY($this->posxqty - 1, $tab_top + 1);
713 713
 			$pdf->MultiCell($this->posxup - $this->posxqty - 1, 2, $outputlangs->transnoentities("Units"), '', 'C');
714 714
 		}
715 715
 
716
-		$pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
716
+		$pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
717 717
 		if (empty($hidetop)) {
718 718
 			$pdf->SetXY($this->posxup - 1, $tab_top + 1);
719 719
 			$pdf->MultiCell($this->posxunit - $this->posxup - 1, 2, $outputlangs->transnoentities("AverageUnitPricePMPShort"), '', 'C');
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 			$pdf->MultiCell($this->posxdiscount - $this->posxunit - 1, 2, $outputlangs->transnoentities("EstimatedStockValueShort"), '', 'C');
726 726
 		}
727 727
 
728
-		$pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
728
+		$pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height);
729 729
 		if (empty($hidetop)) {
730 730
 			$pdf->SetXY($this->posxdiscount - 1, $tab_top + 1);
731 731
 			$pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities("SellPriceMin"), '', 'C');
Please login to merge, or discard this patch.
htdocs/recruitment/recruitmentjobposition_list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -303,7 +303,7 @@
 block discarded – undo
303 303
 					$sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
304 304
 				}
305 305
 				if (preg_match('/_dtend$/', $key)) {
306
-					$sql .= " AND t.".$db->escape($columnName)." <= '" . $db->idate($search[$key])."'";
306
+					$sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
307 307
 				}
308 308
 			}
309 309
 		}
Please login to merge, or discard this patch.