diff --git a/htdocs/product/card.php b/htdocs/product/card.php index f65898bda68..a3e52f33cd5 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1240,8 +1240,8 @@ else else if ($object->id > 0) { // Fiche en mode edition - if ($action == 'edit' && $usercancreate) - { + if ($action == 'edit' && $usercancreate) + { //WYSIWYG Editor require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -1302,11 +1302,15 @@ else print ''; // Batch number managment - if ($conf->productbatch->enabled) { - print ''.$langs->trans("ManageLotSerial").''; - $statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); - print $form->selectarray('status_batch',$statutarray,$object->status_batch); - print ''; + if ($conf->productbatch->enabled) + { + if ($object->isProduct() || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + print ''.$langs->trans("ManageLotSerial").''; + $statutarray=array('0' => $langs->trans("ProductStatusNotOnBatch"), '1' => $langs->trans("ProductStatusOnBatch")); + print $form->selectarray('status_batch',$statutarray,$object->status_batch); + print ''; + } } // Barcode @@ -1391,7 +1395,6 @@ else print 'duration_unit=='m'?' checked':'').'>'.$langs->trans("Month"); print '  '; print 'duration_unit=='y'?' checked':'').'>'.$langs->trans("Year"); - print ''; } else @@ -1612,7 +1615,7 @@ else { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php'; $formbarcode = new FormBarCode($db); - } + } if ($action == 'editbarcodetype') { $formbarcode->form_barcode_type($_SERVER['PHP_SELF'].'?id='.$object->id,$object->barcode_type,'fk_barcode_type'); @@ -1718,35 +1721,19 @@ else } print ''; - // Status (to sell) - /* - print ''.$langs->trans("Status").' ('.$langs->trans("Sell").')'; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell'); - } else { - print $object->getLibStatut(2,0); - } - print ''; - - // Status (to buy) - print ''.$langs->trans("Status").' ('.$langs->trans("Buy").')'; - if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($object, 'status_buy', 'tobuy', 'ProductStatusOnBuy', 'ProductStatusNotOnBuy'); - } else { - print $object->getLibStatut(2,1); - } - print ''; - */ - // Batch number management (to batch) - if (! empty($conf->productbatch->enabled)) { - print ''.$langs->trans("ManageLotSerial").''; - if (! empty($conf->use_javascript_ajax) && $usercancreate && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { - print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch'); - } else { - print $object->getLibStatut(0,2); - } - print ''; + if (! empty($conf->productbatch->enabled)) + { + if ($object->isProduct() || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) + { + print ''.$langs->trans("ManageLotSerial").''; + if (! empty($conf->use_javascript_ajax) && $usercancreate && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) { + print ajax_object_onoff($object, 'status_batch', 'tobatch', 'ProductStatusOnBatch', 'ProductStatusNotOnBatch'); + } else { + print $object->getLibStatut(0,2); + } + print ''; + } } // Description