Completed
Branch develop (896bab)
by
unknown
21:08
created
htdocs/expedition/dispatch.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
 						$sql .= " JOIN ".MAIN_DB_PREFIX."product_stock as ps";
179 179
 						$sql .= " ON ps.rowid = pb.fk_product_stock";
180 180
 						$sql .= " WHERE pb.batch = '".$db->escape($lot)."'";
181
-						$sql .= " AND ps.fk_product = ".((int) $prod_id) ;
182
-						$sql .= " AND ps.fk_entrepot = ".((int) $warehouse_id) ;
181
+						$sql .= " AND ps.fk_product = ".((int) $prod_id);
182
+						$sql .= " AND ps.fk_entrepot = ".((int) $warehouse_id);
183 183
 
184 184
 						$resql = $db->query($sql);
185 185
 						if ($resql) {
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 					$qtystart = 0;
208 208
 
209 209
 					if ($idline > 0) {
210
-						$result = $expeditiondispatch->fetch($idline);	// get line from llx_expeditiondet
210
+						$result = $expeditiondispatch->fetch($idline); // get line from llx_expeditiondet
211 211
 						if ($result < 0) {
212 212
 							setEventMessages($expeditiondispatch->error, $expeditiondispatch->errors, 'errors');
213 213
 							$error++;
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
 llxHeader('', $title, $help_url, '', 0, 0, $morejs);
381 381
 
382 382
 if ($object->id > 0 || !empty($object->ref)) {
383
-	$lines = $object->lines;	// This is an array of detail of line, on line per source order line found intolines[]->fk_origin_line, then each line may have sub data
383
+	$lines = $object->lines; // This is an array of detail of line, on line per source order line found intolines[]->fk_origin_line, then each line may have sub data
384 384
 	//var_dump($lines[0]->fk_origin_line); exit;
385 385
 
386 386
 	$num_prod = count($lines);
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 
439 439
 	// Ref customer shipment
440 440
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1);
441
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
441
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
442 442
 
443 443
 	// Thirdparty
444 444
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 	print '<center>';
530 530
 
531 531
 	print '<br>';
532
-	$disabled = 0;	// This is used to disable or not the bulk selection of target warehouse. No reason to have it disabled so forced to 0.
532
+	$disabled = 0; // This is used to disable or not the bulk selection of target warehouse. No reason to have it disabled so forced to 0.
533 533
 
534 534
 	if ($object->statut == Expedition::STATUS_DRAFT) {
535 535
 		require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 				}
634 634
 				print '<td class="right">'.$langs->trans("QtyOrdered").'</td>';
635 635
 				if ($object->status == Expedition::STATUS_DRAFT) {
636
-					print '<td class="right">'.$langs->trans("QtyToShip");	// Qty to dispatch (sum for all lines of batch detail if there is)
636
+					print '<td class="right">'.$langs->trans("QtyToShip"); // Qty to dispatch (sum for all lines of batch detail if there is)
637 637
 				} else {
638 638
 					print '<td class="right">'.$langs->trans("QtyDispatchedShort").'</td>';
639 639
 				}
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 				if (!$objp->fk_product > 0) {
690 690
 					$nbfreeproduct++;
691 691
 				} else {
692
-					$alreadydispatched = isset($products_dispatched[$objp->rowid])?$products_dispatched[$objp->rowid]:0;
692
+					$alreadydispatched = isset($products_dispatched[$objp->rowid]) ? $products_dispatched[$objp->rowid] : 0;
693 693
 					$remaintodispatch = price2num($objp->qty, 5); // Calculation of dispatched
694 694
 					if ($remaintodispatch < 0 && empty($conf->global->SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN)) {
695 695
 						$remaintodispatch = 0;
@@ -895,10 +895,10 @@  discard block
 block discarded – undo
895 895
 								print '<td>';
896 896
 								if (isModEnabled('productbatch') && $objp->tobatch > 0) {
897 897
 									$type = 'batch';
898
-									print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
898
+									print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j + 1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
899 899
 								} else {
900 900
 									$type = 'dispatch';
901
-									print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j+1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
901
+									print img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" '.($numd != $j + 1 ? 'style="display:none"' : '').' onClick="addDispatchLine('.$i.', \''.$type.'\')"');
902 902
 								}
903 903
 
904 904
 								print '</td>';
Please login to merge, or discard this patch.
htdocs/expedition/card.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 			$stockLocation = "ent1".$i."_0";
274 274
 			$qty = "qtyl".$i;
275 275
 
276
-			$is_batch_or_serial=0;
276
+			$is_batch_or_serial = 0;
277 277
 			if (!empty($objectsrc->lines[$i]->fk_product)) {
278 278
 				$resultFetch = $product->fetch($objectsrc->lines[$i]->fk_product, '', '', '', 1, 1, 1);
279 279
 				if ($resultFetch < 0) {
@@ -299,9 +299,9 @@  discard block
 block discarded – undo
299 299
 						//var_dump($sub_qty[$j]['id_batch']);
300 300
 
301 301
 						//var_dump($qty);var_dump($batch);var_dump($sub_qty[$j]['q']);var_dump($sub_qty[$j]['id_batch']);
302
-						if ($is_batch_or_serial==2 && $sub_qty[$j]['q']>1) {
302
+						if ($is_batch_or_serial == 2 && $sub_qty[$j]['q'] > 1) {
303 303
 							setEventMessages($langs->trans("TooManyQtyForSerialNumber", $product->ref, ''), null, 'errors');
304
-							$totalqty=0;
304
+							$totalqty = 0;
305 305
 							break 2;
306 306
 						}
307 307
 						$j++;
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
 			// check qty shipped not greater than ordered
352 352
 			if (getDolGlobalInt("MAIN_DONT_SHIP_MORE_THAN_ORDERED") && $subtotalqty > $objectsrc->lines[$i]->qty) {
353
-				setEventMessages($langs->trans("ErrorTooMuchShipped", $i+1), null, 'errors');
353
+				setEventMessages($langs->trans("ErrorTooMuchShipped", $i + 1), null, 'errors');
354 354
 				$error++;
355 355
 				continue;
356 356
 			}
@@ -678,7 +678,7 @@  discard block
 block discarded – undo
678 678
 									setEventMessages($line->error, $line->errors, 'errors');
679 679
 									$error++;
680 680
 								} else {
681
-									$update_done=true;
681
+									$update_done = true;
682 682
 								}
683 683
 							} else {
684 684
 								setEventMessages($lotStock->error, $lotStock->errors, 'errors');
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
 										setEventMessages($line->error, $line->errors, 'errors');
723 723
 										$error++;
724 724
 									} else {
725
-										$update_done=true;
725
+										$update_done = true;
726 726
 									}
727 727
 								} else {
728 728
 									setEventMessages($line->error, $line->errors, 'errors');
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 									setEventMessages($object->error, $object->errors, 'errors');
742 742
 									$error++;
743 743
 								} else {
744
-									$update_done=true;
744
+									$update_done = true;
745 745
 								}
746 746
 							}
747 747
 						} else {
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
 											setEventMessages($line->error, $line->errors, 'errors');
781 781
 											$error++;
782 782
 										} else {
783
-											$update_done=true;
783
+											$update_done = true;
784 784
 										}
785 785
 									}
786 786
 									unset($_POST[$stockLocation]);
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 								setEventMessages($line->error, $line->errors, 'errors');
797 797
 								$error++;
798 798
 							} else {
799
-								$update_done=true;
799
+								$update_done = true;
800 800
 							}
801 801
 							unset($_POST[$qty]);
802 802
 						}
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
 							setEventMessages($line->error, $line->errors, 'errors');
811 811
 							$error++;
812 812
 						} else {
813
-							$update_done=true;
813
+							$update_done = true;
814 814
 						}
815 815
 						unset($_POST[$qty]);
816 816
 					}
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
 						if (empty($conf->productbatch->enabled) || !$product->hasbatch()) {
1438 1438
 							print '<!-- Case warehouse not already known and product does not need lot -->';
1439 1439
 							print '<td></td><td></td>';
1440
-							if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>';//StockEntrydate
1440
+							if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>'; //StockEntrydate
1441 1441
 							print '</tr>'."\n"; // end line and start a new one for each warehouse
1442 1442
 
1443 1443
 							print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
@@ -1522,7 +1522,7 @@  discard block
 block discarded – undo
1522 1522
 										$quantityToBeDelivered = 0;
1523 1523
 									}
1524 1524
 									$subj++;
1525
-									if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>';//StockEntrydate
1525
+									if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>'; //StockEntrydate
1526 1526
 									print "</tr>\n";
1527 1527
 								}
1528 1528
 							}
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
 										<a href=\"".DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']."
1543 1543
 										</a> (".$value['nb'].")</td><td class=\"center\"> ".$value['nb_total']."</td><td>&nbsp;</td><td>&nbsp;</td>
1544 1544
 										<td class=\"center\">".$value['stock']." ".$img."</td>";
1545
-										if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>';//StockEntrydate
1545
+										if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>'; //StockEntrydate
1546 1546
 										print "</tr>";
1547 1547
 									}
1548 1548
 								}
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
 						} else {
1551 1551
 							print '<!-- Case warehouse not already known and product need lot -->';
1552 1552
 							print '<td></td><td></td>';
1553
-							if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>';//StockEntrydate
1553
+							if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>'; //StockEntrydate
1554 1554
 							print '</tr>'; // end line and start a new one for lot/serial
1555 1555
 
1556 1556
 							$subj = 0;
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
 							$nbofsuggested = 0;
1564 1564
 							foreach ($product->stock_warehouse as $warehouse_id => $stock_warehouse) {
1565 1565
 								if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
1566
-									$nbofsuggested+=count($stock_warehouse->detail_batch);
1566
+									$nbofsuggested += count($stock_warehouse->detail_batch);
1567 1567
 								}
1568 1568
 							}
1569 1569
 
@@ -1604,11 +1604,11 @@  discard block
 block discarded – undo
1604 1604
 											$tooltipClass = ' classfortooltip';
1605 1605
 											$tooltipTitle = $langs->trans('StockQuantitiesAlreadyAllocatedOnPreviousLines').' : '.$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1606 1606
 										} else {
1607
-											$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0 ;
1607
+											$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = 0;
1608 1608
 										}
1609 1609
 										$alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)] = $deliverableQty + $alreadyQtyBatchSetted[$line->fk_product][$dbatch->batch][intval($warehouse_id)];
1610 1610
 
1611
-										print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ?'oddeven' : '').'><td colspan="3"></td><td class="center">';
1611
+										print '<!-- subj='.$subj.'/'.$nbofsuggested.' --><tr '.((($subj + 1) == $nbofsuggested) ? 'oddeven' : '').'><td colspan="3"></td><td class="center">';
1612 1612
 										print '<input class="qtyl '.$tooltipClass.'" title="'.$tooltipTitle.'" name="'.$inputName.'" id="'.$inputName.'" type="text" size="4" value="'.$deliverableQty.'">';
1613 1613
 										print '</td>';
1614 1614
 
@@ -1686,7 +1686,7 @@  discard block
 block discarded – undo
1686 1686
 								print $langs->trans("Service");
1687 1687
 							}
1688 1688
 							print '</td>';
1689
-							if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>';//StockEntrydate
1689
+							if (!empty($conf->global->SHIPPING_DISPLAY_STOCK_ENTRY_DATE)) print '<td></td>'; //StockEntrydate
1690 1690
 							print '</tr>';
1691 1691
 						}
1692 1692
 					}
@@ -1837,7 +1837,7 @@  discard block
 block discarded – undo
1837 1837
 	$morehtmlref = '<div class="refidno">';
1838 1838
 	// Ref customer shipment
1839 1839
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string', '', 0, 1);
1840
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
1840
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->hasRight('expedition', 'creer'), 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
1841 1841
 	// Thirdparty
1842 1842
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
1843 1843
 	// Project
@@ -2372,7 +2372,7 @@  discard block
 block discarded – undo
2372 2372
 							// only show lot numbers from src warehouse when shipping from multiple warehouses
2373 2373
 							$line->fetch($detail_batch->fk_expeditiondet);
2374 2374
 						}
2375
-						$entrepot_id = !empty($detail_batch->entrepot_id)?$detail_batch->entrepot_id:$lines[$i]->entrepot_id;
2375
+						$entrepot_id = !empty($detail_batch->entrepot_id) ? $detail_batch->entrepot_id : $lines[$i]->entrepot_id;
2376 2376
 						print '<td>'.$formproduct->selectLotStock($detail_batch->fk_origin_stock, 'batchl'.$detail_batch->fk_expeditiondet.'_'.$detail_batch->fk_origin_stock, '', 1, 0, $lines[$i]->fk_product, $entrepot_id).'</td>';
2377 2377
 						print '</tr>';
2378 2378
 					}
@@ -2593,7 +2593,7 @@  discard block
 block discarded – undo
2593 2593
 				 || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('expedition', 'shipping_advance', 'validate'))) {
2594 2594
 					print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, '');
2595 2595
 				} else {
2596
-					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2596
+					print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2597 2597
 				}
2598 2598
 			}
2599 2599
 
@@ -2615,7 +2615,7 @@  discard block
 block discarded – undo
2615 2615
 					if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('expedition', 'shipping_advance', 'send')) {
2616 2616
 						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
2617 2617
 					} else {
2618
-						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2618
+						print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2619 2619
 					}
2620 2620
 				}
2621 2621
 			}
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 }
81 81
 
82 82
 // General $Variables
83
-$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int'));    // For backward compatibility
83
+$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
84 84
 $ref = GETPOST('ref', 'alpha');
85 85
 $socid = GETPOST('socid', 'int');
86 86
 $action = GETPOST('action', 'aZ09');
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
 			$error++;
1010 1010
 		}
1011 1011
 
1012
-		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver');	// If we enter the 02 january, we need to save the 02 january for server
1012
+		$dateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); // If we enter the 02 january, we need to save the 02 january for server
1013 1013
 		$date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver');
1014 1014
 
1015 1015
 		// Replacement invoice
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1042 1042
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1043 1043
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1044
-				$object->model_pdf          = GETPOST('model', 'alphanohtml');
1044
+				$object->model_pdf = GETPOST('model', 'alphanohtml');
1045 1045
 				$object->fk_project			= GETPOST('projectid', 'int');
1046 1046
 				$object->cond_reglement_id	= GETPOST('cond_reglement_id', 'int');
1047 1047
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id', 'int');
@@ -1102,9 +1102,9 @@  discard block
 block discarded – undo
1102 1102
 				$object->note_private		= trim(GETPOST('note_private', 'restricthtml'));
1103 1103
 				$object->ref_client			= GETPOST('ref_client', 'alphanohtml');
1104 1104
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1105
-				$object->model_pdf          = GETPOST('model');
1105
+				$object->model_pdf = GETPOST('model');
1106 1106
 				$object->fk_project			= GETPOST('projectid', 'int');
1107
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1107
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1108 1108
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id', 'int');
1109 1109
 				$object->fk_account         = GETPOST('fk_account', 'int');
1110 1110
 				$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1411,7 +1411,7 @@  discard block
 block discarded – undo
1411 1411
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1412 1412
 				$object->note_private       = trim(GETPOST('note_private', 'restricthtml'));
1413 1413
 				$object->ref_client			= GETPOST('ref_client');
1414
-				$object->ref_customer		= GETPOST('ref_client');
1414
+				$object->ref_customer = GETPOST('ref_client');
1415 1415
 				$object->model_pdf          = GETPOST('model');
1416 1416
 				$object->fk_project			= GETPOST('projectid', 'int');
1417 1417
 				$object->cond_reglement_id	= (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1963,7 +1963,7 @@  discard block
 block discarded – undo
1963 1963
 				$object->fk_project = GETPOST('projectid', 'int');
1964 1964
 				$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
1965 1965
 				$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
1966
-				$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
1966
+				$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
1967 1967
 				$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
1968 1968
 				$object->fk_account = GETPOST('fk_account', 'int');
1969 1969
 
@@ -2047,7 +2047,7 @@  discard block
 block discarded – undo
2047 2047
 
2048 2048
 		// Set if we used free entry or predefined product
2049 2049
 		$predef = '';
2050
-		$product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2050
+		$product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2051 2051
 
2052 2052
 		$price_ht = '';
2053 2053
 		$price_ht_devise = '';
@@ -2242,8 +2242,8 @@  discard block
 block discarded – undo
2242 2242
 				}
2243 2243
 
2244 2244
 				//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
2245
-				if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
2246
-					$product_desc='';
2245
+				if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
2246
+					$product_desc = '';
2247 2247
 				}
2248 2248
 
2249 2249
 				if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {
@@ -2542,7 +2542,7 @@  discard block
 block discarded – undo
2542 2542
 		// Define special_code for special lines
2543 2543
 		$special_code = GETPOST('special_code', 'int');
2544 2544
 		if ($special_code == 3) {
2545
-			$special_code = 0;	// Options should not exists on invoices
2545
+			$special_code = 0; // Options should not exists on invoices
2546 2546
 		}
2547 2547
 
2548 2548
 		$line = new FactureLigne($db);
@@ -3153,7 +3153,7 @@  discard block
 block discarded – undo
3153 3153
 
3154 3154
 				if (isModEnabled('multicurrency')) {
3155 3155
 					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3156
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3156
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3157 3157
 				}
3158 3158
 
3159 3159
 				//Replicate extrafields
@@ -3205,7 +3205,7 @@  discard block
 block discarded – undo
3205 3205
 
3206 3206
 	// when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value
3207 3207
 	if ($socid > 0 && $fk_account) {	// A company has already been set and it has a default fk_account
3208
-		$fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account;	// The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company
3208
+		$fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company
3209 3209
 	} else {	// No company forced
3210 3210
 		$fk_account = GETPOST("fk_account", 'int');
3211 3211
 	}
@@ -3236,7 +3236,7 @@  discard block
 block discarded – undo
3236 3236
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3237 3237
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3238 3238
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3239
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
3239
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
3240 3240
 	if ($soc->id > 0) {
3241 3241
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3242 3242
 	}
@@ -3832,7 +3832,7 @@  discard block
 block discarded – undo
3832 3832
 	// Payment mode
3833 3833
 	print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
3834 3834
 	print img_picto('', 'bank', 'class="pictofixedwidth"');
3835
-	print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0)? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
3835
+	print $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id') != 0) ? GETPOST('mode_reglement_id') : $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
3836 3836
 	print '</td></tr>';
3837 3837
 
3838 3838
 	// Bank Account
@@ -3907,7 +3907,7 @@  discard block
 block discarded – undo
3907 3907
 		print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
3908 3908
 		print '<td colspan="2" class="maxwidthonsmartphone">';
3909 3909
 		print img_picto('', 'currency', 'class="pictofixedwidth"');
3910
-		print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code');
3910
+		print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ?GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code');
3911 3911
 		print '</td></tr>';
3912 3912
 	}
3913 3913
 
@@ -4274,14 +4274,14 @@  discard block
 block discarded – undo
4274 4274
 		$nbMandated = 0;
4275 4275
 		foreach ($object->lines as $line) {
4276 4276
 			$res = $line->fetch_product();
4277
-			if ($res  > 0  ) {
4278
-				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
4277
+			if ($res > 0) {
4278
+				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4279 4279
 					$nbMandated++;
4280 4280
 					break;
4281 4281
 				}
4282 4282
 			}
4283 4283
 		}
4284
-		if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
4284
+		if ($nbMandated > 0) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
4285 4285
 
4286 4286
 
4287 4287
 		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2);
@@ -4473,7 +4473,7 @@  discard block
 block discarded – undo
4473 4473
 	}
4474 4474
 	// Ref customer
4475 4475
 	$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string', '', 0, 1);
4476
-	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4476
+	$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
4477 4477
 	// Thirdparty
4478 4478
 	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'customer');
4479 4479
 	if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) {
@@ -4897,40 +4897,40 @@  discard block
 block discarded – undo
4897 4897
 	}
4898 4898
 	print '<tr>';
4899 4899
 	// Amount HT
4900
-	print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
4901
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4900
+	print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
4901
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4902 4902
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4903 4903
 		// Multicurrency Amount HT
4904
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4904
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4905 4905
 	}
4906 4906
 	print '</tr>';
4907 4907
 
4908 4908
 	print '<tr>';
4909 4909
 	// Amount VAT
4910
-	print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
4911
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4910
+	print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
4911
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4912 4912
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4913 4913
 		// Multicurrency Amount VAT
4914
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4914
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4915 4915
 	}
4916 4916
 	print '</tr>';
4917 4917
 
4918 4918
 	// Amount Local Taxes
4919 4919
 	if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
4920 4920
 		print '<tr>';
4921
-		print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
4922
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4921
+		print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
4922
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4923 4923
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4924
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4924
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4925 4925
 		}
4926 4926
 		print '</tr>';
4927 4927
 
4928 4928
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
4929 4929
 			print '<tr>';
4930
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
4931
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4930
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
4931
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4932 4932
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4933
-				print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4933
+				print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4934 4934
 			}
4935 4935
 			print '</tr>';
4936 4936
 		}
@@ -4992,11 +4992,11 @@  discard block
 block discarded – undo
4992 4992
 
4993 4993
 	print '<tr>';
4994 4994
 	// Amount TTC
4995
-	print '<td>' . $langs->trans('AmountTTC') . '</td>';
4996
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4995
+	print '<td>'.$langs->trans('AmountTTC').'</td>';
4996
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4997 4997
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4998 4998
 		// Multicurrency Amount TTC
4999
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4999
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
5000 5000
 	}
5001 5001
 	print '</tr>';
5002 5002
 
@@ -5395,7 +5395,7 @@  discard block
 block discarded – undo
5395 5395
 			print '</td>';
5396 5396
 			print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">';
5397 5397
 			//print (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code).' ';
5398
-			print price(price2num($object->multicurrency_tx*$resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td>&nbsp;</td></tr>';
5398
+			print price(price2num($object->multicurrency_tx * $resteapayeraffiche, 'MT'), 1, $langs, 1, -1, -1, (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code)).'</td><td>&nbsp;</td></tr>';
5399 5399
 		}
5400 5400
 
5401 5401
 		// Retained warranty : usualy use on construction industry
@@ -5646,7 +5646,7 @@  discard block
 block discarded – undo
5646 5646
 					$langs->load("contracts");
5647 5647
 
5648 5648
 					if ($usercancreatecontract) {
5649
-						print '<a class="butAction" href="' . DOL_URL_ROOT . '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '">' . $langs->trans('AddContract') . '</a>';
5649
+						print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans('AddContract').'</a>';
5650 5650
 					}
5651 5651
 				}
5652 5652
 			}
Please login to merge, or discard this patch.
htdocs/compta/facture/class/facture.class.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 			$this->mode_reglement_id = 0;
471 471
 		}
472 472
 		$this->status = self::STATUS_DRAFT;
473
-		$this->statut = self::STATUS_DRAFT;	// deprecated
473
+		$this->statut = self::STATUS_DRAFT; // deprecated
474 474
 
475 475
 		if (!empty($this->multicurrency_code)) {
476 476
 			// Multicurrency (test on $this->multicurrency_tx because we should take the default rate of multicurrency_code only if not using original rate)
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 
552 552
 			// Fields always coming from template
553 553
 			$this->remise_absolue    = $_facrec->remise_absolue;
554
-			$this->remise_percent    = $_facrec->remise_percent;	// TODO deprecated
554
+			$this->remise_percent    = $_facrec->remise_percent; // TODO deprecated
555 555
 			$this->fk_incoterms = $_facrec->fk_incoterms;
556 556
 			$this->location_incoterms = $_facrec->location_incoterms;
557 557
 
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 				$this->mode_reglement_id = 0;
572 572
 			}
573 573
 			$this->status = self::STATUS_DRAFT;
574
-			$this->statut = self::STATUS_DRAFT;	// deprecated
574
+			$this->statut = self::STATUS_DRAFT; // deprecated
575 575
 
576 576
 			$this->linked_objects = $_facrec->linkedObjectsIds;
577 577
 			// We do not add link to template invoice or next invoice will be linked to all generated invoices
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
 		$sql .= ", fk_soc";
655 655
 		$sql .= ", datec";
656 656
 		$sql .= ", remise_absolue";
657
-		$sql .= ", remise_percent";	// TODO deprecated
657
+		$sql .= ", remise_percent"; // TODO deprecated
658 658
 		$sql .= ", datef";
659 659
 		$sql .= ", date_pointoftax";
660 660
 		$sql .= ", note_private";
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 		$sql .= ", ".((int) $socid);
682 682
 		$sql .= ", '".$this->db->idate($now)."'";
683 683
 		$sql .= ", ".($this->remise_absolue > 0 ? $this->remise_absolue : 'NULL');
684
-		$sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL');	// TODO deprecated
684
+		$sql .= ", ".($this->remise_percent > 0 ? $this->remise_percent : 'NULL'); // TODO deprecated
685 685
 		$sql .= ", '".$this->db->idate($this->date)."'";
686 686
 		$sql .= ", ".(empty($this->date_pointoftax) ? "null" : "'".$this->db->idate($this->date_pointoftax)."'");
687 687
 		$sql .= ", ".($this->note_private ? "'".$this->db->escape($this->note_private)."'" : "null");
@@ -820,7 +820,7 @@  discard block
 block discarded – undo
820 820
 
821 821
 						// Complete vat rate with code
822 822
 						$vatrate = $newinvoiceline->tva_tx;
823
-						if ($newinvoiceline->vat_src_code && ! preg_match('/\(.*\)/', $vatrate)) $vatrate.=' ('.$newinvoiceline->vat_src_code.')';
823
+						if ($newinvoiceline->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$newinvoiceline->vat_src_code.')';
824 824
 
825 825
 						$newinvoiceline->fk_parent_line = $fk_parent_line;
826 826
 
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
 						$buyprice,
1051 1051
 						$_facrec->lines[$i]->label,
1052 1052
 						empty($_facrec->lines[$i]->array_options) ?null:$_facrec->lines[$i]->array_options,
1053
-						100,	// situation percent is undefined on recurring invoice lines
1053
+						100, // situation percent is undefined on recurring invoice lines
1054 1054
 						'',
1055 1055
 						$_facrec->lines[$i]->fk_unit,
1056 1056
 						$_facrec->lines[$i]->multicurrency_subprice,
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 
1147 1147
 		$facture->fk_facture_source = $this->fk_facture_source;
1148 1148
 		$facture->type 			    = $this->type;
1149
-		$facture->subtype 			= $this->subtype;
1149
+		$facture->subtype = $this->subtype;
1150 1150
 		$facture->socid 		    = $this->socid;
1151 1151
 		$facture->date              = $this->date;
1152 1152
 		$facture->date_pointoftax   = $this->date_pointoftax;
@@ -1158,11 +1158,11 @@  discard block
 block discarded – undo
1158 1158
 		$facture->cond_reglement_id = $this->cond_reglement_id;
1159 1159
 		$facture->mode_reglement_id = $this->mode_reglement_id;
1160 1160
 		$facture->remise_absolue    = $this->remise_absolue;
1161
-		$facture->remise_percent    = $this->remise_percent;	// TODO deprecated
1161
+		$facture->remise_percent    = $this->remise_percent; // TODO deprecated
1162 1162
 
1163 1163
 		$facture->origin            = $this->origin;
1164 1164
 		$facture->origin_id         = $this->origin_id;
1165
-		$facture->fk_account         = $this->fk_account;
1165
+		$facture->fk_account = $this->fk_account;
1166 1166
 
1167 1167
 		$facture->lines = $this->lines; // Array of lines of invoice
1168 1168
 		$facture->situation_counter = $this->situation_counter;
@@ -1633,7 +1633,7 @@  discard block
 block discarded – undo
1633 1633
 	{
1634 1634
 		global $conf, $langs, $hookmanager, $action;
1635 1635
 
1636
-		if (! in_array($origin->element, array('propal', 'commande'))) {
1636
+		if (!in_array($origin->element, array('propal', 'commande'))) {
1637 1637
 			$origin->error = 'ErrorCanOnlyAutomaticallyGenerateADepositFromProposalOrOrder';
1638 1638
 			return null;
1639 1639
 		}
@@ -1643,7 +1643,7 @@  discard block
 block discarded – undo
1643 1643
 			return null;
1644 1644
 		}
1645 1645
 
1646
-		require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
1646
+		require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
1647 1647
 
1648 1648
 		if ($date > (dol_get_last_hour(dol_now('tzuserrel')) + (empty($conf->global->INVOICE_MAX_FUTURE_DELAY) ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) {
1649 1649
 			$origin->error = 'ErrorDateIsInFuture';
@@ -1687,7 +1687,7 @@  discard block
 block discarded – undo
1687 1687
 		$deposit->pos_source = $origin->pos_source;
1688 1688
 		$deposit->model_pdf = 'crabe';
1689 1689
 
1690
-		$modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type;
1690
+		$modelByTypeConfName = 'FACTURE_ADDON_PDF_'.$deposit->type;
1691 1691
 
1692 1692
 		if (!empty($conf->global->$modelByTypeConfName)) {
1693 1693
 			$deposit->model_pdf = $conf->global->$modelByTypeConfName;
@@ -1742,10 +1742,10 @@  discard block
 block discarded – undo
1742 1742
 					continue;
1743 1743
 				}
1744 1744
 				$TTotalByTva[$line->tva_tx] += $line->total_ttc;
1745
-				$descriptions[$line->tva_tx] .= '<li>' . (!empty($line->product_ref) ? $line->product_ref . ' - ' :  '');
1746
-				$descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label . ' - ' : '');
1747
-				$descriptions[$line->tva_tx] .= $langs->trans('Qty') . ' : ' . $line->qty;
1748
-				$descriptions[$line->tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($line->total_ht) . '</li>';
1745
+				$descriptions[$line->tva_tx] .= '<li>'.(!empty($line->product_ref) ? $line->product_ref.' - ' : '');
1746
+				$descriptions[$line->tva_tx] .= (!empty($line->product_label) ? $line->product_label.' - ' : '');
1747
+				$descriptions[$line->tva_tx] .= $langs->trans('Qty').' : '.$line->qty;
1748
+				$descriptions[$line->tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($line->total_ht).'</li>';
1749 1749
 			}
1750 1750
 
1751 1751
 			foreach ($TTotalByTva as $tva => &$total) {
@@ -1769,10 +1769,10 @@  discard block
 block discarded – undo
1769 1769
 				$totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ?
1770 1770
 				$tva_tx = $lines[$i]->tva_tx;
1771 1771
 				$amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $origin->deposit_percent) / 100;
1772
-				$descriptions[$tva_tx] .= '<li>' . (!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref . ' - ' :  '');
1773
-				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label . ' - ' : '');
1774
-				$descriptions[$tva_tx] .= $langs->trans('Qty') . ' : ' . $lines[$i]->qty;
1775
-				$descriptions[$tva_tx] .= ' - ' . $langs->trans('TotalHT') . ' : ' . price($lines[$i]->total_ht) . '</li>';
1772
+				$descriptions[$tva_tx] .= '<li>'.(!empty($lines[$i]->product_ref) ? $lines[$i]->product_ref.' - ' : '');
1773
+				$descriptions[$tva_tx] .= (!empty($lines[$i]->product_label) ? $lines[$i]->product_label.' - ' : '');
1774
+				$descriptions[$tva_tx] .= $langs->trans('Qty').' : '.$lines[$i]->qty;
1775
+				$descriptions[$tva_tx] .= ' - '.$langs->trans('TotalHT').' : '.price($lines[$i]->total_ht).'</li>';
1776 1776
 			}
1777 1777
 
1778 1778
 			if ($totalamount == 0) {
@@ -1787,11 +1787,11 @@  discard block
 block discarded – undo
1787 1787
 				continue;
1788 1788
 			}
1789 1789
 
1790
-			$descline = '(DEPOSIT) ('. $origin->deposit_percent .'%) - '.$origin->ref;
1790
+			$descline = '(DEPOSIT) ('.$origin->deposit_percent.'%) - '.$origin->ref;
1791 1791
 
1792 1792
 			// Hidden conf
1793 1793
 			if (!empty($conf->global->INVOICE_DEPOSIT_VARIABLE_MODE_DETAIL_LINES_IN_DESCRIPTION) && !empty($descriptions[$tva])) {
1794
-				$descline .= '<ul>' . $descriptions[$tva] . '</ul>';
1794
+				$descline .= '<ul>'.$descriptions[$tva].'</ul>';
1795 1795
 			}
1796 1796
 
1797 1797
 			$addlineResult = $deposit->addline(
@@ -2053,7 +2053,7 @@  discard block
 block discarded – undo
2053 2053
 				$label = $langs->trans("Invoice");
2054 2054
 				$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
2055 2055
 			}
2056
-			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' :  ' title="tocomplete"');
2056
+			$linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"');
2057 2057
 			$linkclose .= $dataparams.' class="'.$classfortooltip.'"';
2058 2058
 		}
2059 2059
 
@@ -2165,9 +2165,9 @@  discard block
 block discarded – undo
2165 2165
 				$this->id = $obj->rowid;
2166 2166
 				$this->entity = $obj->entity;
2167 2167
 
2168
-				$this->ref					= $obj->ref;
2169
-				$this->ref_client			= $obj->ref_client;
2170
-				$this->ref_customer			= $obj->ref_client;
2168
+				$this->ref = $obj->ref;
2169
+				$this->ref_client = $obj->ref_client;
2170
+				$this->ref_customer = $obj->ref_client;
2171 2171
 				$this->ref_ext				= $obj->ref_ext;
2172 2172
 				$this->type					= $obj->type;
2173 2173
 				$this->subtype				= $obj->subtype;
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
 				$this->date_validation		= $this->db->jdate($obj->datev);
2178 2178
 				$this->date_modification    = $this->db->jdate($obj->datem);
2179 2179
 				$this->datem                = $this->db->jdate($obj->datem);
2180
-				$this->remise_percent		= $obj->remise_percent;	// TODO deprecated
2180
+				$this->remise_percent		= $obj->remise_percent; // TODO deprecated
2181 2181
 				$this->remise_absolue		= $obj->remise_absolue;
2182 2182
 				$this->total_ht				= $obj->total_ht;
2183 2183
 				$this->total_tva			= $obj->total_tva;
@@ -2195,7 +2195,7 @@  discard block
 block discarded – undo
2195 2195
 				$this->fk_project = $obj->fk_project;
2196 2196
 				$this->project = null; // Clear if another value was already set by fetch_projet
2197 2197
 
2198
-				$this->statut = $obj->status;	// deprecated
2198
+				$this->statut = $obj->status; // deprecated
2199 2199
 				$this->status = $obj->status;
2200 2200
 
2201 2201
 				$this->date_lim_reglement = $this->db->jdate($obj->dlr);
@@ -2211,7 +2211,7 @@  discard block
 block discarded – undo
2211 2211
 				$this->fk_fac_rec_source	= $obj->fk_fac_rec_source;
2212 2212
 				$this->note = $obj->note_private; // deprecated
2213 2213
 				$this->note_private = $obj->note_private;
2214
-				$this->note_public			= $obj->note_public;
2214
+				$this->note_public = $obj->note_public;
2215 2215
 				$this->user_creation_id     = $obj->fk_user_author; // deprecated
2216 2216
 				$this->user_validation_id   = $obj->fk_user_valid; // deprecated
2217 2217
 				$this->user_modification    = $obj->fk_user_modif; // deprecated
@@ -2327,7 +2327,7 @@  discard block
 block discarded – undo
2327 2327
 				$line->ref              = $objp->product_ref; // Ref product
2328 2328
 				$line->product_ref      = $objp->product_ref; // Ref product
2329 2329
 				$line->libelle          = $objp->product_label; // deprecated
2330
-				$line->product_label 	= $objp->product_label; // Label product
2330
+				$line->product_label = $objp->product_label; // Label product
2331 2331
 				$line->product_desc     = $objp->product_desc; // Description product
2332 2332
 				$line->fk_product_type  = $objp->fk_product_type; // Type of product
2333 2333
 				$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
 
@@ -3200,7 +3200,7 @@  discard block
 block discarded – undo
3200 3200
 		if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('facture', 'creer'))
3201 3201
 		|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->hasRight('facture', 'invoice_advance', 'validate'))) {
3202 3202
 			$this->error = 'Permission denied';
3203
-			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS=' . getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3203
+			dol_syslog(get_class($this)."::validate ".$this->error.' MAIN_USE_ADVANCED_PERMS='.getDolGlobalString('MAIN_USE_ADVANCED_PERMS'), LOG_ERR);
3204 3204
 			return -1;
3205 3205
 		}
3206 3206
 		if (!empty($conf->global-> INVOICE_CHECK_POSTERIOR_DATE)) {
@@ -3544,7 +3544,7 @@  discard block
 block discarded – undo
3544 3544
 			// Set new ref and define current status
3545 3545
 			if (!$error) {
3546 3546
 				$this->ref = $num;
3547
-				$this->statut = self::STATUS_VALIDATED;	// deprecated
3547
+				$this->statut = self::STATUS_VALIDATED; // deprecated
3548 3548
 				$this->status = self::STATUS_VALIDATED;
3549 3549
 				$this->date_validation = $now;
3550 3550
 				$i = 0;
@@ -3689,7 +3689,7 @@  discard block
 block discarded – undo
3689 3689
 
3690 3690
 			if ($error == 0) {
3691 3691
 				$old_statut = $this->status;
3692
-				$this->statut = self::STATUS_DRAFT;	// deprecated
3692
+				$this->statut = self::STATUS_DRAFT; // deprecated
3693 3693
 				$this->status = self::STATUS_DRAFT;
3694 3694
 
3695 3695
 				// Call trigger
@@ -4020,7 +4020,7 @@  discard block
 block discarded – undo
4020 4020
 				return -2;
4021 4021
 			}
4022 4022
 		} else {
4023
-			$this->errors[]='status of invoice must be Draft to allow use of ->addline()';
4023
+			$this->errors[] = 'status of invoice must be Draft to allow use of ->addline()';
4024 4024
 			dol_syslog(get_class($this)."::addline status of invoice must be Draft to allow use of ->addline()", LOG_ERR);
4025 4025
 			return -3;
4026 4026
 		}
@@ -4584,7 +4584,7 @@  discard block
 block discarded – undo
4584 4584
 		}
4585 4585
 
4586 4586
 		if (!empty($addon)) {
4587
-			dol_syslog("Call getNextNumRef with ".$addonConstName." = " . getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
4587
+			dol_syslog("Call getNextNumRef with ".$addonConstName." = ".getDolGlobalString('FACTURE_ADDON').", thirdparty=".$soc->name.", type=".$soc->typent_code.", mode=".$mode, LOG_DEBUG);
4588 4588
 
4589 4589
 			$mybool = false;
4590 4590
 
@@ -5661,14 +5661,14 @@  discard block
 block discarded – undo
5661 5661
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5662 5662
 			$sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp";
5663 5663
 		}
5664
-		$sql .= " WHERE f.paye = 0";	// Only unpaid
5665
-		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED;	// Only validated status
5664
+		$sql .= " WHERE f.paye = 0"; // Only unpaid
5665
+		$sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; // Only validated status
5666 5666
 		if ($datetouse == 'invoicedate') {
5667 5667
 			$sql .= " AND f.datef = '".$this->db->idate($tmpidate, 'gmt')."'";
5668 5668
 		} else {
5669 5669
 			$sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'";
5670 5670
 		}
5671
-		$sql .= " AND f.entity IN (".getEntity('facture', 0).")";	// One batch process only one company (no sharing)
5671
+		$sql .= " AND f.entity IN (".getEntity('facture', 0).")"; // One batch process only one company (no sharing)
5672 5672
 		if (!empty($paymentmode) && $paymentmode != 'all') {
5673 5673
 			$sql .= " AND f.fk_mode_reglement = cp.id AND cp.code = '".$this->db->escape($paymentmode)."'";
5674 5674
 		}
@@ -5876,7 +5876,7 @@  discard block
 block discarded – undo
5876 5876
 								$actioncomm->create($user);
5877 5877
 							}
5878 5878
 
5879
-							$this->db->commit();	// We always commit
5879
+							$this->db->commit(); // We always commit
5880 5880
 						}
5881 5881
 
5882 5882
 						if ($errormesg) {
@@ -5912,7 +5912,7 @@  discard block
 block discarded – undo
5912 5912
 		// get date of last validated invoices of same type
5913 5913
 		$sql  = "SELECT datef";
5914 5914
 		$sql .= " FROM ".MAIN_DB_PREFIX."facture";
5915
-		$sql .= " WHERE type = " . (int) $this->type ;
5915
+		$sql .= " WHERE type = ".(int) $this->type;
5916 5916
 		$sql .= " AND date_valid IS NOT NULL";
5917 5917
 		$sql .= " AND entity IN (".getEntity('invoice').")";
5918 5918
 		$sql .= " ORDER BY datef DESC LIMIT 1";
@@ -6102,7 +6102,7 @@  discard block
 block discarded – undo
6102 6102
 			$objp = $this->db->fetch_object($result);
6103 6103
 
6104 6104
 			if (!$objp) {
6105
-				$this->error = 'InvoiceLine with id '. $rowid .' not found sql='.$sql;
6105
+				$this->error = 'InvoiceLine with id '.$rowid.' not found sql='.$sql;
6106 6106
 				return 0;
6107 6107
 			}
6108 6108
 
Please login to merge, or discard this patch.