Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into dev_importexport_ressources

This commit is contained in:
florian HENRY 2017-04-19 14:48:06 +02:00
commit 10541e0c53
2 changed files with 20 additions and 11 deletions

View File

@ -726,7 +726,9 @@ if ($action == 'create')
print '<tr><td>'; print '<tr><td>';
print $langs->trans("Weight"); print $langs->trans("Weight");
print '</td><td><input name="weight" size="4" value="'.GETPOST('weight','int').'"> '; print '</td><td><input name="weight" size="4" value="'.GETPOST('weight','int').'"> ';
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 '</td></tr>'; print '</td></tr>';
// Dim // Dim
print '<tr><td>'; print '<tr><td>';
@ -735,7 +737,9 @@ if ($action == 'create')
print ' x <input name="sizeH" size="4" value="'.GETPOST('sizeH','int').'">'; print ' x <input name="sizeH" size="4" value="'.GETPOST('sizeH','int').'">';
print ' x <input name="sizeS" size="4" value="'.GETPOST('sizeS','int').'">'; print ' x <input name="sizeS" size="4" value="'.GETPOST('sizeS','int').'">';
print ' '; 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 '</td></tr>'; print '</td></tr>';
// Delivery method // Delivery method
@ -865,7 +869,7 @@ if ($action == 'create')
if (! empty($line->date_start)) $type=1; if (! empty($line->date_start)) $type=1;
if (! empty($line->date_end)) $type=1; if (! empty($line->date_end)) $type=1;
print "<tr ".$bc[$var].">\n"; print '<tr class="oddeven">'."\n";
// Product label // Product label
if ($line->fk_product > 0) // If predefined product if ($line->fk_product > 0) // If predefined product
@ -1096,10 +1100,10 @@ if ($action == 'create')
$nbofsuggested++; $nbofsuggested++;
} }
} }
$tmpwarehouseObject=new Entrepot($db);
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) // $stock_warehouse is product_stock foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) // $stock_warehouse is product_stock
{ {
$warehouseObject=new Entrepot($db); $tmpwarehouseObject->fetch($warehouse_id);
$warehouseObject->fetch($warehouse_id);
if ($stock_warehouse->real > 0) if ($stock_warehouse->real > 0)
{ {
$stock = + $stock_warehouse->real; // Convert it to number $stock = + $stock_warehouse->real; // Convert it to number
@ -1122,7 +1126,7 @@ if ($action == 'create')
print '<td align="left">'; print '<td align="left">';
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES))
{ {
print $warehouseObject->getNomUrl(0).' '; print $tmpwarehouseObject->getNomUrl(0).' ';
print '<!-- Show details of stock -->'; print '<!-- Show details of stock -->';
print '('.$stock.')'; print '('.$stock.')';
@ -1158,7 +1162,7 @@ if ($action == 'create')
{ {
$img=img_warning($langs->trans("StockTooLow")); $img=img_warning($langs->trans("StockTooLow"));
} }
print "<tr ".$bc[$var]."><td>"; print '<tr class"oddeven"><td>';
print "&nbsp; &nbsp; &nbsp; -> print "&nbsp; &nbsp; &nbsp; ->
<a href=\"".DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']." <a href=\"".DOL_URL_ROOT."/product/card.php?id=".$value['id']."\">".$value['fullpath']."
</a> (".$value['nb'].")</td><td align=\"center\"> ".$value['nb_total']."</td><td>&nbsp</td><td>&nbsp</td> </a> (".$value['nb'].")</td><td align=\"center\"> ".$value['nb_total']."</td><td>&nbsp</td><td>&nbsp</td>
@ -1175,7 +1179,7 @@ if ($action == 'create')
$subj=0; $subj=0;
print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">'; print '<input name="idl'.$indiceAsked.'" type="hidden" value="'.$line->id.'">';
$warehouseObject=new Entrepot($db); $tmpwarehouseObject=new Entrepot($db);
$productlotObject=new Productlot($db); $productlotObject=new Productlot($db);
// Define nb of lines suggested for this order line // Define nb of lines suggested for this order line
$nbofsuggested=0; $nbofsuggested=0;
@ -1190,7 +1194,7 @@ if ($action == 'create')
} }
foreach ($product->stock_warehouse as $warehouse_id=>$stock_warehouse) 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))) { if (($stock_warehouse->real > 0) && (count($stock_warehouse->detail_batch))) {
foreach ($stock_warehouse->detail_batch as $dbatch) foreach ($stock_warehouse->detail_batch as $dbatch)
{ {
@ -1203,7 +1207,7 @@ if ($action == 'create')
print '<td align="left">'; print '<td align="left">';
print $warehouseObject->getNomUrl(0).' / '; print $tmpwarehouseObject->getNomUrl(0).' / ';
print '<!-- Show details of lot -->'; print '<!-- Show details of lot -->';
print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">'; print '<input name="batchl'.$indiceAsked.'_'.$subj.'" type="hidden" value="'.$dbatch->id.'">';
@ -1223,6 +1227,7 @@ if ($action == 'create')
} }
} }
} }
} }
if ($subj == 0) // Line not shown yet, we show it if ($subj == 0) // Line not shown yet, we show it
{ {
@ -1246,8 +1251,11 @@ if ($action == 'create')
print '<td align="left">'; print '<td align="left">';
if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) 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); print img_warning().' '.$langs->trans("NoProductToShipFoundIntoStock", $warehouseObject->libelle);
} }
else else

View File

@ -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 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 PercentVariationOver=%% variation over %s
PercentDiscountOver=%% discount over %s PercentDiscountOver=%% discount over %s
KeepEmptyForAutoCalculation=Keep empty to have this calculated automatically from weight or volume of products
### composition fabrication ### composition fabrication
Build=Produce Build=Produce
ProductsMultiPrice=Products and prices for each price segment ProductsMultiPrice=Products and prices for each price segment