Completed
Branch develop (bc7303)
by
unknown
16:52
created
htdocs/accountancy/admin/index.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -275,19 +275,19 @@  discard block
 block discarded – undo
275 275
 // Show message if accountancy hidden options are activated to help to resolve some problems
276 276
 if (!$user->admin) {
277 277
 	if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
278
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
278
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS").'</div>';
279 279
 	}
280 280
 	if (getDolGlobalString('FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS')) {
281
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
281
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS").'</div>';
282 282
 	}
283 283
 	if (getDolGlobalString('ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY')) {
284
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
284
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY").'</div>';
285 285
 	}
286 286
 	if (getDolGlobalString('MAIN_COMPANY_PERENTITY_SHARED')) {
287
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
287
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED").'</div>';
288 288
 	}
289 289
 	if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
290
-		print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
290
+		print '<div class="info">'.$langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED").'</div>';
291 291
 	}
292 292
 }
293 293
 
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
 // Advanced params
460 460
 print '<table class="noborder centpercent">';
461 461
 print '<tr class="liste_titre">';
462
-print '<td colspan="2">' . $langs->trans('OptionsAdvanced') . '</td>';
462
+print '<td colspan="2">'.$langs->trans('OptionsAdvanced').'</td>';
463 463
 print "</tr>\n";
464 464
 
465 465
 print '<tr class="oddeven">';
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 	// Number of letters for lettering (3 by default (AAA), min 2 (AA))
481 481
 	print '<tr class="oddeven">';
482 482
 	print '<td>';
483
-	print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")) . '</td>';
483
+	print $form->textwithpicto($langs->trans("ACCOUNTING_LETTERING_NBLETTERS"), $langs->trans("ACCOUNTING_LETTERING_NBLETTERS_DESC")).'</td>';
484 484
 	print '<td class="right">';
485 485
 
486 486
 	if (empty($letter)) {
@@ -491,19 +491,19 @@  discard block
 block discarded – undo
491 491
 		}
492 492
 	}
493 493
 
494
-	print '<input class="flat" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="' . $nbletter . '" type="number" step="1" min="2" max="3" >' . "\n";
494
+	print '<input class="flat" name="ACCOUNTING_LETTERING_NBLETTERS" id="ACCOUNTING_LETTERING_NBLETTERS" value="'.$nbletter.'" type="number" step="1" min="2" max="3" >'."\n";
495 495
 	print '</tr>';
496 496
 
497 497
 	// Auto Lettering when transfer in accountancy is realized
498 498
 	print '<tr class="oddeven">';
499 499
 	print '<td>';
500
-	print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")) . '</td>';
500
+	print $form->textwithpicto($langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING"), $langs->trans("ACCOUNTING_ENABLE_AUTOLETTERING_DESC")).'</td>';
501 501
 	if (getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) {
502
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=0">';
502
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=0">';
503 503
 		print img_picto($langs->trans("Activated"), 'switch_on');
504 504
 		print '</a></td>';
505 505
 	} else {
506
-		print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenableautolettering&value=1">';
506
+		print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenableautolettering&value=1">';
507 507
 		print img_picto($langs->trans("Disabled"), 'switch_off');
508 508
 		print '</a></td>';
509 509
 	}
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
 print '<td>';
515 515
 print $form->textwithpicto($langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE"), $langs->trans("ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE_DESC", $langs->transnoentities("MenuDefaultAccounts"))).'</td>';
516 516
 if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
517
-	print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=0">';
517
+	print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=0">';
518 518
 	print img_picto($langs->trans("Activated"), 'switch_on');
519 519
 	print '</a></td>';
520 520
 } else {
521
-	print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setenablevatreversecharge&value=1">';
521
+	print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setenablevatreversecharge&value=1">';
522 522
 	print img_picto($langs->trans("Disabled"), 'switch_off');
523 523
 	print '</a></td>';
524 524
 }
Please login to merge, or discard this patch.
htdocs/accountancy/admin/productaccount.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -200,8 +200,8 @@  discard block
 block discarded – undo
200 200
 				} else {
201 201
 					$sql = '';
202 202
 					if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
203
-						$sql_exists  = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
204
-						$sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
203
+						$sql_exists  = "SELECT rowid FROM ".MAIN_DB_PREFIX."product_perentity";
204
+						$sql_exists .= " WHERE fk_product = ".((int) $productid)." AND entity = ".((int) $conf->entity);
205 205
 						$resql_exists = $db->query($sql_exists);
206 206
 						if (!$resql_exists) {
207 207
 							$msg .= '<div><span class="error">'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.'<br> <pre>'.$resql_exists.'</pre></span></div>';
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
 							$nb_exists = $db->num_rows($resql_exists);
211 211
 							if ($nb_exists <= 0) {
212 212
 								// insert
213
-								$sql  = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, " . $db->escape($accountancy_field_name) . ")";
214
-								$sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
213
+								$sql  = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, ".$db->escape($accountancy_field_name).")";
214
+								$sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
215 215
 							} else {
216 216
 								$obj_exists = $db->fetch_object($resql_exists);
217 217
 								// update
218
-								$sql  = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
219
-								$sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
220
-								$sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
218
+								$sql  = "UPDATE ".MAIN_DB_PREFIX."product_perentity";
219
+								$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
220
+								$sql .= " WHERE rowid = ".((int) $obj_exists->rowid);
221 221
 							}
222 222
 						}
223 223
 					} else {
@@ -320,17 +320,17 @@  discard block
 block discarded – undo
320 320
 $sql .= " aa.rowid as aaid";
321 321
 $sql .= " FROM ".MAIN_DB_PREFIX."product as p";
322 322
 if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
323
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
324
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = ppe." . $accountancy_field_name . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'";
323
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
324
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.account_number = ppe.".$accountancy_field_name." AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
325 325
 } else {
326
-	$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account as aa ON aa.account_number = p." . $accountancy_field_name . " AND aa.fk_pcg_version = '" . $db->escape($pcgvercode) . "'";
326
+	$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON aa.account_number = p.".$accountancy_field_name." AND aa.fk_pcg_version = '".$db->escape($pcgvercode)."'";
327 327
 }
328 328
 if (!empty($searchCategoryProductList)) {
329 329
 	$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_product as cp ON p.rowid = cp.fk_product"; // We'll need this table joined to the select in order to filter by categ
330 330
 }
331 331
 $sql .= ' WHERE p.entity IN ('.getEntity('product').')';
332 332
 if (strlen(trim($search_current_account))) {
333
-	$sql .= natural_search((empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p." : "ppe.") . $accountancy_field_name, $search_current_account);
333
+	$sql .= natural_search((empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p." : "ppe.").$accountancy_field_name, $search_current_account);
334 334
 }
335 335
 if ($search_current_account_valid == 'withoutvalidaccount') {
336 336
 	$sql .= " AND aa.account_number IS NULL";
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 	print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
515 515
 
516 516
 	if ($massaction == 'set_default_account') {
517
-		$formquestion[]=array('type' => 'other',
517
+		$formquestion[] = array('type' => 'other',
518 518
 			'name' => 'set_default_account',
519 519
 			'label' => $langs->trans("AccountancyCode"),
520 520
 			'value' => $form->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'));
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 	} else {
615 615
 		print_liste_field_titre("OnBuy", $_SERVER["PHP_SELF"], "p.tobuy", "", $param, '', $sortfield, $sortorder, 'center ');
616 616
 	}
617
-	print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p." : "ppe.") . $accountancy_field_name, "", $param, '', $sortfield, $sortorder);
617
+	print_liste_field_titre("CurrentDedicatedAccountingAccount", $_SERVER["PHP_SELF"], (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? "p." : "ppe.").$accountancy_field_name, "", $param, '', $sortfield, $sortorder);
618 618
 	print_liste_field_titre("AssignDedicatedAccountingAccount");
619 619
 	// Action column
620 620
 	if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
Please login to merge, or discard this patch.
htdocs/comm/propal/card.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 		// Validation
276 276
 		$idwarehouse = GETPOST('idwarehouse', 'int');
277 277
 		$result = $object->valid($user);
278
-		if ( $result > 0 && ! empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) ) {
278
+		if ($result > 0 && !empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
279 279
 			$result = $object->closeProposal($user, $object::STATUS_SIGNED);
280 280
 		}
281 281
 		if ($result >= 0) {
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 					$object->deposit_percent = GETPOST('cond_reglement_id_deposit_percent', 'alpha');
428 428
 					$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
429 429
 					$object->fk_account = GETPOST('fk_account', 'int');
430
-					$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);	// deprecated
430
+					$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2); // deprecated
431 431
 					$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
432 432
 					$object->socid = GETPOST('socid', 'int');
433 433
 					$object->contact_id = GETPOST('contactid', 'int');
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
 		} elseif (GETPOST('statut', 'int') == $object::STATUS_SIGNED || GETPOST('statut', 'int') == $object::STATUS_NOTSIGNED) {
705 705
 			$locationTarget = '';
706 706
 			// prevent browser refresh from closing proposal several times
707
-			if ($object->statut == $object::STATUS_VALIDATED || ( ! empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) && $object->statut == $object::STATUS_DRAFT)) {
707
+			if ($object->statut == $object::STATUS_VALIDATED || (!empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE) && $object->statut == $object::STATUS_DRAFT)) {
708 708
 				$db->begin();
709 709
 
710 710
 				$result = $object->closeProposal($user, GETPOST('statut', 'int'), GETPOST('note_private', 'restricthtml'));
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
 					$error++;
714 714
 				} else {
715 715
 					// Needed if object linked modified by trigger (because linked objects can't be fetched two times : linkedObjectsFullLoaded)
716
-					$locationTarget = DOL_URL_ROOT . '/comm/propal/card.php?id=' . $object->id;
716
+					$locationTarget = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
717 717
 				}
718 718
 
719 719
 				$deposit = null;
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 					!$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on'
725 725
 					&& !empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)
726 726
 				) {
727
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
727
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
728 728
 
729 729
 					$date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'));
730 730
 					$forceFields = array();
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
 
738 738
 					if ($deposit) {
739 739
 						setEventMessage('DepositGenerated');
740
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
740
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
741 741
 					} else {
742 742
 						$error++;
743 743
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
 					}
766 766
 
767 767
 					if ($locationTarget) {
768
-						header('Location: ' . $locationTarget);
768
+						header('Location: '.$locationTarget);
769 769
 						exit;
770 770
 					}
771 771
 				} else {
@@ -925,11 +925,11 @@  discard block
 block discarded – undo
925 925
 		// Define margin
926 926
 		$margin_rate = (GETPOST('marginforalllines') ? GETPOST('marginforalllines') : 0);
927 927
 		foreach ($object->lines as &$line) {
928
-			$subprice = price2num($line->pa_ht * (1 + $margin_rate/100), 'MU');
928
+			$subprice = price2num($line->pa_ht * (1 + $margin_rate / 100), 'MU');
929 929
 			$prod = new Product($db);
930 930
 			$prod->fetch($line->fk_product);
931 931
 			if ($prod->price_min > $subprice) {
932
-				$price_subprice  = price($subprice,        0, $outlangs, 1, -1, -1, 'auto');
932
+				$price_subprice  = price($subprice, 0, $outlangs, 1, -1, -1, 'auto');
933 933
 				$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
934 934
 				setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
935 935
 			}
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 			$pu_ttc_devise = 0;
1044 1044
 			$price_min = 0;
1045 1045
 			$price_min_ttc = 0;
1046
-			$tva_npr=0;
1046
+			$tva_npr = 0;
1047 1047
 			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
1048 1048
 
1049 1049
 			$db->begin();
@@ -1102,8 +1102,8 @@  discard block
 block discarded – undo
1102 1102
 						if (count($prodcustprice->lines) > 0) {
1103 1103
 							$pu_ht = price($prodcustprice->lines[0]->price);
1104 1104
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
1105
-							$price_min =  price($prodcustprice->lines[0]->price_min);
1106
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
1105
+							$price_min = price($prodcustprice->lines[0]->price_min);
1106
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
1107 1107
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
1108 1108
 							/*$tva_tx = ($prodcustprice->lines[0]->default_vat_code ? $prodcustprice->lines[0]->tva_tx.' ('.$prodcustprice->lines[0]->default_vat_code.' )' : $prodcustprice->lines[0]->tva_tx);
1109 1109
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -1201,8 +1201,8 @@  discard block
 block discarded – undo
1201 1201
 				}
1202 1202
 
1203 1203
 				//If text set in desc is the same as product description (as now it's preloaded) whe add it only one time
1204
-				if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
1205
-					$product_desc='';
1204
+				if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
1205
+					$product_desc = '';
1206 1206
 				}
1207 1207
 
1208 1208
 				if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {
@@ -1663,7 +1663,7 @@  discard block
 block discarded – undo
1663 1663
 	}
1664 1664
 
1665 1665
 	// Actions to build doc
1666
-	$upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output;
1666
+	$upload_dir = !empty($conf->propal->multidir_output[$object->entity]) ? $conf->propal->multidir_output[$object->entity] : $conf->propal->dir_output;
1667 1667
 	$permissiontoadd = $usercancreate;
1668 1668
 	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
1669 1669
 }
@@ -1754,7 +1754,7 @@  discard block
 block discarded – undo
1754 1754
 
1755 1755
 			$cond_reglement_id 	= (!empty($objectsrc->cond_reglement_id) ? $objectsrc->cond_reglement_id : (!empty($soc->cond_reglement_id) ? $soc->cond_reglement_id : 0));
1756 1756
 			$mode_reglement_id 	= (!empty($objectsrc->mode_reglement_id) ? $objectsrc->mode_reglement_id : (!empty($soc->mode_reglement_id) ? $soc->mode_reglement_id : 0));
1757
-			$remise_absolue 	= (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0));	// deprecated
1757
+			$remise_absolue 	= (!empty($objectsrc->remise_absolue) ? $objectsrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); // deprecated
1758 1758
 			$remise_percent 	= (!empty($objectsrc->remise_percent) ? $objectsrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0));
1759 1759
 			$warehouse_id       = (!empty($objectsrc->warehouse_id) ? $objectsrc->warehouse_id : (!empty($soc->warehouse_id) ? $soc->warehouse_id : 0));
1760 1760
 
@@ -1817,7 +1817,7 @@  discard block
 block discarded – undo
1817 1817
 	print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
1818 1818
 	print '<input type="hidden" name="token" value="'.newToken().'">';
1819 1819
 	print '<input type="hidden" name="action" value="add">';
1820
-	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
1820
+	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
1821 1821
 	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
1822 1822
 	if ($origin != 'project' && $originid) {
1823 1823
 		print '<input type="hidden" name="origin" value="'.$origin.'">';
@@ -1835,7 +1835,7 @@  discard block
 block discarded – undo
1835 1835
 
1836 1836
 	// Ref customer
1837 1837
 	print '<tr class="field_ref_client"><td class="titlefieldcreate">'.$langs->trans('RefCustomer').'</td><td class="valuefieldcreate">';
1838
-	print '<input type="text" name="ref_client" value="'.(!empty($ref_client)?$ref_client:GETPOST('ref_client')).'"></td>';
1838
+	print '<input type="text" name="ref_client" value="'.(!empty($ref_client) ? $ref_client : GETPOST('ref_client')).'"></td>';
1839 1839
 	print '</tr>';
1840 1840
 
1841 1841
 	// Third party
@@ -2010,7 +2010,7 @@  discard block
 block discarded – undo
2010 2010
 		print '<tr class="field_currency">';
2011 2011
 		print '<td class="titlefieldcreate">'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
2012 2012
 		print '<td class="valuefieldcreate maxwidthonsmartphone">';
2013
-		print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0);
2013
+		print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ?GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0);
2014 2014
 		print '</td></tr>';
2015 2015
 	}
2016 2016
 
@@ -2042,7 +2042,7 @@  discard block
 block discarded – undo
2042 2042
 		// TODO for compatibility
2043 2043
 		if ($origin == 'contrat') {
2044 2044
 			// Calcul contrat->price (HT), contrat->total (TTC), contrat->tva
2045
-			$objectsrc->remise_absolue = $remise_absolue;	// deprecated
2045
+			$objectsrc->remise_absolue = $remise_absolue; // deprecated
2046 2046
 			$objectsrc->remise_percent = $remise_percent;
2047 2047
 			$objectsrc->update_price(1, 'auto', 1);
2048 2048
 		}
@@ -2197,7 +2197,7 @@  discard block
 block discarded – undo
2197 2197
 		if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
2198 2198
 			$formquestion[] = array('type' => 'select', 'name' => 'statut', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array($object::STATUS_SIGNED => $object->LibStatut($object::STATUS_SIGNED), $object::STATUS_NOTSIGNED => $object->LibStatut($object::STATUS_NOTSIGNED)));
2199 2199
 		}
2200
-		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '');				// Field to complete private note (not replace)
2200
+		$formquestion[] = array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => ''); // Field to complete private note (not replace)
2201 2201
 
2202 2202
 		if (getDolGlobalInt('PROPOSAL_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2203 2203
 			// This is a hidden option:
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
 			$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2208 2208
 
2209 2209
 			if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) {
2210
-				require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2210
+				require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2211 2211
 
2212 2212
 				$object->fetchObjectLinked();
2213 2213
 
@@ -2289,7 +2289,7 @@  discard block
 block discarded – undo
2289 2289
 						'type' => 'onecolumn',
2290 2290
 						'value' => '
2291 2291
 							<script>
2292
-								let signedValue = ' . $object::STATUS_SIGNED . ';
2292
+								let signedValue = ' . $object::STATUS_SIGNED.';
2293 2293
 
2294 2294
 								$(document).ready(function() {
2295 2295
 									$("[name=generate_deposit]").change(function () {
@@ -2339,7 +2339,7 @@  discard block
 block discarded – undo
2339 2339
 		if (empty($conf->global->PROPAL_SKIP_ACCEPT_REFUSE)) {
2340 2340
 			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('SetAcceptedRefused'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2341 2341
 		} else {
2342
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?statut=3&id=' . $object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2342
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?statut=3&id='.$object->id, $langs->trans('Close'), '', 'confirm_closeas', $formquestion, '', 1, 250);
2343 2343
 		}
2344 2344
 	} elseif ($action == 'delete') {
2345 2345
 		// Confirm delete
@@ -2378,8 +2378,8 @@  discard block
 block discarded – undo
2378 2378
 		$nbMandated = 0;
2379 2379
 		foreach ($object->lines as $line) {
2380 2380
 			$res = $line->fetch_product();
2381
-			if ($res  > 0  ) {
2382
-				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
2381
+			if ($res > 0) {
2382
+				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2383 2383
 					$nbMandated++;
2384 2384
 					break;
2385 2385
 				}
@@ -2798,46 +2798,46 @@  discard block
 block discarded – undo
2798 2798
 	print '<table class="border tableforfield centpercent">';
2799 2799
 
2800 2800
 	print '<tr>';
2801
-	print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2802
-	print '<td class="nowrap amountcard right">' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
2801
+	print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2802
+	print '<td class="nowrap amountcard right">'.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'</td>';
2803 2803
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2804
-		print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, '', $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2804
+		print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, '', $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2805 2805
 	}
2806 2806
 	print '</tr>';
2807 2807
 
2808 2808
 	print '<tr>';
2809
-	print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
2810
-	print '<td class="nowrap amountcard right">' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
2809
+	print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
2810
+	print '<td class="nowrap amountcard right">'.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).'</td>';
2811 2811
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2812
-		print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, '', $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2812
+		print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, '', $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2813 2813
 	}
2814 2814
 	print '</tr>';
2815 2815
 
2816 2816
 	if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2817 2817
 		print '<tr>';
2818
-		print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2819
-		print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
2818
+		print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2819
+		print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 1, -1, -1, $conf->currency).'</td>';
2820 2820
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2821
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2821
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2822 2822
 		}
2823 2823
 		print '</tr>';
2824 2824
 
2825 2825
 		if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2826 2826
 			print '<tr>';
2827
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2828
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
2827
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2828
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 1, -1, -1, $conf->currency).'</td>';
2829 2829
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2830
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2830
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2831 2831
 			}
2832 2832
 			print '</tr>';
2833 2833
 		}
2834 2834
 	}
2835 2835
 
2836 2836
 	print '<tr>';
2837
-	print '<td>' . $langs->trans('AmountTTC') . '</td>';
2838
-	print '<td class="nowrap amountcard right">' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . '</td>';
2837
+	print '<td>'.$langs->trans('AmountTTC').'</td>';
2838
+	print '<td class="nowrap amountcard right">'.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).'</td>';
2839 2839
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2840
-		print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ttc, '', $langs, 1, -1, -1, $object->multicurrency_code) . '</td>';
2840
+		print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ttc, '', $langs, 1, -1, -1, $object->multicurrency_code).'</td>';
2841 2841
 	}
2842 2842
 	print '</tr>';
2843 2843
 
@@ -2955,7 +2955,7 @@  discard block
 block discarded – undo
2955 2955
 				}
2956 2956
 
2957 2957
 				// ReOpen
2958
-				if ( (( !empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) {
2958
+				if (((!empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) {
2959 2959
 					print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=reopen&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen').'"';
2960 2960
 					print '>'.$langs->trans('ReOpen').'</a>';
2961 2961
 				}
@@ -3030,8 +3030,8 @@  discard block
 block discarded – undo
3030 3030
 				} else {
3031 3031
 					// Set not signed (close)
3032 3032
 					if ($object->statut == Propal::STATUS_DRAFT && $usercanclose) {
3033
-						print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&token='.newToken().'&action=closeas&token='.newToken() . (empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close') . '"';
3034
-						print '>' . $langs->trans('SetRefusedAndClose') . '</a>';
3033
+						print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&token='.newToken().'&action=closeas&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
3034
+						print '>'.$langs->trans('SetRefusedAndClose').'</a>';
3035 3035
 					}
3036 3036
 				}
3037 3037
 
Please login to merge, or discard this patch.
htdocs/societe/project.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
37 37
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
38 38
 
39
-$form  = new Form($db);
39
+$form = new Form($db);
40 40
 
41 41
 // Load translation files required by the page
42 42
 $langs->loadLangs(array('companies', 'projects'));
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 if (!empty($permissiontodelete)) {
89 89
 	$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
90 90
 }
91
-if (in_array($massaction, array('presend', 'predelete','preaffecttag'))) {
91
+if (in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
92 92
 	$arrayofmassactions = array();
93 93
 }
94 94
 
Please login to merge, or discard this patch.
htdocs/commande/card.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -79,18 +79,18 @@  discard block
 block discarded – undo
79 79
 
80 80
 
81 81
 $id        = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('orderid', 'int'));
82
-$ref       =  GETPOST('ref', 'alpha');
83
-$socid     =  GETPOST('socid', 'int');
84
-$action    =  GETPOST('action', 'aZ09');
85
-$cancel    =  GETPOST('cancel', 'alpha');
86
-$confirm   =  GETPOST('confirm', 'alpha');
82
+$ref       = GETPOST('ref', 'alpha');
83
+$socid     = GETPOST('socid', 'int');
84
+$action    = GETPOST('action', 'aZ09');
85
+$cancel    = GETPOST('cancel', 'alpha');
86
+$confirm   = GETPOST('confirm', 'alpha');
87 87
 $backtopage = GETPOST('backtopage', 'alpha');
88 88
 
89
-$lineid    =  GETPOST('lineid', 'int');
90
-$contactid =  GETPOST('contactid', 'int');
91
-$projectid =  GETPOST('projectid', 'int');
92
-$origin    =  GETPOST('origin', 'alpha');
93
-$originid  = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int'));    // For backward compatibility
89
+$lineid    = GETPOST('lineid', 'int');
90
+$contactid = GETPOST('contactid', 'int');
91
+$projectid = GETPOST('projectid', 'int');
92
+$origin    = GETPOST('origin', 'alpha');
93
+$originid  = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
94 94
 $rank      = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
95 95
 
96 96
 // PDF
@@ -115,26 +115,26 @@  discard block
 block discarded – undo
115 115
 $extrafields->fetch_name_optionals_label($object->table_element);
116 116
 
117 117
 // Load object
118
-include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php';     // Must be include, not include_once
118
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
119 119
 
120 120
 // Permissions / Rights
121
-$usercanread    =  $user->hasRight("commande", "lire");
122
-$usercancreate  =  $user->hasRight("commande", "creer");
123
-$usercandelete  =  $user->hasRight("commande", "supprimer");
121
+$usercanread    = $user->hasRight("commande", "lire");
122
+$usercancreate  = $user->hasRight("commande", "creer");
123
+$usercandelete  = $user->hasRight("commande", "supprimer");
124 124
 
125 125
 // Advanced permissions
126
-$usercanclose       =  ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'close')));
127
-$usercanvalidate    =  ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'validate')));
128
-$usercancancel      =  ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'annuler')));
129
-$usercansend        =   (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'send'));
130
-$usercangeneretedoc =   (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc'));
126
+$usercanclose       = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'close')));
127
+$usercanvalidate    = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'validate')));
128
+$usercancancel      = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('commande', 'order_advance', 'annuler')));
129
+$usercansend        = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'send'));
130
+$usercangeneretedoc = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc'));
131 131
 
132 132
 $usermustrespectpricemin    = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS));
133 133
 $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
134 134
 
135
-$permissionnote    = $usercancreate;     //  Used by the include of actions_setnotes.inc.php
136
-$permissiondellink = $usercancreate;     //  Used by the include of actions_dellink.inc.php
137
-$permissiontoadd   = $usercancreate;     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
135
+$permissionnote    = $usercancreate; //  Used by the include of actions_setnotes.inc.php
136
+$permissiondellink = $usercancreate; //  Used by the include of actions_dellink.inc.php
137
+$permissiontoadd   = $usercancreate; //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
138 138
 
139 139
 
140 140
 $error = 0;
@@ -177,11 +177,11 @@  discard block
 block discarded – undo
177 177
 		$action = '';
178 178
 	}
179 179
 
180
-	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php';    // Must be include, not include_once
180
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
181 181
 
182
-	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';     // Must be include, not include_once
182
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
183 183
 
184
-	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';  // Must be include, not include_once
184
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once
185 185
 
186 186
 	// Action clone object
187 187
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 		$pu_ht = '';
667 667
 		$pu_ttc = '';
668 668
 		$pu_ht_devise = '';
669
-		$pu_ttc_devise  = '';
669
+		$pu_ttc_devise = '';
670 670
 
671 671
 		if (GETPOST('price_ht') !== '') {
672 672
 			$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
@@ -808,8 +808,8 @@  discard block
 block discarded – undo
808 808
 						if (count($prodcustprice->lines) > 0) {
809 809
 							$pu_ht = price($prodcustprice->lines[0]->price);
810 810
 							$pu_ttc = price($prodcustprice->lines[0]->price_ttc);
811
-							$price_min =  price($prodcustprice->lines[0]->price_min);
812
-							$price_min_ttc =  price($prodcustprice->lines[0]->price_min_ttc);
811
+							$price_min = price($prodcustprice->lines[0]->price_min);
812
+							$price_min_ttc = price($prodcustprice->lines[0]->price_min_ttc);
813 813
 							$price_base_type = $prodcustprice->lines[0]->price_base_type;
814 814
 							$tva_tx = $prodcustprice->lines[0]->tva_tx;
815 815
 							if ($prodcustprice->lines[0]->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
@@ -908,8 +908,8 @@  discard block
 block discarded – undo
908 908
 				}
909 909
 
910 910
 				//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
911
-				if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
912
-					$product_desc='';
911
+				if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
912
+					$product_desc = '';
913 913
 				}
914 914
 
915 915
 				if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
 					GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
1306 1306
 					&& isModEnabled('facture') && !empty($user->rights->facture->creer)
1307 1307
 				) {
1308
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1308
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1309 1309
 
1310 1310
 					$date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'));
1311 1311
 					$forceFields = array();
@@ -1318,7 +1318,7 @@  discard block
 block discarded – undo
1318 1318
 
1319 1319
 					if ($deposit) {
1320 1320
 						setEventMessage('DepositGenerated');
1321
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
1321
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
1322 1322
 					} else {
1323 1323
 						$error++;
1324 1324
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1326,7 +1326,7 @@  discard block
 block discarded – undo
1326 1326
 				}
1327 1327
 
1328 1328
 				// Define output language
1329
-				if (! $error) {
1329
+				if (!$error) {
1330 1330
 					$db->commit();
1331 1331
 
1332 1332
 					if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
@@ -1354,7 +1354,7 @@  discard block
 block discarded – undo
1354 1354
 					}
1355 1355
 
1356 1356
 					if ($locationTarget) {
1357
-						header('Location: ' . $locationTarget);
1357
+						header('Location: '.$locationTarget);
1358 1358
 						exit;
1359 1359
 					}
1360 1360
 				} else {
@@ -1547,7 +1547,7 @@  discard block
 block discarded – undo
1547 1547
 	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
1548 1548
 
1549 1549
 	// Actions to build doc
1550
-	$upload_dir = !empty($conf->commande->multidir_output[$object->entity])?$conf->commande->multidir_output[$object->entity]:$conf->commande->dir_output;
1550
+	$upload_dir = !empty($conf->commande->multidir_output[$object->entity]) ? $conf->commande->multidir_output[$object->entity] : $conf->commande->dir_output;
1551 1551
 	$permissiontoadd = $usercancreate;
1552 1552
 	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
1553 1553
 
@@ -1780,7 +1780,7 @@  discard block
 block discarded – undo
1780 1780
 	print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
1781 1781
 	print '<input type="hidden" name="token" value="'.newToken().'">';
1782 1782
 	print '<input type="hidden" name="action" value="add">';
1783
-	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
1783
+	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
1784 1784
 	print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
1785 1785
 	print '<input type="hidden" name="origin" value="'.$origin.'">';
1786 1786
 	print '<input type="hidden" name="originid" value="'.$originid.'">';
@@ -1842,7 +1842,7 @@  discard block
 block discarded – undo
1842 1842
 		// Contacts (ask contact only if thirdparty already defined).
1843 1843
 		print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
1844 1844
 		print img_picto('', 'contact', 'class="pictofixedwidth"');
1845
-		print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, !empty($srccontactslist)?$srccontactslist:"", '', 1, 'maxwidth200 widthcentpercentminusx');
1845
+		print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, !empty($srccontactslist) ? $srccontactslist : "", '', 1, 'maxwidth200 widthcentpercentminusx');
1846 1846
 		print '</td></tr>';
1847 1847
 
1848 1848
 		// Ligne info remises tiers
@@ -1911,14 +1911,14 @@  discard block
 block discarded – undo
1911 1911
 		require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
1912 1912
 		$formproduct = new FormProduct($db);
1913 1913
 		print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
1914
-		print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id')?GETPOST('warehouse_id'):$warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
1914
+		print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id') ?GETPOST('warehouse_id') : $warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
1915 1915
 		print '</td></tr>';
1916 1916
 	}
1917 1917
 
1918 1918
 	// Source / Channel - What trigger creation
1919 1919
 	print '<tr><td>'.$langs->trans('Channel').'</td><td>';
1920 1920
 	print img_picto('', 'question', 'class="pictofixedwidth"');
1921
-	$form->selectInputReason((GETPOSTISSET('demand_reason_id')?GETPOST('demand_reason_id'):$demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
1921
+	$form->selectInputReason((GETPOSTISSET('demand_reason_id') ?GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
1922 1922
 	print '</td></tr>';
1923 1923
 
1924 1924
 	// TODO How record was recorded OrderMode (llx_c_input_method)
@@ -1928,7 +1928,7 @@  discard block
 block discarded – undo
1928 1928
 		$langs->load("projects");
1929 1929
 		print '<tr>';
1930 1930
 		print '<td>'.$langs->trans("Project").'</td><td>';
1931
-		print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid')?GETPOST('projectid'):$projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
1931
+		print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ?GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
1932 1932
 		print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
1933 1933
 		print '</td>';
1934 1934
 		print '</tr>';
@@ -1953,7 +1953,7 @@  discard block
 block discarded – undo
1953 1953
 	// Other attributes
1954 1954
 	$parameters = array();
1955 1955
 	if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
1956
-		$parameters['objectsrc'] =  $objectsrc;
1956
+		$parameters['objectsrc'] = $objectsrc;
1957 1957
 	}
1958 1958
 	$parameters['socid'] = $socid;
1959 1959
 
@@ -1988,7 +1988,7 @@  discard block
 block discarded – undo
1988 1988
 		print '<tr>';
1989 1989
 		print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>';
1990 1990
 		print '<td class="maxwidthonsmartphone">';
1991
-		print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
1991
+		print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ?GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
1992 1992
 		print '</td></tr>';
1993 1993
 	}
1994 1994
 
@@ -2169,14 +2169,14 @@  discard block
 block discarded – undo
2169 2169
 			$nbMandated = 0;
2170 2170
 			foreach ($object->lines as $line) {
2171 2171
 				$res = $line->fetch_product();
2172
-				if ($res  > 0  ) {
2173
-					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
2172
+				if ($res > 0) {
2173
+					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2174 2174
 						$nbMandated++;
2175 2175
 						break;
2176 2176
 					}
2177 2177
 				}
2178 2178
 			}
2179
-			if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2179
+			if ($nbMandated > 0) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2180 2180
 
2181 2181
 			if (getDolGlobalInt('SALE_ORDER_SUGGEST_DOWN_PAYMENT_INVOICE_CREATION')) {
2182 2182
 				// This is a hidden option:
@@ -2186,7 +2186,7 @@  discard block
 block discarded – undo
2186 2186
 				$deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2187 2187
 
2188 2188
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && !empty($user->rights->facture->creer)) {
2189
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2189
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2190 2190
 
2191 2191
 					$object->fetchObjectLinked();
2192 2192
 
@@ -2716,55 +2716,55 @@  discard block
 block discarded – undo
2716 2716
 
2717 2717
 		$alert = '';
2718 2718
 		if (!empty($conf->global->ORDER_MANAGE_MIN_AMOUNT) && $object->total_ht < $object->thirdparty->order_min_amount) {
2719
-			$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
2719
+			$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
2720 2720
 		}
2721 2721
 
2722 2722
 		print '<tr>';
2723
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2724
-		print '<td class="nowrap amountcard right">' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2723
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2724
+		print '<td class="nowrap amountcard right">'.price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2725 2725
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2726 2726
 			// Multicurrency Amount HT
2727
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2727
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2728 2728
 		}
2729 2729
 		print '</tr>';
2730 2730
 
2731 2731
 		print '<tr>';
2732
-		print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
2733
-		print '<td class="nowrap amountcard right">' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2732
+		print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
2733
+		print '<td class="nowrap amountcard right">'.price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2734 2734
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2735 2735
 			// Multicurrency Amount VAT
2736
-			print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2736
+			print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2737 2737
 		}
2738 2738
 		print '</tr>';
2739 2739
 
2740 2740
 		// Amount Local Taxes
2741 2741
 		if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2742 2742
 			print '<tr>';
2743
-			print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2744
-			print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2743
+			print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2744
+			print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2745 2745
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2746
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2746
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2747 2747
 			}
2748 2748
 			print '</tr>';
2749 2749
 
2750 2750
 			// Amount Local Taxes
2751 2751
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2752 2752
 				print '<tr>';
2753
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2754
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
2753
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2754
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>';
2755 2755
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2756
-					print '<td class="nowrap amountcard right">' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2756
+					print '<td class="nowrap amountcard right">'.price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2757 2757
 				}
2758 2758
 				print '</tr>';
2759 2759
 			}
2760 2760
 		}
2761 2761
 
2762 2762
 		print '<tr>';
2763
-		print '<td>' . $langs->trans('AmountTTC') . '</td>';
2764
-		print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
2763
+		print '<td>'.$langs->trans('AmountTTC').'</td>';
2764
+		print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
2765 2765
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2766 2766
 			// Multicurrency Amount TTC
2767
-			print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
2767
+			print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
2768 2768
 		}
2769 2769
 		print '</tr>'."\n";
2770 2770
 
@@ -2874,7 +2874,7 @@  discard block
 block discarded – undo
2874 2874
 						if ($usercansend) {
2875 2875
 							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
2876 2876
 						} else {
2877
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false);
2877
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
2878 2878
 						}
2879 2879
 					}
2880 2880
 				}
@@ -2943,7 +2943,7 @@  discard block
 block discarded – undo
2943 2943
 						}*/
2944 2944
 					} else {
2945 2945
 						$langs->load("errors");
2946
-						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2946
+						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2947 2947
 					}
2948 2948
 				}
2949 2949
 
@@ -2995,7 +2995,7 @@  discard block
 block discarded – undo
2995 2995
 					if ($numshipping == 0) {
2996 2996
 						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
2997 2997
 					} else {
2998
-						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
2998
+						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
2999 2999
 					}
3000 3000
 				}
3001 3001
 			}
Please login to merge, or discard this patch.
htdocs/commande/list.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
183 183
 	'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60, 'csslist'=>'nowraponall'),
184 184
 	'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65, 'csslist'=>'nowraponall'),
185
-	'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("expedition")),
185
+	'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66, 'enabled'=>isModEnabled("expedition")),
186 186
 	'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67),
187 187
 	'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68),
188 188
 	'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69),
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130),
206 206
 	'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>135),
207 207
 	'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>140),
208
-	'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990),
208
+	'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'enabled'=>(isModEnabled("expedition")), 'position'=>990),
209 209
 	'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995),
210 210
 	'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999),
211 211
 	'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 		$TFactThirdNbLines = array();
333 333
 
334 334
 		$nb_bills_created = 0;
335
-		$lastid= 0;
335
+		$lastid = 0;
336 336
 		$lastref = '';
337 337
 
338 338
 		$db->begin();
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 			if ($searchCategoryProductOperator == 0) {
1033 1033
 				$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
1034 1034
 			} else {
1035
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
1035
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct);
1036 1036
 			}
1037 1037
 		}
1038 1038
 	}
@@ -2596,13 +2596,13 @@  discard block
 block discarded – undo
2596 2596
 			print '<td class="center">';
2597 2597
 			if (!empty($show_shippable_command) && isModEnabled('stock')) {
2598 2598
 				if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
2599
-					$generic_commande->getLinesArray(); 	// Load array ->lines
2600
-					$generic_commande->loadExpeditions();	// Load array ->expeditions
2599
+					$generic_commande->getLinesArray(); // Load array ->lines
2600
+					$generic_commande->loadExpeditions(); // Load array ->expeditions
2601 2601
 
2602 2602
 					$numlines = count($generic_commande->lines); // Loop on each line of order
2603 2603
 					for ($lig = 0; $lig < $numlines; $lig++) {
2604 2604
 						if (isset($generic_commande->expeditions[$generic_commande->lines[$lig]->id])) {
2605
-							$reliquat =  $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id];
2605
+							$reliquat = $generic_commande->lines[$lig]->qty - $generic_commande->expeditions[$generic_commande->lines[$lig]->id];
2606 2606
 						} else {
2607 2607
 							$reliquat = $generic_commande->lines[$lig]->qty;
2608 2608
 						}
Please login to merge, or discard this patch.
htdocs/compta/facture/card.php 1 patch
Spacing   +34 added lines, -34 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
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 				$object->ref_customer		= GETPOST('ref_client', 'alphanohtml');
1098 1098
 				$object->model_pdf = GETPOST('model');
1099 1099
 				$object->fk_project			= GETPOST('projectid', 'int');
1100
-				$object->cond_reglement_id	= 0;		// No payment term for a credit note
1100
+				$object->cond_reglement_id	= 0; // No payment term for a credit note
1101 1101
 				$object->mode_reglement_id	= GETPOST('mode_reglement_id', 'int');
1102 1102
 				$object->fk_account = GETPOST('fk_account', 'int');
1103 1103
 				$object->remise_absolue		= price2num(GETPOST('remise_absolue'), 'MU');
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
 				$object->note_public		= trim(GETPOST('note_public', 'restricthtml'));
1390 1390
 				$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
1391 1391
 				$object->ref_client			= GETPOST('ref_client');
1392
-				$object->ref_customer		= GETPOST('ref_client');
1392
+				$object->ref_customer = GETPOST('ref_client');
1393 1393
 				$object->model_pdf = GETPOST('model');
1394 1394
 				$object->fk_project			= GETPOST('projectid', 'int');
1395 1395
 				$object->cond_reglement_id	= (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id'));
@@ -1941,7 +1941,7 @@  discard block
 block discarded – undo
1941 1941
 				$object->fk_project = GETPOST('projectid', 'int');
1942 1942
 				$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
1943 1943
 				$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
1944
-				$object->remise_absolue =price2num(GETPOST('remise_absolue'), 'MU', 2);
1944
+				$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
1945 1945
 				$object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
1946 1946
 
1947 1947
 				// Proprietes particulieres a facture de remplacement
@@ -2023,7 +2023,7 @@  discard block
 block discarded – undo
2023 2023
 
2024 2024
 		// Set if we used free entry or predefined product
2025 2025
 		$predef = '';
2026
-		$product_desc =(GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2026
+		$product_desc = (GETPOSTISSET('dp_desc') ? GETPOST('dp_desc', 'restricthtml') : '');
2027 2027
 
2028 2028
 		$price_ht = '';
2029 2029
 		$price_ht_devise = '';
@@ -2217,8 +2217,8 @@  discard block
 block discarded – undo
2217 2217
 				}
2218 2218
 
2219 2219
 				//If text set in desc is the same as product descpription (as now it's preloaded) whe add it only one time
2220
-				if ($product_desc==$desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
2221
-					$product_desc='';
2220
+				if ($product_desc == $desc && !empty($conf->global->PRODUIT_AUTOFILL_DESC)) {
2221
+					$product_desc = '';
2222 2222
 				}
2223 2223
 
2224 2224
 				if (!empty($product_desc) && !empty($conf->global->MAIN_NO_CONCAT_DESCRIPTION)) {
@@ -2468,7 +2468,7 @@  discard block
 block discarded – undo
2468 2468
 		// Define special_code for special lines
2469 2469
 		$special_code = GETPOST('special_code', 'int');
2470 2470
 		if ($special_code == 3) {
2471
-			$special_code = 0;	// Options should not exists on invoices
2471
+			$special_code = 0; // Options should not exists on invoices
2472 2472
 		}
2473 2473
 
2474 2474
 		$line = new FactureLigne($db);
@@ -3082,7 +3082,7 @@  discard block
 block discarded – undo
3082 3082
 
3083 3083
 				if (isModEnabled('multicurrency')) {
3084 3084
 					$currency_code 	= (!empty($expesrc->multicurrency_code) ? $expesrc->multicurrency_code : (!empty($soc->multicurrency_code) ? $soc->multicurrency_code : $objectsrc->multicurrency_code));
3085
-					$currency_tx 	= (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3085
+					$currency_tx = (!empty($expesrc->multicurrency_tx) ? $expesrc->multicurrency_tx : (!empty($soc->multicurrency_tx) ? $soc->multicurrency_tx : $objectsrc->multicurrency_tx));
3086 3086
 				}
3087 3087
 
3088 3088
 				//Replicate extrafields
@@ -3134,7 +3134,7 @@  discard block
 block discarded – undo
3134 3134
 
3135 3135
 	// when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value
3136 3136
 	if ($socid > 0 && $fk_account) {	// A company has already been set and it has a default fk_account
3137
-		$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
3137
+		$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
3138 3138
 	} else {	// No company forced
3139 3139
 		$fk_account = GETPOST("fk_account", 'int');
3140 3140
 	}
@@ -3165,7 +3165,7 @@  discard block
 block discarded – undo
3165 3165
 	print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
3166 3166
 	print '<input type="hidden" name="token" value="'.newToken().'">';
3167 3167
 	print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
3168
-	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
3168
+	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
3169 3169
 	if ($soc->id > 0) {
3170 3170
 		print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
3171 3171
 	}
@@ -3754,7 +3754,7 @@  discard block
 block discarded – undo
3754 3754
 	// Payment mode
3755 3755
 	print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
3756 3756
 	print img_picto('', 'bank', 'class="pictofixedwidth"');
3757
-	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);
3757
+	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);
3758 3758
 	print '</td></tr>';
3759 3759
 
3760 3760
 	// Bank Account
@@ -3829,7 +3829,7 @@  discard block
 block discarded – undo
3829 3829
 		print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
3830 3830
 		print '<td colspan="2" class="maxwidthonsmartphone">';
3831 3831
 		print img_picto('', 'currency', 'class="pictofixedwidth"');
3832
-		print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany'))?GETPOST('multicurrency_code'):$currency_code), 'multicurrency_code');
3832
+		print $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ?GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code');
3833 3833
 		print '</td></tr>';
3834 3834
 	}
3835 3835
 
@@ -4196,14 +4196,14 @@  discard block
 block discarded – undo
4196 4196
 		$nbMandated = 0;
4197 4197
 		foreach ($object->lines as $line) {
4198 4198
 			$res = $line->fetch_product();
4199
-			if ($res  > 0  ) {
4200
-				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end) )) {
4199
+			if ($res > 0) {
4200
+				if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
4201 4201
 					$nbMandated++;
4202 4202
 					break;
4203 4203
 				}
4204 4204
 			}
4205 4205
 		}
4206
-		if ($nbMandated > 0 ) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
4206
+		if ($nbMandated > 0) $text .= '<div><span class="clearboth nowraponall warning">'.$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
4207 4207
 
4208 4208
 
4209 4209
 		$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);
@@ -4818,40 +4818,40 @@  discard block
 block discarded – undo
4818 4818
 	}
4819 4819
 	print '<tr>';
4820 4820
 	// Amount HT
4821
-	print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
4822
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4821
+	print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
4822
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_ht, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4823 4823
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4824 4824
 		// Multicurrency Amount HT
4825
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4825
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4826 4826
 	}
4827 4827
 	print '</tr>';
4828 4828
 
4829 4829
 	print '<tr>';
4830 4830
 	// Amount VAT
4831
-	print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
4832
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4831
+	print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
4832
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_tva, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4833 4833
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4834 4834
 		// Multicurrency Amount VAT
4835
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4835
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4836 4836
 	}
4837 4837
 	print '</tr>';
4838 4838
 
4839 4839
 	// Amount Local Taxes
4840 4840
 	if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {
4841 4841
 		print '<tr>';
4842
-		print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
4843
-		print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4842
+		print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
4843
+		print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4844 4844
 		if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4845
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4845
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4846 4846
 		}
4847 4847
 		print '</tr>';
4848 4848
 
4849 4849
 		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {
4850 4850
 			print '<tr>';
4851
-			print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
4852
-			print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4851
+			print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
4852
+			print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4853 4853
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4854
-				print '<td class="nowrap amountcard right">' . price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4854
+				print '<td class="nowrap amountcard right">'.price($sign * $object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4855 4855
 			}
4856 4856
 			print '</tr>';
4857 4857
 		}
@@ -4913,11 +4913,11 @@  discard block
 block discarded – undo
4913 4913
 
4914 4914
 	print '<tr>';
4915 4915
 	// Amount TTC
4916
-	print '<td>' . $langs->trans('AmountTTC') . '</td>';
4917
-	print '<td class="nowrap amountcard right">' . price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '</td>';
4916
+	print '<td>'.$langs->trans('AmountTTC').'</td>';
4917
+	print '<td class="nowrap amountcard right">'.price($sign * $object->total_ttc, '', $langs, 0, -1, -1, $conf->currency).'</td>';
4918 4918
 	if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
4919 4919
 		// Multicurrency Amount TTC
4920
-		print '<td class="nowrap amountcard right">' . price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
4920
+		print '<td class="nowrap amountcard right">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
4921 4921
 	}
4922 4922
 	print '</tr>';
4923 4923
 
@@ -5316,7 +5316,7 @@  discard block
 block discarded – undo
5316 5316
 			print '</td>';
5317 5317
 			print '<td class="right'.($resteapayeraffiche ? ' amountremaintopay' : (' '.$cssforamountpaymentcomplete)).'">';
5318 5318
 			//print (empty($object->multicurrency_code) ? $conf->currency : $object->multicurrency_code).' ';
5319
-			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>';
5319
+			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>';
5320 5320
 		}
5321 5321
 
5322 5322
 		// Retained warranty : usualy use on construction industry
@@ -5564,7 +5564,7 @@  discard block
 block discarded – undo
5564 5564
 					$langs->load("contracts");
5565 5565
 
5566 5566
 					if ($usercancreatecontract) {
5567
-						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>';
5567
+						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>';
5568 5568
 					}
5569 5569
 				}
5570 5570
 			}
Please login to merge, or discard this patch.