diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index c7893aefd2f..cbe602f7313 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -726,7 +726,9 @@ if ($action == 'create') print ''; print $langs->trans("Weight"); print ' '; - print $formproduct->select_measuring_units("weight_units","weight",GETPOST('weight_units','int')); + $text=$formproduct->select_measuring_units("weight_units","weight",GETPOST('weight_units','int')); + $htmltext=$langs->trans("KeepEmptyForAutoCalculation"); + print $form->textwithpicto($text, $htmltext); print ''; // Dim print ''; @@ -735,7 +737,9 @@ if ($action == 'create') print ' x '; print ' x '; print ' '; - print $formproduct->select_measuring_units("size_units","size"); + $text=$formproduct->select_measuring_units("size_units","size"); + $htmltext=$langs->trans("KeepEmptyForAutoCalculation"); + print $form->textwithpicto($text, $htmltext); print ''; // Delivery method @@ -865,7 +869,7 @@ if ($action == 'create') if (! empty($line->date_start)) $type=1; if (! empty($line->date_end)) $type=1; - print "\n"; + print ''."\n"; // Product label if ($line->fk_product > 0) // If predefined product @@ -1096,10 +1100,10 @@ if ($action == 'create') $nbofsuggested++; } } + $tmpwarehouseObject=new Entrepot($db); foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) // $stock_warehouse is product_stock { - $warehouseObject=new Entrepot($db); - $warehouseObject->fetch($warehouse_id); + $tmpwarehouseObject->fetch($warehouse_id); if ($stock_warehouse->real > 0) { $stock = + $stock_warehouse->real; // Convert it to number @@ -1122,7 +1126,7 @@ if ($action == 'create') print ''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - print $warehouseObject->getNomUrl(0).' '; + print $tmpwarehouseObject->getNomUrl(0).' '; print ''; print '('.$stock.')'; @@ -1158,7 +1162,7 @@ if ($action == 'create') { $img=img_warning($langs->trans("StockTooLow")); } - print ""; + print ''; print "      -> ".$value['fullpath']." (".$value['nb'].") ".$value['nb_total']."   @@ -1175,7 +1179,7 @@ if ($action == 'create') $subj=0; print ''; - $warehouseObject=new Entrepot($db); + $tmpwarehouseObject=new Entrepot($db); $productlotObject=new Productlot($db); // Define nb of lines suggested for this order line $nbofsuggested=0; @@ -1190,7 +1194,7 @@ if ($action == 'create') } foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) { - $warehouseObject->fetch($warehouse_id); + $tmpwarehouseObject->fetch($warehouse_id); if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) { foreach ($stock_warehouse->detail_batch as $dbatch) { @@ -1203,7 +1207,7 @@ if ($action == 'create') print ''; - print $warehouseObject->getNomUrl(0).' / '; + print $tmpwarehouseObject->getNomUrl(0).' / '; print ''; print ''; @@ -1223,6 +1227,7 @@ if ($action == 'create') } } } + } if ($subj == 0) // Line not shown yet, we show it { @@ -1246,8 +1251,11 @@ if ($action == 'create') print ''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) { - if ($warehouseObject) + $warehouse_selected_id = GETPOST('entrepot_id','int'); + if ($warehouse_selected_id > 0) { + $warehouseObject=new Entrepot($db); + $warehouseObject->fetch($warehouse_selected_id); print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->libelle); } else diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang index 48ced509c47..0ab21cae322 100644 --- a/htdocs/langs/en_US/products.lang +++ b/htdocs/langs/en_US/products.lang @@ -198,6 +198,7 @@ MultipriceRules=Price segment rules UseMultipriceRules=Use price segment rules (defined into product module setup) to autocalculate prices of all other segment according to first segment PercentVariationOver=%% variation over %s PercentDiscountOver=%% discount over %s +KeepEmptyForAutoCalculation=Keep empty to have this calculated automatically from weight or volume of products ### composition fabrication Build=Produce ProductsMultiPrice=Products and prices for each price segment