@@ -68,21 +68,21 @@ |
||
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | if (empty($fk_expense) || $fk_expense < 0) { |
| 71 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'); |
|
| 71 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_expense, 'fk_expense'); |
|
| 72 | 72 | } elseif (empty($fk_c_exp_tax_cat) || $fk_c_exp_tax_cat < 0) { |
| 73 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'); |
|
| 73 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorBadValueForParameter', $fk_c_exp_tax_cat, 'fk_c_exp_tax_cat'); |
|
| 74 | 74 | |
| 75 | 75 | $rep->response_status = 'error'; |
| 76 | 76 | } else { |
| 77 | 77 | // @see ndfp.class.php:3576 (method: compute_total_km) |
| 78 | 78 | $expense = new ExpenseReport($db); |
| 79 | 79 | if ($expense->fetch($fk_expense) <= 0) { |
| 80 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 80 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 81 | 81 | $rep->response_status = 'error'; |
| 82 | 82 | } else { |
| 83 | 83 | $userauthor = new User($db); |
| 84 | 84 | if ($userauthor->fetch($expense->fk_user_author) <= 0) { |
| 85 | - $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 85 | + $rep->errorMessage = $langs->transnoentitiesnoconv('ErrorRecordNotFound'); |
|
| 86 | 86 | $rep->response_status = 'error'; |
| 87 | 87 | } else { |
| 88 | 88 | $expense = new ExpenseReport($db); |
@@ -129,21 +129,21 @@ |
||
| 129 | 129 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 130 | 130 | $coldisplay++; |
| 131 | 131 | print '<td class="nobottom nowrap linecolunit right">'; |
| 132 | - print $formproduct->selectMeasuringUnits("fk_unit", '', (($line->fk_unit) ? $line->fk_unit : ''), 0, 0); |
|
| 132 | + print $formproduct->selectMeasuringUnits("fk_unit", '', (($line->fk_unit) ? $line->fk_unit : ''), 0, 0); |
|
| 133 | 133 | print '</td>'; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $coldisplay++; |
| 137 | - print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"' . (GETPOSTISSET("qty_frozen") ? (GETPOST('qty_frozen', 'int') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')) . '>'; |
|
| 137 | + print '<td class="nobottom linecolqtyfrozen right"><input type="checkbox" name="qty_frozen" id="qty_frozen" class="flat right" value="1"'.(GETPOSTISSET("qty_frozen") ? (GETPOST('qty_frozen', 'int') ? ' checked="checked"' : '') : ($line->qty_frozen ? ' checked="checked"' : '')).'>'; |
|
| 138 | 138 | print '</td>'; |
| 139 | 139 | |
| 140 | 140 | $coldisplay++; |
| 141 | - print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"' . (GETPOSTISSET('disablestockchange') ? (GETPOST("disable_stock_change", 'int') ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')) . '">'; |
|
| 141 | + print '<td class="nobottom linecoldisablestockchange right"><input type="checkbox" name="disable_stock_change" id="disable_stock_change" class="flat right" value="1"'.(GETPOSTISSET('disablestockchange') ? (GETPOST("disable_stock_change", 'int') ? ' checked="checked"' : '') : ($line->disable_stock_change ? ' checked="checked"' : '')).'">'; |
|
| 142 | 142 | print '</td>'; |
| 143 | 143 | |
| 144 | 144 | $coldisplay++; |
| 145 | 145 | print '<td class="nobottom nowrap linecollost right">'; |
| 146 | - print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="' . $line->efficiency . '"></td>'; |
|
| 146 | + print '<input type="text" size="2" name="efficiency" id="efficiency" class="flat right" value="'.$line->efficiency.'"></td>'; |
|
| 147 | 147 | |
| 148 | 148 | $coldisplay++; |
| 149 | 149 | print '<td class="nobottom nowrap linecolcostprice right">'; |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // add html5 elements |
| 70 | -if ($filtertype == 1) $domData = ' data-element="'.$line->element.'service"'; |
|
| 71 | -else $domData = ' data-element="'.$line->element.'"'; |
|
| 70 | +if ($filtertype == 1) $domData = ' data-element="'.$line->element.'service"'; |
|
| 71 | +else $domData = ' data-element="'.$line->element.'"'; |
|
| 72 | 72 | |
| 73 | 73 | $domData .= ' data-id="'.$line->id.'"'; |
| 74 | 74 | $domData .= ' data-qty="'.$line->qty.'"'; |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | if ($filtertype != 1) { |
| 129 | 129 | if (getDolGlobalInt('PRODUCT_USE_UNITS')) { |
| 130 | 130 | print '<td class="linecoluseunit nowrap left">'; |
| 131 | - $label = measuringUnitString($line->fk_unit, '', '', 1); |
|
| 131 | + $label = measuringUnitString($line->fk_unit, '', '', 1); |
|
| 132 | 132 | if ($label !== '') { |
| 133 | 133 | print $langs->trans($label); |
| 134 | 134 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // Select of all the sub-BOM lines |
| 240 | 240 | // From this pont to the end of the file, we only take care of sub-BOM lines |
| 241 | 241 | $sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; |
| 242 | -$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; |
|
| 242 | +$sql .= ' WHERE fk_bom ='.(int) $tmpbom->id; |
|
| 243 | 243 | $resql = $object->db->query($sql); |
| 244 | 244 | |
| 245 | 245 | if ($resql) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | if (!empty($sub_bom->id)) { |
| 310 | 310 | $sub_bom->calculateCosts(); |
| 311 | 311 | print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>'; |
| 312 | - $total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty; |
|
| 312 | + $total_cost += $sub_bom->total_cost * $sub_bom_line->qty * $line->qty; |
|
| 313 | 313 | } elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) { |
| 314 | 314 | //Convert qty to hour |
| 315 | 315 | $unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1); |
@@ -323,24 +323,24 @@ discard block |
||
| 323 | 323 | } elseif ($sub_bom_product->cost_price > 0) { |
| 324 | 324 | print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'">'; |
| 325 | 325 | print '<span class="amount">'.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>'; |
| 326 | - $total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty; |
|
| 326 | + $total_cost += $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty; |
|
| 327 | 327 | } elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined |
| 328 | 328 | print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'">'; |
| 329 | 329 | print '<span class="amount">'.price(price2num($sub_bom_product->pmp * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>'; |
| 330 | - $total_cost.= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty; |
|
| 330 | + $total_cost .= $sub_bom_product->pmp * $sub_bom_line->qty * $line->qty; |
|
| 331 | 331 | } else { // Minimum purchase price if cost price and PMP aren't defined |
| 332 | 332 | $sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; |
| 333 | - $sql_supplier_price.= ' WHERE fk_product = '. (int) $sub_bom_product->id; |
|
| 333 | + $sql_supplier_price .= ' WHERE fk_product = '.(int) $sub_bom_product->id; |
|
| 334 | 334 | $resql_supplier_price = $object->db->query($sql_supplier_price); |
| 335 | 335 | if ($resql_supplier_price) { |
| 336 | 336 | $obj = $object->db->fetch_object($resql_supplier_price); |
| 337 | 337 | if (!empty($obj->qty) && !empty($sub_bom_line->qty) && !empty($line->qty)) { |
| 338 | - $line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty * $line->qty; |
|
| 338 | + $line_cost = $obj->min_price / $obj->qty * $sub_bom_line->qty * $line->qty; |
|
| 339 | 339 | } else { |
| 340 | 340 | $line_cost = $obj->min_price; |
| 341 | 341 | } |
| 342 | 342 | print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price2num($line_cost, 'MT').'</span></td>'; |
| 343 | - $total_cost+= $line_cost; |
|
| 343 | + $total_cost += $line_cost; |
|
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0); |
| 133 | 133 | $result = $object->cancel($user, 0, $also_cancel_consumed_and_produced_lines); |
| 134 | 134 | if ($result > 0) { |
| 135 | - header("Location: " . dol_buildpath('/mrp/mo_card.php?id=' . $object->id, 1)); |
|
| 135 | + header("Location: ".dol_buildpath('/mrp/mo_card.php?id='.$object->id, 1)); |
|
| 136 | 136 | exit; |
| 137 | 137 | } else { |
| 138 | 138 | $action = ''; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $also_cancel_consumed_and_produced_lines = (GETPOST('alsoCancelConsumedAndProducedLines', 'alpha') ? 1 : 0); |
| 143 | 143 | $result = $object->delete($user, 0, $also_cancel_consumed_and_produced_lines); |
| 144 | 144 | if ($result > 0) { |
| 145 | - header("Location: " . $backurlforlist); |
|
| 145 | + header("Location: ".$backurlforlist); |
|
| 146 | 146 | exit; |
| 147 | 147 | } else { |
| 148 | 148 | $action = ''; |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | 'value' => empty($conf->global->MO_ALSO_CANCEL_CONSUMED_AND_PRODUCED_LINES_BY_DEFAULT) ? 0 : 1 |
| 578 | 578 | ), |
| 579 | 579 | ); |
| 580 | - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CancelMo'), $langs->trans('ConfirmCancelMo'), 'confirm_cancel', $formquestion, 0, 1); |
|
| 580 | + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('CancelMo'), $langs->trans('ConfirmCancelMo'), 'confirm_cancel', $formquestion, 0, 1); |
|
| 581 | 581 | } |
| 582 | 582 | |
| 583 | 583 | // Call Hook formConfirm |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | // Qty |
| 815 | 815 | print '<td class="right">'.$langs->trans("Qty").'</td>'; |
| 816 | 816 | // Unit |
| 817 | - if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">' . $langs->trans("Unit") . '</td>'; |
|
| 817 | + if ($conf->global->PRODUCT_USE_UNITS) print '<td class="right">'.$langs->trans("Unit").'</td>'; |
|
| 818 | 818 | // Cost price |
| 819 | 819 | if ($permissiontoupdatecost && !empty($conf->global->MRP_SHOW_COST_FOR_CONSUMPTION)) { |
| 820 | 820 | print '<td class="right">'.$langs->trans("UnitCost").'</td>'; |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | |
| 911 | 911 | // Lines to consume |
| 912 | 912 | |
| 913 | - $bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO" |
|
| 913 | + $bomcostupdated = 0; // We will recalculate the unitary cost to produce a product using the real "products to consume into MO" |
|
| 914 | 914 | |
| 915 | 915 | if (!empty($object->lines)) { |
| 916 | 916 | $nblinetoconsume = 0; |
@@ -941,8 +941,8 @@ discard block |
||
| 941 | 941 | $costprice = 0; |
| 942 | 942 | } |
| 943 | 943 | } |
| 944 | - $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 945 | - $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 944 | + $linecost = price2num(($line->qty * $costprice) / $object->qty, 'MT'); // price for line for all quantities |
|
| 945 | + $bomcostupdated += price2num(($line->qty * $costprice) / $object->qty, 'MU'); // same but with full accuracy |
|
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | $bomcostupdated = price2num($bomcostupdated, 'MU'); |
@@ -962,23 +962,23 @@ discard block |
||
| 962 | 962 | $alreadyconsumed += $line2['qty']; |
| 963 | 963 | } |
| 964 | 964 | } |
| 965 | - $suffix = '_' . $line->id; |
|
| 966 | - print '<!-- Line to dispatch ' . $suffix . ' -->' . "\n"; |
|
| 965 | + $suffix = '_'.$line->id; |
|
| 966 | + print '<!-- Line to dispatch '.$suffix.' -->'."\n"; |
|
| 967 | 967 | // hidden fields for js function |
| 968 | - print '<input id="qty_ordered' . $suffix . '" type="hidden" value="' . $line->qty . '">'; |
|
| 968 | + print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$line->qty.'">'; |
|
| 969 | 969 | // Duration - Time spent |
| 970 | - print '<input id="qty_dispatched' . $suffix . '" type="hidden" value="' . $alreadyconsumed . '">'; |
|
| 970 | + print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyconsumed.'">'; |
|
| 971 | 971 | print '<tr>'; |
| 972 | - print '<input name="lineid" type="hidden" value="' . $line->id . '">'; |
|
| 972 | + print '<input name="lineid" type="hidden" value="'.$line->id.'">'; |
|
| 973 | 973 | |
| 974 | 974 | // Product |
| 975 | - print '<td>' . $tmpproduct->getNomUrl(1); |
|
| 976 | - print '<br><div class="opacitymedium small tdoverflowmax150" title="' . dol_escape_htmltag($tmpproduct->label) . '">' . $tmpproduct->label . '</span>'; |
|
| 975 | + print '<td>'.$tmpproduct->getNomUrl(1); |
|
| 976 | + print '<br><div class="opacitymedium small tdoverflowmax150" title="'.dol_escape_htmltag($tmpproduct->label).'">'.$tmpproduct->label.'</span>'; |
|
| 977 | 977 | print '</td>'; |
| 978 | 978 | |
| 979 | 979 | // Qty |
| 980 | 980 | print '<td class="right nowraponall">'; |
| 981 | - print '<input name="qty_lineProduce" type="number" value="'. $line->qty.'" width="25px">'; |
|
| 981 | + print '<input name="qty_lineProduce" type="number" value="'.$line->qty.'" width="25px">'; |
|
| 982 | 982 | print '</td>'; |
| 983 | 983 | // Unit |
| 984 | 984 | if ($conf->global->PRODUCT_USE_UNITS) { |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | } |
| 989 | 989 | // Qty consumed |
| 990 | 990 | print '<td class="right">'; |
| 991 | - print ' ' . price2num($alreadyconsumed, 'MS'); |
|
| 991 | + print ' '.price2num($alreadyconsumed, 'MS'); |
|
| 992 | 992 | print '</td>'; |
| 993 | 993 | // Entrepot |
| 994 | 994 | print '<td class="right">'; |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) { |
| 999 | 999 | print img_warning($langs->trans('StockTooLow')).' '; |
| 1000 | 1000 | } |
| 1001 | - print '<span class="left">'. $tmpproduct->stock_reel .' </span>'; |
|
| 1001 | + print '<span class="left">'.$tmpproduct->stock_reel.' </span>'; |
|
| 1002 | 1002 | print '</td>'; |
| 1003 | 1003 | // Batch |
| 1004 | 1004 | print '<td class="right">'; |
@@ -1006,8 +1006,8 @@ discard block |
||
| 1006 | 1006 | |
| 1007 | 1007 | // Action delete line |
| 1008 | 1008 | print '<td>'; |
| 1009 | - print '<input type="submit" class="button buttongen button-add" name="save" value="' . $langs->trans("Edit") . '">'; |
|
| 1010 | - print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">'; |
|
| 1009 | + print '<input type="submit" class="button buttongen button-add" name="save" value="'.$langs->trans("Edit").'">'; |
|
| 1010 | + print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">'; |
|
| 1011 | 1011 | print '</td>'; |
| 1012 | 1012 | |
| 1013 | 1013 | // Action delete line |
@@ -1017,28 +1017,28 @@ discard block |
||
| 1017 | 1017 | print '<td></td>'; |
| 1018 | 1018 | print '</tr>'; |
| 1019 | 1019 | } else { |
| 1020 | - $suffix = '_' . $line->id; |
|
| 1021 | - print '<!-- Line to dispatch ' . $suffix . ' -->' . "\n"; |
|
| 1020 | + $suffix = '_'.$line->id; |
|
| 1021 | + print '<!-- Line to dispatch '.$suffix.' -->'."\n"; |
|
| 1022 | 1022 | // hidden fields for js function |
| 1023 | - print '<input id="qty_ordered' . $suffix . '" type="hidden" value="' . $line->qty . '">'; |
|
| 1024 | - print '<input id="qty_dispatched' . $suffix . '" type="hidden" value="' . $alreadyconsumed . '">'; |
|
| 1023 | + print '<input id="qty_ordered'.$suffix.'" type="hidden" value="'.$line->qty.'">'; |
|
| 1024 | + print '<input id="qty_dispatched'.$suffix.'" type="hidden" value="'.$alreadyconsumed.'">'; |
|
| 1025 | 1025 | |
| 1026 | - print '<tr data-line-id="' . $line->id . '">'; |
|
| 1026 | + print '<tr data-line-id="'.$line->id.'">'; |
|
| 1027 | 1027 | // Product |
| 1028 | - print '<td>' . $tmpproduct->getNomUrl(1); |
|
| 1029 | - print '<br><div class="opacitymedium small tdoverflowmax150" title="' . dol_escape_htmltag($tmpproduct->label) . '">' . $tmpproduct->label . '</div>'; |
|
| 1028 | + print '<td>'.$tmpproduct->getNomUrl(1); |
|
| 1029 | + print '<br><div class="opacitymedium small tdoverflowmax150" title="'.dol_escape_htmltag($tmpproduct->label).'">'.$tmpproduct->label.'</div>'; |
|
| 1030 | 1030 | print '</td>'; |
| 1031 | 1031 | // Qty |
| 1032 | 1032 | print '<td class="right nowraponall">'; |
| 1033 | 1033 | $help = ''; |
| 1034 | 1034 | $picto = 'help'; |
| 1035 | 1035 | if ($line->qty_frozen) { |
| 1036 | - $help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("QuantityFrozen") . '</strong>: ' . yn(1) . ' (' . $langs->trans("QuantityConsumedInvariable") . ')'; |
|
| 1037 | - print $form->textwithpicto('', $help, -1, 'lock') . ' '; |
|
| 1036 | + $help = ($help ? '<br>' : '').'<strong>'.$langs->trans("QuantityFrozen").'</strong>: '.yn(1).' ('.$langs->trans("QuantityConsumedInvariable").')'; |
|
| 1037 | + print $form->textwithpicto('', $help, -1, 'lock').' '; |
|
| 1038 | 1038 | } |
| 1039 | 1039 | if ($line->disable_stock_change) { |
| 1040 | - $help = ($help ? '<br>' : '') . '<strong>' . $langs->trans("DisableStockChange") . '</strong>: ' . yn(1) . ' (' . (($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")) . ')'; |
|
| 1041 | - print $form->textwithpicto('', $help, -1, 'help') . ' '; |
|
| 1040 | + $help = ($help ? '<br>' : '').'<strong>'.$langs->trans("DisableStockChange").'</strong>: '.yn(1).' ('.(($tmpproduct->type == Product::TYPE_SERVICE && empty($conf->global->STOCK_SUPPORTS_SERVICES)) ? $langs->trans("NoStockChangeOnServices") : $langs->trans("DisableStockChangeHelp")).')'; |
|
| 1041 | + print $form->textwithpicto('', $help, -1, 'help').' '; |
|
| 1042 | 1042 | } |
| 1043 | 1043 | print price2num($line->qty, 'MS'); |
| 1044 | 1044 | print '</td>'; |
@@ -1059,9 +1059,9 @@ discard block |
||
| 1059 | 1059 | if ($alreadyconsumed) { |
| 1060 | 1060 | print '<script>'; |
| 1061 | 1061 | print 'jQuery(document).ready(function() { |
| 1062 | - jQuery("#expandtoproduce' . $line->id . '").click(function() { |
|
| 1063 | - console.log("Expand mrp_production line ' . $line->id . '"); |
|
| 1064 | - jQuery(".expanddetail' . $line->id . '").toggle();'; |
|
| 1062 | + jQuery("#expandtoproduce' . $line->id.'").click(function() { |
|
| 1063 | + console.log("Expand mrp_production line ' . $line->id.'"); |
|
| 1064 | + jQuery(".expanddetail' . $line->id.'").toggle();'; |
|
| 1065 | 1065 | if ($nblinetoconsume == $nblinetoconsumecursor) { // If it is the last line |
| 1066 | 1066 | print 'if (jQuery("#tablelines").hasClass("nobottom")) { jQuery("#tablelines").removeClass("nobottom"); } else { jQuery("#tablelines").addClass("nobottom"); }'; |
| 1067 | 1067 | } |
@@ -1070,9 +1070,9 @@ discard block |
||
| 1070 | 1070 | });'; |
| 1071 | 1071 | print '</script>'; |
| 1072 | 1072 | if (empty($conf->use_javascript_ajax)) { |
| 1073 | - print '<a href="' . $_SERVER["PHP_SELF"] . '?collapse=' . $collapse . ',' . $line->id . '">'; |
|
| 1073 | + print '<a href="'.$_SERVER["PHP_SELF"].'?collapse='.$collapse.','.$line->id.'">'; |
|
| 1074 | 1074 | } |
| 1075 | - print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce' . $line->id . '"'); |
|
| 1075 | + print img_picto($langs->trans("ShowDetails"), "chevron-down", 'id="expandtoproduce'.$line->id.'"'); |
|
| 1076 | 1076 | if (empty($conf->use_javascript_ajax)) { |
| 1077 | 1077 | print '</a>'; |
| 1078 | 1078 | } |
@@ -1081,12 +1081,12 @@ discard block |
||
| 1081 | 1081 | print '<script>jQuery("#tablelines").removeClass("nobottom");</script>'; |
| 1082 | 1082 | } |
| 1083 | 1083 | } |
| 1084 | - print ' ' . price2num($alreadyconsumed, 'MS'); |
|
| 1084 | + print ' '.price2num($alreadyconsumed, 'MS'); |
|
| 1085 | 1085 | print '</td>'; |
| 1086 | 1086 | // Warehouse |
| 1087 | 1087 | print '<td>'; |
| 1088 | 1088 | if (!empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE) && $tmpwarehouse->id > 0) { |
| 1089 | - print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label; |
|
| 1089 | + print img_picto('', $tmpwarehouse->picto)." ".$tmpwarehouse->label; |
|
| 1090 | 1090 | } |
| 1091 | 1091 | print '</td>'; |
| 1092 | 1092 | // Stock |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | print '<td class="nowraponall right">'; |
| 1095 | 1095 | if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $tmpproduct->type != Product::TYPE_SERVICE) { |
| 1096 | 1096 | if (!$line->disable_stock_change && $tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) { |
| 1097 | - print img_warning($langs->trans('StockTooLow')) . ' '; |
|
| 1097 | + print img_warning($langs->trans('StockTooLow')).' '; |
|
| 1098 | 1098 | } |
| 1099 | 1099 | if (empty($conf->global->STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE) || empty($tmpwarehouse->id)) { |
| 1100 | 1100 | print price2num($tmpproduct->stock_reel, 'MS'); // Available |
@@ -1124,9 +1124,9 @@ discard block |
||
| 1124 | 1124 | |
| 1125 | 1125 | // Action Edit line |
| 1126 | 1126 | if ($object->status == Mo::STATUS_DRAFT) { |
| 1127 | - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line->id); |
|
| 1127 | + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=editline&token='.newToken().'&lineid='.((int) $line->id); |
|
| 1128 | 1128 | print '<td class="center">'; |
| 1129 | - print '<a class="reposition" href="' . $href . '">'; |
|
| 1129 | + print '<a class="reposition" href="'.$href.'">'; |
|
| 1130 | 1130 | print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit'); |
| 1131 | 1131 | print '</a>'; |
| 1132 | 1132 | print '</td>'; |
@@ -1134,9 +1134,9 @@ discard block |
||
| 1134 | 1134 | |
| 1135 | 1135 | // Action delete line |
| 1136 | 1136 | if ($permissiontodelete) { |
| 1137 | - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=deleteline&token=' . newToken() . '&lineid=' . ((int) $line->id); |
|
| 1137 | + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=deleteline&token='.newToken().'&lineid='.((int) $line->id); |
|
| 1138 | 1138 | print '<td class="center">'; |
| 1139 | - print '<a class="reposition" href="' . $href . '">'; |
|
| 1139 | + print '<a class="reposition" href="'.$href.'">'; |
|
| 1140 | 1140 | print img_picto($langs->trans('TooltipDeleteAndRevertStockMovement'), 'delete'); |
| 1141 | 1141 | print '</a>'; |
| 1142 | 1142 | print '</td>'; |
@@ -1199,9 +1199,9 @@ discard block |
||
| 1199 | 1199 | |
| 1200 | 1200 | // Action Edit line |
| 1201 | 1201 | if ($object->status == Mo::STATUS_DRAFT) { |
| 1202 | - $href = $_SERVER["PHP_SELF"] . '?id=' . ((int) $object->id) . '&action=editline&token=' . newToken() . '&lineid=' . ((int) $line->id); |
|
| 1202 | + $href = $_SERVER["PHP_SELF"].'?id='.((int) $object->id).'&action=editline&token='.newToken().'&lineid='.((int) $line->id); |
|
| 1203 | 1203 | print '<td class="center">'; |
| 1204 | - print '<a class="reposition" href="' . $href . '">'; |
|
| 1204 | + print '<a class="reposition" href="'.$href.'">'; |
|
| 1205 | 1205 | print img_picto($langs->trans('TooltipEditAndRevertStockMovement'), 'edit'); |
| 1206 | 1206 | print '</a>'; |
| 1207 | 1207 | print '</td>'; |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | print '<input type="hidden" name="product-'.$line->id.'-'.$i.'" value="'.$line->fk_product.'">'; |
| 1242 | 1242 | |
| 1243 | 1243 | // Qty |
| 1244 | - print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-' . $line->id . '-' . $i . '" name="qty-' . $line->id . '-' . $i . '" value="' . $preselected . '" ' . $disable . '></td>'; |
|
| 1244 | + print '<td class="right"><input type="text" class="width50 right" id="qtytoconsume-'.$line->id.'-'.$i.'" name="qty-'.$line->id.'-'.$i.'" value="'.$preselected.'" '.$disable.'></td>'; |
|
| 1245 | 1245 | |
| 1246 | 1246 | // Unit |
| 1247 | 1247 | if ($conf->global->PRODUCT_USE_UNITS) print '<td></td>'; |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | |
| 1743 | 1743 | $.ajax({ |
| 1744 | 1744 | type: "POST", |
| 1745 | - url: "<?php echo DOL_URL_ROOT . '/mrp/ajax/interface.php'; ?>", |
|
| 1745 | + url: "<?php echo DOL_URL_ROOT.'/mrp/ajax/interface.php'; ?>", |
|
| 1746 | 1746 | data: { |
| 1747 | 1747 | action: "updateselectbatchbywarehouse", |
| 1748 | 1748 | permissiontoproduce: <?php echo $permissiontoproduce ?>, |
@@ -1803,7 +1803,7 @@ discard block |
||
| 1803 | 1803 | |
| 1804 | 1804 | $.ajax({ |
| 1805 | 1805 | type: "POST", |
| 1806 | - url: "<?php echo DOL_URL_ROOT . '/mrp/ajax/interface.php'; ?>", |
|
| 1806 | + url: "<?php echo DOL_URL_ROOT.'/mrp/ajax/interface.php'; ?>", |
|
| 1807 | 1807 | data: { |
| 1808 | 1808 | action: "updateselectwarehousebybatch", |
| 1809 | 1809 | permissiontoproduce: <?php echo $permissiontoproduce ?>, |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | * Address of the bank account |
| 180 | 180 | * @var string |
| 181 | 181 | */ |
| 182 | - public $domiciliation; // deprecated, use now address |
|
| 182 | + public $domiciliation; // deprecated, use now address |
|
| 183 | 183 | public $address; |
| 184 | 184 | public $state_id; |
| 185 | 185 | public $state_code; |
@@ -460,13 +460,13 @@ discard block |
||
| 460 | 460 | $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url ("; |
| 461 | 461 | $sql .= "fk_bank"; |
| 462 | 462 | $sql .= ", url_id"; |
| 463 | - $sql .= ", url"; // deprecated |
|
| 463 | + $sql .= ", url"; // deprecated |
|
| 464 | 464 | $sql .= ", label"; |
| 465 | 465 | $sql .= ", type"; |
| 466 | 466 | $sql .= ") VALUES ("; |
| 467 | 467 | $sql .= " ".((int) $line_id); |
| 468 | 468 | $sql .= ", ".((int) $url_id); |
| 469 | - $sql .= ", '".$this->db->escape($url)."'"; // dperecated |
|
| 469 | + $sql .= ", '".$this->db->escape($url)."'"; // dperecated |
|
| 470 | 470 | $sql .= ", '".$this->db->escape($label)."'"; |
| 471 | 471 | $sql .= ", '".$this->db->escape($type)."'"; |
| 472 | 472 | $sql .= ")"; |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | |
| 1076 | 1076 | $this->date_creation = $this->db->jdate($obj->date_creation); |
| 1077 | 1077 | $this->date_modification = $this->db->jdate($obj->date_modification); |
| 1078 | - $this->date_update = $this->date_modification; // For compatibility |
|
| 1078 | + $this->date_update = $this->date_modification; // For compatibility |
|
| 1079 | 1079 | |
| 1080 | 1080 | $this->ics = $obj->ics; |
| 1081 | 1081 | $this->ics_transfer = $obj->ics_transfer; |
@@ -1448,9 +1448,9 @@ discard block |
||
| 1448 | 1448 | } |
| 1449 | 1449 | // show categories for this record only in ajax to not overload lists |
| 1450 | 1450 | if (isModEnabled('categorie') && !$nofetch) { |
| 1451 | - require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; |
|
| 1451 | + require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; |
|
| 1452 | 1452 | $form = new Form($this->db); |
| 1453 | - $datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1); |
|
| 1453 | + $datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1); |
|
| 1454 | 1454 | } |
| 1455 | 1455 | |
| 1456 | 1456 | return $datas; |
@@ -1518,7 +1518,7 @@ discard block |
||
| 1518 | 1518 | $label = $langs->trans("BankAccount"); |
| 1519 | 1519 | $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; |
| 1520 | 1520 | } |
| 1521 | - $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
| 1521 | + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); |
|
| 1522 | 1522 | $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; |
| 1523 | 1523 | } else { |
| 1524 | 1524 | $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); |
@@ -1574,7 +1574,7 @@ discard block |
||
| 1574 | 1574 | $this->error = 'SwiftNotValid'; |
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | - if (! $error) { |
|
| 1577 | + if (!$error) { |
|
| 1578 | 1578 | return 1; |
| 1579 | 1579 | } else { |
| 1580 | 1580 | return 0; |
@@ -1953,8 +1953,8 @@ discard block |
||
| 1953 | 1953 | */ |
| 1954 | 1954 | public $datev; |
| 1955 | 1955 | |
| 1956 | - public $amount; /* Amount of payment in the bank account currency */ |
|
| 1957 | - public $amount_main_currency; /* Amount in the currency of company if bank account use another currency */ |
|
| 1956 | + public $amount; /* Amount of payment in the bank account currency */ |
|
| 1957 | + public $amount_main_currency; /* Amount in the currency of company if bank account use another currency */ |
|
| 1958 | 1958 | |
| 1959 | 1959 | /** |
| 1960 | 1960 | * @var int ID |
@@ -2346,7 +2346,7 @@ discard block |
||
| 2346 | 2346 | |
| 2347 | 2347 | // Check statement field |
| 2348 | 2348 | if (!empty($conf->global->BANK_STATEMENT_REGEX_RULE)) { |
| 2349 | - if (!preg_match('/' . getDolGlobalString('BANK_STATEMENT_REGEX_RULE').'/', $this->num_releve)) { |
|
| 2349 | + if (!preg_match('/'.getDolGlobalString('BANK_STATEMENT_REGEX_RULE').'/', $this->num_releve)) { |
|
| 2350 | 2350 | $this->errors[] = $langs->trans("ErrorBankStatementNameMustFollowRegex", $conf->global->BANK_STATEMENT_REGEX_RULE); |
| 2351 | 2351 | return -1; |
| 2352 | 2352 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $invoicestatic->id = $obj->rowid; |
| 163 | 163 | $invoicestatic->ref = $obj->ref; |
| 164 | 164 | $invoicestatic->status = $obj->fk_statut; |
| 165 | - $invoicestatic->statut = $obj->fk_statut; // For backward comaptibility |
|
| 165 | + $invoicestatic->statut = $obj->fk_statut; // For backward comaptibility |
|
| 166 | 166 | $invoicestatic->paye = $obj->paye; |
| 167 | 167 | $invoicestatic->type = $obj->type; |
| 168 | 168 | $invoicestatic->date = $db->jdate($obj->datef); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | $resql2 = $db->query($sqlForSalary); |
| 224 | 224 | if ($resql2) { |
| 225 | 225 | $numRow = $db->num_rows($resql2); |
| 226 | - $j = 0 ; |
|
| 226 | + $j = 0; |
|
| 227 | 227 | |
| 228 | 228 | print '<div class="div-table-responsive-no-min">'; |
| 229 | 229 | print '<table class="noborder rightpercent">'; |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | print '<th colspan="5">'.$langs->trans("SalaryInvoiceWaitingWithdraw").' <span class="opacitymedium">('.$numRow.')</span></th></tr>'; |
| 232 | 232 | |
| 233 | 233 | if ($numRow) { |
| 234 | - while ($j < $numRow && $j<10) { |
|
| 234 | + while ($j < $numRow && $j < 10) { |
|
| 235 | 235 | $objSalary = $db->fetch_object($resql2); |
| 236 | 236 | $user->fetch($objSalary->fk_user); |
| 237 | 237 | $salary->fetch($objSalary->fk_salary); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | } |
| 439 | 439 | $title = $langs->trans("InvoiceWaitingWithdraw"); |
| 440 | 440 | $picto = 'bill'; |
| 441 | - if ($type =='bank-transfer') { |
|
| 441 | + if ($type == 'bank-transfer') { |
|
| 442 | 442 | if ($sourcetype != 'salary') { |
| 443 | 443 | $title = $langs->trans("InvoiceWaitingPaymentByBankTransfer"); |
| 444 | 444 | } else { |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | print '<td>'.$langs->trans("Employee").'</td>'; |
| 481 | 481 | } |
| 482 | 482 | print '<td>'.$langs->trans("RIB").'</td>'; |
| 483 | - print ($sourcetype != 'salary'? '<td>'.$langs->trans("RUM").'</td>' : ''); |
|
| 483 | + print ($sourcetype != 'salary' ? '<td>'.$langs->trans("RUM").'</td>' : ''); |
|
| 484 | 484 | print '<td class="right">'.$langs->trans("AmountTTC").'</td>'; |
| 485 | 485 | print '<td class="right">'.$langs->trans("DateRequest").'</td>'; |
| 486 | 486 | // Action column |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | while ($i < $num && $i < $limit) { |
| 503 | 503 | $obj = $db->fetch_object($resql); |
| 504 | 504 | if ($sourcetype != 'salary') { |
| 505 | - $bac = new CompanyBankAccount($db); // Must include the new in loop so the fetch is clean |
|
| 505 | + $bac = new CompanyBankAccount($db); // Must include the new in loop so the fetch is clean |
|
| 506 | 506 | $bac->fetch(0, $obj->socid); |
| 507 | 507 | |
| 508 | 508 | $invoicestatic->id = $obj->rowid; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $sql .= MAIN_DB_PREFIX."prelevement_demande as pd"; |
| 182 | 182 | $sql .= " WHERE s.rowid = pd.fk_salary"; |
| 183 | 183 | $sql .= " AND u.rowid = s.fk_user"; |
| 184 | - $sql .=" AND s.paye = 0 AND pd.traite = 0"; |
|
| 184 | + $sql .= " AND s.paye = 0 AND pd.traite = 0"; |
|
| 185 | 185 | if ($search_facture) { |
| 186 | 186 | $sql .= natural_search("s.rowid", $search_facture); |
| 187 | 187 | } |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | print '<tr class="liste_titre">'; |
| 254 | 254 | print_liste_field_titre(($sourcetype ? "RefSalary" : "Bill"), $_SERVER["PHP_SELF"]); |
| 255 | -print_liste_field_titre(($sourcetype ? "Employee" :"Company"), $_SERVER["PHP_SELF"]); |
|
| 255 | +print_liste_field_titre(($sourcetype ? "Employee" : "Company"), $_SERVER["PHP_SELF"]); |
|
| 256 | 256 | print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'right '); |
| 257 | 257 | print_liste_field_titre("DateRequest", $_SERVER["PHP_SELF"], "", "", $param, '', '', '', 'center '); |
| 258 | 258 | print_liste_field_titre(''); |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $i = 0; |
| 269 | 269 | |
| 270 | 270 | if ($limit > 0 && $limit != $conf->liste_limit) { |
| 271 | - $param.='&limit='.((int) $limit); |
|
| 271 | + $param .= '&limit='.((int) $limit); |
|
| 272 | 272 | } |
| 273 | 273 | $param = "&id=".urlencode($id); |
| 274 | 274 | |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | print_liste_field_titre("RefSupplierShort", $_SERVER["PHP_SELF"], "f.ref_supplier", '', $param, '', $sortfield, $sortorder); |
| 300 | 300 | } |
| 301 | 301 | print_liste_field_titre(($salaryBonPl ? "Employee" : "ThirdParty"), $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder); |
| 302 | - print_liste_field_titre(($salaryBonPl ? "AmountSalary": "AmountInvoice"), $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder); |
|
| 302 | + print_liste_field_titre(($salaryBonPl ? "AmountSalary" : "AmountInvoice"), $_SERVER["PHP_SELF"], "f.total_ttc", "", $param, 'class="right"', $sortfield, $sortorder); |
|
| 303 | 303 | print_liste_field_titre("AmountRequested", $_SERVER["PHP_SELF"], "pl.amount", "", $param, 'class="right"', $sortfield, $sortorder); |
| 304 | 304 | print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, 'align="center"', $sortfield, $sortorder); |
| 305 | 305 | print_liste_field_titre(''); |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | print "</td>\n"; |
| 349 | 349 | |
| 350 | 350 | // Amount of invoice |
| 351 | - print '<td class="right"><span class="amount">'.price(($salaryBonPl ? $obj->amount :$obj->total_ttc))."</span></td>\n"; |
|
| 351 | + print '<td class="right"><span class="amount">'.price(($salaryBonPl ? $obj->amount : $obj->total_ttc))."</span></td>\n"; |
|
| 352 | 352 | |
| 353 | 353 | // Amount requested |
| 354 | 354 | print '<td class="right"><span class="amount">'.price($obj->amount_requested)."</span></td>\n"; |