@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | global $conf, $langs; |
310 | 310 | |
311 | 311 | $error = 0; |
312 | - $way = $this->getWay(); // 'dolibarr' to use amount, 'customer' to use foreign multicurrency amount |
|
312 | + $way = $this->getWay(); // 'dolibarr' to use amount, 'customer' to use foreign multicurrency amount |
|
313 | 313 | |
314 | 314 | $now = dol_now(); |
315 | 315 | |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $currencytxofpayment = isset($this->multicurrency_tx[$key]) ? $this->multicurrency_tx[$key] : ""; |
371 | 371 | } |
372 | 372 | |
373 | - $totalamount_converted += $value_converted; // Total in currency of the invoice |
|
373 | + $totalamount_converted += $value_converted; // Total in currency of the invoice |
|
374 | 374 | $amounts_to_update[$key] = price2num($value_converted, 'MT'); |
375 | 375 | |
376 | 376 | $newvalue = price2num($value, 'MT'); |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | $this->error = $hookmanager->error; |
499 | 499 | $error++; |
500 | 500 | } elseif ($reshook == 0) { |
501 | - dol_syslog("Remain to pay for invoice " . $facid . " not null. We do nothing more."); |
|
501 | + dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); |
|
502 | 502 | } |
503 | 503 | // } else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more."); |
504 | 504 | } else { |
@@ -813,8 +813,8 @@ discard block |
||
813 | 813 | |
814 | 814 | // if company currency != bank currency, then we received an amount in customer currency (currently I don't manage the case : my currency is USD, the customer currency is EUR and he paid me in GBP. Seems no sense for me) |
815 | 815 | if ($conf->currency != $acc->currency_code) { |
816 | - $totalamount = $this->multicurrency_amount; // We will insert into llx_bank.amount in foreign currency of invoice |
|
817 | - $totalamount_main_currency = $this->amount; // We will also save the amount in main currency into column llx_bank.amount_main_currency |
|
816 | + $totalamount = $this->multicurrency_amount; // We will insert into llx_bank.amount in foreign currency of invoice |
|
817 | + $totalamount_main_currency = $this->amount; // We will also save the amount in main currency into column llx_bank.amount_main_currency |
|
818 | 818 | } |
819 | 819 | |
820 | 820 | if ($mode == 'payment_supplier') { |
@@ -1245,7 +1245,7 @@ discard block |
||
1245 | 1245 | if (getDolGlobalString('PAYMENT_ADDON')) { |
1246 | 1246 | $mybool = false; |
1247 | 1247 | |
1248 | - $file = getDolGlobalString('PAYMENT_ADDON') . ".php"; |
|
1248 | + $file = getDolGlobalString('PAYMENT_ADDON').".php"; |
|
1249 | 1249 | $classname = getDolGlobalString('PAYMENT_ADDON'); |
1250 | 1250 | |
1251 | 1251 | // Include file with class |
@@ -1262,8 +1262,8 @@ discard block |
||
1262 | 1262 | |
1263 | 1263 | // For compatibility |
1264 | 1264 | if (!$mybool) { |
1265 | - $file = getDolGlobalString('PAYMENT_ADDON') . ".php"; |
|
1266 | - $classname = "mod_payment_" . getDolGlobalString('PAYMENT_ADDON'); |
|
1265 | + $file = getDolGlobalString('PAYMENT_ADDON').".php"; |
|
1266 | + $classname = "mod_payment_".getDolGlobalString('PAYMENT_ADDON'); |
|
1267 | 1267 | $classname = preg_replace('/\-.*$/', '', $classname); |
1268 | 1268 | // Include file with class |
1269 | 1269 | foreach ($conf->file->dol_document_root as $dirroot) { |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | } |
1427 | 1427 | $result .= $linkend; |
1428 | 1428 | global $action; |
1429 | - $hookmanager->initHooks(array($this->element . 'dao')); |
|
1429 | + $hookmanager->initHooks(array($this->element.'dao')); |
|
1430 | 1430 | $parameters = array('id' => $this->id, 'getnomurl' => &$result); |
1431 | 1431 | $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks |
1432 | 1432 | if ($reshook > 0) { |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | //$result = restrictedArea($user, 'mymodule', $id); |
109 | 109 | |
110 | 110 | //Parameters Page |
111 | -$paramwithsearch = '&sortfield=' . urlencode($sortfield); |
|
112 | -$paramwithsearch .= '&sortorder=' . urlencode($sortorder); |
|
111 | +$paramwithsearch = '&sortfield='.urlencode($sortfield); |
|
112 | +$paramwithsearch .= '&sortorder='.urlencode($sortorder); |
|
113 | 113 | if ($limit > 0 && $limit != $conf->liste_limit) { |
114 | 114 | $paramwithsearch .= '&limit='.((int) $limit); |
115 | 115 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $line = $db->fetch_object($resql); |
178 | 178 | |
179 | 179 | $qty_stock = $line->qty_stock; |
180 | - $qty_view = $line->qty_view; // The quantity viewed by inventorier, the qty we target |
|
180 | + $qty_view = $line->qty_view; // The quantity viewed by inventorier, the qty we target |
|
181 | 181 | |
182 | 182 | |
183 | 183 | // Load real stock we have now. |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | } |
235 | 235 | $sqlupdate .= " WHERE rowid = ".((int) $line->rowid); |
236 | 236 | $resqlupdate = $db->query($sqlupdate); |
237 | - if (! $resqlupdate) { |
|
237 | + if (!$resqlupdate) { |
|
238 | 238 | $error++; |
239 | 239 | setEventMessages($db->lasterror(), null, 'errors'); |
240 | 240 | break; |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if (!empty($line->pmp_real) && getDolGlobalString('INVENTORY_MANAGE_REAL_PMP')) { |
245 | 245 | $sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product SET pmp = '.((float) $line->pmp_real).' WHERE rowid = '.((int) $line->fk_product); |
246 | 246 | $resqlpmp = $db->query($sqlpmp); |
247 | - if (! $resqlpmp) { |
|
247 | + if (!$resqlpmp) { |
|
248 | 248 | $error++; |
249 | 249 | setEventMessages($db->lasterror(), null, 'errors'); |
250 | 250 | break; |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) { |
253 | 253 | $sqlpmp = 'UPDATE '.MAIN_DB_PREFIX.'product_perentity SET pmp = '.((float) $line->pmp_real).' WHERE fk_product = '.((int) $line->fk_product).' AND entity='.$conf->entity; |
254 | 254 | $resqlpmp = $db->query($sqlpmp); |
255 | - if (! $resqlpmp) { |
|
255 | + if (!$resqlpmp) { |
|
256 | 256 | $error++; |
257 | 257 | setEventMessages($db->lasterror(), null, 'errors'); |
258 | 258 | break; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $error++; |
272 | 272 | } |
273 | 273 | |
274 | - if (! $error) { |
|
274 | + if (!$error) { |
|
275 | 275 | $db->commit(); |
276 | 276 | } else { |
277 | 277 | $db->rollback(); |
@@ -311,17 +311,17 @@ discard block |
||
311 | 311 | setEventMessages($langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv("RealQty")), null, 'errors'); |
312 | 312 | } |
313 | 313 | if ($result > 0) { |
314 | - $inventoryline->qty_stock = (float) price2num(GETPOST('stock_qty_'.$lineid, 'alpha'), 'MS'); // The new value that was set in as hidden field |
|
315 | - $inventoryline->qty_view = $qtytoupdate; // The new value we want |
|
314 | + $inventoryline->qty_stock = (float) price2num(GETPOST('stock_qty_'.$lineid, 'alpha'), 'MS'); // The new value that was set in as hidden field |
|
315 | + $inventoryline->qty_view = $qtytoupdate; // The new value we want |
|
316 | 316 | $inventoryline->pmp_real = price2num(GETPOST('realpmp_'.$lineid, 'alpha'), 'MS'); |
317 | 317 | $inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_'.$lineid, 'alpha'), 'MS'); |
318 | 318 | $resultupdate = $inventoryline->update($user); |
319 | 319 | } |
320 | - } elseif (GETPOSTISSET('id_' . $lineid)) { |
|
320 | + } elseif (GETPOSTISSET('id_'.$lineid)) { |
|
321 | 321 | // Delete record |
322 | 322 | $result = $inventoryline->fetch($lineid); |
323 | 323 | if ($result > 0) { |
324 | - $inventoryline->qty_view = null; // The new value we want |
|
324 | + $inventoryline->qty_view = null; // The new value we want |
|
325 | 325 | $inventoryline->pmp_real = price2num(GETPOST('realpmp_'.$lineid, 'alpha'), 'MS'); |
326 | 326 | $inventoryline->pmp_expected = price2num(GETPOST('expectedpmp_'.$lineid, 'alpha'), 'MS'); |
327 | 327 | $resultupdate = $inventoryline->update($user); |
@@ -337,12 +337,12 @@ discard block |
||
337 | 337 | } |
338 | 338 | |
339 | 339 | // Update line with id of stock movement (and the start quantity if it has changed this last recording) |
340 | - if (! $error) { |
|
340 | + if (!$error) { |
|
341 | 341 | $sqlupdate = "UPDATE ".MAIN_DB_PREFIX."inventory"; |
342 | 342 | $sqlupdate .= " SET fk_user_modif = ".((int) $user->id); |
343 | 343 | $sqlupdate .= " WHERE rowid = ".((int) $object->id); |
344 | 344 | $resqlupdate = $db->query($sqlupdate); |
345 | - if (! $resqlupdate) { |
|
345 | + if (!$resqlupdate) { |
|
346 | 346 | $error++; |
347 | 347 | setEventMessages($db->lasterror(), null, 'errors'); |
348 | 348 | } |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | } else { |
428 | 428 | // Clear var |
429 | - $_POST['batch'] = ''; // TODO Replace this with a var |
|
429 | + $_POST['batch'] = ''; // TODO Replace this with a var |
|
430 | 430 | $_POST['qtytoadd'] = ''; |
431 | 431 | } |
432 | 432 | } |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | |
455 | 455 | $param = ''; |
456 | 456 | if ($limit > 0 && $limit != $conf->liste_limit) { |
457 | - $param .= '&limit=' . ((int) $limit); |
|
457 | + $param .= '&limit='.((int) $limit); |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | print '<input type="hidden" name="token" value="'.newToken().'">'; |
593 | 593 | print '<input type="hidden" name="action" value="updateinventorylines">'; |
594 | 594 | print '<input type="hidden" name="id" value="'.$object->id.'">'; |
595 | -print '<input type="hidden" name="sortfield" value="' . $sortfield . '">'; |
|
596 | -print '<input type="hidden" name="sortorder" value="' . $sortorder . '">'; |
|
595 | +print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; |
|
596 | +print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; |
|
597 | 597 | if ($backtopage) { |
598 | 598 | print '<input type="hidden" name="backtopage" value="'.$backtopage.'">'; |
599 | 599 | } |
@@ -944,8 +944,8 @@ discard block |
||
944 | 944 | print '<table id="tablelines" class="noborder noshadow centpercent">'; |
945 | 945 | |
946 | 946 | print '<tr class="liste_titre">'; |
947 | -print getTitleFieldOfList($langs->trans("Warehouse"), 0, $_SERVER['PHP_SELF'], 'e.ref', '', 'id=' . $object->id . '&page=' . $page . $param, '', $sortfield, $sortorder, '', 0, '') . "\n"; |
|
948 | -print getTitleFieldOfList($langs->trans("Product"), 0, $_SERVER['PHP_SELF'], 'p.ref', '', 'id=' . $object->id . '&page=' . $page . $param, '', $sortfield, $sortorder, '', 0, '') . "\n"; |
|
947 | +print getTitleFieldOfList($langs->trans("Warehouse"), 0, $_SERVER['PHP_SELF'], 'e.ref', '', 'id='.$object->id.'&page='.$page.$param, '', $sortfield, $sortorder, '', 0, '')."\n"; |
|
948 | +print getTitleFieldOfList($langs->trans("Product"), 0, $_SERVER['PHP_SELF'], 'p.ref', '', 'id='.$object->id.'&page='.$page.$param, '', $sortfield, $sortorder, '', 0, '')."\n"; |
|
949 | 949 | if (isModEnabled('productbatch')) { |
950 | 950 | print '<td>'; |
951 | 951 | print $langs->trans("Batch"); |
@@ -1030,16 +1030,16 @@ discard block |
||
1030 | 1030 | } |
1031 | 1031 | |
1032 | 1032 | // Sort by warehouse/product or product/warehouse |
1033 | -$sortfield .= ',' . ($sortfield == 'e.ref' ? 'p.ref' : 'e.ref'); |
|
1034 | -$sortorder .= ',' . $sortorder; |
|
1033 | +$sortfield .= ','.($sortfield == 'e.ref' ? 'p.ref' : 'e.ref'); |
|
1034 | +$sortorder .= ','.$sortorder; |
|
1035 | 1035 | |
1036 | 1036 | // Request to show lines of inventory (prefilled after start/validate step) |
1037 | 1037 | $sql = 'SELECT id.rowid, id.datec as date_creation, id.tms as date_modification, id.fk_inventory, id.fk_warehouse,'; |
1038 | 1038 | $sql .= ' id.fk_product, id.batch, id.qty_stock, id.qty_view, id.qty_regulated, id.fk_movement, id.pmp_real, id.pmp_expected'; |
1039 | -$sql .= ' FROM ' . $db->prefix() . 'inventorydet as id'; |
|
1040 | -$sql .= ' LEFT JOIN ' . $db->prefix() . 'product as p ON id.fk_product = p.rowid'; |
|
1041 | -$sql .= ' LEFT JOIN ' . $db->prefix() . 'entrepot as e ON id.fk_warehouse = e.rowid'; |
|
1042 | -$sql .= ' WHERE id.fk_inventory = ' . ((int) $object->id); |
|
1039 | +$sql .= ' FROM '.$db->prefix().'inventorydet as id'; |
|
1040 | +$sql .= ' LEFT JOIN '.$db->prefix().'product as p ON id.fk_product = p.rowid'; |
|
1041 | +$sql .= ' LEFT JOIN '.$db->prefix().'entrepot as e ON id.fk_warehouse = e.rowid'; |
|
1042 | +$sql .= ' WHERE id.fk_inventory = '.((int) $object->id); |
|
1043 | 1043 | $sql .= $db->order($sortfield, $sortorder); |
1044 | 1044 | $sql .= $db->plimit($limit, $offset); |
1045 | 1045 | |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | $num = $db->num_rows($resql); |
1053 | 1053 | |
1054 | 1054 | if (!empty($limit != 0) || $num > $limit || $page) { |
1055 | - print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$object->id.$paramwithsearch, ($num >= $limit ? 1 : 0), '<li class="pagination"><span>' . $langs->trans("Page") . ' ' . ($page + 1) . '</span></li>', '', $limit); |
|
1055 | + print_fleche_navigation($page, $_SERVER["PHP_SELF"], '&id='.$object->id.$paramwithsearch, ($num >= $limit ? 1 : 0), '<li class="pagination"><span>'.$langs->trans("Page").' '.($page + 1).'</span></li>', '', $limit); |
|
1056 | 1056 | } |
1057 | 1057 | |
1058 | 1058 | $i = 0; |
@@ -1204,7 +1204,7 @@ discard block |
||
1204 | 1204 | print '</td>'; |
1205 | 1205 | |
1206 | 1206 | print '<td class="right nowraponall">'; |
1207 | - print $obj->qty_view; // qty found |
|
1207 | + print $obj->qty_view; // qty found |
|
1208 | 1208 | print '</td>'; |
1209 | 1209 | |
1210 | 1210 | //PMP Real |
@@ -1226,7 +1226,7 @@ discard block |
||
1226 | 1226 | $totalRealValuation += $pmp_valuation_real; |
1227 | 1227 | } else { |
1228 | 1228 | print '<td class="right nowraponall">'; |
1229 | - print $obj->qty_view; // qty found |
|
1229 | + print $obj->qty_view; // qty found |
|
1230 | 1230 | print '</td>'; |
1231 | 1231 | } |
1232 | 1232 | print '<td>'; |