|  | @@ -32,17 +32,17 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 32 | 32 |   | 
                                                                                                            
                                                            | 33 | 33 |  // Load Dolibarr environment | 
                                                                                                            
                                                            | 34 | 34 |  require '../../main.inc.php'; | 
                                                                                                            
                                                            | 35 |  | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture-rec.class.php'; | 
                                                                                                            
                                                            | 36 |  | -require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; | 
                                                                                                            
                                                            | 37 |  | -require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; | 
                                                                                                            
                                                            | 38 |  | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; | 
                                                                                                            
                                                            |  | 35 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture-rec.class.php'; | 
                                                                                                            
                                                            |  | 36 | +require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; | 
                                                                                                            
                                                            |  | 37 | +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; | 
                                                                                                            
                                                            |  | 38 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; | 
                                                                                                            
                                                            | 39 | 39 |  if (isModEnabled('project')) { | 
                                                                                                            
                                                            | 40 |  | -	include_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; | 
                                                                                                            
                                                            |  | 40 | +	include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; | 
                                                                                                            
                                                            | 41 | 41 |  } | 
                                                                                                            
                                                            | 42 |  | -require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; | 
                                                                                                            
                                                            | 43 |  | -require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; | 
                                                                                                            
                                                            | 44 |  | -require_once DOL_DOCUMENT_ROOT . '/core/lib/invoice.lib.php'; | 
                                                                                                            
                                                            | 45 |  | -require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php'; | 
                                                                                                            
                                                            |  | 42 | +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; | 
                                                                                                            
                                                            |  | 43 | +require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; | 
                                                                                                            
                                                            |  | 44 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; | 
                                                                                                            
                                                            |  | 45 | +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; | 
                                                                                                            
                                                            | 46 | 46 |   | 
                                                                                                            
                                                            | 47 | 47 |  // Load translation files required by the page | 
                                                                                                            
                                                            | 48 | 48 |  $langs->loadLangs(array('bills', 'companies', 'compta', 'admin', 'other', 'products', 'banks', 'suppliers')); | 
                                                                                                                                                        
                                                        |  | @@ -83,10 +83,10 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 83 | 83 |  	$page = 0; | 
                                                                                                            
                                                            | 84 | 84 |  }     // If $page is not defined, or '' or -1 | 
                                                                                                            
                                                            | 85 | 85 |  $offset = $limit * $page; | 
                                                                                                            
                                                            | 86 |  | -if (! $sortorder) { | 
                                                                                                            
                                                            |  | 86 | +if (!$sortorder) { | 
                                                                                                            
                                                            | 87 | 87 |  	$sortorder = 'DESC'; | 
                                                                                                            
                                                            | 88 | 88 |  } | 
                                                                                                            
                                                            | 89 |  | -if (! $sortfield) { | 
                                                                                                            
                                                            |  | 89 | +if (!$sortfield) { | 
                                                                                                            
                                                            | 90 | 90 |  	$sortfield = 'f.titre'; | 
                                                                                                            
                                                            | 91 | 91 |  } | 
                                                                                                            
                                                            | 92 | 92 |  $pageprev = $page - 1; | 
                                                                                                                                                        
                                                        |  | @@ -95,7 +95,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 95 | 95 |  $object = new FactureFournisseurRec($db); | 
                                                                                                            
                                                            | 96 | 96 |  if (($id > 0 || $title) && $action != 'create' && $action != 'add') { | 
                                                                                                            
                                                            | 97 | 97 |  	$ret = $object->fetch($id, $title); | 
                                                                                                            
                                                            | 98 |  | -	if (! $ret) { | 
                                                                                                            
                                                            |  | 98 | +	if (!$ret) { | 
                                                                                                            
                                                            | 99 | 99 |  		setEventMessages($langs->trans("ErrorRecordNotFound"), null, 'errors'); | 
                                                                                                            
                                                            | 100 | 100 |  	} | 
                                                                                                            
                                                            | 101 | 101 |  } | 
                                                                                                                                                        
                                                        |  | @@ -139,7 +139,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 139 | 139 |  	$action = 'list'; | 
                                                                                                            
                                                            | 140 | 140 |  	$massaction = ''; | 
                                                                                                            
                                                            | 141 | 141 |  } | 
                                                                                                            
                                                            | 142 |  | -if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { | 
                                                                                                            
                                                            |  | 142 | +if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { | 
                                                                                                            
                                                            | 143 | 143 |  	$massaction = ''; | 
                                                                                                            
                                                            | 144 | 144 |  } | 
                                                                                                            
                                                            | 145 | 145 |   | 
                                                                                                                                                        
                                                        |  | @@ -155,18 +155,18 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 155 | 155 |  	} | 
                                                                                                            
                                                            | 156 | 156 |   | 
                                                                                                            
                                                            | 157 | 157 |  	// Selection of new fields | 
                                                                                                            
                                                            | 158 |  | -	include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php'; | 
                                                                                                            
                                                            |  | 158 | +	include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; | 
                                                                                                            
                                                            | 159 | 159 |   | 
                                                                                                            
                                                            | 160 | 160 |  	// Set note | 
                                                                                                            
                                                            | 161 |  | -	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not include_once | 
                                                                                                            
                                                            |  | 161 | +	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once | 
                                                                                                            
                                                            | 162 | 162 |   | 
                                                                                                            
                                                            | 163 |  | -	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once | 
                                                                                                            
                                                            |  | 163 | +	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once | 
                                                                                                            
                                                            | 164 | 164 |   | 
                                                                                                            
                                                            | 165 |  | -	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php'; // Must be include, not include_once | 
                                                                                                            
                                                            |  | 165 | +	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be include, not include_once | 
                                                                                                            
                                                            | 166 | 166 |   | 
                                                                                                            
                                                            | 167 | 167 |  	// Create predefined invoice | 
                                                                                                            
                                                            | 168 | 168 |  	if ($action == 'add') { | 
                                                                                                            
                                                            | 169 |  | -		if (! GETPOST('title', 'alphanohtml')) { | 
                                                                                                            
                                                            |  | 169 | +		if (!GETPOST('title', 'alphanohtml')) { | 
                                                                                                            
                                                            | 170 | 170 |  			setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->trans("Title")), null, 'errors'); | 
                                                                                                            
                                                            | 171 | 171 |  			$action = "create"; | 
                                                                                                            
                                                            | 172 | 172 |  			$error++; | 
                                                                                                                                                        
                                                        |  | @@ -189,10 +189,10 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 189 | 189 |  			} | 
                                                                                                            
                                                            | 190 | 190 |  		} | 
                                                                                                            
                                                            | 191 | 191 |   | 
                                                                                                            
                                                            | 192 |  | -		if (! $error) { | 
                                                                                                            
                                                            |  | 192 | +		if (!$error) { | 
                                                                                                            
                                                            | 193 | 193 |  			$object->titre = GETPOST('title', 'alphanohtml'); // deprecated | 
                                                                                                            
                                                            | 194 | 194 |  			$object->title = GETPOST('title', 'alphanohtml'); | 
                                                                                                            
                                                            | 195 |  | -			$object->libelle = GETPOST('libelle', 'alpha');	// deprecated | 
                                                                                                            
                                                            |  | 195 | +			$object->libelle = GETPOST('libelle', 'alpha'); // deprecated | 
                                                                                                            
                                                            | 196 | 196 |  			$object->label = GETPOST('libelle', 'alpha'); | 
                                                                                                            
                                                            | 197 | 197 |  			$object->fk_project = GETPOSTINT('projectid'); | 
                                                                                                            
                                                            | 198 | 198 |  			$object->ref_supplier = GETPOST('ref_supplier', 'alphanohtml'); | 
                                                                                                                                                        
                                                        |  | @@ -238,10 +238,10 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 238 | 238 |  				$action = "create"; | 
                                                                                                            
                                                            | 239 | 239 |  			} | 
                                                                                                            
                                                            | 240 | 240 |   | 
                                                                                                            
                                                            | 241 |  | -			if (! $error) { | 
                                                                                                            
                                                            |  | 241 | +			if (!$error) { | 
                                                                                                            
                                                            | 242 | 242 |  				$db->commit(); | 
                                                                                                            
                                                            | 243 | 243 |   | 
                                                                                                            
                                                            | 244 |  | -				header("Location: " . $_SERVER['PHP_SELF'] . '?facid=' . $object->id); | 
                                                                                                            
                                                            |  | 244 | +				header("Location: ".$_SERVER['PHP_SELF'].'?facid='.$object->id); | 
                                                                                                            
                                                            | 245 | 245 |  				exit; | 
                                                                                                            
                                                            | 246 | 246 |  			} else { | 
                                                                                                            
                                                            | 247 | 247 |  				$db->rollback(); | 
                                                                                                                                                        
                                                        |  | @@ -258,7 +258,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 258 | 258 |  	if ($action == 'confirm_deleteinvoice' && $confirm == 'yes' && ($user->hasRight("fournisseur", "facture", "supprimer") || $user->hasRight("supplier_invoice", "supprimer"))) { | 
                                                                                                            
                                                            | 259 | 259 |  		$object->delete($user); | 
                                                                                                            
                                                            | 260 | 260 |   | 
                                                                                                            
                                                            | 261 |  | -		header('Location: ' . DOL_URL_ROOT . '/fourn/facture/list-rec.php'); | 
                                                                                                            
                                                            |  | 261 | +		header('Location: '.DOL_URL_ROOT.'/fourn/facture/list-rec.php'); | 
                                                                                                            
                                                            | 262 | 262 |  		exit; | 
                                                                                                            
                                                            | 263 | 263 |  	} | 
                                                                                                            
                                                            | 264 | 264 |   | 
                                                                                                                                                        
                                                        |  | @@ -288,7 +288,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 288 | 288 |  		$result = $object->setValueFrom('titre', $title, '', null, 'text', '', $user); | 
                                                                                                            
                                                            | 289 | 289 |   | 
                                                                                                            
                                                            | 290 | 290 |  		if ($result > 0) { | 
                                                                                                            
                                                            | 291 |  | -			$object->titre = $title;	// deprecated | 
                                                                                                            
                                                            |  | 291 | +			$object->titre = $title; // deprecated | 
                                                                                                            
                                                            | 292 | 292 |  			$object->title = $title; | 
                                                                                                            
                                                            | 293 | 293 |  			$object->ref = $object->title; | 
                                                                                                            
                                                            | 294 | 294 |  		} else { | 
                                                                                                                                                        
                                                        |  | @@ -335,7 +335,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 335 | 335 |  			$error++; | 
                                                                                                            
                                                            | 336 | 336 |  		} | 
                                                                                                            
                                                            | 337 | 337 |   | 
                                                                                                            
                                                            | 338 |  | -		if (! $error) { | 
                                                                                                            
                                                            |  | 338 | +		if (!$error) { | 
                                                                                                            
                                                            | 339 | 339 |  			$db->commit(); | 
                                                                                                            
                                                            | 340 | 340 |  		} else { | 
                                                                                                            
                                                            | 341 | 341 |  			$db->rollback(); | 
                                                                                                                                                        
                                                        |  | @@ -352,7 +352,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 352 | 352 |  			$error++; | 
                                                                                                            
                                                            | 353 | 353 |  		} | 
                                                                                                            
                                                            | 354 | 354 |   | 
                                                                                                            
                                                            | 355 |  | -		if (! $error) { | 
                                                                                                            
                                                            |  | 355 | +		if (!$error) { | 
                                                                                                            
                                                            | 356 | 356 |  			$db->commit(); | 
                                                                                                            
                                                            | 357 | 357 |  		} else { | 
                                                                                                            
                                                            | 358 | 358 |  			$db->rollback(); | 
                                                                                                                                                        
                                                        |  | @@ -411,7 +411,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 411 | 411 |  			$error++; | 
                                                                                                            
                                                            | 412 | 412 |  		} | 
                                                                                                            
                                                            | 413 | 413 |   | 
                                                                                                            
                                                            | 414 |  | -		if (! $error) { | 
                                                                                                            
                                                            |  | 414 | +		if (!$error) { | 
                                                                                                            
                                                            | 415 | 415 |  			$result = $object->insertExtraFields('BILLREC_MODIFY'); | 
                                                                                                            
                                                            | 416 | 416 |  			if ($result < 0) { | 
                                                                                                            
                                                            | 417 | 417 |  				setEventMessages($object->error, $object->errors, 'errors'); | 
                                                                                                                                                        
                                                        |  | @@ -440,8 +440,8 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 440 | 440 |  			$tva_tx = ''; | 
                                                                                                            
                                                            | 441 | 441 |  		} | 
                                                                                                            
                                                            | 442 | 442 |   | 
                                                                                                            
                                                            | 443 |  | -		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2); | 
                                                                                                            
                                                            | 444 |  | -		$remise_percent = price2num(GETPOST('remise_percent' . $predef), '', 2); | 
                                                                                                            
                                                            |  | 443 | +		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2); | 
                                                                                                            
                                                            |  | 444 | +		$remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2); | 
                                                                                                            
                                                            | 445 | 445 |   | 
                                                                                                            
                                                            | 446 | 446 |  		// Extrafields | 
                                                                                                            
                                                            | 447 | 447 |  		$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line); | 
                                                                                                                                                        
                                                        |  | @@ -450,7 +450,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 450 | 450 |  		if (is_array($extralabelsline)) { | 
                                                                                                            
                                                            | 451 | 451 |  			// Get extra fields | 
                                                                                                            
                                                            | 452 | 452 |  			foreach ($extralabelsline as $key => $value) { | 
                                                                                                            
                                                            | 453 |  | -				unset($_POST["options_" . $key . $predef]); | 
                                                                                                            
                                                            |  | 453 | +				unset($_POST["options_".$key.$predef]); | 
                                                                                                            
                                                            | 454 | 454 |  			} | 
                                                                                                            
                                                            | 455 | 455 |  		} | 
                                                                                                            
                                                            | 456 | 456 |   | 
                                                                                                                                                        
                                                        |  | @@ -462,7 +462,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 462 | 462 |  			setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors'); | 
                                                                                                            
                                                            | 463 | 463 |  			$error++; | 
                                                                                                            
                                                            | 464 | 464 |  		} | 
                                                                                                            
                                                            | 465 |  | -		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (! ($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not '' | 
                                                                                                            
                                                            |  | 465 | +		if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && (!($price_ht >= 0) || $price_ht == '')) {    // Unit price can be 0 but not '' | 
                                                                                                            
                                                            | 466 | 466 |  			setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); | 
                                                                                                            
                                                            | 467 | 467 |  			$error++; | 
                                                                                                            
                                                            | 468 | 468 |  		} | 
                                                                                                                                                        
                                                        |  | @@ -511,7 +511,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 511 | 511 |  			} | 
                                                                                                            
                                                            | 512 | 512 |  		} | 
                                                                                                            
                                                            | 513 | 513 |   | 
                                                                                                            
                                                            | 514 |  | -		if (! $error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { | 
                                                                                                            
                                                            |  | 514 | +		if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) { | 
                                                                                                            
                                                            | 515 | 515 |  			$ret = $object->fetch($id); | 
                                                                                                            
                                                            | 516 | 516 |  			if ($ret < 0) { | 
                                                                                                            
                                                            | 517 | 517 |  				dol_print_error($db, $object->error); | 
                                                                                                                                                        
                                                        |  | @@ -520,8 +520,8 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 520 | 520 |  			$ret = $object->fetch_thirdparty(); | 
                                                                                                            
                                                            | 521 | 521 |   | 
                                                                                                            
                                                            | 522 | 522 |  			// Clean parameters | 
                                                                                                            
                                                            | 523 |  | -			$date_start = dol_mktime(GETPOST('date_start' . $predef . 'hour'), GETPOST('date_start' . $predef . 'min'), GETPOST('date_start' . $predef . 'sec'), GETPOST('date_start' . $predef . 'month'), GETPOST('date_start' . $predef . 'day'), GETPOST('date_start' . $predef . 'year')); | 
                                                                                                            
                                                            | 524 |  | -			$date_end = dol_mktime(GETPOST('date_end' . $predef . 'hour'), GETPOST('date_end' . $predef . 'min'), GETPOST('date_end' . $predef . 'sec'), GETPOST('date_end' . $predef . 'month'), GETPOST('date_end' . $predef . 'day'), GETPOST('date_end' . $predef . 'year')); | 
                                                                                                            
                                                            |  | 523 | +			$date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year')); | 
                                                                                                            
                                                            |  | 524 | +			$date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year')); | 
                                                                                                            
                                                            | 525 | 525 |  			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); | 
                                                                                                            
                                                            | 526 | 526 |   | 
                                                                                                            
                                                            | 527 | 527 |  			// Define special_code for special lines | 
                                                                                                                                                        
                                                        |  | @@ -618,23 +618,23 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 618 | 618 |  							$outputlangs->load('products'); | 
                                                                                                            
                                                            | 619 | 619 |  						} | 
                                                                                                            
                                                            | 620 | 620 |  						if (!empty($prod->customcode)) { | 
                                                                                                            
                                                            | 621 |  | -							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; | 
                                                                                                            
                                                            |  | 621 | +							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; | 
                                                                                                            
                                                            | 622 | 622 |  						} | 
                                                                                                            
                                                            | 623 | 623 |  						if (!empty($prod->customcode) && !empty($prod->country_code)) { | 
                                                                                                            
                                                            | 624 | 624 |  							$tmptxt .= ' - '; | 
                                                                                                            
                                                            | 625 | 625 |  						} | 
                                                                                                            
                                                            | 626 | 626 |  						if (!empty($prod->country_code)) { | 
                                                                                                            
                                                            | 627 |  | -							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0); | 
                                                                                                            
                                                            |  | 627 | +							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0); | 
                                                                                                            
                                                            | 628 | 628 |  						} | 
                                                                                                            
                                                            | 629 | 629 |  					} else { | 
                                                                                                            
                                                            | 630 | 630 |  						if (!empty($prod->customcode)) { | 
                                                                                                            
                                                            | 631 |  | -							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode") . ': ' . $prod->customcode; | 
                                                                                                            
                                                            |  | 631 | +							$tmptxt .= $langs->transnoentitiesnoconv("CustomCode").': '.$prod->customcode; | 
                                                                                                            
                                                            | 632 | 632 |  						} | 
                                                                                                            
                                                            | 633 | 633 |  						if (!empty($prod->customcode) && !empty($prod->country_code)) { | 
                                                                                                            
                                                            | 634 | 634 |  							$tmptxt .= ' - '; | 
                                                                                                            
                                                            | 635 | 635 |  						} | 
                                                                                                            
                                                            | 636 | 636 |  						if (!empty($prod->country_code)) { | 
                                                                                                            
                                                            | 637 |  | -							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); | 
                                                                                                            
                                                            |  | 637 | +							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0); | 
                                                                                                            
                                                            | 638 | 638 |  						} | 
                                                                                                            
                                                            | 639 | 639 |  					} | 
                                                                                                            
                                                            | 640 | 640 |  					$tmptxt .= ')'; | 
                                                                                                                                                        
                                                        |  | @@ -660,8 +660,8 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 660 | 660 |  			$date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : null; | 
                                                                                                            
                                                            | 661 | 661 |   | 
                                                                                                            
                                                            | 662 | 662 |  			// Margin | 
                                                                                                            
                                                            | 663 |  | -			$fournprice = price2num(GETPOST('fournprice' . $predef) ? GETPOST('fournprice' . $predef) : ''); | 
                                                                                                            
                                                            | 664 |  | -			$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value | 
                                                                                                            
                                                            |  | 663 | +			$fournprice = price2num(GETPOST('fournprice'.$predef) ? GETPOST('fournprice'.$predef) : ''); | 
                                                                                                            
                                                            |  | 664 | +			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value | 
                                                                                                            
                                                            | 665 | 665 |   | 
                                                                                                            
                                                            | 666 | 666 |  			// Local Taxes | 
                                                                                                            
                                                            | 667 | 667 |  			$localtax1_tx = get_localtax($tva_tx, 1, $object->thirdparty, $mysoc, $tva_npr); | 
                                                                                                                                                        
                                                        |  | @@ -727,8 +727,8 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 727 | 727 |  				$action = ''; | 
                                                                                                            
                                                            | 728 | 728 |  			} | 
                                                                                                            
                                                            | 729 | 729 |  		} | 
                                                                                                            
                                                            | 730 |  | -	} elseif ($action == 'updateline' && $usercancreate && ! GETPOST('cancel', 'alpha')) { | 
                                                                                                            
                                                            | 731 |  | -		if (! $object->fetch($id) > 0) { | 
                                                                                                            
                                                            |  | 730 | +	} elseif ($action == 'updateline' && $usercancreate && !GETPOST('cancel', 'alpha')) { | 
                                                                                                            
                                                            |  | 731 | +		if (!$object->fetch($id) > 0) { | 
                                                                                                            
                                                            | 732 | 732 |  			dol_print_error($db); | 
                                                                                                            
                                                            | 733 | 733 |  		} | 
                                                                                                            
                                                            | 734 | 734 |  		$object->fetch_thirdparty(); | 
                                                                                                                                                        
                                                        |  | @@ -763,7 +763,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 763 | 763 |  			$objectline->array_options = $array_options; | 
                                                                                                            
                                                            | 764 | 764 |  			$result = $objectline->insertExtraFields(); | 
                                                                                                            
                                                            | 765 | 765 |  			if ($result < 0) { | 
                                                                                                            
                                                            | 766 |  | -				setEventMessages($langs->trans('Error') . $result, null, 'errors'); | 
                                                                                                            
                                                            |  | 766 | +				setEventMessages($langs->trans('Error').$result, null, 'errors'); | 
                                                                                                            
                                                            | 767 | 767 |  			} | 
                                                                                                            
                                                            | 768 | 768 |  		} | 
                                                                                                            
                                                            | 769 | 769 |   | 
                                                                                                                                                        
                                                        |  | @@ -773,13 +773,13 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 773 | 773 |  		if (is_array($extralabelsline)) { | 
                                                                                                            
                                                            | 774 | 774 |  			// Get extra fields | 
                                                                                                            
                                                            | 775 | 775 |  			foreach ($extralabelsline as $key => $value) { | 
                                                                                                            
                                                            | 776 |  | -				unset($_POST["options_" . $key]); | 
                                                                                                            
                                                            |  | 776 | +				unset($_POST["options_".$key]); | 
                                                                                                            
                                                            | 777 | 777 |  			} | 
                                                                                                            
                                                            | 778 | 778 |  		} | 
                                                                                                            
                                                            | 779 | 779 |   | 
                                                                                                            
                                                            | 780 | 780 |  		// Define special_code for special lines | 
                                                                                                            
                                                            | 781 | 781 |  		$special_code = GETPOST('special_code', 'int'); | 
                                                                                                            
                                                            | 782 |  | -		if (! GETPOST('qty', 'alpha')) { | 
                                                                                                            
                                                            |  | 782 | +		if (!GETPOST('qty', 'alpha')) { | 
                                                                                                            
                                                            | 783 | 783 |  			$special_code = 3; | 
                                                                                                            
                                                            | 784 | 784 |  		} | 
                                                                                                            
                                                            | 785 | 785 |   | 
                                                                                                                                                        
                                                        |  | @@ -825,7 +825,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 825 | 825 |  		$date_end_fill = !empty(GETPOST('date_end_fill', 'int')) ? GETPOST('date_end_fill', 'int') : 'NULL'; | 
                                                                                                            
                                                            | 826 | 826 |   | 
                                                                                                            
                                                            | 827 | 827 |  		// Update line | 
                                                                                                            
                                                            | 828 |  | -		if (! $error) { | 
                                                                                                            
                                                            |  | 828 | +		if (!$error) { | 
                                                                                                            
                                                            | 829 | 829 |  			$result = $object->updateline(GETPOST('lineid', 'int'), GETPOST('productid', 'int'), $ref_fourn, $label, $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax1_rate, 'HT', $type, $date_start_fill, $date_end_fill, $info_bits, $special_code, -1); | 
                                                                                                            
                                                            | 830 | 830 |  			if ($result >= 0) { | 
                                                                                                            
                                                            | 831 | 831 |  				$object->fetch($object->id); // Reload lines | 
                                                                                                                                                        
                                                        |  | @@ -899,10 +899,10 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 899 | 899 |  	if ($object->fetch($id) > 0) { | 
                                                                                                            
                                                            | 900 | 900 |  		$result = $object->fetch_lines(); | 
                                                                                                            
                                                            | 901 | 901 |   | 
                                                                                                            
                                                            | 902 |  | -		print '<form action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; | 
                                                                                                            
                                                            | 903 |  | -		print '<input type="hidden" name="token" value="' . newToken() . '">'; | 
                                                                                                            
                                                            |  | 902 | +		print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; | 
                                                                                                            
                                                            |  | 903 | +		print '<input type="hidden" name="token" value="'.newToken().'">'; | 
                                                                                                            
                                                            | 904 | 904 |  		print '<input type="hidden" name="action" value="add">'; | 
                                                                                                            
                                                            | 905 |  | -		print '<input type="hidden" name="facid" value="' . $object->id . '">'; | 
                                                                                                            
                                                            |  | 905 | +		print '<input type="hidden" name="facid" value="'.$object->id.'">'; | 
                                                                                                            
                                                            | 906 | 906 |   | 
                                                                                                            
                                                            | 907 | 907 |  		print dol_get_fiche_head(null, '', '', 0); | 
                                                                                                            
                                                            | 908 | 908 |   | 
                                                                                                                                                        
                                                        |  | @@ -919,17 +919,17 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 919 | 919 |  		$object->fetch_thirdparty(); | 
                                                                                                            
                                                            | 920 | 920 |   | 
                                                                                                            
                                                            | 921 | 921 |  		// Title | 
                                                                                                            
                                                            | 922 |  | -		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("Title") . '</td><td>'; | 
                                                                                                            
                                                            | 923 |  | -		print '<input class="flat quatrevingtpercent" type="text" name="title" value="' . dol_escape_htmltag(GETPOST("title", 'alphanohtml')) . '" autofocus>'; | 
                                                                                                            
                                                            |  | 922 | +		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Title").'</td><td>'; | 
                                                                                                            
                                                            |  | 923 | +		print '<input class="flat quatrevingtpercent" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title", 'alphanohtml')).'" autofocus>'; | 
                                                                                                            
                                                            | 924 | 924 |  		print '</td></tr>'; | 
                                                                                                            
                                                            | 925 | 925 |   | 
                                                                                                            
                                                            | 926 | 926 |  		// Ref supplier | 
                                                                                                            
                                                            | 927 |  | -		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans("RefSupplier") . '</td><td>'; | 
                                                                                                            
                                                            | 928 |  | -		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="' . $object->ref_supplier . '">'; | 
                                                                                                            
                                                            |  | 927 | +		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("RefSupplier").'</td><td>'; | 
                                                                                                            
                                                            |  | 928 | +		print '<input class="flat maxwidth500" type="text" name="ref_supplier" value="'.$object->ref_supplier.'">'; | 
                                                                                                            
                                                            | 929 | 929 |  		print '</td></tr>'; | 
                                                                                                            
                                                            | 930 | 930 |   | 
                                                                                                            
                                                            | 931 | 931 |  		// Third party | 
                                                                                                            
                                                            | 932 |  | -		print '<tr><td class="titlefieldcreate">' . $langs->trans("Customer") . '</td><td>' . $object->thirdparty->getNomUrl(1, 'customer') . '</td>'; | 
                                                                                                            
                                                            |  | 932 | +		print '<tr><td class="titlefieldcreate">'.$langs->trans("Customer").'</td><td>'.$object->thirdparty->getNomUrl(1, 'customer').'</td>'; | 
                                                                                                            
                                                            | 933 | 933 |  		print '</tr>'; | 
                                                                                                            
                                                            | 934 | 934 |   | 
                                                                                                            
                                                            | 935 | 935 |  		$note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $object->note_public; | 
                                                                                                                                                        
                                                        |  | @@ -938,30 +938,30 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 938 | 938 |  		// Help of substitution key | 
                                                                                                            
                                                            | 939 | 939 |  		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); | 
                                                                                                            
                                                            | 940 | 940 |   | 
                                                                                                            
                                                            | 941 |  | -		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m') . ')'; | 
                                                                                                            
                                                            | 942 |  | -		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%m') . ')'; | 
                                                                                                            
                                                            | 943 |  | -		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m') . ')'; | 
                                                                                                            
                                                            | 944 |  | -		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B') . ')'; | 
                                                                                                            
                                                            | 945 |  | -		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%B') . ')'; | 
                                                                                                            
                                                            | 946 |  | -		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B') . ')'; | 
                                                                                                            
                                                            | 947 |  | -		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y') . ')'; | 
                                                                                                            
                                                            | 948 |  | -		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($object->date, '%Y') . ')'; | 
                                                                                                            
                                                            | 949 |  | -		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y') . ')'; | 
                                                                                                            
                                                            |  | 941 | +		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%m').')'; | 
                                                                                                            
                                                            |  | 942 | +		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%m').')'; | 
                                                                                                            
                                                            |  | 943 | +		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%m').')'; | 
                                                                                                            
                                                            |  | 944 | +		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'm'), '%B').')'; | 
                                                                                                            
                                                            |  | 945 | +		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%B').')'; | 
                                                                                                            
                                                            |  | 946 | +		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'm'), '%B').')'; | 
                                                                                                            
                                                            |  | 947 | +		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, -1, 'y'), '%Y').')'; | 
                                                                                                            
                                                            |  | 948 | +		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date, '%Y').')'; | 
                                                                                                            
                                                            |  | 949 | +		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'), '%Y').')'; | 
                                                                                                            
                                                            | 950 | 950 |  		// Only on template invoices | 
                                                                                                            
                                                            | 951 |  | -		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' .dol_print_date($object->date_when, 'dayhour') . ')' : ''); | 
                                                                                                            
                                                            | 952 |  | -		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . (isset($object->date_when) ? ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour') . ')' : ''); | 
                                                                                                            
                                                            |  | 951 | +		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date($object->date_when, 'dayhour').')' : ''); | 
                                                                                                            
                                                            |  | 952 | +		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").(isset($object->date_when) ? ' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date_when, $object->frequency, $object->unit_frequency), 'dayhour').')' : ''); | 
                                                                                                            
                                                            | 953 | 953 |  		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $langs->trans("Count"); | 
                                                                                                            
                                                            | 954 | 954 |  		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $langs->trans("MaxPeriodNumber"); | 
                                                                                                            
                                                            | 955 | 955 |   | 
                                                                                                            
                                                            | 956 |  | -		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; | 
                                                                                                            
                                                            |  | 956 | +		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; | 
                                                                                                            
                                                            | 957 | 957 |  		foreach ($substitutionarray as $key => $val) { | 
                                                                                                            
                                                            | 958 |  | -			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; | 
                                                                                                            
                                                            |  | 958 | +			$htmltext .= $key.' = '.$langs->trans($val).'<br>'; | 
                                                                                                            
                                                            | 959 | 959 |  		} | 
                                                                                                            
                                                            | 960 | 960 |  		$htmltext .= '</i>'; | 
                                                                                                            
                                                            | 961 | 961 |   | 
                                                                                                            
                                                            | 962 | 962 |  		// Label | 
                                                                                                            
                                                            | 963 |  | -		print '<tr><td class="titlefieldcreate">' . $langs->trans("Label") . '</td><td>'; | 
                                                                                                            
                                                            | 964 |  | -		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="' . $object->label . '">'; | 
                                                                                                            
                                                            |  | 963 | +		print '<tr><td class="titlefieldcreate">'.$langs->trans("Label").'</td><td>'; | 
                                                                                                            
                                                            |  | 964 | +		print '<input class="flat quatrevingtpercent" type="text" name="libelle" value="'.$object->label.'">'; | 
                                                                                                            
                                                            | 965 | 965 |  		print '</td></tr>'; | 
                                                                                                            
                                                            | 966 | 966 |   | 
                                                                                                            
                                                            | 967 | 967 |  		// Public note | 
                                                                                                                                                        
                                                        |  | @@ -986,38 +986,38 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 986 | 986 |  		} | 
                                                                                                            
                                                            | 987 | 987 |   | 
                                                                                                            
                                                            | 988 | 988 |  		// Author | 
                                                                                                            
                                                            | 989 |  | -		print "<tr><td>" . $langs->trans("Author") . "</td><td>" . $user->getFullName($langs) . "</td></tr>"; | 
                                                                                                            
                                                            |  | 989 | +		print "<tr><td>".$langs->trans("Author")."</td><td>".$user->getFullName($langs)."</td></tr>"; | 
                                                                                                            
                                                            | 990 | 990 |   | 
                                                                                                            
                                                            | 991 | 991 |  		// Payment term | 
                                                                                                            
                                                            | 992 |  | -		print "<tr><td>" . $langs->trans("PaymentConditions") . "</td><td>"; | 
                                                                                                            
                                                            | 993 |  | -		$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->cond_reglement_id, 'none'); | 
                                                                                                            
                                                            |  | 992 | +		print "<tr><td>".$langs->trans("PaymentConditions")."</td><td>"; | 
                                                                                                            
                                                            |  | 993 | +		$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none'); | 
                                                                                                            
                                                            | 994 | 994 |  		print "</td></tr>"; | 
                                                                                                            
                                                            | 995 | 995 |   | 
                                                                                                            
                                                            | 996 | 996 |  		// Payment mode | 
                                                                                                            
                                                            | 997 |  | -		print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>"; | 
                                                                                                            
                                                            | 998 |  | -		$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->mode_reglement_id, 'none', '', 1); | 
                                                                                                            
                                                            |  | 997 | +		print "<tr><td>".$langs->trans("PaymentMode")."</td><td>"; | 
                                                                                                            
                                                            |  | 998 | +		$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none', '', 1); | 
                                                                                                            
                                                            | 999 | 999 |  		print "</td></tr>"; | 
                                                                                                            
                                                            | 1000 | 1000 |   | 
                                                                                                            
                                                            | 1001 | 1001 |  		// Project | 
                                                                                                            
                                                            | 1002 | 1002 |  		if (isModEnabled('project') && is_object($object->thirdparty) && $object->thirdparty->id > 0) { | 
                                                                                                            
                                                            | 1003 | 1003 |  			$projectid = GETPOST('projectid') ? GETPOST('projectid') : $object->fk_project; | 
                                                                                                            
                                                            | 1004 | 1004 |  			$langs->load('projects'); | 
                                                                                                            
                                                            | 1005 |  | -			print '<tr><td>' . $langs->trans('Project') . '</td><td>'; | 
                                                                                                            
                                                            |  | 1005 | +			print '<tr><td>'.$langs->trans('Project').'</td><td>'; | 
                                                                                                            
                                                            | 1006 | 1006 |  			$numprojet = $formproject->select_projects($object->thirdparty->id, $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, ''); | 
                                                                                                            
                                                            | 1007 |  | -			print '   <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->thirdparty->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $object->thirdparty->id . (!empty($id) ? '&id=' . $id : '')) . '">' . $langs->trans("AddProject") . '</a>'; | 
                                                                                                            
                                                            |  | 1007 | +			print '   <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->thirdparty->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$object->thirdparty->id.(!empty($id) ? '&id='.$id : '')).'">'.$langs->trans("AddProject").'</a>'; | 
                                                                                                            
                                                            | 1008 | 1008 |  			print '</td></tr>'; | 
                                                                                                            
                                                            | 1009 | 1009 |  		} | 
                                                                                                            
                                                            | 1010 | 1010 |   | 
                                                                                                            
                                                            | 1011 | 1011 |  		// Bank account | 
                                                                                                            
                                                            | 1012 | 1012 |  		if ($object->fk_account > 0) { | 
                                                                                                            
                                                            | 1013 |  | -			print "<tr><td>" . $langs->trans('BankAccount') . "</td><td>"; | 
                                                                                                            
                                                            | 1014 |  | -			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none'); | 
                                                                                                            
                                                            |  | 1013 | +			print "<tr><td>".$langs->trans('BankAccount')."</td><td>"; | 
                                                                                                            
                                                            |  | 1014 | +			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); | 
                                                                                                            
                                                            | 1015 | 1015 |  			print "</td></tr>"; | 
                                                                                                            
                                                            | 1016 | 1016 |  		} | 
                                                                                                            
                                                            | 1017 | 1017 |   | 
                                                                                                            
                                                            | 1018 | 1018 |  		// Model pdf | 
                                                                                                            
                                                            | 1019 |  | -		print "<tr><td>" . $langs->trans('Model') . "</td><td>"; | 
                                                                                                            
                                                            | 1020 |  | -		include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; | 
                                                                                                            
                                                            |  | 1019 | +		print "<tr><td>".$langs->trans('Model')."</td><td>"; | 
                                                                                                            
                                                            |  | 1020 | +		include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; | 
                                                                                                            
                                                            | 1021 | 1021 |  		$list = ModelePDFSuppliersInvoices::liste_modeles($db); | 
                                                                                                            
                                                            | 1022 | 1022 |  		print $form->selectarray('modelpdf', $list, $conf->global->INVOICE_SUPPLIER_ADDON_PDF); | 
                                                                                                            
                                                            | 1023 | 1023 |  		print "</td></tr>"; | 
                                                                                                                                                        
                                                        |  | @@ -1028,7 +1028,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1028 | 1028 |   | 
                                                                                                            
                                                            | 1029 | 1029 |  		// Autogeneration | 
                                                                                                            
                                                            | 1030 | 1030 |  		$title = $langs->trans("Recurrence"); | 
                                                                                                            
                                                            | 1031 |  | -		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"') . $title, '', ''); | 
                                                                                                            
                                                            |  | 1031 | +		print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', ''); | 
                                                                                                            
                                                            | 1032 | 1032 |   | 
                                                                                                            
                                                            | 1033 | 1033 |  		print '<span class="opacitymedium">'.$langs->trans("ToCreateARecurringInvoiceGeneAuto", $langs->transnoentitiesnoconv('Module2300Name')).'</span><br><br>'; | 
                                                                                                            
                                                            | 1034 | 1034 |   | 
                                                                                                                                                        
                                                        |  | @@ -1037,30 +1037,30 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1037 | 1037 |  		print '<table class="border centpercent">'; | 
                                                                                                            
                                                            | 1038 | 1038 |   | 
                                                                                                            
                                                            | 1039 | 1039 |  		// Frequency + unit | 
                                                                                                            
                                                            | 1040 |  | -		print '<tr><td class="titlefieldcreate">' . $form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency')) . "</td><td>"; | 
                                                                                                            
                                                            | 1041 |  | -		print "<input type='text' name='frequency' value='" . GETPOST('frequency', 'int') . "' size='4' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); | 
                                                                                                            
                                                            |  | 1040 | +		print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("Frequency"), $langs->transnoentitiesnoconv('toolTipFrequency'))."</td><td>"; | 
                                                                                                            
                                                            |  | 1041 | +		print "<input type='text' name='frequency' value='".GETPOST('frequency', 'int')."' size='4' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), (GETPOST('unit_frequency') ? GETPOST('unit_frequency') : 'm')); | 
                                                                                                            
                                                            | 1042 | 1042 |  		print "</td></tr>"; | 
                                                                                                            
                                                            | 1043 | 1043 |   | 
                                                                                                            
                                                            | 1044 | 1044 |  		// Date next run | 
                                                                                                            
                                                            | 1045 |  | -		print "<tr><td>" . $langs->trans('NextDateToExecution') . "</td><td>"; | 
                                                                                                            
                                                            |  | 1045 | +		print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>"; | 
                                                                                                            
                                                            | 1046 | 1046 |  		$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); | 
                                                                                                            
                                                            | 1047 | 1047 |  		print $form->selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1); | 
                                                                                                            
                                                            | 1048 | 1048 |  		print "</td></tr>"; | 
                                                                                                            
                                                            | 1049 | 1049 |   | 
                                                                                                            
                                                            | 1050 | 1050 |  		// Number max of generation | 
                                                                                                            
                                                            | 1051 |  | -		print "<tr><td>" . $langs->trans("MaxPeriodNumber") . "</td><td>"; | 
                                                                                                            
                                                            | 1052 |  | -		print '<input type="text" name="nb_gen_max" value="' . GETPOST('nb_gen_max') . '" size="5" />'; | 
                                                                                                            
                                                            |  | 1051 | +		print "<tr><td>".$langs->trans("MaxPeriodNumber")."</td><td>"; | 
                                                                                                            
                                                            |  | 1052 | +		print '<input type="text" name="nb_gen_max" value="'.GETPOST('nb_gen_max').'" size="5" />'; | 
                                                                                                            
                                                            | 1053 | 1053 |  		print "</td></tr>"; | 
                                                                                                            
                                                            | 1054 | 1054 |   | 
                                                                                                            
                                                            | 1055 | 1055 |  		// Auto validate the invoice | 
                                                                                                            
                                                            | 1056 |  | -		print "<tr><td>" . $langs->trans("StatusOfGeneratedInvoices") . "</td><td>"; | 
                                                                                                            
                                                            |  | 1056 | +		print "<tr><td>".$langs->trans("StatusOfGeneratedInvoices")."</td><td>"; | 
                                                                                                            
                                                            | 1057 | 1057 |  		$select = array('0' => $langs->trans('BillStatusDraft'), '1' => $langs->trans('BillStatusValidated')); | 
                                                                                                            
                                                            | 1058 | 1058 |  		print $form->selectarray('auto_validate', $select, GETPOST('auto_validate')); | 
                                                                                                            
                                                            | 1059 | 1059 |  		print "</td></tr>"; | 
                                                                                                            
                                                            | 1060 | 1060 |   | 
                                                                                                            
                                                            | 1061 | 1061 |  		// Auto generate document | 
                                                                                                            
                                                            | 1062 | 1062 |  		if (getDolGlobalString('INVOICE_REC_CAN_DISABLE_DOCUMENT_FILE_GENERATION')) { | 
                                                                                                            
                                                            | 1063 |  | -			print "<tr><td>" . $langs->trans("StatusOfAutoGeneratedDocuments") . "</td><td>"; | 
                                                                                                            
                                                            |  | 1063 | +			print "<tr><td>".$langs->trans("StatusOfAutoGeneratedDocuments")."</td><td>"; | 
                                                                                                            
                                                            | 1064 | 1064 |  			$select = array('0' => $langs->trans('DoNotGenerateDoc'), '1' => $langs->trans('AutoGenerateDoc')); | 
                                                                                                            
                                                            | 1065 | 1065 |  			print $form->selectarray('generate_pdf', $select, GETPOST('generate_pdf')); | 
                                                                                                            
                                                            | 1066 | 1066 |  			print "</td></tr>"; | 
                                                                                                                                                        
                                                        |  | @@ -1103,7 +1103,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1103 | 1103 |   | 
                                                                                                            
                                                            | 1104 | 1104 |  		print "</form>\n"; | 
                                                                                                            
                                                            | 1105 | 1105 |  	} else { | 
                                                                                                            
                                                            | 1106 |  | -		dol_print_error('', "Error, no invoice " . $object->id); | 
                                                                                                            
                                                            |  | 1106 | +		dol_print_error('', "Error, no invoice ".$object->id); | 
                                                                                                            
                                                            | 1107 | 1107 |  	} | 
                                                                                                            
                                                            | 1108 | 1108 |  } else { | 
                                                                                                            
                                                            | 1109 | 1109 |  	/* | 
                                                                                                                                                        
                                                        |  | @@ -1117,12 +1117,12 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1117 | 1117 |   | 
                                                                                                            
                                                            | 1118 | 1118 |  		// Confirmation de la suppression d'une ligne produit | 
                                                                                                            
                                                            | 1119 | 1119 |  		if ($action == 'ask_deleteline') { | 
                                                                                                            
                                                            | 1120 |  | -			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); | 
                                                                                                            
                                                            |  | 1120 | +			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1); | 
                                                                                                            
                                                            | 1121 | 1121 |  		} | 
                                                                                                            
                                                            | 1122 | 1122 |   | 
                                                                                                            
                                                            | 1123 | 1123 |  		// Confirm delete of repeatable invoice | 
                                                                                                            
                                                            | 1124 | 1124 |  		if ($action == 'ask_deleteinvoice') { | 
                                                                                                            
                                                            | 1125 |  | -			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); | 
                                                                                                            
                                                            |  | 1125 | +			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRepeatableInvoice'), $langs->trans('ConfirmDeleteRepeatableInvoice'), 'confirm_deleteinvoice', '', 'no', 1); | 
                                                                                                            
                                                            | 1126 | 1126 |  		} | 
                                                                                                            
                                                            | 1127 | 1127 |   | 
                                                                                                            
                                                            | 1128 | 1128 |  		print $formconfirm; | 
                                                                                                                                                        
                                                        |  | @@ -1136,7 +1136,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1136 | 1136 |   | 
                                                                                                            
                                                            | 1137 | 1137 |  		// Recurring invoice content | 
                                                                                                            
                                                            | 1138 | 1138 |   | 
                                                                                                            
                                                            | 1139 |  | -		$linkback = '<a href="' . DOL_URL_ROOT . '/fourn/facture/list-rec.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans('BackToList') . '</a>'; | 
                                                                                                            
                                                            |  | 1139 | +		$linkback = '<a href="'.DOL_URL_ROOT.'/fourn/facture/list-rec.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans('BackToList').'</a>'; | 
                                                                                                            
                                                            | 1140 | 1140 |   | 
                                                                                                            
                                                            | 1141 | 1141 |  		$morehtmlref = ''; | 
                                                                                                            
                                                            | 1142 | 1142 |  		if ($action != 'edittitle') { | 
                                                                                                                                                        
                                                        |  | @@ -1149,33 +1149,33 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1149 | 1149 |  		$morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', 0, 1); | 
                                                                                                            
                                                            | 1150 | 1150 |  		$morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $usercancreate, 'string', '', null, null, '', 1); | 
                                                                                                            
                                                            | 1151 | 1151 |  		// Thirdparty | 
                                                                                                            
                                                            | 1152 |  | -		$morehtmlref .= '<br>' . $langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1); | 
                                                                                                            
                                                            |  | 1152 | +		$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); | 
                                                                                                            
                                                            | 1153 | 1153 |   | 
                                                                                                            
                                                            | 1154 | 1154 |  		// Project | 
                                                                                                            
                                                            | 1155 | 1155 |  		if (isModEnabled('project')) { | 
                                                                                                            
                                                            | 1156 | 1156 |  			$langs->load('projects'); | 
                                                                                                            
                                                            | 1157 |  | -			$morehtmlref .= '<br>' . $langs->trans('Project') . ' '; | 
                                                                                                            
                                                            |  | 1157 | +			$morehtmlref .= '<br>'.$langs->trans('Project').' '; | 
                                                                                                            
                                                            | 1158 | 1158 |  			if ($usercancreate) { | 
                                                                                                            
                                                            | 1159 | 1159 |  				if ($action != 'classify') { | 
                                                                                                            
                                                            | 1160 |  | -					$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : '; | 
                                                                                                            
                                                            |  | 1160 | +					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : '; | 
                                                                                                            
                                                            | 1161 | 1161 |  				} | 
                                                                                                            
                                                            | 1162 | 1162 |  				if ($action == 'classify') { | 
                                                                                                            
                                                            | 1163 |  | -					$morehtmlref .= '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">'; | 
                                                                                                            
                                                            |  | 1163 | +					$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">'; | 
                                                                                                            
                                                            | 1164 | 1164 |  					$morehtmlref .= '<input type="hidden" name="action" value="classin">'; | 
                                                                                                            
                                                            | 1165 |  | -					$morehtmlref .= '<input type="hidden" name="token" value="' . newToken() . '">'; | 
                                                                                                            
                                                            |  | 1165 | +					$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">'; | 
                                                                                                            
                                                            | 1166 | 1166 |  					$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); | 
                                                                                                            
                                                            | 1167 |  | -					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="' . $langs->trans("Modify") . '">'; | 
                                                                                                            
                                                            |  | 1167 | +					$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">'; | 
                                                                                                            
                                                            | 1168 | 1168 |  					$morehtmlref .= '</form>'; | 
                                                                                                            
                                                            | 1169 | 1169 |  				} else { | 
                                                                                                            
                                                            | 1170 |  | -					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); | 
                                                                                                            
                                                            |  | 1170 | +					$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); | 
                                                                                                            
                                                            | 1171 | 1171 |  				} | 
                                                                                                            
                                                            | 1172 | 1172 |  			} else { | 
                                                                                                            
                                                            | 1173 | 1173 |  				if (!empty($object->fk_project)) { | 
                                                                                                            
                                                            | 1174 | 1174 |  					$project = new Project($db); | 
                                                                                                            
                                                            | 1175 | 1175 |  					$project->fetch($object->fk_project); | 
                                                                                                            
                                                            | 1176 |  | -					$morehtmlref .= ' : ' . $project->getNomUrl(1); | 
                                                                                                            
                                                            |  | 1176 | +					$morehtmlref .= ' : '.$project->getNomUrl(1); | 
                                                                                                            
                                                            | 1177 | 1177 |  					if ($project->title) { | 
                                                                                                            
                                                            | 1178 |  | -						$morehtmlref .= ' - ' . $project->title; | 
                                                                                                            
                                                            |  | 1178 | +						$morehtmlref .= ' - '.$project->title; | 
                                                                                                            
                                                            | 1179 | 1179 |  					} | 
                                                                                                            
                                                            | 1180 | 1180 |  				} else { | 
                                                                                                            
                                                            | 1181 | 1181 |  					$morehtmlref .= ''; | 
                                                                                                                                                        
                                                        |  | @@ -1194,34 +1194,34 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1194 | 1194 |   | 
                                                                                                            
                                                            | 1195 | 1195 |  		print '<table class="border centpercent tableforfield">'; | 
                                                                                                            
                                                            | 1196 | 1196 |   | 
                                                                                                            
                                                            | 1197 |  | -		print '<tr><td class="titlefield">' . $langs->trans('Author') . '</td><td>'; | 
                                                                                                            
                                                            |  | 1197 | +		print '<tr><td class="titlefield">'.$langs->trans('Author').'</td><td>'; | 
                                                                                                            
                                                            | 1198 | 1198 |  		print $author->getNomUrl(-1); | 
                                                                                                            
                                                            | 1199 | 1199 |  		print "</td></tr>"; | 
                                                                                                            
                                                            | 1200 | 1200 |   | 
                                                                                                            
                                                            | 1201 | 1201 |  		// Label | 
                                                                                                            
                                                            | 1202 | 1202 |  		print '<tr>'; | 
                                                                                                            
                                                            | 1203 |  | -		print '<td>' . $form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>'; | 
                                                                                                            
                                                            | 1204 |  | -		print '<td>' . $form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate) . '</td>'; | 
                                                                                                            
                                                            |  | 1203 | +		print '<td>'.$form->editfieldkey("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>'; | 
                                                                                                            
                                                            |  | 1204 | +		print '<td>'.$form->editfieldval("Label", 'libelle', $object->libelle, $object, $usercancreate).'</td>'; | 
                                                                                                            
                                                            | 1205 | 1205 |  		print '</tr>'; | 
                                                                                                            
                                                            | 1206 | 1206 |   | 
                                                                                                            
                                                            | 1207 |  | -		print '<tr><td>' . $langs->trans('AmountHT') . '</td>'; | 
                                                                                                            
                                                            | 1208 |  | -		print '<td>' . price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; | 
                                                                                                            
                                                            |  | 1207 | +		print '<tr><td>'.$langs->trans('AmountHT').'</td>'; | 
                                                                                                            
                                                            |  | 1208 | +		print '<td>'.price($object->total_ht, '', $langs, 1, -1, -1, $conf->currency).'</td>'; | 
                                                                                                            
                                                            | 1209 | 1209 |  		print '</tr>'; | 
                                                                                                            
                                                            | 1210 | 1210 |   | 
                                                                                                            
                                                            | 1211 |  | -		print '<tr><td>' . $langs->trans("AmountVAT") . '</td><td>' . price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; | 
                                                                                                            
                                                            |  | 1211 | +		print '<tr><td>'.$langs->trans("AmountVAT").'</td><td>'.price($object->total_tva, '', $langs, 1, -1, -1, $conf->currency).'</td>'; | 
                                                                                                            
                                                            | 1212 | 1212 |  		print '</tr>'; | 
                                                                                                            
                                                            | 1213 | 1213 |   | 
                                                                                                            
                                                            | 1214 | 1214 |  		// Amount Local Taxes | 
                                                                                                            
                                                            | 1215 | 1215 |  		if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) {    // Localtax1 | 
                                                                                                            
                                                            | 1216 |  | -			print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>'; | 
                                                                                                            
                                                            | 1217 |  | -			print '<td class="nowrap">' . price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; | 
                                                                                                            
                                                            |  | 1216 | +			print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>'; | 
                                                                                                            
                                                            |  | 1217 | +			print '<td class="nowrap">'.price($object->total_localtax1, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; | 
                                                                                                            
                                                            | 1218 | 1218 |  		} | 
                                                                                                            
                                                            | 1219 | 1219 |  		if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) {    // Localtax2 | 
                                                                                                            
                                                            | 1220 |  | -			print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>'; | 
                                                                                                            
                                                            | 1221 |  | -			print '<td class=nowrap">' . price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency) . '</td></tr>'; | 
                                                                                                            
                                                            |  | 1220 | +			print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>'; | 
                                                                                                            
                                                            |  | 1221 | +			print '<td class=nowrap">'.price($object->total_localtax2, 1, '', 1, -1, -1, $conf->currency).'</td></tr>'; | 
                                                                                                            
                                                            | 1222 | 1222 |  		} | 
                                                                                                            
                                                            | 1223 | 1223 |   | 
                                                                                                            
                                                            | 1224 |  | -		print '<tr><td>' . $langs->trans("AmountTTC") . '</td><td colspan="3">' . price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency) . '</td>'; | 
                                                                                                            
                                                            |  | 1224 | +		print '<tr><td>'.$langs->trans("AmountTTC").'</td><td colspan="3">'.price($object->total_ttc, '', $langs, 1, -1, -1, $conf->currency).'</td>'; | 
                                                                                                            
                                                            | 1225 | 1225 |  		print '</tr>'; | 
                                                                                                            
                                                            | 1226 | 1226 |   | 
                                                                                                            
                                                            | 1227 | 1227 |  		// Payment term | 
                                                                                                                                                        
                                                        |  | @@ -1230,14 +1230,14 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1230 | 1230 |  		print $langs->trans('PaymentConditionsShort'); | 
                                                                                                            
                                                            | 1231 | 1231 |  		print '</td>'; | 
                                                                                                            
                                                            | 1232 | 1232 |  		if ($action != 'editconditions' && $usercancreate) { | 
                                                                                                            
                                                            | 1233 |  | -			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editconditions&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetConditions'), 1) . '</a></td>'; | 
                                                                                                            
                                                            |  | 1233 | +			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>'; | 
                                                                                                            
                                                            | 1234 | 1234 |  		} | 
                                                                                                            
                                                            | 1235 | 1235 |  		print '</tr></table>'; | 
                                                                                                            
                                                            | 1236 | 1236 |  		print '</td><td>'; | 
                                                                                                            
                                                            | 1237 | 1237 |  		if ($action == 'editconditions') { | 
                                                                                                            
                                                            | 1238 |  | -			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'cond_reglement_id'); | 
                                                                                                            
                                                            |  | 1238 | +			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'cond_reglement_id'); | 
                                                                                                            
                                                            | 1239 | 1239 |  		} else { | 
                                                                                                            
                                                            | 1240 |  | -			$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->cond_reglement_id, 'none'); | 
                                                                                                            
                                                            |  | 1240 | +			$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->cond_reglement_id, 'none'); | 
                                                                                                            
                                                            | 1241 | 1241 |  		} | 
                                                                                                            
                                                            | 1242 | 1242 |   | 
                                                                                                            
                                                            | 1243 | 1243 |  		print '</td></tr>'; | 
                                                                                                                                                        
                                                        |  | @@ -1248,14 +1248,14 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1248 | 1248 |  		print $langs->trans('PaymentMode'); | 
                                                                                                            
                                                            | 1249 | 1249 |  		print '</td>'; | 
                                                                                                            
                                                            | 1250 | 1250 |  		if ($action != 'editmode' && $usercancreate) { | 
                                                                                                            
                                                            | 1251 |  | -			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmode&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('SetMode'), 1) . '</a></td>'; | 
                                                                                                            
                                                            |  | 1251 | +			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('SetMode'), 1).'</a></td>'; | 
                                                                                                            
                                                            | 1252 | 1252 |  		} | 
                                                                                                            
                                                            | 1253 | 1253 |  		print '</tr></table>'; | 
                                                                                                            
                                                            | 1254 | 1254 |  		print '</td><td>'; | 
                                                                                                            
                                                            | 1255 | 1255 |  		if ($action == 'editmode') { | 
                                                                                                            
                                                            | 1256 |  | -			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); | 
                                                                                                            
                                                            |  | 1256 | +			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1); | 
                                                                                                            
                                                            | 1257 | 1257 |  		} else { | 
                                                                                                            
                                                            | 1258 |  | -			$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->mode_reglement_id, 'none'); | 
                                                                                                            
                                                            |  | 1258 | +			$form->form_modes_reglement($_SERVER['PHP_SELF'].'?facid='.$object->id, $object->mode_reglement_id, 'none'); | 
                                                                                                            
                                                            | 1259 | 1259 |  		} | 
                                                                                                            
                                                            | 1260 | 1260 |  		print '</td></tr>'; | 
                                                                                                            
                                                            | 1261 | 1261 |   | 
                                                                                                                                                        
                                                        |  | @@ -1268,12 +1268,12 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1268 | 1268 |  			print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0); | 
                                                                                                            
                                                            | 1269 | 1269 |  			print '</td>'; | 
                                                                                                            
                                                            | 1270 | 1270 |  			if ($usercancreate && $action != 'editmulticurrencycode' && $object->suspended == $object::STATUS_SUSPENDED) { | 
                                                                                                            
                                                            | 1271 |  | -				print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencycode&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; | 
                                                                                                            
                                                            |  | 1271 | +				print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencycode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; | 
                                                                                                            
                                                            | 1272 | 1272 |  			} | 
                                                                                                            
                                                            | 1273 | 1273 |  			print '</tr></table>'; | 
                                                                                                            
                                                            | 1274 | 1274 |  			print '</td><td>'; | 
                                                                                                            
                                                            | 1275 | 1275 |  			$htmlname = (($usercancreate && $action == 'editmulticurrencycode') ? 'multicurrency_code' : 'none'); | 
                                                                                                            
                                                            | 1276 |  | -			$form->form_multicurrency_code($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_code, $htmlname); | 
                                                                                                            
                                                            |  | 1276 | +			$form->form_multicurrency_code($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_code, $htmlname); | 
                                                                                                            
                                                            | 1277 | 1277 |  			print '</td></tr>'; | 
                                                                                                            
                                                            | 1278 | 1278 |   | 
                                                                                                            
                                                            | 1279 | 1279 |  			// Multicurrency rate | 
                                                                                                                                                        
                                                        |  | @@ -1284,7 +1284,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1284 | 1284 |  				print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0); | 
                                                                                                            
                                                            | 1285 | 1285 |  				print '</td>'; | 
                                                                                                            
                                                            | 1286 | 1286 |  				if ($usercancreate && $action != 'editmulticurrencyrate' && $object->suspended == $object::STATUS_SUSPENDED && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { | 
                                                                                                            
                                                            | 1287 |  | -					print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editmulticurrencyrate&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1) . '</a></td>'; | 
                                                                                                            
                                                            |  | 1287 | +					print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmulticurrencyrate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).'</a></td>'; | 
                                                                                                            
                                                            | 1288 | 1288 |  				} | 
                                                                                                            
                                                            | 1289 | 1289 |  				print '</tr></table>'; | 
                                                                                                            
                                                            | 1290 | 1290 |  				print '</td><td>'; | 
                                                                                                                                                        
                                                        |  | @@ -1292,12 +1292,12 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1292 | 1292 |  					if ($action == 'actualizemulticurrencyrate') { | 
                                                                                                            
                                                            | 1293 | 1293 |  						list($object->fk_multicurrency, $object->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($object->db, $object->multicurrency_code); | 
                                                                                                            
                                                            | 1294 | 1294 |  					} | 
                                                                                                            
                                                            | 1295 |  | -					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code); | 
                                                                                                            
                                                            |  | 1295 | +					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, ($usercancreate ? 'multicurrency_tx' : 'none'), $object->multicurrency_code); | 
                                                                                                            
                                                            | 1296 | 1296 |  				} else { | 
                                                                                                            
                                                            | 1297 |  | -					$form->form_multicurrency_rate($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); | 
                                                                                                            
                                                            |  | 1297 | +					$form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$object->id, $object->multicurrency_tx, 'none', $object->multicurrency_code); | 
                                                                                                            
                                                            | 1298 | 1298 |  					if ($object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) { | 
                                                                                                            
                                                            | 1299 | 1299 |  						print '<div class="inline-block">         '; | 
                                                                                                            
                                                            | 1300 |  | -						print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=actualizemulticurrencyrate">' . $langs->trans("ActualizeCurrency") . '</a>'; | 
                                                                                                            
                                                            |  | 1300 | +						print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=actualizemulticurrencyrate">'.$langs->trans("ActualizeCurrency").'</a>'; | 
                                                                                                            
                                                            | 1301 | 1301 |  						print '</div>'; | 
                                                                                                            
                                                            | 1302 | 1302 |  					} | 
                                                                                                            
                                                            | 1303 | 1303 |  				} | 
                                                                                                                                                        
                                                        |  | @@ -1313,24 +1313,24 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1313 | 1313 |   | 
                                                                                                            
                                                            | 1314 | 1314 |  		$substitutionarray = getCommonSubstitutionArray($langs, 2, null, $object); | 
                                                                                                            
                                                            | 1315 | 1315 |   | 
                                                                                                            
                                                            | 1316 |  | -		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m') . ')'; | 
                                                                                                            
                                                            | 1317 |  | -		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%m') . ')'; | 
                                                                                                            
                                                            | 1318 |  | -		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m') . ')'; | 
                                                                                                            
                                                            | 1319 |  | -		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B') . ')'; | 
                                                                                                            
                                                            | 1320 |  | -		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%B') . ')'; | 
                                                                                                            
                                                            | 1321 |  | -		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B') . ')'; | 
                                                                                                            
                                                            | 1322 |  | -		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y') . ')'; | 
                                                                                                            
                                                            | 1323 |  | -		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date($dateexample, '%Y') . ')'; | 
                                                                                                            
                                                            | 1324 |  | -		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y') . ')'; | 
                                                                                                            
                                                            |  | 1316 | +		$substitutionarray['__INVOICE_PREVIOUS_MONTH__'] = $langs->trans("PreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%m').')'; | 
                                                                                                            
                                                            |  | 1317 | +		$substitutionarray['__INVOICE_MONTH__'] = $langs->trans("MonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%m').')'; | 
                                                                                                            
                                                            |  | 1318 | +		$substitutionarray['__INVOICE_NEXT_MONTH__'] = $langs->trans("NextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%m').')'; | 
                                                                                                            
                                                            |  | 1319 | +		$substitutionarray['__INVOICE_PREVIOUS_MONTH_TEXT__'] = $langs->trans("TextPreviousMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'm'), '%B').')'; | 
                                                                                                            
                                                            |  | 1320 | +		$substitutionarray['__INVOICE_MONTH_TEXT__'] = $langs->trans("TextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%B').')'; | 
                                                                                                            
                                                            |  | 1321 | +		$substitutionarray['__INVOICE_NEXT_MONTH_TEXT__'] = $langs->trans("TextNextMonthOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'm'), '%B').')'; | 
                                                                                                            
                                                            |  | 1322 | +		$substitutionarray['__INVOICE_PREVIOUS_YEAR__'] = $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, -1, 'y'), '%Y').')'; | 
                                                                                                            
                                                            |  | 1323 | +		$substitutionarray['__INVOICE_YEAR__'] = $langs->trans("YearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample, '%Y').')'; | 
                                                                                                            
                                                            |  | 1324 | +		$substitutionarray['__INVOICE_NEXT_YEAR__'] = $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'), '%Y').')'; | 
                                                                                                            
                                                            | 1325 | 1325 |  		// Only on template invoices | 
                                                                                                            
                                                            | 1326 |  | -		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour') . ')'; | 
                                                                                                            
                                                            | 1327 |  | -		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen") . ' (' . $langs->trans("Example") . ': ' . dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour') . ')'; | 
                                                                                                            
                                                            |  | 1326 | +		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_BEFORE_GEN__'] = $langs->trans("DateNextInvoiceBeforeGen").' ('.$langs->trans("Example").': '.dol_print_date(($object->date_when ? $object->date_when : dol_now()), 'dayhour').')'; | 
                                                                                                            
                                                            |  | 1327 | +		$substitutionarray['__INVOICE_DATE_NEXT_INVOICE_AFTER_GEN__'] = $langs->trans("DateNextInvoiceAfterGen").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree(($object->date_when ? $object->date_when : dol_now()), $object->frequency, $object->unit_frequency), 'dayhour').')'; | 
                                                                                                            
                                                            | 1328 | 1328 |  		$substitutionarray['__INVOICE_COUNTER_CURRENT__'] = $object->nb_gen_done; | 
                                                                                                            
                                                            | 1329 | 1329 |  		$substitutionarray['__INVOICE_COUNTER_MAX__'] = $object->nb_gen_max; | 
                                                                                                            
                                                            | 1330 | 1330 |   | 
                                                                                                            
                                                            | 1331 |  | -		$htmltext = '<i>' . $langs->trans("FollowingConstantsWillBeSubstituted") . ':<br>'; | 
                                                                                                            
                                                            |  | 1331 | +		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>'; | 
                                                                                                            
                                                            | 1332 | 1332 |  		foreach ($substitutionarray as $key => $val) { | 
                                                                                                            
                                                            | 1333 |  | -			$htmltext .= $key . ' = ' . $langs->trans($val) . '<br>'; | 
                                                                                                            
                                                            |  | 1333 | +			$htmltext .= $key.' = '.$langs->trans($val).'<br>'; | 
                                                                                                            
                                                            | 1334 | 1334 |  		} | 
                                                                                                            
                                                            | 1335 | 1335 |  		$htmltext .= '</i>'; | 
                                                                                                            
                                                            | 1336 | 1336 |   | 
                                                                                                                                                        
                                                        |  | @@ -1338,7 +1338,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1338 | 1338 |  		print '<tr><td>'; | 
                                                                                                            
                                                            | 1339 | 1339 |  		print $form->editfieldkey($form->textwithpicto($langs->trans('NotePublic'), $htmltext, 1, 'help', '', 0, 2, 'notepublic'), 'note_public', $object->note_public, $object, $usercancreate); | 
                                                                                                            
                                                            | 1340 | 1340 |  		print '</td><td class="wordbreak">'; | 
                                                                                                            
                                                            | 1341 |  | -		print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1); | 
                                                                                                            
                                                            |  | 1341 | +		print $form->editfieldval($langs->trans("NotePublic"), 'note_public', $object->note_public, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); | 
                                                                                                            
                                                            | 1342 | 1342 |  		print '</td>'; | 
                                                                                                            
                                                            | 1343 | 1343 |  		print '</tr>'; | 
                                                                                                            
                                                            | 1344 | 1344 |   | 
                                                                                                                                                        
                                                        |  | @@ -1346,7 +1346,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1346 | 1346 |  		print '<tr><td>'; | 
                                                                                                            
                                                            | 1347 | 1347 |  		print $form->editfieldkey($form->textwithpicto($langs->trans("NotePrivate"), $htmltext, 1, 'help', '', 0, 2, 'noteprivate'), 'note_private', $object->note_private, $object, $usercancreate); | 
                                                                                                            
                                                            | 1348 | 1348 |  		print '</td><td class="wordbreak">'; | 
                                                                                                            
                                                            | 1349 |  | -		print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:' . ROWS_4 . ':90%', '', null, null, '', 1); | 
                                                                                                            
                                                            |  | 1349 | +		print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $usercancreate, 'textarea:'.ROWS_4.':90%', '', null, null, '', 1); | 
                                                                                                            
                                                            | 1350 | 1350 |  		print '</td>'; | 
                                                                                                            
                                                            | 1351 | 1351 |  		print '</tr>'; | 
                                                                                                            
                                                            | 1352 | 1352 |   | 
                                                                                                                                                        
                                                        |  | @@ -1356,14 +1356,14 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1356 | 1356 |  		print $langs->trans('BankAccount'); | 
                                                                                                            
                                                            | 1357 | 1357 |  		print '<td>'; | 
                                                                                                            
                                                            | 1358 | 1358 |  		if ($action != 'editbankaccount' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { | 
                                                                                                            
                                                            | 1359 |  | -			print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editbankaccount&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetBankAccount'), 1) . '</a></td>'; | 
                                                                                                            
                                                            |  | 1359 | +			print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editbankaccount&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetBankAccount'), 1).'</a></td>'; | 
                                                                                                            
                                                            | 1360 | 1360 |  		} | 
                                                                                                            
                                                            | 1361 | 1361 |  		print '</tr></table>'; | 
                                                                                                            
                                                            | 1362 | 1362 |  		print '</td><td>'; | 
                                                                                                            
                                                            | 1363 | 1363 |  		if ($action == 'editbankaccount') { | 
                                                                                                            
                                                            | 1364 |  | -			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'fk_account', 1); | 
                                                                                                            
                                                            |  | 1364 | +			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'fk_account', 1); | 
                                                                                                            
                                                            | 1365 | 1365 |  		} else { | 
                                                                                                            
                                                            | 1366 |  | -			$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_account, 'none'); | 
                                                                                                            
                                                            |  | 1366 | +			$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_account, 'none'); | 
                                                                                                            
                                                            | 1367 | 1367 |  		} | 
                                                                                                            
                                                            | 1368 | 1368 |  		print "</td>"; | 
                                                                                                            
                                                            | 1369 | 1369 |  		print '</tr>'; | 
                                                                                                                                                        
                                                        |  | @@ -1374,18 +1374,18 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1374 | 1374 |  		print $langs->trans('Model'); | 
                                                                                                            
                                                            | 1375 | 1375 |  		print '<td>'; | 
                                                                                                            
                                                            | 1376 | 1376 |  		if ($action != 'editmodelpdf' && $usercancreate && $object->statut == FactureFournisseurRec::STATUS_NOTSUSPENDED) { | 
                                                                                                            
                                                            | 1377 |  | -			print '<td class="right"><a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=editmodelpdf&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetModel'), 1) . '</a></td>'; | 
                                                                                                            
                                                            |  | 1377 | +			print '<td class="right"><a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=editmodelpdf&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetModel'), 1).'</a></td>'; | 
                                                                                                            
                                                            | 1378 | 1378 |  		} | 
                                                                                                            
                                                            | 1379 | 1379 |  		print '</tr></table>'; | 
                                                                                                            
                                                            | 1380 | 1380 |  		print '</td><td>'; | 
                                                                                                            
                                                            | 1381 | 1381 |  		if ($action == 'editmodelpdf') { | 
                                                                                                            
                                                            | 1382 |  | -			include_once DOL_DOCUMENT_ROOT . '/core/modules/supplier_invoice/modules_facturefournisseur.php'; | 
                                                                                                            
                                                            |  | 1382 | +			include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php'; | 
                                                                                                            
                                                            | 1383 | 1383 |  			$list = array(); | 
                                                                                                            
                                                            | 1384 | 1384 |  			$models = ModelePDFSuppliersInvoices::liste_modeles($db); | 
                                                                                                            
                                                            | 1385 | 1385 |  			foreach ($models as $k => $model) { | 
                                                                                                            
                                                            | 1386 |  | -				$list[] = str_replace(':', '|', $k) . ':' . $model; | 
                                                                                                            
                                                            |  | 1386 | +				$list[] = str_replace(':', '|', $k).':'.$model; | 
                                                                                                            
                                                            | 1387 | 1387 |  			} | 
                                                                                                            
                                                            | 1388 |  | -			$select = 'select;' . implode(',', $list); | 
                                                                                                            
                                                            |  | 1388 | +			$select = 'select;'.implode(',', $list); | 
                                                                                                            
                                                            | 1389 | 1389 |  			//TODO : Droits | 
                                                                                                            
                                                            | 1390 | 1390 |  			print $form->editfieldval($langs->trans('Model'), 'modelpdf', $object->model_pdf, $object, $usercancreate, $select); | 
                                                                                                            
                                                            | 1391 | 1391 |  		} else { | 
                                                                                                                                                        
                                                        |  | @@ -1396,7 +1396,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1396 | 1396 |   | 
                                                                                                            
                                                            | 1397 | 1397 |  		// Other attributes | 
                                                                                                            
                                                            | 1398 | 1398 |  		$cols = 2; | 
                                                                                                            
                                                            | 1399 |  | -		include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; | 
                                                                                                            
                                                            |  | 1399 | +		include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; | 
                                                                                                            
                                                            | 1400 | 1400 |   | 
                                                                                                            
                                                            | 1401 | 1401 |  		print '</table>'; | 
                                                                                                            
                                                            | 1402 | 1402 |   | 
                                                                                                                                                        
                                                        |  | @@ -1412,7 +1412,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1412 | 1412 |   | 
                                                                                                            
                                                            | 1413 | 1413 |  		print '<table class="border centpercent tableforfield">'; | 
                                                                                                            
                                                            | 1414 | 1414 |   | 
                                                                                                            
                                                            | 1415 |  | -		print '<tr><td colspan="2">' . img_picto('', 'recurring', 'class="pictofixedwidth"') . $title . '</td></tr>'; | 
                                                                                                            
                                                            |  | 1415 | +		print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>'; | 
                                                                                                            
                                                            | 1416 | 1416 |   | 
                                                                                                            
                                                            | 1417 | 1417 |  		// if "frequency" is empty or = 0, the recurrence is disabled | 
                                                                                                            
                                                            | 1418 | 1418 |  		print '<tr><td style="width: 50%">'; | 
                                                                                                                                                        
                                                        |  | @@ -1420,23 +1420,23 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1420 | 1420 |  		print $langs->trans('Frequency'); | 
                                                                                                            
                                                            | 1421 | 1421 |  		print '</td>'; | 
                                                                                                            
                                                            | 1422 | 1422 |  		if ($action != 'editfrequency' && $usercancreate) { | 
                                                                                                            
                                                            | 1423 |  | -			print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editfrequency&token=' . newToken() . '&facid=' . $object->id . '">' . img_edit($langs->trans('Edit'), 1) . '</a></td>'; | 
                                                                                                            
                                                            |  | 1423 | +			print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editfrequency&token='.newToken().'&facid='.$object->id.'">'.img_edit($langs->trans('Edit'), 1).'</a></td>'; | 
                                                                                                            
                                                            | 1424 | 1424 |  		} | 
                                                                                                            
                                                            | 1425 | 1425 |  		print '</tr></table>'; | 
                                                                                                            
                                                            | 1426 | 1426 |  		print '</td><td>'; | 
                                                                                                            
                                                            | 1427 | 1427 |  		if ($action == 'editfrequency') { | 
                                                                                                            
                                                            | 1428 |  | -			print '<form method="post" action="' . $_SERVER["PHP_SELF"] . '?facid=' . $object->id . '">'; | 
                                                                                                            
                                                            |  | 1428 | +			print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?facid='.$object->id.'">'; | 
                                                                                                            
                                                            | 1429 | 1429 |  			print '<input type="hidden" name="action" value="setfrequency">'; | 
                                                                                                            
                                                            | 1430 |  | -			print '<input type="hidden" name="token" value="' . newToken() . '">'; | 
                                                                                                            
                                                            |  | 1430 | +			print '<input type="hidden" name="token" value="'.newToken().'">'; | 
                                                                                                            
                                                            | 1431 | 1431 |  			print '<table class="nobordernopadding">'; | 
                                                                                                            
                                                            | 1432 | 1432 |  			print '<tr><td>'; | 
                                                                                                            
                                                            | 1433 |  | -			print "<input type='text' name='frequency' value='" . $object->frequency . "' size='5' /> " . $form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); | 
                                                                                                            
                                                            |  | 1433 | +			print "<input type='text' name='frequency' value='".$object->frequency."' size='5' /> ".$form->selectarray('unit_frequency', array('d' => $langs->trans('Day'), 'm' => $langs->trans('Month'), 'y' => $langs->trans('Year')), ($object->unit_frequency ? $object->unit_frequency : 'm')); | 
                                                                                                            
                                                            | 1434 | 1434 |  			print '</td>'; | 
                                                                                                            
                                                            | 1435 |  | -			print '<td class="left"><input type="submit" class="button button-edit" value="' . $langs->trans("Modify") . '"></td>'; | 
                                                                                                            
                                                            |  | 1435 | +			print '<td class="left"><input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'"></td>'; | 
                                                                                                            
                                                            | 1436 | 1436 |  			print '</tr></table></form>'; | 
                                                                                                            
                                                            | 1437 | 1437 |  		} else { | 
                                                                                                            
                                                            | 1438 | 1438 |  			if ($object->frequency > 0) { | 
                                                                                                            
                                                            | 1439 |  | -				print $langs->trans('FrequencyPer_' . $object->unit_frequency, $object->frequency); | 
                                                                                                            
                                                            |  | 1439 | +				print $langs->trans('FrequencyPer_'.$object->unit_frequency, $object->frequency); | 
                                                                                                            
                                                            | 1440 | 1440 |  			} else { | 
                                                                                                            
                                                            | 1441 | 1441 |  				print $langs->trans("NotARecurringInvoiceTemplate"); | 
                                                                                                            
                                                            | 1442 | 1442 |  			} | 
                                                                                                                                                        
                                                        |  | @@ -1455,8 +1455,8 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1455 | 1455 |  			print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $usercancreate, 'day', $object->date_when, null, '', '', 0, 'strikeIfMaxNbGenReached'); | 
                                                                                                            
                                                            | 1456 | 1456 |  		} | 
                                                                                                            
                                                            | 1457 | 1457 |  		//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour')); | 
                                                                                                            
                                                            | 1458 |  | -		if (! $object->isMaxNbGenReached()) { | 
                                                                                                            
                                                            | 1459 |  | -			if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { | 
                                                                                                            
                                                            |  | 1458 | +		if (!$object->isMaxNbGenReached()) { | 
                                                                                                            
                                                            |  | 1459 | +			if (!$object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) { | 
                                                                                                            
                                                            | 1460 | 1460 |  				print img_warning($langs->trans("Late")); | 
                                                                                                            
                                                            | 1461 | 1461 |  			} | 
                                                                                                            
                                                            | 1462 | 1462 |  		} else { | 
                                                                                                                                                        
                                                        |  | @@ -1489,7 +1489,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1489 | 1489 |  			print $langs->trans("StatusOfGeneratedInvoices"); | 
                                                                                                            
                                                            | 1490 | 1490 |  		} | 
                                                                                                            
                                                            | 1491 | 1491 |  		print '</td><td>'; | 
                                                                                                            
                                                            | 1492 |  | -		$select = 'select;0:' . $langs->trans('BillStatusDraft') . ',1:' . $langs->trans('BillStatusValidated'); | 
                                                                                                            
                                                            |  | 1492 | +		$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated'); | 
                                                                                                            
                                                            | 1493 | 1493 |  		if ($action == 'auto_validate' || $object->frequency > 0) { | 
                                                                                                            
                                                            | 1494 | 1494 |  			print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $usercancreate, $select); | 
                                                                                                            
                                                            | 1495 | 1495 |  		} | 
                                                                                                                                                        
                                                        |  | @@ -1505,7 +1505,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1505 | 1505 |  			} | 
                                                                                                            
                                                            | 1506 | 1506 |  			print '</td>'; | 
                                                                                                            
                                                            | 1507 | 1507 |  			print '<td>'; | 
                                                                                                            
                                                            | 1508 |  | -			$select = 'select;0:' . $langs->trans('DoNotGenerateDoc') . ',1:' . $langs->trans('AutogenerateDoc'); | 
                                                                                                            
                                                            |  | 1508 | +			$select = 'select;0:'.$langs->trans('DoNotGenerateDoc').',1:'.$langs->trans('AutogenerateDoc'); | 
                                                                                                            
                                                            | 1509 | 1509 |  			if ($action == 'generate_pdf' || $object->frequency > 0) { | 
                                                                                                            
                                                            | 1510 | 1510 |  				print $form->editfieldval($langs->trans("StatusOfGeneratedDocuments"), 'generate_pdf', $object->generate_pdf, $object, $usercancreate, $select); | 
                                                                                                            
                                                            | 1511 | 1511 |  			} | 
                                                                                                                                                        
                                                        |  | @@ -1529,7 +1529,7 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1529 | 1529 |  			print '<table class="border centpercent tableforfield">'; | 
                                                                                                            
                                                            | 1530 | 1530 |   | 
                                                                                                            
                                                            | 1531 | 1531 |  			// Nb of generation already done | 
                                                                                                            
                                                            | 1532 |  | -			print '<tr><td style="width: 50%">' . $langs->trans("NbOfGenerationDone") . '</td>'; | 
                                                                                                            
                                                            |  | 1532 | +			print '<tr><td style="width: 50%">'.$langs->trans("NbOfGenerationDone").'</td>'; | 
                                                                                                            
                                                            | 1533 | 1533 |  			print '<td>'; | 
                                                                                                            
                                                            | 1534 | 1534 |  			print $object->nb_gen_done ? $object->nb_gen_done : '0'; | 
                                                                                                            
                                                            | 1535 | 1535 |  			print '</td>'; | 
                                                                                                                                                        
                                                        |  | @@ -1554,15 +1554,15 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1554 | 1554 |  		print '<div class="clearboth"></div><br>'; | 
                                                                                                            
                                                            | 1555 | 1555 |   | 
                                                                                                            
                                                            | 1556 | 1556 |  		// Lines | 
                                                                                                            
                                                            | 1557 |  | -		print '	<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '#add' : '#line_' . GETPOST('lineid', 'int')) . '" method="POST"> | 
                                                                                                            
                                                            | 1558 |  | -        	<input type="hidden" name="token" value="' . newToken() . '"> | 
                                                                                                            
                                                            | 1559 |  | -        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '"> | 
                                                                                                            
                                                            |  | 1557 | +		print '	<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#add' : '#line_'.GETPOST('lineid', 'int')).'" method="POST"> | 
                                                                                                            
                                                            |  | 1558 | +        	<input type="hidden" name="token" value="' . newToken().'"> | 
                                                                                                            
                                                            |  | 1559 | +        	<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'"> | 
                                                                                                            
                                                            | 1560 | 1560 |          	<input type="hidden" name="mode" value=""> | 
                                                                                                            
                                                            | 1561 |  | -        	<input type="hidden" name="id" value="' . $object->id . '"> | 
                                                                                                            
                                                            |  | 1561 | +        	<input type="hidden" name="id" value="' . $object->id.'"> | 
                                                                                                            
                                                            | 1562 | 1562 |          	'; | 
                                                                                                            
                                                            | 1563 | 1563 |   | 
                                                                                                            
                                                            | 1564 | 1564 |  		if (!empty($conf->use_javascript_ajax) && $object->statut == 0) { | 
                                                                                                            
                                                            | 1565 |  | -			include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php'; | 
                                                                                                            
                                                            |  | 1565 | +			include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php'; | 
                                                                                                            
                                                            | 1566 | 1566 |  		} | 
                                                                                                            
                                                            | 1567 | 1567 |   | 
                                                                                                            
                                                            | 1568 | 1568 |  		print '<div class="div-table-responsive-no-min">'; | 
                                                                                                                                                        
                                                        |  | @@ -1619,24 +1619,24 @@  discard block | 
                                                    
                                                        |  |  |  block discarded – undo | 
                                                                                                                                                                                                                    
                                                            | 1619 | 1619 |  		if (empty($object->suspended)) { | 
                                                                                                            
                                                            | 1620 | 1620 |  			if ($usercancreate) { | 
                                                                                                            
                                                            | 1621 | 1621 |  				if (!empty($object->frequency) && $object->nb_gen_max > 0 && ($object->nb_gen_done >= $object->nb_gen_max)) { | 
                                                                                                            
                                                            | 1622 |  | -					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("MaxGenerationReached")) . '">' . $langs->trans("CreateBill") . '</a></div>'; | 
                                                                                                            
                                                            |  | 1622 | +					print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("MaxGenerationReached")).'">'.$langs->trans("CreateBill").'</a></div>'; | 
                                                                                                            
                                                            | 1623 | 1623 |  				} else { | 
                                                                                                            
                                                            | 1624 | 1624 |  					if (empty($object->frequency) || $object->date_when <= $nowlasthour) { | 
                                                                                                            
                                                            | 1625 |  | -						print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/fourn/facture/card.php?action=create&socid=' . $object->thirdparty->id . '&fac_rec=' . $object->id . '">' . $langs->trans("CreateBill") . '</a></div>'; | 
                                                                                                            
                                                            |  | 1625 | +						print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->thirdparty->id.'&fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>'; | 
                                                                                                            
                                                            | 1626 | 1626 |  					} else { | 
                                                                                                            
                                                            | 1627 |  | -						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("DateIsNotEnough")) . '">' . $langs->trans("CreateBill") . '</a></div>'; | 
                                                                                                            
                                                            |  | 1627 | +						print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("DateIsNotEnough")).'">'.$langs->trans("CreateBill").'</a></div>'; | 
                                                                                                            
                                                            | 1628 | 1628 |  					} | 
                                                                                                            
                                                            | 1629 | 1629 |  				} | 
                                                                                                            
                                                            | 1630 | 1630 |  			} else { | 
                                                                                                            
                                                            | 1631 |  | -				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">' . $langs->trans("CreateBill") . '</a></div>'; | 
                                                                                                            
                                                            |  | 1631 | +				print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("CreateBill").'</a></div>'; | 
                                                                                                            
                                                            | 1632 | 1632 |  			} | 
                                                                                                            
                                                            | 1633 | 1633 |  		} | 
                                                                                                            
                                                            | 1634 | 1634 |   | 
                                                                                                            
                                                            | 1635 | 1635 |  		if ($usercancreate) { | 
                                                                                                            
                                                            | 1636 | 1636 |  			if (empty($object->suspended)) { | 
                                                                                                            
                                                            | 1637 |  | -				print '<div class="inline-block divButAction"><a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?action=disable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Disable") . '</a></div>'; | 
                                                                                                            
                                                            |  | 1637 | +				print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=disable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Disable").'</a></div>'; | 
                                                                                                            
                                                            | 1638 | 1638 |  			} else { | 
                                                                                                            
                                                            | 1639 |  | -				print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=enable&id=' . $object->id . '&token=' . newToken() . '">' . $langs->trans("Enable") . '</a></div>'; | 
                                                                                                            
                                                            |  | 1639 | +				print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=enable&id='.$object->id.'&token='.newToken().'">'.$langs->trans("Enable").'</a></div>'; | 
                                                                                                            
                                                            | 1640 | 1640 |  			} | 
                                                                                                            
                                                            | 1641 | 1641 |  		} | 
                                                                                                            
                                                            | 1642 | 1642 |   |