Qual: Make option to create automatic personal stock easier to setup
This commit is contained in:
parent
d6984e7133
commit
60dc831ec6
@ -38,7 +38,7 @@ accessforbidden();
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
if ($_POST["action"] == 'STOCK_USERSTOCK')
|
/*if ($_POST["action"] == 'STOCK_USERSTOCK')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "STOCK_USERSTOCK", $_POST["STOCK_USERSTOCK"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "STOCK_USERSTOCK", $_POST["STOCK_USERSTOCK"],'chaine',0,'',$conf->entity);
|
||||||
//On desactive l'autocreation si l'option "stock personnel" est desactivee
|
//On desactive l'autocreation si l'option "stock personnel" est desactivee
|
||||||
@ -49,7 +49,9 @@ if ($_POST["action"] == 'STOCK_USERSTOCK')
|
|||||||
Header("Location: stock.php");
|
Header("Location: stock.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
elseif ($_POST["action"] == 'STOCK_USERSTOCK_AUTOCREATE')
|
else
|
||||||
|
*/
|
||||||
|
if ($_POST["action"] == 'STOCK_USERSTOCK_AUTOCREATE')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", $_POST["STOCK_USERSTOCK_AUTOCREATE"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "STOCK_USERSTOCK_AUTOCREATE", $_POST["STOCK_USERSTOCK_AUTOCREATE"],'chaine',0,'',$conf->entity);
|
||||||
Header("Location: stock.php");
|
Header("Location: stock.php");
|
||||||
@ -133,10 +135,10 @@ print '</tr>'."\n";
|
|||||||
// sousproduits activation/desactivation
|
// sousproduits activation/desactivation
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print "<tr ".$bc[$var].">";
|
/*print "<tr ".$bc[$var].">";
|
||||||
print '<td width="60%">'.$langs->trans("UserWarehouse").'</td>';
|
print '<td width="60%">'.$langs->trans("UserWarehouse").'</td>';
|
||||||
print '<td width="160" align="right">';
|
print '<td width="160" align="right">';
|
||||||
print "<form method=\"post\" action=\"stock.php\">";
|
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK\">";
|
||||||
print $html->selectyesno("STOCK_USERSTOCK",$conf->global->STOCK_USERSTOCK,1);
|
print $html->selectyesno("STOCK_USERSTOCK",$conf->global->STOCK_USERSTOCK,1);
|
||||||
@ -146,7 +148,7 @@ print "</form>\n</td>\n</tr>\n";
|
|||||||
if ($conf->global->STOCK_USERSTOCK == 1)
|
if ($conf->global->STOCK_USERSTOCK == 1)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
*/
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
print '<td width="60%">'.$langs->trans("UserWarehouseAutoCreate").'</td>';
|
print '<td width="60%">'.$langs->trans("UserWarehouseAutoCreate").'</td>';
|
||||||
|
|
||||||
@ -155,12 +157,11 @@ if ($conf->global->STOCK_USERSTOCK == 1)
|
|||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
|
print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
|
||||||
print $html->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
|
print $html->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
|
||||||
|
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
/*} */
|
||||||
|
|
||||||
|
|
||||||
// Title rule for stock decrease
|
// Title rule for stock decrease
|
||||||
|
|||||||
@ -72,4 +72,6 @@ AverageUnitPricePMP=Average input price
|
|||||||
EstimatedStockValueShort=Estimated value of stock
|
EstimatedStockValueShort=Estimated value of stock
|
||||||
EstimatedStockValue=Estimated value of stock
|
EstimatedStockValue=Estimated value of stock
|
||||||
DeleteAWarehouse=Delete a warehouse
|
DeleteAWarehouse=Delete a warehouse
|
||||||
ConfirmDeleteWarehouse=Are you sure you want to delete the warehouse <b>%s</b> ?
|
ConfirmDeleteWarehouse=Are you sure you want to delete the warehouse <b>%s</b> ?
|
||||||
|
PersonalStock=Personal stock %s
|
||||||
|
ThisWarehouseIsPersonalStock=This warehouse represents personal stock of %s %s
|
||||||
@ -38,7 +38,7 @@ EnhancedValue=Valorisation
|
|||||||
PMPValue=Valorisation (PMP)
|
PMPValue=Valorisation (PMP)
|
||||||
PMPValueShort=PMP
|
PMPValueShort=PMP
|
||||||
EnhancedValueOfWarehouses=Valorisation des stocks
|
EnhancedValueOfWarehouses=Valorisation des stocks
|
||||||
UserWarehouseAutoCreate=Créer un stock automatiquement à la création d'un utilisateur
|
UserWarehouseAutoCreate=Créer un stock/entrepot propre à l'utilisateur automatiquement à la création de cet utilisateur
|
||||||
QtyDispatched=Quantité ventilée
|
QtyDispatched=Quantité ventilée
|
||||||
OrderDispatch=Réception vers stocks
|
OrderDispatch=Réception vers stocks
|
||||||
RuleForStockManagementDecrease=Règle de gestion des décrémentations de stock
|
RuleForStockManagementDecrease=Règle de gestion des décrémentations de stock
|
||||||
@ -72,4 +72,6 @@ AverageUnitPricePMP=Prix moyen pondéré (PMP) d'aquisition
|
|||||||
EstimatedStockValueShort=Valorisation (PMP)
|
EstimatedStockValueShort=Valorisation (PMP)
|
||||||
EstimatedStockValue=Valorisation acquisition stock (PMP)
|
EstimatedStockValue=Valorisation acquisition stock (PMP)
|
||||||
DeleteAWarehouse=Supprimer un entrepôt
|
DeleteAWarehouse=Supprimer un entrepôt
|
||||||
ConfirmDeleteWarehouse=Êtes-vous sûr de vouloir supprimer l'entrepôt <b>%s</b> ?
|
ConfirmDeleteWarehouse=Êtes-vous sûr de vouloir supprimer l'entrepôt <b>%s</b> ?
|
||||||
|
PersonalStock=Stock personnel %s
|
||||||
|
ThisWarehouseIsPersonalStock=Cet entrepôt représente le stock personnel de %s %s
|
||||||
@ -750,12 +750,13 @@ class User extends CommonObject
|
|||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($conf->global->STOCK_USERSTOCK) && ! empty($conf->global->STOCK_USERSTOCK_AUTOCREATE))
|
if (! empty($conf->global->STOCK_USERSTOCK_AUTOCREATE))
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/product/stock/class/entrepot.class.php");
|
||||||
|
$langs->load("stocks");
|
||||||
$entrepot = new Entrepot($this->db);
|
$entrepot = new Entrepot($this->db);
|
||||||
$entrepot->libelle = 'Stock Personnel '.$this->nom;
|
$entrepot->libelle = $langs->trans("PersonalStock",$this->nom);
|
||||||
$entrepot->description = 'Cet entrepot represente le stock personnel de '.$this->prenom.' '.$this->nom;
|
$entrepot->description = $langs->trans("ThisWarehouseIsPersonalStock",$this->prenom,$this->nom);
|
||||||
$entrepot->statut = 1;
|
$entrepot->statut = 1;
|
||||||
$entrepot->create($user);
|
$entrepot->create($user);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user