mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Debug default BOM on product
This commit is contained in:
parent
baec6aa169
commit
ecb673f15c
|
|
@ -399,3 +399,5 @@ ProductSupplierExtraFields=Additional Attributes (Supplier Prices)
|
|||
DeleteLinkedProduct=Delete the child product linked to the combination
|
||||
PMPValue=Weighted average price
|
||||
PMPValueShort=WAP
|
||||
DefaultBOM=Default BOM
|
||||
DefaultBOMDesc=The default BOM recommended to use to manufacture this product. This field can be set only if nature of product is '%s'.
|
||||
|
|
@ -1221,8 +1221,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<tr><td>'.$form->textwithpicto($langs->trans("StockLimit"), $langs->trans("StockLimitDesc"), 1).'</td><td>';
|
||||
print '<input name="seuil_stock_alerte" class="maxwidth50" value="'.GETPOST('seuil_stock_alerte').'">';
|
||||
print '</td>';
|
||||
|
||||
print '</tr><tr>';
|
||||
print '</tr>';
|
||||
|
||||
// Stock desired level
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).'</td><td>';
|
||||
|
|
@ -1252,7 +1251,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($type != 1) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
||||
// Brut Weight
|
||||
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
|
||||
|
|
@ -1788,7 +1789,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print $formproduct->selectProductNature('finished', $object->finished);
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$object->isService() && !empty($conf->bom->enabled)) {
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).'</td><td>';
|
||||
$bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".$object->id;
|
||||
print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (!$object->isService()) {
|
||||
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
||||
// Brut Weight
|
||||
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
|
||||
|
|
@ -1911,13 +1921,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if (!$object->isService() && !empty($conf->bom->enabled)) {
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).'</td><td>';
|
||||
$bomkey = "Bom:bom/class/bom.class.php:0:t.status=1 AND t.fk_product=".$object->id;
|
||||
print $form->selectForForms($bomkey, 'fk_default_bom', $object->fk_default_bom, 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
// Accountancy_code_sell
|
||||
|
|
@ -2279,7 +2282,19 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print $object->getLibFinished();
|
||||
print '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
if (!$object->isService() && !empty($conf->bom->enabled) && $object->finished) {
|
||||
print '<tr><td class="titlefield">'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc", $langs->transnoentitiesnoconv("Finished"))).'</td><td>';
|
||||
if ($object->fk_default_bom) {
|
||||
$bom_static = new BOM($db);
|
||||
$bom_static->fetch($object->fk_default_bom);
|
||||
print $bom_static->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if (!$object->isService()) {
|
||||
// Brut Weight
|
||||
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td>';
|
||||
|
|
@ -2370,17 +2385,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<tr><td>'.$langs->trans("QCFrequency").'</td><td>'.$object->qc_frequency.'</td></tr>';
|
||||
}
|
||||
|
||||
if (!$object->isService() && !empty($conf->bom->enabled)) {
|
||||
print '<tr><td class="titlefield">'.$form->textwithpicto($langs->trans("DefaultBOM"), $langs->trans("DefaultBOMDesc")).'</td><td>';
|
||||
if ($object->fk_default_bom) {
|
||||
$bom_static = new BOM($db);
|
||||
$bom_static->fetch($object->fk_default_bom);
|
||||
print $bom_static->getNomUrl(1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
// Other attributes
|
||||
$parameters = array();
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
|
|
|||
|
|
@ -477,18 +477,13 @@ class FormProduct
|
|||
$filter = array();
|
||||
$filter['t.active'] = 1;
|
||||
|
||||
$result = $productNature->fetchAll(
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
$filter
|
||||
);
|
||||
$result = $productNature->fetchAll('', '', 0, 0, $filter);
|
||||
|
||||
if ($result < 0) {
|
||||
dol_print_error($db);
|
||||
return -1;
|
||||
} else {
|
||||
$return .= '<select class="flat" name="'.$name.'">';
|
||||
$return .= '<select class="flat" name="'.$name.'" id="'.$name.'">';
|
||||
if ($showempty || ($selected == '' || $selected == '-1')) {
|
||||
$return .= '<option value="-1"';
|
||||
if ($selected == '' || $selected == '-1') {
|
||||
|
|
@ -521,6 +516,8 @@ class FormProduct
|
|||
$return .= '</select>';
|
||||
}
|
||||
|
||||
$return .= ajax_combobox($name);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user