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
|
DeleteLinkedProduct=Delete the child product linked to the combination
|
||||||
PMPValue=Weighted average price
|
PMPValue=Weighted average price
|
||||||
PMPValueShort=WAP
|
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 '<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 '<input name="seuil_stock_alerte" class="maxwidth50" value="'.GETPOST('seuil_stock_alerte').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
print '</tr><tr>';
|
|
||||||
|
|
||||||
// Stock desired level
|
// Stock desired level
|
||||||
print '<tr><td>'.$form->textwithpicto($langs->trans("DesiredStock"), $langs->trans("DesiredStockDesc"), 1).'</td><td>';
|
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 $form->selectarray('finished', $statutarray, GETPOST('finished', 'alpha'), 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($type != 1) {
|
||||||
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
||||||
// Brut Weight
|
// Brut Weight
|
||||||
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
|
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 $formproduct->selectProductNature('finished', $object->finished);
|
||||||
print '</td></tr>';
|
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)) {
|
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
||||||
// Brut Weight
|
// Brut Weight
|
||||||
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
|
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
|
||||||
@ -1911,13 +1921,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
print '<table class="border centpercent">';
|
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->global->PRODUCT_DISABLE_ACCOUNTING)) {
|
||||||
if (!empty($conf->accounting->enabled)) {
|
if (!empty($conf->accounting->enabled)) {
|
||||||
// Accountancy_code_sell
|
// Accountancy_code_sell
|
||||||
@ -2279,7 +2282,19 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
print $object->getLibFinished();
|
print $object->getLibFinished();
|
||||||
print '</td></tr>';
|
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
|
// Brut Weight
|
||||||
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Weight").'</td><td>';
|
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>';
|
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
|
// Other attributes
|
||||||
$parameters = array();
|
$parameters = array();
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||||
|
|||||||
@ -477,18 +477,13 @@ class FormProduct
|
|||||||
$filter = array();
|
$filter = array();
|
||||||
$filter['t.active'] = 1;
|
$filter['t.active'] = 1;
|
||||||
|
|
||||||
$result = $productNature->fetchAll(
|
$result = $productNature->fetchAll('', '', 0, 0, $filter);
|
||||||
'',
|
|
||||||
'',
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
$filter
|
|
||||||
);
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
$return .= '<select class="flat" name="'.$name.'">';
|
$return .= '<select class="flat" name="'.$name.'" id="'.$name.'">';
|
||||||
if ($showempty || ($selected == '' || $selected == '-1')) {
|
if ($showempty || ($selected == '' || $selected == '-1')) {
|
||||||
$return .= '<option value="-1"';
|
$return .= '<option value="-1"';
|
||||||
if ($selected == '' || $selected == '-1') {
|
if ($selected == '' || $selected == '-1') {
|
||||||
@ -521,6 +516,8 @@ class FormProduct
|
|||||||
$return .= '</select>';
|
$return .= '</select>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$return .= ajax_combobox($name);
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user