2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of https://github.com/atm-gauthier/dolibarr into feature_Product_stock_subproduct_stock_independent

This commit is contained in:
Alexis Algoud
2015-02-23 10:51:41 +01:00
3 changed files with 25 additions and 3 deletions

View File

@@ -87,6 +87,9 @@ if($action)
if($action == 'STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT') {
$res = dolibarr_set_const($db, "STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", GETPOST('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT','alpha'),'chaine',0,'',$conf->entity);
}
if($action == 'INDEPENDANT_SUBPRODUCT_STOCK') {
$res = dolibarr_set_const($db, "INDEPENDANT_SUBPRODUCT_STOCK", GETPOST('INDEPENDANT_SUBPRODUCT_STOCK','alpha'),'chaine',0,'',$conf->entity);
}
if (! $res > 0) $error++;
@@ -339,9 +342,27 @@ print '</form>';
print "</td>\n";
print "</tr>\n";
print '<br>';
print '</table>';
print '<br>';
if($conf->global->PRODUIT_SOUSPRODUITS) {
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="60%">'.$langs->trans("IndependantSubProductStock").'</td>';
print '<td width="160" align="right">';
print "<form method=\"post\" action=\"stock.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print "<input type=\"hidden\" name=\"action\" value=\"INDEPENDANT_SUBPRODUCT_STOCK\">";
print $form->selectyesno("INDEPENDANT_SUBPRODUCT_STOCK",$conf->global->INDEPENDANT_SUBPRODUCT_STOCK,1);
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print '</form>';
print "</td>\n";
print "</tr>\n";
}
print '</table>';
llxFooter();

View File

@@ -47,6 +47,7 @@ PMPValue=Weighted average price
PMPValueShort=WAP
EnhancedValueOfWarehouses=Warehouses value
UserWarehouseAutoCreate=Create a warehouse automatically when creating a user
IndependantSubProductStock=Product stock and subproduct stock are independant
QtyDispatched=Quantity dispatched
QtyDispatchedShort=Qty dispatched
QtyToDispatchShort=Qty to dispatch

View File

@@ -292,7 +292,7 @@ class MouvementStock extends CommonObject
}
// Add movement for sub products (recursive call)
if (! $error && ! empty($conf->global->PRODUIT_SOUSPRODUITS))
if (! $error && ! empty($conf->global->PRODUIT_SOUSPRODUITS) && empty($conf->global->INDEPENDANT_SUBPRODUCT_STOCK))
{
$error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label, $inventorycode); // we use 0 as price, because pmp is not changed for subproduct
}