Completed
Branch develop (1a4226)
by
unknown
25:43
created
htdocs/commande/messaging.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 
27 27
 // Load Dolibarr environment
28 28
 require '../main.inc.php';
29
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
30
-require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; // Changed from project.class.php
31
-require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php'; // Changed from project.lib.php
32
-require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
29
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
30
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // Changed from project.class.php
31
+require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; // Changed from project.lib.php
32
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
33 33
 
34 34
 /**
35 35
  * @var Conf $conf
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
  */
125 125
 
126 126
 $form = new Form($db);
127
-$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : '';
128
-$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Removed $object->name as orders typically don't have it
127
+$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : '';
128
+$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Removed $object->name as orders typically don't have it
129 129
 if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ordernamonly/', getDolGlobalString('MAIN_HTML_TITLE'))) { // Changed from projectnameonly
130
-	$title = $object->ref . ' - ' . $langs->trans("Info"); // Simplified title
130
+	$title = $object->ref.' - '.$langs->trans("Info"); // Simplified title
131 131
 }
132 132
 $help_url = "EN:Module_Orders|FR:Module_Commandes|ES:Módulo_Pedidos"; // Changed help URL
133 133
 llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_messaging'); // Changed mod-project
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['order'])) { // Changed from project
143 143
 	$tmpurl = $_SESSION['pageforbacktolist']['order']; // Changed from project
144 144
 	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
145
-	$linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
145
+	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
146 146
 } else {
147
-	$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; // Changed from projet
147
+	$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; // Changed from projet
148 148
 }
149 149
 
150 150
 $morehtmlref = '<div class="refidno">';
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 $morehtmlref .= $object->ref; // Changed from $object->title as orders typically use ref for main identification
153 153
 // Thirdparty
154 154
 if (!empty($object->thirdparty->id) && $object->thirdparty->id > 0) {
155
-	$morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1, 'order'); // Changed from project
155
+	$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1, 'order'); // Changed from project
156 156
 }
157 157
 $morehtmlref .= '</div>';
158 158
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 $out = '';
186 186
 $permok = $user->hasRight('agenda', 'myactions', 'create');
187 187
 if ($permok) {
188
-	$out .= '&orderid=' . $object->id; // Changed from projectid
188
+	$out .= '&orderid='.$object->id; // Changed from projectid
189 189
 }
190 190
 
191 191
 
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 
201 201
 
202 202
 	// Show link to change view in message
203
-	$messagingUrl = DOL_URL_ROOT . '/commande/messaging.php?id=' . $object->id; // Changed from projet
203
+	$messagingUrl = DOL_URL_ROOT.'/commande/messaging.php?id='.$object->id; // Changed from projet
204 204
 	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 2);
205 205
 
206 206
 	// Show link to change view in agenda
207
-	$messagingUrl = DOL_URL_ROOT . '/commande/agenda.php?id=' . $object->id; // Changed from projet
207
+	$messagingUrl = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id; // Changed from projet
208 208
 	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 1);
209 209
 
210 210
 
@@ -221,24 +221,24 @@  discard block
 block discarded – undo
221 221
 	// Show link to add event
222 222
 	if (isModEnabled('agenda')) {
223 223
 		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create');
224
-		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight);
224
+		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight);
225 225
 	}
226 226
 
227
-	$param = '&id=' . $object->id;
227
+	$param = '&id='.$object->id;
228 228
 	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
229
-		$param .= '&contextpage=' . urlencode($contextpage);
229
+		$param .= '&contextpage='.urlencode($contextpage);
230 230
 	}
231 231
 	if ($limit > 0 && $limit != $conf->liste_limit) {
232
-		$param .= '&limit=' . ((int) $limit);
232
+		$param .= '&limit='.((int) $limit);
233 233
 	}
234 234
 
235
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
236
-	$cachekey = 'count_events_order_' . $object->id; // Changed from project
235
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
236
+	$cachekey = 'count_events_order_'.$object->id; // Changed from project
237 237
 	$nbEvent = dol_getcache($cachekey);
238 238
 
239
-	$titlelist = $langs->trans("ActionsOnOrder") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); // Changed from ActionsOnProject
239
+	$titlelist = $langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); // Changed from ActionsOnProject
240 240
 	if (!empty($conf->dol_optimize_smallscreen)) {
241
-		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : '');
241
+		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : '');
242 242
 	}
243 243
 
244 244
 	print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0);
Please login to merge, or discard this patch.
htdocs/commande/agenda.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 // Load Dolibarr environment
29 29
 //MODIF VAL
30 30
 require '../main.inc.php';
31
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
32
-require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php'; // Added for contact object
33
-require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
34
-require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php'; // Keep if you use project linking in order
35
-require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php';
36
-require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
31
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
32
+require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Added for contact object
33
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
34
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Keep if you use project linking in order
35
+require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
36
+require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
37 37
 
38 38
 /**
39 39
  * @var Conf $conf
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
  */
129 129
 
130 130
 $form = new Form($db);
131
-$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/' . $langs->trans("Agenda") : '';
132
-$title = $langs->trans('Events') . $agenda . ' - ' . $object->ref; // Changed from $object->ref.' '.$object->name;
131
+$agenda = (isModEnabled('agenda') && ($user->hasRight('agenda', 'myactions', 'read') || $user->hasRight('agenda', 'allactions', 'read'))) ? '/'.$langs->trans("Agenda") : '';
132
+$title = $langs->trans('Events').$agenda.' - '.$object->ref; // Changed from $object->ref.' '.$object->name;
133 133
 
134 134
 if (getDolGlobalString('MAIN_HTML_TITLE') && preg_match('/ordernamonly/', getDolGlobalString('MAIN_HTML_TITLE')) && $object->ref) { // Changed from projectnameonly
135
-	$title = $object->ref . ' - ' . $langs->trans("Info"); // Simplified title
135
+	$title = $object->ref.' - '.$langs->trans("Info"); // Simplified title
136 136
 }
137 137
 $help_url = "EN:Module_Orders|FR:Module_Commandes|ES:M&oacute;dulo_Pedidos"; // Changed help URL
138 138
 llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-order page-card_agenda'); // Changed mod-project
@@ -147,9 +147,9 @@  discard block
 block discarded – undo
147 147
 if (!empty($_SESSION['pageforbacktolist']) && !empty($_SESSION['pageforbacktolist']['order'])) { // Changed from project
148 148
 	$tmpurl = $_SESSION['pageforbacktolist']['order']; // Changed from project
149 149
 	$tmpurl = preg_replace('/__SOCID__/', (string) $object->socid, $tmpurl);
150
-	$linkback = '<a href="' . $tmpurl . (preg_match('/\?/', $tmpurl) ? '&' : '?') . 'restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>';
150
+	$linkback = '<a href="'.$tmpurl.(preg_match('/\?/', $tmpurl) ? '&' : '?').'restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
151 151
 } else {
152
-	$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1">' . $langs->trans("BackToList") . '</a>'; // Changed from projet
152
+	$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>'; // Changed from projet
153 153
 }
154 154
 
155 155
 $morehtmlref = '<div class="refidno">';
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
158 158
 $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
159 159
 // Thirdparty
160
-$morehtmlref .= '<br>' . $object->thirdparty->getNomUrl(1);
160
+$morehtmlref .= '<br>'.$object->thirdparty->getNomUrl(1);
161 161
 // Project
162 162
 if (isModEnabled('project')) {
163 163
 	$langs->load("projects");
@@ -165,16 +165,16 @@  discard block
 block discarded – undo
165 165
 	if (0) {
166 166
 		$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
167 167
 		if ($action != 'classify') {
168
-			$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
168
+			$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
169 169
 		}
170
-		$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
170
+		$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
171 171
 	} else {
172 172
 		if (!empty($object->fk_project)) {
173 173
 			$proj = new Project($db);
174 174
 			$proj->fetch($object->fk_project);
175 175
 			$morehtmlref .= $proj->getNomUrl(1);
176 176
 			if ($proj->title) {
177
-				$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
177
+				$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
178 178
 			}
179 179
 		}
180 180
 	}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 $out = '';
207 207
 $permok = $user->hasRight('agenda', 'myactions', 'create');
208 208
 if ($permok) {
209
-	$out .= '&orderid=' . $object->id; // Changed from projectid
209
+	$out .= '&orderid='.$object->id; // Changed from projectid
210 210
 }
211 211
 
212 212
 
@@ -221,12 +221,12 @@  discard block
 block discarded – undo
221 221
 
222 222
 	//MODIF PICHINOV MESSAGING
223 223
 	// Show link to change view in message
224
-	$messagingUrl = DOL_URL_ROOT . '/commande/messaging.php?id=' . $object->id; // Changed from projet
224
+	$messagingUrl = DOL_URL_ROOT.'/commande/messaging.php?id='.$object->id; // Changed from projet
225 225
 	$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1); // Status 1 for "not current page"
226 226
 
227 227
 
228 228
 	// Show link to change view in agenda
229
-	$messagingUrl = DOL_URL_ROOT . '/commande/agenda.php?id=' . $object->id; // Changed from projet
229
+	$messagingUrl = DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id; // Changed from projet
230 230
 	$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2); // Status 2 for "current page"
231 231
 
232 232
 	//END MODIF
@@ -234,24 +234,24 @@  discard block
 block discarded – undo
234 234
 	// Show link to add event
235 235
 	if (isModEnabled('agenda')) {
236 236
 		$addActionBtnRight = $user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create');
237
-		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '&socid=' . $object->socid . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id), '', (int) $addActionBtnRight);
237
+		$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', (int) $addActionBtnRight);
238 238
 	}
239 239
 
240
-	$param = '&id=' . $object->id;
240
+	$param = '&id='.$object->id;
241 241
 	if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
242
-		$param .= '&contextpage=' . urlencode($contextpage);
242
+		$param .= '&contextpage='.urlencode($contextpage);
243 243
 	}
244 244
 	if ($limit > 0 && $limit != $conf->liste_limit) {
245
-		$param .= '&limit=' . ((int) $limit);
245
+		$param .= '&limit='.((int) $limit);
246 246
 	}
247 247
 
248
-	require_once DOL_DOCUMENT_ROOT . '/core/lib/memory.lib.php';
249
-	$cachekey = 'count_events_commande_' . $object->id; // Changed from project
248
+	require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
249
+	$cachekey = 'count_events_commande_'.$object->id; // Changed from project
250 250
 	$nbEvent = dol_getcache($cachekey);
251 251
 
252
-	$titlelist = $langs->trans("ActionsOnOrder") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : ''); // Changed from ActionsOnProject
252
+	$titlelist = $langs->trans("ActionsOnOrder").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : ''); // Changed from ActionsOnProject
253 253
 	if (!empty($conf->dol_optimize_smallscreen)) {
254
-		$titlelist = $langs->trans("Actions") . (is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">(' . $nbEvent . ')</span>' : '');
254
+		$titlelist = $langs->trans("Actions").(is_numeric($nbEvent) ? '<span class="opacitymedium colorblack paddingleft">('.$nbEvent.')</span>' : '');
255 255
 	}
256 256
 
257 257
 	print_barre_liste($titlelist, 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 0);
Please login to merge, or discard this patch.
htdocs/commande/card.php 1 patch
Spacing   +281 added lines, -281 removed lines patch added patch discarded remove patch
@@ -40,30 +40,30 @@  discard block
 block discarded – undo
40 40
 
41 41
 // Load Dolibarr environment
42 42
 require '../main.inc.php';
43
-require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
44
-require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
45
-require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
46
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
47
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formorder.class.php';
48
-require_once DOL_DOCUMENT_ROOT . '/core/class/html.formmargin.class.php';
49
-require_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php';
50
-require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
51
-require_once DOL_DOCUMENT_ROOT . '/core/lib/order.lib.php';
52
-
53
-require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
54
-require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
43
+require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
44
+require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
45
+require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
46
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
47
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formorder.class.php';
48
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
49
+require_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
50
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
51
+require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
52
+
53
+require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
54
+require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
55 55
 
56 56
 if (isModEnabled("propal")) {
57
-	require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
57
+	require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
58 58
 }
59 59
 
60 60
 if (isModEnabled('project')) {
61
-	require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
62
-	require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
61
+	require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
62
+	require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
63 63
 }
64 64
 
65 65
 if (isModEnabled('variants')) {
66
-	require_once DOL_DOCUMENT_ROOT . '/variants/class/ProductCombination.class.php';
66
+	require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
67 67
 }
68 68
 
69 69
 
@@ -91,18 +91,18 @@  discard block
 block discarded – undo
91 91
 
92 92
 
93 93
 $id        = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid'));
94
-$ref       =  GETPOST('ref', 'alpha');
95
-$socid     =  GETPOSTINT('socid');
96
-$action    =  GETPOST('action', 'aZ09');
97
-$cancel    =  GETPOST('cancel', 'alpha');
98
-$confirm   =  GETPOST('confirm', 'alpha');
94
+$ref       = GETPOST('ref', 'alpha');
95
+$socid     = GETPOSTINT('socid');
96
+$action    = GETPOST('action', 'aZ09');
97
+$cancel    = GETPOST('cancel', 'alpha');
98
+$confirm   = GETPOST('confirm', 'alpha');
99 99
 $backtopage = GETPOST('backtopage', 'alpha');
100 100
 
101
-$lineid    =  GETPOSTINT('lineid');
102
-$contactid =  GETPOSTINT('contactid');
103
-$projectid =  GETPOSTINT('projectid');
104
-$origin    =  GETPOST('origin', 'alpha');
105
-$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id'));    // For backward compatibility
101
+$lineid    = GETPOSTINT('lineid');
102
+$contactid = GETPOSTINT('contactid');
103
+$projectid = GETPOSTINT('projectid');
104
+$origin    = GETPOST('origin', 'alpha');
105
+$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility
106 106
 $rank      = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1;
107 107
 
108 108
 // Type Contact default
@@ -147,26 +147,26 @@  discard block
 block discarded – undo
147 147
 $extrafields->fetch_name_optionals_label($object->table_element);
148 148
 
149 149
 // Load object
150
-include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php';     // Must be 'include', not 'include_once'
150
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
151 151
 
152 152
 // Permissions / Rights
153
-$usercanread    =  $user->hasRight("commande", "lire");
154
-$usercancreate  =  $user->hasRight("commande", "creer");
155
-$usercandelete  =  $user->hasRight("commande", "supprimer");
153
+$usercanread    = $user->hasRight("commande", "lire");
154
+$usercancreate  = $user->hasRight("commande", "creer");
155
+$usercandelete  = $user->hasRight("commande", "supprimer");
156 156
 
157 157
 // Advanced permissions
158
-$usercanclose       =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
159
-$usercanvalidate    =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
160
-$usercancancel      =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
161
-$usercansend        =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
162
-$usercangeneretedoc =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
158
+$usercanclose       = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
159
+$usercanvalidate    = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
160
+$usercancancel      = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
161
+$usercansend        = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
162
+$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
163 163
 
164 164
 $usermustrespectpricemin    = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
165 165
 $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
166 166
 
167
-$permissionnote    = $usercancreate;     //  Used by the include of actions_setnotes.inc.php
168
-$permissiondellink = $usercancreate;     //  Used by the include of actions_dellink.inc.php
169
-$permissiontoadd   = $usercancreate;     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
167
+$permissionnote    = $usercancreate; //  Used by the include of actions_setnotes.inc.php
168
+$permissiondellink = $usercancreate; //  Used by the include of actions_dellink.inc.php
169
+$permissiontoadd   = $usercancreate; //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
170 170
 $permissiontoeditextra = $usercancreate;
171 171
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
172 172
 	// For action 'update_extras', is there a specific permission set for the attribute to update
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
 }
193 193
 
194 194
 if (empty($reshook)) {
195
-	$backurlforlist = DOL_URL_ROOT . '/commande/list.php';
195
+	$backurlforlist = DOL_URL_ROOT.'/commande/list.php';
196 196
 
197 197
 	if (empty($backtopage) || ($cancel && empty($id))) {
198 198
 		if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
199 199
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
200 200
 				$backtopage = $backurlforlist;
201 201
 			} else {
202
-				$backtopage = DOL_URL_ROOT . '/commande/card.php?id=' . ((!empty($id) && $id > 0) ? $id : '__ID__');
202
+				$backtopage = DOL_URL_ROOT.'/commande/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
203 203
 			}
204 204
 		}
205 205
 	}
@@ -208,20 +208,20 @@  discard block
 block discarded – undo
208 208
 
209 209
 	if ($cancel) {
210 210
 		if (!empty($backtopageforcancel)) {
211
-			header("Location: " . $backtopageforcancel);
211
+			header("Location: ".$backtopageforcancel);
212 212
 			exit;
213 213
 		} elseif (!empty($backtopage)) {
214
-			header("Location: " . $backtopage);
214
+			header("Location: ".$backtopage);
215 215
 			exit;
216 216
 		}
217 217
 		$action = '';
218 218
 	}
219 219
 
220
-	include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php';    // Must be 'include', not 'include_once'
220
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once'
221 221
 
222
-	include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php';     // Must be 'include', not 'include_once'
222
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
223 223
 
224
-	include DOL_DOCUMENT_ROOT . '/core/actions_lineupdown.inc.php';  // Must be 'include', not 'include_once'
224
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
225 225
 
226 226
 	// Action clone object
227 227
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 						setEventMessages('', $warningMsgLineList, 'warnings');
251 251
 					}
252 252
 
253
-					header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
253
+					header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result);
254 254
 					exit;
255 255
 				} else {
256 256
 					setEventMessages($object->error, $object->errors, 'errors');
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
310 310
 			}
311 311
 
312
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
312
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
313 313
 			exit;
314 314
 		} else {
315 315
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 				$object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
338 338
 			}
339 339
 
340
-			header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
340
+			header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
341 341
 			exit;
342 342
 		} else {
343 343
 			setEventMessages($object->error, $object->errors, 'errors');
@@ -435,13 +435,13 @@  discard block
 block discarded – undo
435 435
 					$object_id = $object->create($user);
436 436
 
437 437
 					if ($object_id > 0) {
438
-						dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
438
+						dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
439 439
 
440 440
 						$classname = ucfirst($subelement);
441 441
 						$srcobject = new $classname($db);
442 442
 						'@phan-var-force Commande|Propal|Contrat $srcobject';
443 443
 
444
-						dol_syslog("Try to find source object origin=" . $object->origin . " originid=" . $object->origin_id . " to add lines");
444
+						dol_syslog("Try to find source object origin=".$object->origin." originid=".$object->origin_id." to add lines");
445 445
 						$result = $srcobject->fetch($object->origin_id);
446 446
 						if ($result > 0) {
447 447
 							$lines = $srcobject->lines;
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 
493 493
 								$tva_tx = $lines[$i]->tva_tx;
494 494
 								if (!empty($lines[$i]->vat_src_code) && !preg_match('/\(/', $tva_tx)) {
495
-									$tva_tx .= ' (' . $lines[$i]->vat_src_code . ')';
495
+									$tva_tx .= ' ('.$lines[$i]->vat_src_code.')';
496 496
 								}
497 497
 
498 498
 								$result = $object->addline(
@@ -620,7 +620,7 @@  discard block
 block discarded – undo
620 620
 			// End of object creation, we show it
621 621
 			if ($object_id > 0 && !$error) {
622 622
 				$db->commit();
623
-				header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object_id);
623
+				header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object_id);
624 624
 				exit();
625 625
 			} else {
626 626
 				$db->rollback();
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
 			}
797 797
 			$tvatx = $line->tva_tx;
798 798
 			if (!empty($line->vat_src_code)) {
799
-				$tvatx .= ' (' . $line->vat_src_code . ')';
799
+				$tvatx .= ' ('.$line->vat_src_code.')';
800 800
 			}
801 801
 			$result = $object->updateline($line->id, $line->desc, $line->subprice, $line->qty, (float) $remise_percent, $tvatx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->date_start, $line->date_end, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->fk_unit, $line->multicurrency_subprice);
802 802
 		}
@@ -826,7 +826,7 @@  discard block
 block discarded – undo
826 826
 				if ($prod->price_min > $line->subprice) {
827 827
 					$price_subprice = price($line->subprice, 0, $outlangs, 1, -1, -1, 'auto');
828 828
 					$price_price_min = price($prod->price_min, 0, $outlangs, 1, -1, -1, 'auto');
829
-					setEventMessages($prod->ref . ' - ' . $prod->label . ' (' . $price_subprice . ' < ' . $price_price_min . ' ' . strtolower($langs->trans("MinPrice")) . ')' . "\n", null, 'warnings');
829
+					setEventMessages($prod->ref.' - '.$prod->label.' ('.$price_subprice.' < '.$price_price_min.' '.strtolower($langs->trans("MinPrice")).')'."\n", null, 'warnings');
830 830
 				} else {
831 831
 					setEventMessages($prod->error, $prod->errors, 'errors');
832 832
 				}
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 		} else {
902 902
 			setEventMessages($object->error, $object->errors, 'errors');
903 903
 		}
904
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
904
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
905 905
 		exit();
906 906
 	} elseif ($action == 'confirm_addsubtotalline' && $usercancreate) {
907 907
 		// Handling adding a new subtotal line for subtotals module
@@ -953,7 +953,7 @@  discard block
 block discarded – undo
953 953
 		} else {
954 954
 			setEventMessages($object->error, $object->errors, 'errors');
955 955
 		}
956
-		header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $id);
956
+		header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
957 957
 		exit();
958 958
 	} elseif ($action == 'addline' && !GETPOST('submitforalllines', 'alpha') && $usercancreate) {		// Add a new line
959 959
 		$langs->load('errors');
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 		$pu_ht = '';
971 971
 		$pu_ttc = '';
972 972
 		$pu_ht_devise = '';
973
-		$pu_ttc_devise  = '';
973
+		$pu_ttc_devise = '';
974 974
 
975 975
 		if (GETPOST('price_ht') !== '') {
976 976
 			$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
@@ -999,9 +999,9 @@  discard block
 block discarded – undo
999 999
 
1000 1000
 		$tva_tx = GETPOST('tva_tx', 'alpha');
1001 1001
 
1002
-		$qty = price2num(GETPOST('qty' . $predef, 'alpha'), 'MS', 2);
1002
+		$qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
1003 1003
 
1004
-		$remise_percent = (GETPOSTISSET('remise_percent' . $predef) ? price2num(GETPOST('remise_percent' . $predef, 'alpha'), '', 2) : 0);
1004
+		$remise_percent = (GETPOSTISSET('remise_percent'.$predef) ? price2num(GETPOST('remise_percent'.$predef, 'alpha'), '', 2) : 0);
1005 1005
 		if (empty($remise_percent)) {
1006 1006
 			$remise_percent = 0;
1007 1007
 		}
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
 		if (is_array($extralabelsline)) {
1014 1014
 			// Get extra fields
1015 1015
 			foreach ($extralabelsline as $key => $value) {
1016
-				unset($_POST["options_" . $key]);
1016
+				unset($_POST["options_".$key]);
1017 1017
 			}
1018 1018
 		}
1019 1019
 
@@ -1058,8 +1058,8 @@  discard block
 block discarded – undo
1058 1058
 
1059 1059
 		if (!$error && ($qty >= 0) && (!empty($line_desc) || (!empty($idprod) && $idprod > 0))) {
1060 1060
 			// Clean parameters
1061
-			$date_start = dol_mktime(GETPOSTINT('date_start' . $predef . 'hour'), GETPOSTINT('date_start' . $predef . 'min'), GETPOSTINT('date_start' . $predef . 'sec'), GETPOSTINT('date_start' . $predef . 'month'), GETPOSTINT('date_start' . $predef . 'day'), GETPOSTINT('date_start' . $predef . 'year'));
1062
-			$date_end = dol_mktime(GETPOSTINT('date_end' . $predef . 'hour'), GETPOSTINT('date_end' . $predef . 'min'), GETPOSTINT('date_end' . $predef . 'sec'), GETPOSTINT('date_end' . $predef . 'month'), GETPOSTINT('date_end' . $predef . 'day'), GETPOSTINT('date_end' . $predef . 'year'));
1061
+			$date_start = dol_mktime(GETPOSTINT('date_start'.$predef.'hour'), GETPOSTINT('date_start'.$predef.'min'), GETPOSTINT('date_start'.$predef.'sec'), GETPOSTINT('date_start'.$predef.'month'), GETPOSTINT('date_start'.$predef.'day'), GETPOSTINT('date_start'.$predef.'year'));
1062
+			$date_end = dol_mktime(GETPOSTINT('date_end'.$predef.'hour'), GETPOSTINT('date_end'.$predef.'min'), GETPOSTINT('date_end'.$predef.'sec'), GETPOSTINT('date_end'.$predef.'month'), GETPOSTINT('date_end'.$predef.'day'), GETPOSTINT('date_end'.$predef.'year'));
1063 1063
 			$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
1064 1064
 
1065 1065
 			$price_min = $price_min_ttc = 0;
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 
1090 1090
 				if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) {
1091 1091
 					// If price per customer
1092
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1092
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1093 1093
 
1094 1094
 					$prodcustprice = new ProductCustomerPrice($db);
1095 1095
 
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 									$price_base_type = $custprice_line->price_base_type;
1112 1112
 									$tva_tx = $custprice_line->tva_tx;
1113 1113
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', (string) $tva_tx)) {
1114
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
1114
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
1115 1115
 									}
1116 1116
 									$tva_npr = $custprice_line->recuperableonly;
1117 1117
 									if (empty($tva_tx)) {
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
 					}
1159 1159
 				} elseif (getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) {
1160 1160
 					// If price per customer
1161
-					require_once DOL_DOCUMENT_ROOT . '/product/class/productcustomerprice.class.php';
1161
+					require_once DOL_DOCUMENT_ROOT.'/product/class/productcustomerprice.class.php';
1162 1162
 
1163 1163
 					$prodcustprice = new ProductCustomerPrice($db);
1164 1164
 
@@ -1177,7 +1177,7 @@  discard block
 block discarded – undo
1177 1177
 									$price_base_type = $custprice_line->price_base_type;
1178 1178
 									$tva_tx = $custprice_line->tva_tx;
1179 1179
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
1180
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
1180
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
1181 1181
 									}
1182 1182
 									$tva_npr = $custprice_line->recuperableonly;
1183 1183
 									if (empty($tva_tx)) {
@@ -1301,23 +1301,23 @@  discard block
 block discarded – undo
1301 1301
 							$outputlangs->load('products');
1302 1302
 						}
1303 1303
 						if (!empty($prod->customcode)) {
1304
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1304
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1305 1305
 						}
1306 1306
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1307 1307
 							$tmptxt .= ' - ';
1308 1308
 						}
1309 1309
 						if (!empty($prod->country_code)) {
1310
-							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
1310
+							$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
1311 1311
 						}
1312 1312
 					} else {
1313 1313
 						if (!empty($prod->customcode)) {
1314
-							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode") . ': ' . $prod->customcode;
1314
+							$tmptxt .= $langs->transnoentitiesnoconv("CustomsCode").': '.$prod->customcode;
1315 1315
 						}
1316 1316
 						if (!empty($prod->customcode) && !empty($prod->country_code)) {
1317 1317
 							$tmptxt .= ' - ';
1318 1318
 						}
1319 1319
 						if (!empty($prod->country_code)) {
1320
-							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
1320
+							$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
1321 1321
 						}
1322 1322
 					}
1323 1323
 					$tmptxt .= ')';
@@ -1356,8 +1356,8 @@  discard block
 block discarded – undo
1356 1356
 			$localtax2_tx = get_localtax($tva_tx, 2, $object->thirdparty);
1357 1357
 
1358 1358
 			// Margin
1359
-			$fournprice = (int) (GETPOST('fournprice' . $predef) ? GETPOSTINT('fournprice' . $predef) : 0);	// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1360
-			$buyingprice = price2num(GETPOST('buying_price' . $predef) != '' ? GETPOST('buying_price' . $predef) : ''); // If buying_price is '0', we must keep this value
1359
+			$fournprice = (int) (GETPOST('fournprice'.$predef) ? GETPOSTINT('fournprice'.$predef) : 0); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1360
+			$buyingprice = price2num(GETPOST('buying_price'.$predef) != '' ? GETPOST('buying_price'.$predef) : ''); // If buying_price is '0', we must keep this value
1361 1361
 
1362 1362
 			// Prepare a price equivalent for minimum price check
1363 1363
 			$pu_equivalent = $pu_ht;
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
 		 */
1602 1602
 
1603 1603
 		// Add buying price
1604
-		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : '');				// This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1604
+		$fournprice = (int) (GETPOST('fournprice') ? GETPOST('fournprice') : ''); // This can be id of supplier price, or 'pmpprice' or 'costprice', or 'inputprice', we force to keep ID only
1605 1605
 		$buyingprice = price2num(GETPOST('buying_price') != '' ? GETPOST('buying_price') : ''); // If buying_price is '0', we must keep this value
1606 1606
 
1607 1607
 		// Extrafields Lines
@@ -1610,7 +1610,7 @@  discard block
 block discarded – undo
1610 1610
 		// Unset extrafield POST Data
1611 1611
 		if (is_array($extralabelsline)) {
1612 1612
 			foreach ($extralabelsline as $key => $value) {
1613
-				unset($_POST["options_" . $key]);
1613
+				unset($_POST["options_".$key]);
1614 1614
 			}
1615 1615
 		}
1616 1616
 
@@ -1753,7 +1753,7 @@  discard block
 block discarded – undo
1753 1753
 			}
1754 1754
 		}
1755 1755
 	} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
1756
-		header('Location: ' . $_SERVER['PHP_SELF'] . '?id=' . $object->id); //  To re-display card in edit mode
1756
+		header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); //  To re-display card in edit mode
1757 1757
 		exit();
1758 1758
 	} elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) {
1759 1759
 		$idwarehouse = GETPOSTINT('idwarehouse');
@@ -1790,7 +1790,7 @@  discard block
 block discarded – undo
1790 1790
 					GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
1791 1791
 					&& isModEnabled('invoice') && $user->hasRight('facture', 'creer')
1792 1792
 				) {
1793
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1793
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1794 1794
 
1795 1795
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
1796 1796
 					$forceFields = array();
@@ -1803,7 +1803,7 @@  discard block
 block discarded – undo
1803 1803
 
1804 1804
 					if ($deposit) {
1805 1805
 						setEventMessage('DepositGenerated');
1806
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
1806
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
1807 1807
 					} else {
1808 1808
 						$error++;
1809 1809
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
 				}
1812 1812
 
1813 1813
 				// Define output language
1814
-				if (! $error) {
1814
+				if (!$error) {
1815 1815
 					$db->commit();
1816 1816
 
1817 1817
 					if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
 					}
1840 1840
 
1841 1841
 					if ($locationTarget) {
1842
-						header('Location: ' . $locationTarget);
1842
+						header('Location: '.$locationTarget);
1843 1843
 						exit;
1844 1844
 					}
1845 1845
 				} else {
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
 	}
1931 1931
 
1932 1932
 	if ($action == 'update_extras' && $permissiontoeditextra) {
1933
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
1933
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
1934 1934
 
1935 1935
 		$attribute_name = GETPOST('attribute', 'aZ09');
1936 1936
 
@@ -1966,13 +1966,13 @@  discard block
 block discarded – undo
1966 1966
 
1967 1967
 		if (!empty($importLines) && is_array($importLines) && !empty($fromElement) && ctype_alpha($fromElement) && !empty($fromElementid)) {
1968 1968
 			if ($fromElement == 'commande') {
1969
-				dol_include_once('/' . $fromElement . '/class/' . $fromElement . '.class.php');
1969
+				dol_include_once('/'.$fromElement.'/class/'.$fromElement.'.class.php');
1970 1970
 				$lineClassName = 'OrderLine';
1971 1971
 			} elseif ($fromElement == 'propal') {
1972
-				dol_include_once('/comm/' . $fromElement . '/class/' . $fromElement . '.class.php');
1972
+				dol_include_once('/comm/'.$fromElement.'/class/'.$fromElement.'.class.php');
1973 1973
 				$lineClassName = 'PropaleLigne';
1974 1974
 			} elseif ($fromElement == 'facture') {
1975
-				dol_include_once('/compta/' . $fromElement . '/class/' . $fromElement . '.class.php');
1975
+				dol_include_once('/compta/'.$fromElement.'/class/'.$fromElement.'.class.php');
1976 1976
 				$lineClassName = 'FactureLigne';
1977 1977
 			}
1978 1978
 			$nextRang = count($object->lines) + 1;
@@ -2032,19 +2032,19 @@  discard block
 block discarded – undo
2032 2032
 	}
2033 2033
 
2034 2034
 	// Actions when printing a doc from card
2035
-	include DOL_DOCUMENT_ROOT . '/core/actions_printing.inc.php';
2035
+	include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
2036 2036
 
2037 2037
 	// Actions to build doc
2038 2038
 	$upload_dir = !empty($conf->commande->multidir_output[$object->entity]) ? $conf->commande->multidir_output[$object->entity] : $conf->commande->dir_output;
2039 2039
 	$permissiontoadd = $usercancreate;
2040
-	include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
2040
+	include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
2041 2041
 
2042 2042
 	// Actions to send emails
2043 2043
 	$triggersendname = 'ORDER_SENTBYMAIL';
2044 2044
 	$paramname = 'id';
2045 2045
 	$autocopy = 'MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add
2046
-	$trackid = 'ord' . $object->id;
2047
-	include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
2046
+	$trackid = 'ord'.$object->id;
2047
+	include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
2048 2048
 
2049 2049
 
2050 2050
 	if (!$error && getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB') && $usercancreate) {
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 			}
2057 2057
 
2058 2058
 			if ($result >= 0) {
2059
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2059
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2060 2060
 				exit();
2061 2061
 			} else {
2062 2062
 				if ($object->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
@@ -2078,7 +2078,7 @@  discard block
 block discarded – undo
2078 2078
 			$result = $object->delete_contact($lineid);
2079 2079
 
2080 2080
 			if ($result >= 0) {
2081
-				header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
2081
+				header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
2082 2082
 				exit();
2083 2083
 			} else {
2084 2084
 				dol_print_error($db);
@@ -2092,7 +2092,7 @@  discard block
 block discarded – undo
2092 2092
  *	View
2093 2093
  */
2094 2094
 
2095
-$title = $object->ref . " - " . $langs->trans('Card');
2095
+$title = $object->ref." - ".$langs->trans('Card');
2096 2096
 if ($action == 'create') {
2097 2097
 	$title = $langs->trans("NewOrder");
2098 2098
 }
@@ -2165,11 +2165,11 @@  discard block
 block discarded – undo
2165 2165
 				$element = $subelement = 'contrat';
2166 2166
 			}
2167 2167
 
2168
-			dol_include_once('/' . $element . '/class/' . $subelement . '.class.php');
2168
+			dol_include_once('/'.$element.'/class/'.$subelement.'.class.php');
2169 2169
 
2170 2170
 			$classname = ucfirst($subelement);
2171 2171
 			$objectsrc = new $classname($db);
2172
-			'@phan-var-force Commande|Propal|Contrat $objectsrc';  // Can possibly be other class but CommonObject is too general
2172
+			'@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general
2173 2173
 			$objectsrc->fetch($originid);
2174 2174
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
2175 2175
 				$objectsrc->fetch_lines();
@@ -2263,16 +2263,16 @@  discard block
 block discarded – undo
2263 2263
 		}
2264 2264
 	}
2265 2265
 
2266
-	print '<form name="crea_commande" action="' . $_SERVER["PHP_SELF"] . '" method="POST">';
2267
-	print '<input type="hidden" name="token" value="' . newToken() . '">';
2266
+	print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
2267
+	print '<input type="hidden" name="token" value="'.newToken().'">';
2268 2268
 	print '<input type="hidden" name="action" value="add">';
2269
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
2270
-	print '<input type="hidden" name="remise_percent" value="' . $soc->remise_percent . '">';
2271
-	print '<input type="hidden" name="origin" value="' . $origin . '">';
2272
-	print '<input type="hidden" name="originid" value="' . $originid . '">';
2273
-	print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
2269
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
2270
+	print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
2271
+	print '<input type="hidden" name="origin" value="'.$origin.'">';
2272
+	print '<input type="hidden" name="originid" value="'.$originid.'">';
2273
+	print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
2274 2274
 	if (!empty($currency_tx)) {
2275
-		print '<input type="hidden" name="originmulticurrency_tx" value="' . $currency_tx . '">';
2275
+		print '<input type="hidden" name="originmulticurrency_tx" value="'.$currency_tx.'">';
2276 2276
 	}
2277 2277
 
2278 2278
 	print dol_get_fiche_head([]);
@@ -2285,29 +2285,29 @@  discard block
 block discarded – undo
2285 2285
 		print '<table class="border centpercent">';
2286 2286
 
2287 2287
 		// Reference
2288
-		print '<tr><td class="titlefieldcreate fieldrequired">' . $langs->trans('Ref') . '</td><td>' . $langs->trans("Draft") . '</td></tr>';
2288
+		print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans("Draft").'</td></tr>';
2289 2289
 
2290 2290
 		// Reference client
2291
-		print '<tr><td>' . $langs->trans('RefCustomer') . '</td><td>';
2291
+		print '<tr><td>'.$langs->trans('RefCustomer').'</td><td>';
2292 2292
 		if (getDolGlobalString('MAIN_USE_PROPAL_REFCLIENT_FOR_ORDER') && !empty($origin) && !empty($originid)) {
2293
-			print '<input type="text" name="ref_client" value="' . $ref_client . '"></td>';
2293
+			print '<input type="text" name="ref_client" value="'.$ref_client.'"></td>';
2294 2294
 		} else {
2295
-			print '<input type="text" name="ref_client" value="' . GETPOST('ref_client') . '"></td>';
2295
+			print '<input type="text" name="ref_client" value="'.GETPOST('ref_client').'"></td>';
2296 2296
 		}
2297 2297
 		print '</tr>';
2298 2298
 
2299 2299
 		// Thirdparty
2300 2300
 		print '<tr>';
2301
-		print '<td class="fieldrequired">' . $langs->trans('Customer') . '</td>';
2301
+		print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
2302 2302
 		if ($socid > 0) {
2303 2303
 			print '<td>';
2304 2304
 			print $soc->getNomUrl(1, 'customer');
2305
-			print '<input type="hidden" name="socid" value="' . $soc->id . '">';
2305
+			print '<input type="hidden" name="socid" value="'.$soc->id.'">';
2306 2306
 			print '</td>';
2307 2307
 		} else {
2308 2308
 			print '<td class="valuefieldcreate">';
2309 2309
 			$filter = '((s.client:IN:1,2,3) AND (s.status:=:1))';
2310
-			print img_picto('', 'company', 'class="pictofixedwidth"') . $form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
2310
+			print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company('', 'socid', $filter, 'SelectThirdParty', 1, 0, array(), 0, 'minwidth175 maxwidth500 widthcentpercentminusxx');
2311 2311
 			// reload page to retrieve customer information
2312 2312
 			if (!getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
2313 2313
 				print '<script>
@@ -2323,17 +2323,17 @@  discard block
 block discarded – undo
2323 2323
 				});
2324 2324
 				</script>';
2325 2325
 			}
2326
-			print ' <a href="' . DOL_URL_ROOT . '/societe/card.php?action=create&customer=3&fournisseur=0&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create') . '"><span class="fa fa-plus-circle valignmiddle paddingleft" title="' . $langs->trans("AddThirdParty") . '"></span></a>';
2326
+			print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&customer=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
2327 2327
 			print '</td>';
2328 2328
 		}
2329
-		print '</tr>' . "\n";
2329
+		print '</tr>'."\n";
2330 2330
 
2331 2331
 		// Contact of order
2332 2332
 		if ($socid > 0) {
2333 2333
 			// Contacts (ask contact only if thirdparty already defined).
2334 2334
 			// print "<tr><td>".$langs->trans("DefaultContact").'</td><td>';
2335 2335
 			print "<tr><td>";
2336
-			print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_" . $type_contact_code));
2336
+			print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_".$type_contact_code));
2337 2337
 			print '</td><td>';
2338 2338
 			print img_picto('', 'contact', 'class="pictofixedwidth"');
2339 2339
 			//print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx');
@@ -2341,26 +2341,26 @@  discard block
 block discarded – undo
2341 2341
 			print '</td></tr>';
2342 2342
 
2343 2343
 			// Ligne info remises tiers
2344
-			print '<tr><td>' . $langs->trans('Discounts') . '</td><td>';
2344
+			print '<tr><td>'.$langs->trans('Discounts').'</td><td>';
2345 2345
 
2346 2346
 			$absolute_discount = $soc->getAvailableDiscounts();
2347 2347
 
2348 2348
 			$thirdparty = $soc;
2349 2349
 			$discount_type = 0;
2350
-			$backtopage = $_SERVER["PHP_SELF"] . '?socid=' . $thirdparty->id . '&action=' . $action . '&origin=' . urlencode((string) (GETPOST('origin'))) . '&originid=' . urlencode((string) (GETPOSTINT('originid')));
2351
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
2350
+			$backtopage = $_SERVER["PHP_SELF"].'?socid='.$thirdparty->id.'&action='.$action.'&origin='.urlencode((string) (GETPOST('origin'))).'&originid='.urlencode((string) (GETPOSTINT('originid')));
2351
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
2352 2352
 
2353 2353
 			print '</td></tr>';
2354 2354
 		}
2355 2355
 
2356 2356
 		// Date
2357
-		print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td>';
2357
+		print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
2358 2358
 		print img_picto('', 'action', 'class="pictofixedwidth"');
2359 2359
 		print $form->selectDate('', 're', 0, 0, 0, "crea_commande", 1, 1); // Always autofill date with current date
2360 2360
 		print '</td></tr>';
2361 2361
 
2362 2362
 		// Date delivery planned
2363
-		print '<tr><td>' . $langs->trans("DateDeliveryPlanned") . '</td>';
2363
+		print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
2364 2364
 		print '<td colspan="3">';
2365 2365
 		$date_delivery = ($date_delivery ? $date_delivery : $object->delivery_date);
2366 2366
 		print img_picto('', 'action', 'class="pictofixedwidth"');
@@ -2369,33 +2369,33 @@  discard block
 block discarded – undo
2369 2369
 		print '</tr>';
2370 2370
 
2371 2371
 		// Delivery delay
2372
-		print '<tr class="fielddeliverydelay"><td>' . $langs->trans('AvailabilityPeriod') . '</td><td>';
2372
+		print '<tr class="fielddeliverydelay"><td>'.$langs->trans('AvailabilityPeriod').'</td><td>';
2373 2373
 		print img_picto('', 'clock', 'class="pictofixedwidth"');
2374 2374
 		$form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOST('availability_id') : $availability_id), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2375 2375
 		print '</td></tr>';
2376 2376
 
2377 2377
 		// Terms of payment
2378
-		print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td>';
2378
+		print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
2379 2379
 		print img_picto('', 'payment', 'class="pictofixedwidth"');
2380 2380
 		print $form->getSelectConditionsPaiements($cond_reglement_id, 'cond_reglement_id', 1, 1, 0, 'maxwidth200 widthcentpercentminusx', (float) $deposit_percent);
2381 2381
 		print '</td></tr>';
2382 2382
 
2383 2383
 		// Payment mode
2384
-		print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td>';
2384
+		print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
2385 2385
 		print img_picto('', 'bank', 'class="pictofixedwidth"');
2386 2386
 		print $form->select_types_paiements((string) $mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
2387 2387
 		print '</td></tr>';
2388 2388
 
2389 2389
 		// Bank Account
2390 2390
 		if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) {
2391
-			print '<tr><td>' . $langs->trans('BankAccount') . '</td><td>';
2392
-			print img_picto('', 'bank_account', 'class="pictofixedwidth"') . $form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2391
+			print '<tr><td>'.$langs->trans('BankAccount').'</td><td>';
2392
+			print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1);
2393 2393
 			print '</td></tr>';
2394 2394
 		}
2395 2395
 
2396 2396
 		// Shipping Method
2397 2397
 		if (isModEnabled('shipping')) {
2398
-			print '<tr><td>' . $langs->trans('SendingMethod') . '</td><td>';
2398
+			print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
2399 2399
 			print img_picto('', 'object_dolly', 'class="pictofixedwidth"');
2400 2400
 			$form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
2401 2401
 			print '</td></tr>';
@@ -2403,15 +2403,15 @@  discard block
 block discarded – undo
2403 2403
 
2404 2404
 		// Warehouse
2405 2405
 		if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
2406
-			require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2406
+			require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2407 2407
 			$formproduct = new FormProduct($db);
2408
-			print '<tr><td>' . $langs->trans('Warehouse') . '</td><td>';
2409
-			print img_picto('', 'stock', 'class="pictofixedwidth"') . $formproduct->selectWarehouses((GETPOSTISSET('warehouse_id') ? GETPOST('warehouse_id') : $warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2408
+			print '<tr><td>'.$langs->trans('Warehouse').'</td><td>';
2409
+			print img_picto('', 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses((GETPOSTISSET('warehouse_id') ? GETPOST('warehouse_id') : $warehouse_id), 'warehouse_id', '', 1, 0, 0, '', 0, 0, array(), 'maxwidth500 widthcentpercentminusxx');
2410 2410
 			print '</td></tr>';
2411 2411
 		}
2412 2412
 
2413 2413
 		// Source / Channel - What trigger creation
2414
-		print '<tr><td>' . $langs->trans('Source') . '</td><td>';
2414
+		print '<tr><td>'.$langs->trans('Source').'</td><td>';
2415 2415
 		print img_picto('', 'question', 'class="pictofixedwidth"');
2416 2416
 		$form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOST('demand_reason_id') : $demand_reason_id), 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');
2417 2417
 		print '</td></tr>';
@@ -2422,9 +2422,9 @@  discard block
 block discarded – undo
2422 2422
 		if (isModEnabled('project')) {
2423 2423
 			$langs->load("projects");
2424 2424
 			print '<tr>';
2425
-			print '<td>' . $langs->trans("Project") . '</td><td>';
2426
-			print img_picto('', 'project', 'class="pictofixedwidth"') . $formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2427
-			print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create&status=1&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?action=create&socid=' . $soc->id) . '"><span class="fa fa-plus-circle valignmiddle" title="' . $langs->trans("AddProject") . '"></span></a>';
2425
+			print '<td>'.$langs->trans("Project").'</td><td>';
2426
+			print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (GETPOSTISSET('projectid') ? GETPOST('projectid') : $projectid), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
2427
+			print ' <a href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$soc->id.'&action=create&status=1&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create&socid='.$soc->id).'"><span class="fa fa-plus-circle valignmiddle" title="'.$langs->trans("AddProject").'"></span></a>';
2428 2428
 			print '</td>';
2429 2429
 			print '</tr>';
2430 2430
 		}
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
 		// Incoterms
2433 2433
 		if (isModEnabled('incoterm')) {
2434 2434
 			print '<tr>';
2435
-			print '<td><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->fk_incoterms) ? (string) $objectsrc->fk_incoterms : (string) $soc->fk_incoterms, 1) . '</label></td>';
2435
+			print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->fk_incoterms) ? (string) $objectsrc->fk_incoterms : (string) $soc->fk_incoterms, 1).'</label></td>';
2436 2436
 			print '<td class="maxwidthonsmartphone">';
2437 2437
 			$incoterm_id = GETPOST('incoterm_id');
2438 2438
 			$location_incoterms = GETPOST('location_incoterms');
@@ -2448,7 +2448,7 @@  discard block
 block discarded – undo
2448 2448
 		// Other attributes
2449 2449
 		$parameters = array();
2450 2450
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
2451
-			$parameters['objectsrc'] =  $objectsrc;
2451
+			$parameters['objectsrc'] = $objectsrc;
2452 2452
 		}
2453 2453
 		$parameters['socid'] = $socid;
2454 2454
 
@@ -2469,9 +2469,9 @@  discard block
 block discarded – undo
2469 2469
 		}
2470 2470
 
2471 2471
 		// Template to use by default
2472
-		print '<tr><td>' . $langs->trans('DefaultModel') . '</td>';
2472
+		print '<tr><td>'.$langs->trans('DefaultModel').'</td>';
2473 2473
 		print '<td>';
2474
-		include_once DOL_DOCUMENT_ROOT . '/core/modules/commande/modules_commande.php';
2474
+		include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php';
2475 2475
 		$liste = ModelePDFCommandes::liste_modeles($db);
2476 2476
 		$preselected = getDolGlobalString('COMMANDE_ADDON_PDF');
2477 2477
 		print img_picto('', 'pdf', 'class="pictofixedwidth"');
@@ -2481,22 +2481,22 @@  discard block
 block discarded – undo
2481 2481
 		// Multicurrency
2482 2482
 		if (isModEnabled("multicurrency")) {
2483 2483
 			print '<tr>';
2484
-			print '<td>' . $form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0) . '</td>';
2484
+			print '<td>'.$form->editfieldkey("Currency", 'multicurrency_code', '', $object, 0).'</td>';
2485 2485
 			print '<td class="maxwidthonsmartphone">';
2486
-			print img_picto('', 'currency', 'class="pictofixedwidth"') . $form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2486
+			print img_picto('', 'currency', 'class="pictofixedwidth"').$form->selectMultiCurrency(((GETPOSTISSET('multicurrency_code') && !GETPOST('changecompany')) ? GETPOST('multicurrency_code') : $currency_code), 'multicurrency_code', 0, '', false, 'maxwidth200 widthcentpercentminusx');
2487 2487
 			print '</td></tr>';
2488 2488
 		}
2489 2489
 
2490 2490
 		// Categories
2491 2491
 		if (!empty($conf->categorie->enabled)) {
2492
-			print '<tr><td>' . $langs->trans("Categories") . '</td><td colspan="3">';
2492
+			print '<tr><td>'.$langs->trans("Categories").'</td><td colspan="3">';
2493 2493
 			print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
2494 2494
 			print "</td></tr>";
2495 2495
 		}
2496 2496
 
2497 2497
 		// Note public
2498 2498
 		print '<tr>';
2499
-		print '<td class="tdtop">' . $langs->trans('NotePublic') . '</td>';
2499
+		print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
2500 2500
 		print '<td>';
2501 2501
 
2502 2502
 		$doleditor = new DolEditor('note_public', (string) $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
@@ -2507,7 +2507,7 @@  discard block
 block discarded – undo
2507 2507
 		// Note private
2508 2508
 		if (empty($user->socid)) {
2509 2509
 			print '<tr>';
2510
-			print '<td class="tdtop">' . $langs->trans('NotePrivate') . '</td>';
2510
+			print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
2511 2511
 			print '<td>';
2512 2512
 
2513 2513
 			$doleditor = new DolEditor('note_private', (string) $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
@@ -2525,13 +2525,13 @@  discard block
 block discarded – undo
2525 2525
 				$objectsrc->update_price(1);
2526 2526
 			}
2527 2527
 
2528
-			print "\n<!-- " . $classname . " info -->";
2528
+			print "\n<!-- ".$classname." info -->";
2529 2529
 			print "\n";
2530
-			print '<input type="hidden" name="amount"         value="' . $objectsrc->total_ht . '">' . "\n";
2531
-			print '<input type="hidden" name="total"          value="' . $objectsrc->total_ttc . '">' . "\n";
2532
-			print '<input type="hidden" name="tva"            value="' . $objectsrc->total_tva . '">' . "\n";
2533
-			print '<input type="hidden" name="origin"         value="' . $objectsrc->element . '">';
2534
-			print '<input type="hidden" name="originid"       value="' . $objectsrc->id . '">';
2530
+			print '<input type="hidden" name="amount"         value="'.$objectsrc->total_ht.'">'."\n";
2531
+			print '<input type="hidden" name="total"          value="'.$objectsrc->total_ttc.'">'."\n";
2532
+			print '<input type="hidden" name="tva"            value="'.$objectsrc->total_tva.'">'."\n";
2533
+			print '<input type="hidden" name="origin"         value="'.$objectsrc->element.'">';
2534
+			print '<input type="hidden" name="originid"       value="'.$objectsrc->id.'">';
2535 2535
 
2536 2536
 			switch ($classname) {
2537 2537
 				case 'Propal':
@@ -2550,25 +2550,25 @@  discard block
 block discarded – undo
2550 2550
 					$newclassname = $classname;
2551 2551
 			}
2552 2552
 
2553
-			print '<tr><td>' . $langs->trans($newclassname) . '</td><td>' . $objectsrc->getNomUrl(1) . '</td></tr>';
2553
+			print '<tr><td>'.$langs->trans($newclassname).'</td><td>'.$objectsrc->getNomUrl(1).'</td></tr>';
2554 2554
 
2555 2555
 			// Amount
2556
-			print '<tr><td>' . $langs->trans('AmountHT') . '</td><td>' . price($objectsrc->total_ht) . '</td></tr>';
2557
-			print '<tr><td>' . $langs->trans('AmountVAT') . '</td><td>' . price($objectsrc->total_tva) . "</td></tr>";
2556
+			print '<tr><td>'.$langs->trans('AmountHT').'</td><td>'.price($objectsrc->total_ht).'</td></tr>';
2557
+			print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($objectsrc->total_tva)."</td></tr>";
2558 2558
 			if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) { 		// Localtax1 RE
2559
-				print '<tr><td>' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax1) . "</td></tr>";
2559
+				print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax1)."</td></tr>";
2560 2560
 			}
2561 2561
 
2562 2562
 			if ($mysoc->localtax2_assuj == "1" || $objectsrc->total_localtax2 != 0) { 		// Localtax2 IRPF
2563
-				print '<tr><td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td><td>' . price($objectsrc->total_localtax2) . "</td></tr>";
2563
+				print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td><td>'.price($objectsrc->total_localtax2)."</td></tr>";
2564 2564
 			}
2565 2565
 
2566
-			print '<tr><td>' . $langs->trans('AmountTTC') . '</td><td>' . price($objectsrc->total_ttc) . "</td></tr>";
2566
+			print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($objectsrc->total_ttc)."</td></tr>";
2567 2567
 
2568 2568
 			if (isModEnabled("multicurrency")) {
2569
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountHT') . '</td><td>' . price($objectsrc->multicurrency_total_ht) . '</td></tr>';
2570
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountVAT') . '</td><td>' . price($objectsrc->multicurrency_total_tva) . "</td></tr>";
2571
-				print '<tr><td>' . $langs->trans('MulticurrencyAmountTTC') . '</td><td>' . price($objectsrc->multicurrency_total_ttc) . "</td></tr>";
2569
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td>'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
2570
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td>'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
2571
+				print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td>'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
2572 2572
 			}
2573 2573
 		}
2574 2574
 
@@ -2619,7 +2619,7 @@  discard block
 block discarded – undo
2619 2619
 
2620 2620
 		// Confirmation to delete
2621 2621
 		if ($action == 'delete') {
2622
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
2622
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
2623 2623
 		}
2624 2624
 
2625 2625
 		// Confirmation of validation
@@ -2638,7 +2638,7 @@  discard block
 block discarded – undo
2638 2638
 
2639 2639
 			$text = $langs->trans('ConfirmValidateOrder', $numref);
2640 2640
 			if (isModEnabled('notification')) {
2641
-				require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
2641
+				require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
2642 2642
 				$notify = new Notify($db);
2643 2643
 				$text .= '<br>';
2644 2644
 				$text .= $notify->confirmMessage('ORDER_VALIDATE', $object->socid, $object);
@@ -2654,7 +2654,7 @@  discard block
 block discarded – undo
2654 2654
 			$formquestion = array();
2655 2655
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2656 2656
 				$langs->load("stocks");
2657
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2657
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2658 2658
 				$formproduct = new FormProduct($db);
2659 2659
 				$forcecombo = 0;
2660 2660
 				if ($conf->browser->name == 'ie') {
@@ -2672,7 +2672,7 @@  discard block
 block discarded – undo
2672 2672
 			$nbMandated = 0;
2673 2673
 			foreach ($object->lines as $line) {
2674 2674
 				$res = $line->fetch_product();
2675
-				if ($res  > 0) {
2675
+				if ($res > 0) {
2676 2676
 					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2677 2677
 						$nbMandated++;
2678 2678
 						break;
@@ -2684,7 +2684,7 @@  discard block
 block discarded – undo
2684 2684
 					setEventMessages($langs->trans("mandatoryPeriodNeedTobeSetMsgValidate"), null, 'errors');
2685 2685
 					$error++;
2686 2686
 				} else {
2687
-					$text .= '<div><span class="clearboth nowraponall warning">' . img_warning() . $langs->trans("mandatoryPeriodNeedTobeSetMsgValidate") . '</span></div>';
2687
+					$text .= '<div><span class="clearboth nowraponall warning">'.img_warning().$langs->trans("mandatoryPeriodNeedTobeSetMsgValidate").'</span></div>';
2688 2688
 				}
2689 2689
 			}
2690 2690
 
@@ -2696,7 +2696,7 @@  discard block
 block discarded – undo
2696 2696
 				$deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2697 2697
 
2698 2698
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2699
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2699
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2700 2700
 
2701 2701
 					$object->fetchObjectLinked();
2702 2702
 
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
 			}
2801 2801
 
2802 2802
 			if (!$error) {
2803
-				$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240);
2803
+				$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 240);
2804 2804
 			}
2805 2805
 		}
2806 2806
 
@@ -2817,7 +2817,7 @@  discard block
 block discarded – undo
2817 2817
 			$formquestion = array();
2818 2818
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2819 2819
 				$langs->load("stocks");
2820
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2820
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2821 2821
 				$formproduct = new FormProduct($db);
2822 2822
 				$forcecombo = 0;
2823 2823
 				if ($conf->browser->name == 'ie') {
@@ -2831,12 +2831,12 @@  discard block
 block discarded – undo
2831 2831
 				);
2832 2832
 			}
2833 2833
 
2834
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
2834
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
2835 2835
 		}
2836 2836
 
2837 2837
 		// Confirmation of closing
2838 2838
 		if ($action == 'shipped') {
2839
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
2839
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
2840 2840
 		}
2841 2841
 
2842 2842
 		// Confirmation of cancellation
@@ -2852,7 +2852,7 @@  discard block
 block discarded – undo
2852 2852
 			$formquestion = array();
2853 2853
 			if (isModEnabled('stock') && getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER') && $qualified_for_stock_change) {
2854 2854
 				$langs->load("stocks");
2855
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
2855
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
2856 2856
 				$formproduct = new FormProduct($db);
2857 2857
 				$forcecombo = 0;
2858 2858
 				if ($conf->browser->name == 'ie') {
@@ -2866,12 +2866,12 @@  discard block
 block discarded – undo
2866 2866
 				);
2867 2867
 			}
2868 2868
 
2869
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1);
2869
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("Cancel"), $text, 'confirm_cancel', $formquestion, 0, 1);
2870 2870
 		}
2871 2871
 
2872 2872
 		// Confirmation to delete line
2873 2873
 		if ($action == 'ask_deleteline') {
2874
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2874
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
2875 2875
 		}
2876 2876
 
2877 2877
 		// Confirmation de la suppression d'une ligne subtotal
@@ -2884,7 +2884,7 @@  discard block
 block discarded – undo
2884 2884
 				$title = "DeleteTitleLine";
2885 2885
 				$question = "ConfirmDeleteTitleLine";
2886 2886
 			}
2887
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2887
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans($title), $langs->trans($question), 'confirm_delete_subtotalline', $formconfirm, 'no', 1);
2888 2888
 		}
2889 2889
 
2890 2890
 		// Clone confirmation
@@ -2894,7 +2894,7 @@  discard block
 block discarded – undo
2894 2894
 			$formquestion = array(
2895 2895
 				array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, array(), 0, 'maxwidth300'))
2896 2896
 			);
2897
-			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
2897
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
2898 2898
 		}
2899 2899
 
2900 2900
 		// Subtotal line form
@@ -2926,16 +2926,16 @@  discard block
 block discarded – undo
2926 2926
 
2927 2927
 		// Order card
2928 2928
 
2929
-		$linkback = '<a href="' . DOL_URL_ROOT . '/commande/list.php?restore_lastsearch_values=1' . (!empty($socid) ? '&socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
2929
+		$linkback = '<a href="'.DOL_URL_ROOT.'/commande/list.php?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
2930 2930
 
2931 2931
 		$morehtmlref = '<div class="refidno">';
2932 2932
 		// Ref customer
2933 2933
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string', '', 0, 1);
2934
-		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string' . (isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2934
+		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2935 2935
 		// Thirdparty
2936
-		$morehtmlref .= '<br>' . $soc->getNomUrl(1, 'customer');
2936
+		$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2937 2937
 		if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
2938
-			$morehtmlref .= ' (<a href="' . DOL_URL_ROOT . '/commande/list.php?socid=' . $object->thirdparty->id . '&search_societe=' . urlencode($object->thirdparty->name) . '">' . $langs->trans("OtherOrders") . '</a>)';
2938
+			$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
2939 2939
 		}
2940 2940
 		// Project
2941 2941
 		if (isModEnabled('project')) {
@@ -2944,16 +2944,16 @@  discard block
 block discarded – undo
2944 2944
 			if ($usercancreate) {
2945 2945
 				$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
2946 2946
 				if ($action != 'classify') {
2947
-					$morehtmlref .= '<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
2947
+					$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
2948 2948
 				}
2949
-				$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
2949
+				$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
2950 2950
 			} else {
2951 2951
 				if (!empty($object->fk_project)) {
2952 2952
 					$proj = new Project($db);
2953 2953
 					$proj->fetch($object->fk_project);
2954 2954
 					$morehtmlref .= $proj->getNomUrl(1);
2955 2955
 					if ($proj->title) {
2956
-						$morehtmlref .= '<span class="opacitymedium"> - ' . dol_escape_htmltag($proj->title) . '</span>';
2956
+						$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
2957 2957
 					}
2958 2958
 				}
2959 2959
 			}
@@ -2982,20 +2982,20 @@  discard block
 block discarded – undo
2982 2982
 				print $form->textwithpicto($langs->trans('PointOfSale'), $langs->trans('POSInfo'));
2983 2983
 				print '</td>';
2984 2984
 				if ($action != 'editposinfo' && $usercancreate) {
2985
-					print '<td class="right"><a class="editfielda" href="' . $_SERVER["PHP_SELF"] . '?action=editposinfo&token=' . newToken() . '&id=' . $object->id . '">' . img_edit($langs->trans('SetPOSInfo'), 1) . '</a></td>';
2985
+					print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editposinfo&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetPOSInfo'), 1).'</a></td>';
2986 2986
 				}
2987 2987
 				print '</tr></table>';
2988 2988
 				print '</td><td class="valuefield fieldname_type">';
2989
-				print '<form method="POST" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" name="formposinfo">';
2989
+				print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="formposinfo">';
2990 2990
 				print '<input type="hidden" name="action" value="setposinfo">';
2991
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
2991
+				print '<input type="hidden" name="token" value="'.newToken().'">';
2992 2992
 				if ($action == 'editposinfo') {
2993
-					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="' . $langs->trans("POSModule") . '" value="' . $object->module_source . '"> ';
2994
-					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="' . $langs->trans("Terminal") . '" value="' . $object->pos_source . '">';
2995
-					print '<input type="submit" class="button" name="submitposinfo" value="' . $langs->trans("Submit") . '">';
2993
+					print '<input type="text" class="maxwidth150" name="posmodule" placeholder="'.$langs->trans("POSModule").'" value="'.$object->module_source.'"> ';
2994
+					print '<input type="text" class="maxwidth100" name="posterminal" placeholder="'.$langs->trans("Terminal").'" value="'.$object->pos_source.'">';
2995
+					print '<input type="submit" class="button" name="submitposinfo" value="'.$langs->trans("Submit").'">';
2996 2996
 				} else {
2997 2997
 					if ($object->module_source) {
2998
-						print '<span class="opacitymediumbycolor paddingleft">' . dolPrintHTML(ucfirst($object->module_source) . ' - ' . $langs->transnoentitiesnoconv("Terminal") . ' ' . $object->pos_source) . '</span>';
2998
+						print '<span class="opacitymediumbycolor paddingleft">'.dolPrintHTML(ucfirst($object->module_source).' - '.$langs->transnoentitiesnoconv("Terminal").' '.$object->pos_source).'</span>';
2999 2999
 					}
3000 3000
 				}
3001 3001
 				print '</form>';
@@ -3008,7 +3008,7 @@  discard block
 block discarded – undo
3008 3008
 				print $langs->trans('OutstandingBill');
3009 3009
 				print '</td><td class="valuefield">';
3010 3010
 				$arrayoutstandingbills = $soc->getOutstandingBills();
3011
-				print price($arrayoutstandingbills['opened']) . ' / ';
3011
+				print price($arrayoutstandingbills['opened']).' / ';
3012 3012
 				print price($soc->outstanding_limit, 0, '', 1, -1, -1, $conf->currency);
3013 3013
 				print '</td>';
3014 3014
 				print '</tr>';
@@ -3023,11 +3023,11 @@  discard block
 block discarded – undo
3023 3023
 				$filtercreditnote = "fk_facture_source IS NOT NULL AND (description NOT LIKE '(DEPOSIT)%' OR description LIKE '(EXCESS RECEIVED)%')";
3024 3024
 			}
3025 3025
 
3026
-			$addrelativediscount = '<a href="' . DOL_URL_ROOT . '/comm/remise.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditRelativeDiscounts") . '</a>';
3027
-			$addabsolutediscount = '<a href="' . DOL_URL_ROOT . '/comm/remx.php?id=' . $soc->id . '&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("EditGlobalDiscounts") . '</a>';
3028
-			$addcreditnote = '<a href="' . DOL_URL_ROOT . '/compta/facture/card.php?action=create&socid=' . $soc->id . '&type=2&backtopage=' . urlencode($_SERVER["PHP_SELF"]) . '?facid=' . $object->id . '">' . $langs->trans("AddCreditNote") . '</a>';
3026
+			$addrelativediscount = '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditRelativeDiscounts").'</a>';
3027
+			$addabsolutediscount = '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$soc->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("EditGlobalDiscounts").'</a>';
3028
+			$addcreditnote = '<a href="'.DOL_URL_ROOT.'/compta/facture/card.php?action=create&socid='.$soc->id.'&type=2&backtopage='.urlencode($_SERVER["PHP_SELF"]).'?facid='.$object->id.'">'.$langs->trans("AddCreditNote").'</a>';
3029 3029
 
3030
-			print '<tr><td class="titlefield">' . $langs->trans('Discounts') . '</td><td class="valuefield">';
3030
+			print '<tr><td class="titlefield">'.$langs->trans('Discounts').'</td><td class="valuefield">';
3031 3031
 
3032 3032
 			$absolute_discount = $soc->getAvailableDiscounts(null, $filterabsolutediscount);
3033 3033
 			$absolute_creditnote = $soc->getAvailableDiscounts(null, $filtercreditnote);
@@ -3036,8 +3036,8 @@  discard block
 block discarded – undo
3036 3036
 
3037 3037
 			$thirdparty = $soc;
3038 3038
 			$discount_type = 0;
3039
-			$backtopage = $_SERVER["PHP_SELF"] . '?id=' . $object->id;
3040
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_discounts.tpl.php';
3039
+			$backtopage = $_SERVER["PHP_SELF"].'?id='.$object->id;
3040
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_discounts.tpl.php';
3041 3041
 
3042 3042
 			print '</td></tr>';
3043 3043
 
@@ -3047,17 +3047,17 @@  discard block
 block discarded – undo
3047 3047
 			print $form->editfieldkey("Date", 'date', '', $object, (int) $editenable);
3048 3048
 			print '</td><td class="valuefield">';
3049 3049
 			if ($action == 'editdate') {
3050
-				print '<form name="setdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3051
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3050
+				print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3051
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3052 3052
 				print '<input type="hidden" name="action" value="setdate">';
3053
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3053
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3054 3054
 				print $form->selectDate($object->date, 'order_', 0, 0, 0, "setdate");
3055
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3055
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3056 3056
 				print '</form>';
3057 3057
 			} else {
3058 3058
 				print $object->date ? dol_print_date($object->date, 'day') : '&nbsp;';
3059 3059
 				if ($object->hasDelay() && empty($object->delivery_date)) {	// If there is a delivery date planned, warning should be on this date
3060
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3060
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3061 3061
 				}
3062 3062
 			}
3063 3063
 			print '</td>';
@@ -3069,17 +3069,17 @@  discard block
 block discarded – undo
3069 3069
 			print $form->editfieldkey("DateDeliveryPlanned", 'date_livraison', '', $object, (int) $editenable);
3070 3070
 			print '</td><td class="valuefield">';
3071 3071
 			if ($action == 'editdate_livraison') {
3072
-				print '<form name="setdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
3073
-				print '<input type="hidden" name="token" value="' . newToken() . '">';
3072
+				print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
3073
+				print '<input type="hidden" name="token" value="'.newToken().'">';
3074 3074
 				print '<input type="hidden" name="action" value="setdate_livraison">';
3075
-				print '<input type="hidden" name="backtopage" value="' . $backtopage . '">';
3075
+				print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
3076 3076
 				print $form->selectDate($object->delivery_date ? $object->delivery_date : -1, 'liv_', 1, 1, 0, "setdate_livraison", 1, 0);
3077
-				print '<input type="submit" class="button button-edit" value="' . $langs->trans('Modify') . '">';
3077
+				print '<input type="submit" class="button button-edit" value="'.$langs->trans('Modify').'">';
3078 3078
 				print '</form>';
3079 3079
 			} else {
3080 3080
 				print $object->delivery_date ? dol_print_date($object->delivery_date, 'dayhour') : '&nbsp;';
3081 3081
 				if ($object->hasDelay() && !empty($object->delivery_date)) {
3082
-					print ' ' . img_picto($langs->trans("Late") . ' : ' . $object->showDelay(), "warning");
3082
+					print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
3083 3083
 				}
3084 3084
 			}
3085 3085
 			print '</td>';
@@ -3091,9 +3091,9 @@  discard block
 block discarded – undo
3091 3091
 			print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, (int) $editenable);
3092 3092
 			print '</td><td class="valuefield">';
3093 3093
 			if ($action == 'editavailability') {
3094
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'availability_id', 1);
3094
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'availability_id', 1);
3095 3095
 			} else {
3096
-				$form->form_availability($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->availability_id, 'none', 1);
3096
+				$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->availability_id, 'none', 1);
3097 3097
 			}
3098 3098
 			print '</td></tr>';
3099 3099
 
@@ -3104,9 +3104,9 @@  discard block
 block discarded – undo
3104 3104
 				print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, (int) $editenable);
3105 3105
 				print '</td><td class="valuefield">';
3106 3106
 				if ($action == 'editshippingmethod') {
3107
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3107
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'shipping_method_id', 1);
3108 3108
 				} else {
3109
-					$form->formSelectShippingMethod($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->shipping_method_id, 'none');
3109
+					$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->shipping_method_id, 'none');
3110 3110
 				}
3111 3111
 				print '</td>';
3112 3112
 				print '</tr>';
@@ -3115,16 +3115,16 @@  discard block
 block discarded – undo
3115 3115
 			// Warehouse
3116 3116
 			if (isModEnabled('stock') && getDolGlobalString('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')) {
3117 3117
 				$langs->load('stocks');
3118
-				require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php';
3118
+				require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
3119 3119
 				$formproduct = new FormProduct($db);
3120 3120
 				print '<tr><td>';
3121 3121
 				$editenable = $usercancreate;
3122 3122
 				print $form->editfieldkey("Warehouse", 'warehouse', '', $object, (int) $editenable);
3123 3123
 				print '</td><td class="valuefield">';
3124 3124
 				if ($action == 'editwarehouse') {
3125
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'warehouse_id', 1);
3125
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'warehouse_id', 1);
3126 3126
 				} else {
3127
-					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->warehouse_id, 'none');
3127
+					$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->warehouse_id, 'none');
3128 3128
 				}
3129 3129
 				print '</td>';
3130 3130
 				print '</tr>';
@@ -3136,9 +3136,9 @@  discard block
 block discarded – undo
3136 3136
 			print $form->editfieldkey("Source", 'demandreason', '', $object, (int) $editenable);
3137 3137
 			print '</td><td class="valuefield">';
3138 3138
 			if ($action == 'editdemandreason') {
3139
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3139
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'demand_reason_id', 1);
3140 3140
 			} else {
3141
-				$form->formInputReason($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->demand_reason_id, 'none');
3141
+				$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->demand_reason_id, 'none');
3142 3142
 			}
3143 3143
 			print '</td></tr>';
3144 3144
 
@@ -3148,9 +3148,9 @@  discard block
 block discarded – undo
3148 3148
 			print $form->editfieldkey("PaymentConditionsShort", 'conditions', '', $object, (int) $editenable);
3149 3149
 			print '</td><td class="valuefield">';
3150 3150
 			if ($action == 'editconditions') {
3151
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3151
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'cond_reglement_id', 1, '', 1, $object->deposit_percent);
3152 3152
 			} else {
3153
-				$form->form_conditions_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3153
+				$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->cond_reglement_id, 'none', 1, '', 1, $object->deposit_percent);
3154 3154
 			}
3155 3155
 			print '</td>';
3156 3156
 
@@ -3162,9 +3162,9 @@  discard block
 block discarded – undo
3162 3162
 			print $form->editfieldkey("PaymentMode", 'mode', '', $object, (int) $editenable);
3163 3163
 			print '</td><td class="valuefield">';
3164 3164
 			if ($action == 'editmode') {
3165
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3165
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
3166 3166
 			} else {
3167
-				$form->form_modes_reglement($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->mode_reglement_id, 'none');
3167
+				$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->mode_reglement_id, 'none');
3168 3168
 			}
3169 3169
 			print '</td></tr>';
3170 3170
 
@@ -3186,13 +3186,13 @@  discard block
 block discarded – undo
3186 3186
 			$totalWeight = $tmparray['weight'];
3187 3187
 			$totalVolume = $tmparray['volume'];
3188 3188
 			if ($totalWeight) {
3189
-				print '<tr><td>' . $langs->trans("CalculatedWeight") . '</td>';
3189
+				print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
3190 3190
 				print '<td class="valuefield">';
3191 3191
 				print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
3192 3192
 				print '</td></tr>';
3193 3193
 			}
3194 3194
 			if ($totalVolume) {
3195
-				print '<tr><td>' . $langs->trans("CalculatedVolume") . '</td>';
3195
+				print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
3196 3196
 				print '<td class="valuefield">';
3197 3197
 				print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no');
3198 3198
 				print '</td></tr>';
@@ -3210,7 +3210,7 @@  discard block
 block discarded – undo
3210 3210
 				if ($action != 'editincoterm') {
3211 3211
 					print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
3212 3212
 				} else {
3213
-					print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'] . '?id=' . $object->id);
3213
+					print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
3214 3214
 				}
3215 3215
 				print '</td></tr>';
3216 3216
 			}
@@ -3222,9 +3222,9 @@  discard block
 block discarded – undo
3222 3222
 				print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, (int) $editenable);
3223 3223
 				print '</td><td class="valuefield">';
3224 3224
 				if ($action == 'editbankaccount') {
3225
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'fk_account', 1);
3225
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'fk_account', 1);
3226 3226
 				} else {
3227
-					$form->formSelectAccount($_SERVER['PHP_SELF'] . '?id=' . $object->id, (string) $object->fk_account, 'none');
3227
+					$form->formSelectAccount($_SERVER['PHP_SELF'].'?id='.$object->id, (string) $object->fk_account, 'none');
3228 3228
 				}
3229 3229
 				print '</td>';
3230 3230
 				print '</tr>';
@@ -3237,7 +3237,7 @@  discard block
 block discarded – undo
3237 3237
 				print $langs->trans("Categories");
3238 3238
 				print '<td><td class="right">';
3239 3239
 				if ($usercancreate) {
3240
-					print '<a class="editfielda" href="' . DOL_URL_ROOT . '/commande/card.php?id=' . $object->id . '&action=edittags&token=' . newToken() . '">' . img_edit() . '</a>';
3240
+					print '<a class="editfielda" href="'.DOL_URL_ROOT.'/commande/card.php?id='.$object->id.'&action=edittags&token='.newToken().'">'.img_edit().'</a>';
3241 3241
 				} else {
3242 3242
 					print '&nbsp;';
3243 3243
 				}
@@ -3245,11 +3245,11 @@  discard block
 block discarded – undo
3245 3245
 				print '</td>';
3246 3246
 				print '<td>';
3247 3247
 				if ($action == 'edittags') {
3248
-					print '<form method="POST" action="' . $_SERVER['PHP_SELF'] . '?id=' . $object->id . '">';
3248
+					print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
3249 3249
 					print '<input type="hidden" name="action" value="settags">';
3250
-					print '<input type="hidden" name="token" value="' . newToken() . '">';
3250
+					print '<input type="hidden" name="token" value="'.newToken().'">';
3251 3251
 					print $form->selectCategories(Categorie::TYPE_ORDER, 'categories', $object);
3252
-					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="' . $langs->trans("Modify") . '">';
3252
+					print '<input type="submit" class="button valignmiddle smallpaddingimp" value="'.$langs->trans("Modify").'">';
3253 3253
 					print '</form>';
3254 3254
 				} else {
3255 3255
 					print $form->showCategories($object->id, Categorie::TYPE_ORDER, 1);
@@ -3258,7 +3258,7 @@  discard block
 block discarded – undo
3258 3258
 			}
3259 3259
 
3260 3260
 			// Other attributes
3261
-			include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
3261
+			include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
3262 3262
 
3263 3263
 			print '</table>';
3264 3264
 
@@ -3268,40 +3268,40 @@  discard block
 block discarded – undo
3268 3268
 
3269 3269
 			print '<table class="border tableforfield centpercent">';
3270 3270
 
3271
-			include DOL_DOCUMENT_ROOT . '/core/tpl/object_currency_amount.tpl.php';
3271
+			include DOL_DOCUMENT_ROOT.'/core/tpl/object_currency_amount.tpl.php';
3272 3272
 
3273 3273
 			$alert = '';
3274 3274
 			if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) {
3275
-				$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
3275
+				$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
3276 3276
 			}
3277 3277
 
3278 3278
 			print '<tr>';
3279
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
3280
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3279
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
3280
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3281 3281
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3282 3282
 				// Multicurrency Amount HT
3283
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3283
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3284 3284
 			}
3285 3285
 			print '</tr>';
3286 3286
 
3287 3287
 			print '<tr>';
3288
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
3289
-			print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3288
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
3289
+			print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3290 3290
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3291 3291
 				// Multicurrency Amount VAT
3292
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3292
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3293 3293
 			}
3294 3294
 			print '</tr>';
3295 3295
 
3296 3296
 			// Amount Local Taxes
3297 3297
 			if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
3298 3298
 				print '<tr>';
3299
-				print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
3300
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3299
+				print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
3300
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3301 3301
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3302 3302
 					$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
3303 3303
 
3304
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3304
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3305 3305
 				}
3306 3306
 				print '</tr>';
3307 3307
 			}
@@ -3309,24 +3309,24 @@  discard block
 block discarded – undo
3309 3309
 			// Amount Local Taxes
3310 3310
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
3311 3311
 				print '<tr>';
3312
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
3313
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
3312
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
3313
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
3314 3314
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3315 3315
 					$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
3316 3316
 
3317
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
3317
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
3318 3318
 				}
3319 3319
 				print '</tr>';
3320 3320
 			}
3321 3321
 
3322 3322
 			print '<tr>';
3323
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
3324
-			print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
3323
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
3324
+			print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
3325 3325
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
3326 3326
 				// Multicurrency Amount TTC
3327
-				print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
3327
+				print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
3328 3328
 			}
3329
-			print '</tr>' . "\n";
3329
+			print '</tr>'."\n";
3330 3330
 
3331 3331
 			print '</table>';
3332 3332
 
@@ -3347,13 +3347,13 @@  discard block
 block discarded – undo
3347 3347
 			if (getDolGlobalString('MAIN_DISABLE_CONTACTS_TAB')) {
3348 3348
 				$blocname = 'contacts';
3349 3349
 				$title = $langs->trans('ContactsAddresses');
3350
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3350
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3351 3351
 			}
3352 3352
 
3353 3353
 			if (getDolGlobalString('MAIN_DISABLE_NOTES_TAB')) {
3354 3354
 				$blocname = 'notes';
3355 3355
 				$title = $langs->trans('Notes');
3356
-				include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_showhide.tpl.php';
3356
+				include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
3357 3357
 			}
3358 3358
 
3359 3359
 			/*
@@ -3368,20 +3368,20 @@  discard block
 block discarded – undo
3368 3368
 			global $inputalsopricewithtax;
3369 3369
 			$inputalsopricewithtax = 1;
3370 3370
 
3371
-			print '<form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="POST">
3372
-			<input type="hidden" name="token" value="' . newToken() . '">
3373
-			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
3371
+			print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="POST">
3372
+			<input type="hidden" name="token" value="' . newToken().'">
3373
+			<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
3374 3374
 			<input type="hidden" name="mode" value="">
3375 3375
 			<input type="hidden" name="page_y" value="">
3376
-			<input type="hidden" name="id" value="' . $object->id . '">
3377
-			<input type="hidden" name="backtopage" value="' . $backtopage . '">
3376
+			<input type="hidden" name="id" value="' . $object->id.'">
3377
+			<input type="hidden" name="backtopage" value="' . $backtopage.'">
3378 3378
 				';
3379 3379
 
3380 3380
 			if (!empty($conf->use_javascript_ajax) && $object->status == Commande::STATUS_DRAFT) {
3381 3381
 				if (isModEnabled('subtotals')) {
3382
-					include DOL_DOCUMENT_ROOT . '/core/tpl/subtotal_ajaxrow.tpl.php';
3382
+					include DOL_DOCUMENT_ROOT.'/core/tpl/subtotal_ajaxrow.tpl.php';
3383 3383
 				} else {
3384
-					include DOL_DOCUMENT_ROOT . '/core/tpl/ajaxrow.tpl.php';
3384
+					include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
3385 3385
 				}
3386 3386
 			}
3387 3387
 
@@ -3436,22 +3436,22 @@  discard block
 block discarded – undo
3436 3436
 
3437 3437
 				// Reopen a closed order
3438 3438
 				if (($object->status == Commande::STATUS_CLOSED || $object->status == Commande::STATUS_CANCELED) && $usercancreate && (!$object->billed || !getDolGlobalInt('ORDER_DONT_REOPEN_BILLED'))) {
3439
-					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"] . '?action=reopen&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3439
+					print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&amp;token='.newToken().'&amp;id='.$object->id, '');
3440 3440
 				}
3441 3441
 
3442 3442
 				// Send
3443 3443
 				if (empty($user->socid)) {
3444 3444
 					if ($object->status > Commande::STATUS_DRAFT || getDolGlobalString('COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS')) {
3445 3445
 						if ($usercansend) {
3446
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"] . '?action=presend&token=' . newToken() . '&id=' . $object->id . '&mode=init#formmailbeforetitle', '');
3446
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3447 3447
 						} else {
3448
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'] . '#', '', false);
3448
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
3449 3449
 						}
3450 3450
 					}
3451 3451
 				}
3452 3452
 
3453 3453
 				// Subtotal
3454
-				if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_' . strtoupper($object->element))) {
3454
+				if ($object->status == Commande::STATUS_DRAFT && isModEnabled('subtotals') && getDolGlobalString('SUBTOTAL_TITLE_'.strtoupper($object->element))) {
3455 3455
 					$langs->load('subtotals');
3456 3456
 
3457 3457
 					$url_button = array();
@@ -3461,7 +3461,7 @@  discard block
 block discarded – undo
3461 3461
 						'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
3462 3462
 						'perm' => (bool) $usercancreate,
3463 3463
 						'label' => $langs->trans('AddTitleLine'),
3464
-						'url' => '/commande/card.php?id=' . $object->id . '&action=add_title_line&token=' . newToken()
3464
+						'url' => '/commande/card.php?id='.$object->id.'&action=add_title_line&token='.newToken()
3465 3465
 					);
3466 3466
 
3467 3467
 					$url_button[] = array(
@@ -3469,7 +3469,7 @@  discard block
 block discarded – undo
3469 3469
 						'enabled' => (isModEnabled('order') && $object->status == Commande::STATUS_DRAFT),
3470 3470
 						'perm' => (bool) $usercancreate,
3471 3471
 						'label' => $langs->trans('AddSubtotalLine'),
3472
-						'url' => '/commande/card.php?id=' . $object->id . '&action=add_subtotal_line&token=' . newToken()
3472
+						'url' => '/commande/card.php?id='.$object->id.'&action=add_subtotal_line&token='.newToken()
3473 3473
 					);
3474 3474
 					print dolGetButtonAction('', $langs->trans('Subtotal'), 'default', $url_button, '', true);
3475 3475
 				}
@@ -3477,15 +3477,15 @@  discard block
 block discarded – undo
3477 3477
 				// Valid
3478 3478
 				if ($object->status == Commande::STATUS_DRAFT && ($object->total_ttc >= 0 || getDolGlobalString('ORDER_ENABLE_NEGATIVE')) && $usercanvalidate) {
3479 3479
 					if ($numlines > 0) {
3480
-						print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"] . '?action=validate&amp;token=' . newToken() . '&amp;id=' . $object->id, (string) $object->id, 1);
3480
+						print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&amp;token='.newToken().'&amp;id='.$object->id, (string) $object->id, 1);
3481 3481
 					} else {
3482 3482
 						$langs->load("errors");
3483
-						print dolGetButtonAction($langs->trans("ErrorObjectMustHaveLinesToBeValidated", $object->ref), $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"] . '?action=validate&amp;token=' . newToken() . '&amp;id=' . $object->id, (string) $object->id, -1);
3483
+						print dolGetButtonAction($langs->trans("ErrorObjectMustHaveLinesToBeValidated", $object->ref), $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=validate&amp;token='.newToken().'&amp;id='.$object->id, (string) $object->id, -1);
3484 3484
 					}
3485 3485
 				}
3486 3486
 				// Edit
3487 3487
 				if (($object->status == Commande::STATUS_VALIDATED || ($object->status == Commande::STATUS_SHIPMENTONPROCESS && getDolGlobalString('EDIT_ORDER_SHIPMENT_ON_PROCESS'))) && $usercancreate) {
3488
-					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"] . '?action=modif&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3488
+					print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=modif&amp;token='.newToken().'&amp;id='.$object->id, '');
3489 3489
 				}
3490 3490
 
3491 3491
 				$arrayforbutaction = array();
@@ -3497,7 +3497,7 @@  discard block
 block discarded – undo
3497 3497
 						'enabled' => (isModEnabled("supplier_order") && $object->status > Commande::STATUS_DRAFT),
3498 3498
 						'perm' => $usercancreatepurchaseorder,
3499 3499
 						'label' => 'AddPurchaseOrder',
3500
-						'url' => '/fourn/commande/card.php?action=create&amp;origin=' . urlencode($object->element) . '&amp;originid=' . ((int) $object->id)
3500
+						'url' => '/fourn/commande/card.php?action=create&amp;origin='.urlencode($object->element).'&amp;originid='.((int) $object->id)
3501 3501
 					);
3502 3502
 				}
3503 3503
 
@@ -3514,7 +3514,7 @@  discard block
 block discarded – undo
3514 3514
 						'enabled' => (isModEnabled("intervention") && $object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0),
3515 3515
 						'perm' => ($user->hasRight('ficheinter', 'creer') == 1),
3516 3516
 						'label' => 'AddIntervention',
3517
-						'url' => '/fichinter/card.php?action=create&origin=' . urlencode($object->element) . '&originid=' . ((int) $object->id) . '&socid=' . ((int) $object->socid),
3517
+						'url' => '/fichinter/card.php?action=create&origin='.urlencode($object->element).'&originid='.((int) $object->id).'&socid='.((int) $object->socid),
3518 3518
 					);
3519 3519
 				}
3520 3520
 
@@ -3524,7 +3524,7 @@  discard block
 block discarded – undo
3524 3524
 					'enabled' => (isModEnabled("contract") && ($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS || $object->status == Commande::STATUS_CLOSED)),
3525 3525
 					'perm' => ($user->hasRight('contrat', 'creer') == 1),
3526 3526
 					'label' => 'AddContract',
3527
-					'url' => '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
3527
+					'url' => '/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid,
3528 3528
 				);
3529 3529
 				/*if (isModEnabled('contrat') && ($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS || $object->status == Commande::STATUS_CLOSED)) {
3530 3530
 					$langs->load("contracts");
@@ -3548,7 +3548,7 @@  discard block
 block discarded – undo
3548 3548
 								'enabled' => (isModEnabled("shipping") && ($object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3549 3549
 								'perm' => $user->hasRight('expedition', 'creer'),
3550 3550
 								'label' => 'CreateShipment',
3551
-								'url' => '/expedition/shipment.php?id=' . $object->id
3551
+								'url' => '/expedition/shipment.php?id='.$object->id
3552 3552
 							);
3553 3553
 						} else {
3554 3554
 							//c$langs->load("errors");
@@ -3558,7 +3558,7 @@  discard block
 block discarded – undo
3558 3558
 								'enabled' => (isModEnabled("shipping") && ($object->status > Commande::STATUS_DRAFT && $object->status < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3559 3559
 								'perm' => 0,
3560 3560
 								'label' => 'CreateShipment',
3561
-								'url' => '/expedition/shipment.php?id=' . $object->id
3561
+								'url' => '/expedition/shipment.php?id='.$object->id
3562 3562
 							);
3563 3563
 						}
3564 3564
 					}
@@ -3570,7 +3570,7 @@  discard block
 block discarded – undo
3570 3570
 					'enabled' => (isModEnabled('invoice') && $object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0),
3571 3571
 					'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')),
3572 3572
 					'label' => 'CreateBill',
3573
-					'url' => '/compta/facture/card.php?action=create&amp;token=' . newToken() . '&amp;origin=' . urlencode($object->element) . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid
3573
+					'url' => '/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid
3574 3574
 				);
3575 3575
 				/*
3576 3576
 				 if (isModEnabled('facture') && $object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
@@ -3591,38 +3591,38 @@  discard block
 block discarded – undo
3591 3591
 
3592 3592
 				// Set to shipped
3593 3593
 				if (($object->status == Commande::STATUS_VALIDATED || $object->status == Commande::STATUS_SHIPMENTONPROCESS) && $usercanclose) {
3594
-					print dolGetButtonAction('', $langs->trans('ClassifyShipped'), 'default', $_SERVER["PHP_SELF"] . '?action=shipped&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3594
+					print dolGetButtonAction('', $langs->trans('ClassifyShipped'), 'default', $_SERVER["PHP_SELF"].'?action=shipped&amp;token='.newToken().'&amp;id='.$object->id, '');
3595 3595
 				}
3596 3596
 
3597 3597
 				// Set billed or unbilled
3598 3598
 				// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
3599 3599
 				if ($object->status > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
3600 3600
 					if ($usercancreate && $object->status >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) {
3601
-						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"] . '?action=classifybilled&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3601
+						print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&amp;token='.newToken().'&amp;id='.$object->id, '');
3602 3602
 					}
3603 3603
 				}
3604 3604
 				if ($object->status > Commande::STATUS_DRAFT && $object->billed) {
3605 3605
 					if ($usercancreate && $object->status >= Commande::STATUS_VALIDATED && !getDolGlobalString('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER') && !getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')) {
3606
-						print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'delete', $_SERVER["PHP_SELF"] . '?action=classifyunbilled&amp;token=' . newToken() . '&amp;id=' . $object->id, '');
3606
+						print dolGetButtonAction('', $langs->trans('ClassifyUnBilled'), 'delete', $_SERVER["PHP_SELF"].'?action=classifyunbilled&amp;token='.newToken().'&amp;id='.$object->id, '');
3607 3607
 					}
3608 3608
 				}
3609 3609
 
3610 3610
 				// Clone
3611 3611
 				if ($usercancreate) {
3612
-					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"] . '?action=clone&token=' . newToken() . '&id=' . $object->id . '&socid=' . $object->socid, '');
3612
+					print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER["PHP_SELF"].'?action=clone&token='.newToken().'&id='.$object->id.'&socid='.$object->socid, '');
3613 3613
 				}
3614 3614
 
3615 3615
 				// Cancel order
3616 3616
 				if ($object->status == Commande::STATUS_VALIDATED && !empty($usercancancel)) {
3617
-					print '<a class="butActionDelete" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=cancel&token=' . newToken() . '">' . $langs->trans("CancelOrder") . '</a>';
3617
+					print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'">'.$langs->trans("CancelOrder").'</a>';
3618 3618
 				}
3619 3619
 
3620 3620
 				// Delete order
3621 3621
 				if ($usercandelete) {
3622 3622
 					if ($numshipping == 0) {
3623
-						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"] . '?action=delete&token=' . newToken() . '&id=' . $object->id, '');
3623
+						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
3624 3624
 					} else {
3625
-						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'] . '#', '', false);
3625
+						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3626 3626
 					}
3627 3627
 				}
3628 3628
 			}
@@ -3639,9 +3639,9 @@  discard block
 block discarded – undo
3639 3639
 			print '<a name="builddoc"></a>'; // ancre
3640 3640
 			// Documents
3641 3641
 			$objref = dol_sanitizeFileName($object->ref);
3642
-			$relativepath = $objref . '/' . $objref . '.pdf';
3643
-			$filedir = $conf->commande->multidir_output[$object->entity] . '/' . $objref;
3644
-			$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
3642
+			$relativepath = $objref.'/'.$objref.'.pdf';
3643
+			$filedir = $conf->commande->multidir_output[$object->entity].'/'.$objref;
3644
+			$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
3645 3645
 			$genallowed = $usercanread;
3646 3646
 			$delallowed = $usercancreate;
3647 3647
 			print $formfile->showdocuments('commande', $objref, $filedir, $urlsource, $genallowed, (int) $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang, '', $object);
@@ -3664,7 +3664,7 @@  discard block
 block discarded – undo
3664 3664
 
3665 3665
 			// Show online payment link
3666 3666
 			// The list can be complete by the hook 'doValidatePayment' executed inside getValidOnlinePaymentMethods()
3667
-			include_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3667
+			include_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3668 3668
 			$validpaymentmethod = getValidOnlinePaymentMethods('');
3669 3669
 			$useonlinepayment = count($validpaymentmethod);
3670 3670
 
@@ -3673,8 +3673,8 @@  discard block
 block discarded – undo
3673 3673
 			}
3674 3674
 			if ($object->status != Commande::STATUS_DRAFT && $useonlinepayment) {
3675 3675
 				print '<br><!-- Link to pay -->';
3676
-				require_once DOL_DOCUMENT_ROOT . '/core/lib/payments.lib.php';
3677
-				print showOnlinePaymentUrl('order', $object->ref) . '<br>';
3676
+				require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
3677
+				print showOnlinePaymentUrl('order', $object->ref).'<br>';
3678 3678
 			}
3679 3679
 
3680 3680
 			print '</div><div class="fichehalfright">';
@@ -3683,11 +3683,11 @@  discard block
 block discarded – undo
3683 3683
 
3684 3684
 			//MODIF PICHINOV MESSAGING
3685 3685
 			//button to go to messaging from the events box
3686
-			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT . '/commande/messaging.php?id=' . $object->id);
3687
-			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT . '/commande/agenda.php?id=' . $object->id);
3686
+			$morehtmlcenter = dolGetButtonTitle($langs->trans('FullConversation'), '', 'fa fa-comments imgforviewmode', DOL_URL_ROOT.'/commande/messaging.php?id='.$object->id);
3687
+			$morehtmlcenter .= dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/commande/agenda.php?id='.$object->id);
3688 3688
 
3689 3689
 			// List of actions on element
3690
-			include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
3690
+			include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
3691 3691
 			$formactions = new FormActions($db);
3692 3692
 			$somethingshown = $formactions->showactions($object, 'order', $socid, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for thirdparty
3693 3693
 
@@ -3698,9 +3698,9 @@  discard block
 block discarded – undo
3698 3698
 		$modelmail = 'order_send';
3699 3699
 		$defaulttopic = 'SendOrderRef';
3700 3700
 		$diroutput = getMultidirOutput($object);
3701
-		$trackid = 'ord' . $object->id;
3701
+		$trackid = 'ord'.$object->id;
3702 3702
 
3703
-		include DOL_DOCUMENT_ROOT . '/core/tpl/card_presend.tpl.php';
3703
+		include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
3704 3704
 	}
3705 3705
 }
3706 3706
 
Please login to merge, or discard this patch.
htdocs/api/class/api_documents.class.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 				throw new RestException(500, 'Error generating document');
212 212
 			}
213 213
 		} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'invoice_supplier') {
214
-			require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php';
214
+			require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
215 215
 			$tmpobject = new FactureFournisseur($this->db);
216 216
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
217 217
 			if (!$result) {
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 				throw new RestException(500, 'Error generating document');
249 249
 			}
250 250
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
251
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
251
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
252 252
 
253 253
 			$tmpobject = new Contrat($this->db);
254 254
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
265 265
 			}
266 266
 		} elseif ($modulepart == 'expedition' || $modulepart == 'shipment') {
267
-			require_once DOL_DOCUMENT_ROOT . '/expedition/class/expedition.class.php';
267
+			require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
268 268
 
269 269
 			$tmpobject = new Expedition($this->db);
270 270
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 				throw new RestException(500, 'Error generating document missing doctemplate parameter');
281 281
 			}
282 282
 		} elseif ($modulepart == 'mrp') {
283
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
283
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
284 284
 
285 285
 			$tmpobject = new Mo($this->db);
286 286
 			$result = $tmpobject->fetch(0, preg_replace('/\.[^\.]+$/', '', basename($original_file)));
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
 			// $recursive = 0;
592 592
 		} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
593 593
 			$modulepart = 'contrat';
594
-			require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
594
+			require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
595 595
 
596 596
 			$object = new Contrat($this->db);
597 597
 			$result = $object->fetch($id, $ref);
@@ -599,10 +599,10 @@  discard block
 block discarded – undo
599 599
 				throw new RestException(404, 'Contract not found');
600 600
 			}
601 601
 
602
-			$upload_dir = $conf->contract->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'contract');
602
+			$upload_dir = $conf->contract->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'contract');
603 603
 		} elseif ($modulepart == 'intervention' || $modulepart == 'ficheinter') {
604 604
 			$modulepart = 'ficheinter';
605
-			require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php';
605
+			require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
606 606
 
607 607
 			$object = new Fichinter($this->db);
608 608
 			$result = $object->fetch($id, $ref);
@@ -610,10 +610,10 @@  discard block
 block discarded – undo
610 610
 				throw new RestException(404, 'Interventional not found');
611 611
 			}
612 612
 
613
-			$upload_dir = $conf->ficheinter->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'ficheinter');
613
+			$upload_dir = $conf->ficheinter->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'ficheinter');
614 614
 		} elseif ($modulepart == 'projet' || $modulepart == 'project') {
615 615
 			$modulepart = 'project';
616
-			require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
616
+			require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
617 617
 
618 618
 			$object = new Project($this->db);
619 619
 			$result = $object->fetch($id, $ref);
@@ -621,10 +621,10 @@  discard block
 block discarded – undo
621 621
 				throw new RestException(404, 'Project not found');
622 622
 			}
623 623
 
624
-			$upload_dir = $conf->project->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'project');
624
+			$upload_dir = $conf->project->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'project');
625 625
 		} elseif ($modulepart == 'mrp') {
626 626
 			$modulepart = 'mrp';
627
-			require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
627
+			require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
628 628
 
629 629
 			$object = new Mo($this->db);
630 630
 			$result = $object->fetch($id, $ref);
@@ -632,23 +632,23 @@  discard block
 block discarded – undo
632 632
 				throw new RestException(404, 'MO not found');
633 633
 			}
634 634
 
635
-			$upload_dir = $conf->mrp->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'mrp');
635
+			$upload_dir = $conf->mrp->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'mrp');
636 636
 		} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
637 637
 			$modulepart = 'contact';
638 638
 			require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
639 639
 
640 640
 			$object = new Contact($this->db);
641
-			$result = $object->fetch($id?$id:$ref);
641
+			$result = $object->fetch($id ? $id : $ref);
642 642
 			if (!$result) {
643 643
 				throw new RestException(404, 'Contact not found');
644 644
 			}
645
-			$upload_dir = $conf->societe->multidir_output[$object->entity] . "/contact/" . get_exdir(0, 0, 0, 1, $object, 'contact');
645
+			$upload_dir = $conf->societe->multidir_output[$object->entity]."/contact/".get_exdir(0, 0, 0, 1, $object, 'contact');
646 646
 		} else {
647 647
 			throw new RestException(500, 'Modulepart '.$modulepart.' not implemented yet.');
648 648
 		}
649 649
 
650 650
 		$objectType = $modulepart;
651
-		if (! empty($object->id) && ! empty($object->table_element)) {
651
+		if (!empty($object->id) && !empty($object->table_element)) {
652 652
 			$objectType = $object->table_element;
653 653
 		}
654 654
 
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
 					throw new RestException(503, 'Error when retrieve ecm list : '.$this->db->lasterror());
667 667
 				} elseif (is_array($ecmfile->lines) && count($ecmfile->lines) > 0) {
668 668
 					$count = count($filearray);
669
-					for ($i = 0 ; $i < $count ; $i++) {
669
+					for ($i = 0; $i < $count; $i++) {
670 670
 						foreach ($ecmfile->lines as $line) {
671 671
 							unset($line->db);
672 672
 							if ($filearray[$i]['name'] == $line->filename) {
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 				$object = new Propal($this->db);
847 847
 			} elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') {
848 848
 				$modulepart = 'agenda';
849
-				require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
849
+				require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
850 850
 				$object = new ActionComm($this->db);
851 851
 			} elseif ($modulepart == 'contact' || $modulepart == 'socpeople') {
852 852
 				$modulepart = 'contact';
@@ -855,11 +855,11 @@  discard block
 block discarded – undo
855 855
 				$fetchbyid = true;
856 856
 			} elseif ($modulepart == 'contrat' || $modulepart == 'contract') {
857 857
 				$modulepart = 'contrat';
858
-				require_once DOL_DOCUMENT_ROOT . '/contrat/class/contrat.class.php';
858
+				require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
859 859
 				$object = new Contrat($this->db);
860 860
 			} elseif ($modulepart == 'mrp') {
861 861
 				$modulepart = 'mrp';
862
-				require_once DOL_DOCUMENT_ROOT . '/mrp/class/mo.class.php';
862
+				require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
863 863
 				$object = new Mo($this->db);
864 864
 			} elseif ($modulepart == 'ecm') {
865 865
 				throw new RestException(500, 'Using a non empty "ref" is not compatible with using modulepart = '.$modulepart);
Please login to merge, or discard this patch.
htdocs/societe/card.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 $cancel		= GETPOST('cancel', 'alpha');
118 118
 $backtopage = GETPOST('backtopage', 'alpha');
119 119
 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
120
-$confirm 	= GETPOST('confirm', 'alpha');
121
-$canvas		= GETPOST('canvas', 'alpha');
120
+$confirm = GETPOST('confirm', 'alpha');
121
+$canvas = GETPOST('canvas', 'alpha');
122 122
 
123 123
 $dol_openinpopup = '';
124 124
 
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 }
162 162
 
163 163
 // Permissions
164
-$permissiontoread 	= $user->hasRight('societe', 'lire');
165
-$permissiontoadd 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
164
+$permissiontoread = $user->hasRight('societe', 'lire');
165
+$permissiontoadd = $user->hasRight('societe', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
166 166
 $permissiontodelete = $user->hasRight('societe', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == 0);
167
-$permissionnote 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
167
+$permissionnote = $user->hasRight('societe', 'creer'); // Used by the include of actions_setnotes.inc.php
168 168
 $permissiondellink 	= $user->hasRight('societe', 'creer'); // Used by the include of actions_dellink.inc.php
169 169
 $permissiontoeditextra = $permissiontoadd;
170 170
 if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	$permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]);
173 173
 }
174 174
 
175
-$upload_dir 		= $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
175
+$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
176 176
 
177 177
 // Security check
178 178
 $result = restrictedArea($user, 'societe', $object->id, '&societe', '', 'fk_soc', 'rowid', 0);
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
202 202
 				$backtopage = $backurlforlist;
203 203
 			} else {
204
-				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__') . (!empty($canvas) ? "&canvas=" . $canvas : "");
204
+				$backtopage = DOL_URL_ROOT.'/societe/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__').(!empty($canvas) ? "&canvas=".$canvas : "");
205 205
 			}
206 206
 		}
207 207
 	}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 	if ($action == 'confirm_merge' && $confirm == 'yes' && $permissiontoadd) {
221 221
 		$soc_origin_id = GETPOSTINT('soc_origin');
222
-		$soc_origin = new Societe($db);		// The thirdparty that we will delete
222
+		$soc_origin = new Societe($db); // The thirdparty that we will delete
223 223
 
224 224
 		if ($soc_origin_id <= 0) {
225 225
 			$langs->load('errors');
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	if ($action == 'update_extras' && $permissiontoeditextra) {
268 268
 		$object->fetch($socid);
269 269
 
270
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
270
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
271 271
 
272 272
 		$attribute_name = GETPOST('attribute', 'aZ09');
273 273
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 		if (!$error) {
324 324
 			if ($action == 'update') {	// Test on permission not required here
325 325
 				$ret = $object->fetch($socid);
326
-				$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
326
+				$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
327 327
 			} else {
328 328
 				$object->canvas = $canvas;
329 329
 			}
@@ -334,19 +334,19 @@  discard block
 block discarded – undo
334 334
 				$object->name = dolGetFirstLastname(GETPOST('firstname', 'alphanohtml'), GETPOST('name', 'alphanohtml'));
335 335
 				$object->civility_id		= GETPOST('civility_id', 'alphanohtml'); // Note: civility id is a code, not an int
336 336
 				// Add non official properties
337
-				$object->name_bis			= GETPOST('name', 'alphanohtml');
338
-				$object->firstname			= GETPOST('firstname', 'alphanohtml');
337
+				$object->name_bis = GETPOST('name', 'alphanohtml');
338
+				$object->firstname = GETPOST('firstname', 'alphanohtml');
339 339
 			} else {
340
-				$object->name				= GETPOST('name', 'alphanohtml');
340
+				$object->name = GETPOST('name', 'alphanohtml');
341 341
 			}
342 342
 			$object->entity					= ((GETPOSTISSET('entity') && GETPOST('entity') != '') ? GETPOSTINT('entity') : $conf->entity);
343
-			$object->name_alias				= GETPOST('name_alias', 'alphanohtml');
343
+			$object->name_alias = GETPOST('name_alias', 'alphanohtml');
344 344
 			$object->parent					= GETPOSTISSET('parent_company_id') ? GETPOSTINT('parent_company_id') : $object->parent;
345 345
 			$object->address				= GETPOST('address', 'alphanohtml');
346
-			$object->zip					= GETPOST('zipcode', 'alphanohtml');
347
-			$object->town					= GETPOST('town', 'alphanohtml');
348
-			$object->country_id				= GETPOSTINT('country_id');
349
-			$object->state_id				= GETPOSTINT('state_id');
346
+			$object->zip = GETPOST('zipcode', 'alphanohtml');
347
+			$object->town = GETPOST('town', 'alphanohtml');
348
+			$object->country_id = GETPOSTINT('country_id');
349
+			$object->state_id = GETPOSTINT('state_id');
350 350
 
351 351
 			$object->socialnetworks = array();
352 352
 			if (isModEnabled('socialnetworks')) {
@@ -358,10 +358,10 @@  discard block
 block discarded – undo
358 358
 			}
359 359
 
360 360
 			$object->phone					= GETPOST('phone', 'alpha');
361
-			$object->phone_mobile 			= (string) GETPOST("phone_mobile", 'alpha');
361
+			$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
362 362
 			$object->fax					= GETPOST('fax', 'alpha');
363 363
 			$object->email					= trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL));
364
-			$object->no_email 				= GETPOSTINT("no_email");
364
+			$object->no_email = GETPOSTINT("no_email");
365 365
 			$object->url					= trim(GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL));
366 366
 			$object->idprof1				= trim(GETPOST('idprof1', 'alphanohtml'));
367 367
 			$object->idprof2				= trim(GETPOST('idprof2', 'alphanohtml'));
@@ -371,13 +371,13 @@  discard block
 block discarded – undo
371 371
 			$object->idprof6				= trim(GETPOST('idprof6', 'alphanohtml'));
372 372
 			$object->prefix_comm			= GETPOST('prefix_comm', 'alphanohtml');
373 373
 			$object->code_client			= GETPOSTISSET('customer_code') ? GETPOST('customer_code', 'alpha') : GETPOST('code_client', 'alpha');
374
-			$object->code_fournisseur		= GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
374
+			$object->code_fournisseur = GETPOSTISSET('supplier_code') ? GETPOST('supplier_code', 'alpha') : GETPOST('code_fournisseur', 'alpha');
375 375
 			$object->capital				= GETPOSTFLOAT('capital');
376 376
 			$object->barcode				= GETPOST('barcode', 'alphanohtml');
377 377
 
378 378
 			$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
379 379
 			$object->tva_assuj				= GETPOSTINT('assujtva_value');
380
-			$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
380
+			$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
381 381
 			$object->status = GETPOSTINT('status');
382 382
 
383 383
 			// Local Taxes
@@ -387,11 +387,11 @@  discard block
 block discarded – undo
387 387
 			$object->localtax1_value		= GETPOST('lt1', 'alpha');
388 388
 			$object->localtax2_value		= GETPOST('lt2', 'alpha');
389 389
 
390
-			$object->forme_juridique_code	= GETPOSTINT('forme_juridique_code');
391
-			$object->birth				= dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
390
+			$object->forme_juridique_code = GETPOSTINT('forme_juridique_code');
391
+			$object->birth = dol_mktime(0, 0, 0, GETPOSTINT('birthmonth'), GETPOSTINT('birthday'), GETPOSTINT('birthyear'));
392 392
 
393 393
 			$object->effectif_id			= GETPOSTINT('effectif_id');
394
-			$object->typent_id				= GETPOSTINT('typent_id');
394
+			$object->typent_id = GETPOSTINT('typent_id');
395 395
 
396 396
 			$object->typent_code			= dol_getIdFromCode($db, $object->typent_id, 'c_typent', 'id', 'code'); // Force typent_code too so check in verify() will be done on new type
397 397
 
@@ -400,8 +400,8 @@  discard block
 block discarded – undo
400 400
 			$prospect = (GETPOSTINT('prospect') > 0 ? 2 : 0);
401 401
 			$prospectcustomer = $customer + $prospect;
402 402
 
403
-			$object->client					= $prospectcustomer;
404
-			$object->fournisseur			= (GETPOSTINT('supplier') > 0 ? 1 : 0);
403
+			$object->client = $prospectcustomer;
404
+			$object->fournisseur = (GETPOSTINT('supplier') > 0 ? 1 : 0);
405 405
 
406 406
 			if ($action == 'add') {
407 407
 				// for prospect, customer or supplier
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 					}
422 422
 
423 423
 					if ($object->fournisseur > 0) {
424
-						$object->cond_reglement_supplier_id	= $paymentTermId;
424
+						$object->cond_reglement_supplier_id = $paymentTermId;
425 425
 
426 426
 						$filterPaymentTypeIdArr = array(1, 2, 3); // allow payment type for supplier (filter is "DBIT" in "Form::select_types_paiements()" method)
427 427
 						if (!empty($form->cache_types_paiements[$paymentTypeId]) && isset($form->cache_types_paiements[$paymentTypeId]['type']) && in_array($form->cache_types_paiements[$paymentTypeId]['type'], $filterPaymentTypeIdArr)) {
@@ -431,15 +431,15 @@  discard block
 block discarded – undo
431 431
 				}
432 432
 			}
433 433
 
434
-			$object->commercial_id			= GETPOSTINT('commercial_id');
435
-			$object->default_lang			= GETPOST('default_lang');
434
+			$object->commercial_id = GETPOSTINT('commercial_id');
435
+			$object->default_lang = GETPOST('default_lang');
436 436
 
437 437
 			// Webservices url/key
438 438
 			$object->webservices_url		= GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
439 439
 			$object->webservices_key		= GETPOST('webservices_key', 'san_alpha');
440 440
 
441 441
 			if (GETPOSTISSET('accountancy_code_sell')) {
442
-				$accountancy_code_sell		= GETPOST('accountancy_code_sell', 'alpha');
442
+				$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
443 443
 
444 444
 				if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
445 445
 					$object->accountancy_code_sell = '';
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 				}
449 449
 			}
450 450
 			if (GETPOSTISSET('accountancy_code_buy')) {
451
-				$accountancy_code_buy		= GETPOST('accountancy_code_buy', 'alpha');
451
+				$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
452 452
 
453 453
 				if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
454 454
 					$object->accountancy_code_buy = '';
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 	// Delete third party
824 824
 	if ($action == 'confirm_delete' && $confirm == 'yes' && $user->hasRight('societe', 'supprimer')) {
825 825
 		$object->fetch($socid);
826
-		$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
826
+		$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
827 827
 		$result = $object->delete($socid, $user);
828 828
 
829 829
 		if ($result > 0) {
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
 				} else {
902 902
 					$db->commit();
903 903
 					$db->close();
904
-					header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id);
904
+					header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
905 905
 					exit;
906 906
 				}
907 907
 			} else {
@@ -1083,21 +1083,21 @@  discard block
 block discarded – undo
1083 1083
 		}
1084 1084
 
1085 1085
 		$object->phone				= GETPOST('phone', 'alpha');
1086
-		$object->phone_mobile       = (string) GETPOST("phone_mobile", 'alpha');
1086
+		$object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha');
1087 1087
 		$object->fax				= GETPOST('fax', 'alpha');
1088 1088
 		$object->email				= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
1089 1089
 		$object->url				= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
1090
-		$object->capital			= GETPOSTFLOAT('capital');
1090
+		$object->capital = GETPOSTFLOAT('capital');
1091 1091
 		$paymentTermId = GETPOSTINT('cond_reglement_id'); // can be set by default values on create page and not already in get or post variables
1092 1092
 		if (empty($paymentTermId) && !GETPOSTISSET('cond_reglement_id')) {
1093 1093
 			$paymentTermId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TERM_ID');
1094 1094
 		}
1095
-		$object->cond_reglement_id	= $paymentTermId;
1095
+		$object->cond_reglement_id = $paymentTermId;
1096 1096
 		$paymentTypeId = GETPOSTINT('mode_reglement_id'); // can be set by default values on create page and not already in get or post variables
1097 1097
 		if (empty($paymentTypeId) && !GETPOSTISSET('mode_reglement_id')) {
1098 1098
 			$paymentTypeId = getDolGlobalString('MAIN_DEFAULT_PAYMENT_TYPE_ID');
1099 1099
 		}
1100
-		$object->mode_reglement_id 	= $paymentTypeId;
1100
+		$object->mode_reglement_id = $paymentTypeId;
1101 1101
 		$object->barcode			= GETPOST('barcode', 'alphanohtml');
1102 1102
 		$object->idprof1			= GETPOST('idprof1', 'alphanohtml');
1103 1103
 		$object->idprof2			= GETPOST('idprof2', 'alphanohtml');
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
 		$object->civility_id		= GETPOST('civility_id', 'alpha');
1111 1111
 
1112 1112
 		$object->tva_assuj = GETPOSTINT('assujtva_value');
1113
-		$object->vat_reverse_charge	= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1113
+		$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
1114 1114
 		$object->status = GETPOSTINT('status');
1115 1115
 
1116 1116
 		//Local Taxes
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 		$object->default_lang = GETPOST('default_lang');
1127 1127
 
1128 1128
 		if (GETPOSTISSET('accountancy_code_sell')) {
1129
-			$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
1129
+			$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
1130 1130
 
1131 1131
 			if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
1132 1132
 				$object->accountancy_code_sell = '';
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
 			}
1136 1136
 		}
1137 1137
 		if (GETPOSTISSET('accountancy_code_buy')) {
1138
-			$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
1138
+			$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
1139 1139
 
1140 1140
 			if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
1141 1141
 				$object->accountancy_code_buy = '';
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
 			print '<script type="text/javascript">';
1262 1262
 			print '$(document).ready(function () {
1263
-					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1') . ';
1263
+					var canHaveCustomerCategoryIfNotCustomerProspectSupplier = ' . (!getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '0' : '1').';
1264 1264
 
1265 1265
 					init_customer_categ();
1266 1266
 			  		$("#customerprospect").change(function() {
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
 			print '</td><td'.(getDolGlobalString('SOCIETE_USEPREFIX') ? '' : ' colspan="3"').'>';
1333 1333
 
1334 1334
 			print '<input type="text" class="minwidth300" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus">';
1335
-			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300');	// For some countries that need the company name in 2 languages
1335
+			print $form->widgetForTranslation("name", $object, $permissiontoadd, 'string', 'alphanohtml', 'minwidth300'); // For some countries that need the company name in 2 languages
1336 1336
 			// This implementation of the feature to search already existing company has been disabled. It must be implemented by keeping the "input text" and we must call the search ajax societe/ajax/ajaxcompanies.php
1337 1337
 			// on a keydown of the input. We should show data about a duplicate found if we found less than 5 answers into a div under the input.
1338 1338
 			/*
@@ -1452,8 +1452,8 @@  discard block
 block discarded – undo
1452 1452
 
1453 1453
 			// Prospect/Customer/Supplier
1454 1454
 			$selected = $object->client;
1455
-			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1456
-			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT')==3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1455
+			$selectedcustomer = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 1 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'p' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1456
+			$selectedprospect = ((getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 2 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') || (getDolGlobalInt('THIRDPARTY_CUSTOMERTYPE_BY_DEFAULT') == 3 && GETPOST("type", 'aZ') != 'c' && GETPOST("type", 'aZ') != 'f') ? 1 : 0);
1457 1457
 			switch ($selected) {
1458 1458
 				case 1:
1459 1459
 					$selectedcustomer = 1;
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 					print '<td></td>';
1705 1705
 					print '<td></td>';
1706 1706
 				}
1707
-				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email') .' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1707
+				print '<td class="individualline noemail">'.$form->editfieldkey($langs->trans('No_Email').' ('.$langs->trans('Contact').')', 'contact_no_email', '', $object, 0).'</td>';
1708 1708
 				print '<td class="individualline" '.(($conf->browser->layout == 'phone') || !isModEnabled('mailing') ? ' colspan="3"' : '').'>'.$form->selectyesno('contact_no_email', (GETPOSTISSET("contact_no_email") ? GETPOST("contact_no_email", 'alpha') : (empty($object->no_email) ? 0 : 1)), 1, false, 1).'</td>';
1709 1709
 				print '</tr>';
1710 1710
 			}
@@ -1752,7 +1752,7 @@  discard block
 block discarded – undo
1752 1752
 			// Vat is used
1753 1753
 			print '<tr><td><label for="assujtva_value">'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</label></td>';
1754 1754
 			print '<td>';
1755
-			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . (GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"') . ' value="1">'; // Assujeti par default en creation
1755
+			print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.(GETPOSTISSET('assujtva_value') ? (GETPOST('assujtva_value', 'alpha') != '' ? ' checked="checked"' : '') : 'checked="checked"').' value="1">'; // Assujeti par default en creation
1756 1756
 			print '</td>';
1757 1757
 			if ($conf->browser->layout == 'phone') {
1758 1758
 				print '</tr><tr>';
@@ -1793,7 +1793,7 @@  discard block
 block discarded – undo
1793 1793
 
1794 1794
 			// VAT reverse charge by default
1795 1795
 			if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
1796
-				print '<tr><td><label for="vat_reverse_charge">' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</label></td><td colspan="3">';
1796
+				print '<tr><td><label for="vat_reverse_charge">'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</label></td><td colspan="3">';
1797 1797
 				print '<input type="checkbox" name="vat_reverse_charge" id="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
1798 1798
 				print '</td></tr>';
1799 1799
 			}
@@ -1802,21 +1802,21 @@  discard block
 block discarded – undo
1802 1802
 			//TODO: Place into a function to control showing by country or study better option
1803 1803
 			if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
1804 1804
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td>';
1805
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1805
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1806 1806
 				print '</td>';
1807 1807
 				if ($conf->browser->layout == 'phone') {
1808 1808
 					print '</tr><tr>';
1809 1809
 				}
1810 1810
 				print '<td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td>';
1811
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1811
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1812 1812
 				print '</td></tr>';
1813 1813
 			} elseif ($mysoc->localtax1_assuj == "1") {
1814 1814
 				print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1815
-				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '') . ' value="1">';
1815
+				print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX1) ? 'checked="checked"' : '').' value="1">';
1816 1816
 				print '</td></tr>';
1817 1817
 			} elseif ($mysoc->localtax2_assuj == "1") {
1818 1818
 				print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).'</td><td colspan="3">';
1819
-				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . (isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '') . ' value="1">';
1819
+				print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2) ? 'checked="checked"' : '').' value="1">';
1820 1820
 				print '</td></tr>';
1821 1821
 			}
1822 1822
 
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
 				$prefixSupplierIsUsed = false;
2060 2060
 			}
2061 2061
 
2062
-			$object->oldcopy = clone $object;  // @phan-suppress-current-line PhanTypeMismatchProperty
2062
+			$object->oldcopy = clone $object; // @phan-suppress-current-line PhanTypeMismatchProperty
2063 2063
 
2064 2064
 			if (GETPOSTISSET('name')) {
2065 2065
 				// We overwrite with values if posted
@@ -2087,10 +2087,10 @@  discard block
 block discarded – undo
2087 2087
 				}
2088 2088
 
2089 2089
 				$object->phone					= GETPOST('phone', 'alpha');
2090
-				$object->phone_mobile			= (string) GETPOST('phone_mobile', 'alpha');
2090
+				$object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha');
2091 2091
 				$object->fax					= GETPOST('fax', 'alpha');
2092 2092
 				$object->email					= GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
2093
-				$object->no_email				= GETPOSTINT("no_email");
2093
+				$object->no_email = GETPOSTINT("no_email");
2094 2094
 				$object->url					= GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
2095 2095
 				$object->capital				= GETPOSTFLOAT('capital');
2096 2096
 				$object->idprof1				= GETPOST('idprof1', 'alphanohtml');
@@ -2106,16 +2106,16 @@  discard block
 block discarded – undo
2106 2106
 				$object->default_lang = GETPOST('default_lang', 'alpha');
2107 2107
 
2108 2108
 				$object->tva_assuj				= GETPOSTINT('assujtva_value');
2109
-				$object->vat_reverse_charge		= GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2109
+				$object->vat_reverse_charge = GETPOST('vat_reverse_charge') == 'on' ? 1 : 0;
2110 2110
 				$object->tva_intra				= GETPOST('tva_intra', 'alphanohtml');
2111
-				$object->status =				GETPOSTINT('status');
2111
+				$object->status = GETPOSTINT('status');
2112 2112
 
2113 2113
 				// Webservices url/key
2114 2114
 				$object->webservices_url        = GETPOST('webservices_url', 'custom', 0, FILTER_SANITIZE_URL);
2115 2115
 				$object->webservices_key        = GETPOST('webservices_key', 'san_alpha');
2116 2116
 
2117 2117
 				if (GETPOSTISSET('accountancy_code_sell')) {
2118
-					$accountancy_code_sell  = GETPOST('accountancy_code_sell', 'alpha');
2118
+					$accountancy_code_sell = GETPOST('accountancy_code_sell', 'alpha');
2119 2119
 
2120 2120
 					if (empty($accountancy_code_sell) || $accountancy_code_sell == '-1') {
2121 2121
 						$object->accountancy_code_sell = '';
@@ -2124,7 +2124,7 @@  discard block
 block discarded – undo
2124 2124
 					}
2125 2125
 				}
2126 2126
 				if (GETPOSTISSET('accountancy_code_buy')) {
2127
-					$accountancy_code_buy   = GETPOST('accountancy_code_buy', 'alpha');
2127
+					$accountancy_code_buy = GETPOST('accountancy_code_buy', 'alpha');
2128 2128
 
2129 2129
 					if (empty($accountancy_code_buy) || $accountancy_code_buy == '-1') {
2130 2130
 						$object->accountancy_code_buy = '';
@@ -2206,7 +2206,7 @@  discard block
 block discarded – undo
2206 2206
     				}
2207 2207
     			});
2208 2208
 
2209
-				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0') . ';
2209
+				var canHaveCustomerCategoryIfNotCustomerProspect = ' . (getDolGlobalInt('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT') ? '1' : '0').';
2210 2210
 
2211 2211
 				init_customer_categ();
2212 2212
 	  			$("#customerprospect").change(function() {
@@ -2392,7 +2392,7 @@  discard block
 block discarded – undo
2392 2392
 					$colspan = 3;
2393 2393
 				}
2394 2394
 
2395
-				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2395
+				print '<tr><td>'.$form->editfieldkey('CustomerCode', 'customer_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2396 2396
 				print '<table class="nobordernopadding"><tr><td>';
2397 2397
 				$tmpcode = $object->code_client ?? '';
2398 2398
 				if (empty($tmpcode) && !empty($modCodeClient->code_auto)) {
@@ -2409,7 +2409,7 @@  discard block
 block discarded – undo
2409 2409
 					print '</tr><tr>';
2410 2410
 				}
2411 2411
 
2412
-				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"': '').'>';
2412
+				print '<td>'.$form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0).'</td><td'.($colspan ? ' colspan="'.$colspan.'"' : '').'>';
2413 2413
 
2414 2414
 				if ((isModEnabled("fournisseur") && $user->hasRight('fournisseur', 'lire') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) || (isModEnabled("supplier_order") && $user->hasRight('supplier_order', 'lire')) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire'))) {
2415 2415
 					print '<table class="nobordernopadding"><tr><td>';
@@ -2590,14 +2590,14 @@  discard block
 block discarded – undo
2590 2590
 
2591 2591
 				// VAT is used
2592 2592
 				print '<tr><td>'.$form->editfieldkey('VATIsUsed', 'assujtva_value', '', $object, 0).'</td><td colspan="3">';
2593
-				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" ' . ($object->tva_assuj ? 'checked="checked"' : '') . ' value="1">';
2593
+				print '<input id="assujtva_value" name="assujtva_value" type="checkbox" '.($object->tva_assuj ? 'checked="checked"' : '').' value="1">';
2594 2594
 				print '</td></tr>';
2595 2595
 
2596 2596
 				// Local Taxes
2597 2597
 				//TODO: Place into a function to control showing by country or study better option
2598 2598
 				if ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj == "1") {
2599 2599
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td>';
2600
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2600
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2601 2601
 					if (!isOnlyOneLocalTax(1)) {
2602 2602
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2603 2603
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2606,7 +2606,7 @@  discard block
 block discarded – undo
2606 2606
 					print '</td>';
2607 2607
 					print '</tr><tr>';
2608 2608
 					print '<td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td>';
2609
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1"></td></tr>';
2609
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1"></td></tr>';
2610 2610
 					if (!isOnlyOneLocalTax(2)) {
2611 2611
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2612 2612
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2615,7 +2615,7 @@  discard block
 block discarded – undo
2615 2615
 					print '</td></tr>';
2616 2616
 				} elseif ($mysoc->localtax1_assuj == "1" && $mysoc->localtax2_assuj != "1") {
2617 2617
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax1IsUsed", $mysoc->country_code), 'localtax1assuj_value', '', $object, 0).'</td><td colspan="3">';
2618
-					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" ' . ($object->localtax1_assuj ? 'checked="checked"' : '') . ' value="1">';
2618
+					print '<input id="localtax1assuj_value" name="localtax1assuj_value" type="checkbox" '.($object->localtax1_assuj ? 'checked="checked"' : '').' value="1">';
2619 2619
 					if (!isOnlyOneLocalTax(1)) {
2620 2620
 						print '<span class="cblt1">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2621 2621
 						$formcompany->select_localtax(1, (float) $object->localtax1_value, "lt1");
@@ -2624,7 +2624,7 @@  discard block
 block discarded – undo
2624 2624
 					print '</td></tr>';
2625 2625
 				} elseif ($mysoc->localtax2_assuj == "1" && $mysoc->localtax1_assuj != "1") {
2626 2626
 					print '<tr><td>'.$form->editfieldkey($langs->transcountry("LocalTax2IsUsed", $mysoc->country_code), 'localtax2assuj_value', '', $object, 0).'</td><td colspan="3">';
2627
-					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" ' . ($object->localtax2_assuj ? 'checked="checked"' : '') . ' value="1">';
2627
+					print '<input id="localtax2assuj_value" name="localtax2assuj_value" type="checkbox" '.($object->localtax2_assuj ? 'checked="checked"' : '').' value="1">';
2628 2628
 					if (!isOnlyOneLocalTax(2)) {
2629 2629
 						print '<span class="cblt2">     '.$langs->transcountry("Type", $mysoc->country_code).': ';
2630 2630
 						$formcompany->select_localtax(2, (float) $object->localtax2_value, "lt2");
@@ -2635,7 +2635,7 @@  discard block
 block discarded – undo
2635 2635
 
2636 2636
 				// VAT reverse charge by default
2637 2637
 				if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) {
2638
-					print '<tr><td>' . $form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0) . '</td><td colspan="3">';
2638
+					print '<tr><td>'.$form->editfieldkey('VATReverseChargeByDefault', 'vat_reverse_charge', '', $object, 0).'</td><td colspan="3">';
2639 2639
 					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').'>';
2640 2640
 					print '</td></tr>';
2641 2641
 				}
@@ -2797,7 +2797,7 @@  discard block
 block discarded – undo
2797 2797
 					$maxfilesizearray = getMaxFileSizeArray();
2798 2798
 					$maxmin = $maxfilesizearray['maxmin'];
2799 2799
 					if ($maxmin > 0) {
2800
-						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">';	// MAX_FILE_SIZE must precede the field type=file
2800
+						print '<input type="hidden" name="MAX_FILE_SIZE" value="'.($maxmin * 1024).'">'; // MAX_FILE_SIZE must precede the field type=file
2801 2801
 					}
2802 2802
 					print '<input type="file" class="flat" name="photo" id="photoinput">';
2803 2803
 					print '</td></tr>';
@@ -3033,7 +3033,7 @@  discard block
 block discarded – undo
3033 3033
 					print '<tr><td>';
3034 3034
 					print $form->textwithpicto($langs->trans('VATReverseChargeByDefault'), $langs->trans('VATReverseChargeByDefaultDesc'));
3035 3035
 					print '</td><td>';
3036
-					print '<input type="checkbox" name="vat_reverse_charge" ' . ($object->vat_reverse_charge == '1' ? ' checked' : '') . ' disabled>';
3036
+					print '<input type="checkbox" name="vat_reverse_charge" '.($object->vat_reverse_charge == '1' ? ' checked' : '').' disabled>';
3037 3037
 					print '</td>';
3038 3038
 					print '</tr>';
3039 3039
 				}
Please login to merge, or discard this patch.