forked from Wavyzz/dolibarr
Merge pull request #1220 from csalvador/select_warehouse
Select warehouse
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||||
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
|
* Copyright (C) 2013 Jean-Francois FERRY <jfefe@aternatik.fr>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -2605,13 +2606,22 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
$formproduct=new FormProduct($db);
|
$formproduct=new FormProduct($db);
|
||||||
|
$warehouse = new Entrepot($db);
|
||||||
|
$warehouse_array = $warehouse->list_array();
|
||||||
|
if (count($warehouse_array) == 1) {
|
||||||
|
$label = $object->type==2?$langs->trans("WarehouseForStockIncrease", current($warehouse_array)):$langs->trans("WarehouseForStockDecrease", current($warehouse_array));
|
||||||
|
$value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">';
|
||||||
|
} else {
|
||||||
$label = $object->type==2?$langs->trans("SelectWarehouseForStockIncrease"):$langs->trans("SelectWarehouseForStockDecrease");
|
$label = $object->type==2?$langs->trans("SelectWarehouseForStockIncrease"):$langs->trans("SelectWarehouseForStockDecrease");
|
||||||
|
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1);
|
||||||
|
}
|
||||||
$formquestion=array(
|
$formquestion=array(
|
||||||
//'text' => $langs->trans("ConfirmClone"),
|
//'text' => $langs->trans("ConfirmClone"),
|
||||||
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||||
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
|
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $value));
|
||||||
}
|
}
|
||||||
if ($object->type != 2 && $object->total_ttc < 0) // Can happen only if $conf->global->FACTURE_ENABLE_NEGATIVE is on
|
if ($object->type != 2 && $object->total_ttc < 0) // Can happen only if $conf->global->FACTURE_ENABLE_NEGATIVE is on
|
||||||
{
|
{
|
||||||
@@ -2639,13 +2649,22 @@ else if ($id > 0 || ! empty($ref))
|
|||||||
{
|
{
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||||
$formproduct=new FormProduct($db);
|
$formproduct=new FormProduct($db);
|
||||||
|
$warehouse = new Entrepot($db);
|
||||||
|
$warehouse_array = $warehouse->list_array();
|
||||||
|
if (count($warehouse_array) == 1) {
|
||||||
|
$label = $object->type==2?$langs->trans("WarehouseForStockDecrease", current($warehouse_array)):$langs->trans("WarehouseForStockIncrease", current($warehouse_array));
|
||||||
|
$value = '<input type="hidden" id="idwarehouse" name="idwarehouse" value="' . key($warehouse_array) . '">';
|
||||||
|
} else {
|
||||||
$label=$object->type==2?$langs->trans("SelectWarehouseForStockDecrease"):$langs->trans("SelectWarehouseForStockIncrease");
|
$label=$object->type==2?$langs->trans("SelectWarehouseForStockDecrease"):$langs->trans("SelectWarehouseForStockIncrease");
|
||||||
|
$value = $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1);
|
||||||
|
}
|
||||||
$formquestion=array(
|
$formquestion=array(
|
||||||
//'text' => $langs->trans("ConfirmClone"),
|
//'text' => $langs->trans("ConfirmClone"),
|
||||||
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
//array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
|
||||||
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
//array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
|
||||||
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
|
array('type' => 'other', 'name' => 'idwarehouse', 'label' => $label, 'value' => $value));
|
||||||
}
|
}
|
||||||
|
|
||||||
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('UnvalidateBill'),$text,'confirm_modif',$formquestion,"yes",1);
|
$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id,$langs->trans('UnvalidateBill'),$text,'confirm_modif',$formquestion,"yes",1);
|
||||||
|
|||||||
@@ -96,3 +96,5 @@ UseVirtualStock=Use virtual stock instead of physical stock
|
|||||||
RuleForStockReplenishment=Rule for stocks replenishment
|
RuleForStockReplenishment=Rule for stocks replenishment
|
||||||
SelectProduct=Select at least one product
|
SelectProduct=Select at least one product
|
||||||
AlertOnly= Alerts only
|
AlertOnly= Alerts only
|
||||||
|
WarehouseForStockDecrease=The warehouse <b>%s</b> will be used for stock decrease
|
||||||
|
WarehouseForStockIncrease=The warehouse <b>%s</b> will be used for stock increase
|
||||||
|
|||||||
@@ -96,3 +96,5 @@ UseVirtualStock=Utiliser le stock théorique à la place du stock physique
|
|||||||
RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks
|
RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks
|
||||||
SelectProduct=Sélectionnez au moins un produit
|
SelectProduct=Sélectionnez au moins un produit
|
||||||
AlertOnly = Alertes seulement
|
AlertOnly = Alertes seulement
|
||||||
|
WarehouseForStockDecrease=L'entrepôt <b>%s</b> sera utilisé pour la décrémentation du stock
|
||||||
|
WarehouseForStockIncrease=L'entrepôt <b>%s</b> sera utilisé pour l'incrémentation du stock
|
||||||
|
|||||||
Reference in New Issue
Block a user