';
-//if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
-//{
-print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule"));
-//}
print ' ';
// Title rule for stock increase
@@ -217,8 +198,8 @@ if (! empty($conf->fournisseur->enabled))
print "\n\n\n";
}
@@ -231,8 +212,8 @@ if (! empty($conf->fournisseur->enabled))
print "\n\n\n";
}
if (! empty($conf->fournisseur->enabled))
@@ -244,8 +225,8 @@ if (! empty($conf->fournisseur->enabled))
print "\n\n\n";
}
@@ -334,6 +315,34 @@ if ($virtualdiffersfromphysical)
print '';
}
+
+$var=true;
+print '
';
+
+print '
';
+print "
".$langs->trans("Other")."
\n";
+print "
\n";
+print '
'."\n";
+
+$var=!$var;
+
+print "
";
+print '
'.$langs->trans("UserWarehouseAutoCreate").'
';
+
+print '
';
+print "';
+print "
\n";
+print "
\n";
+print ' ';
+print '
';
+print ' ';
+
+
llxFooter();
$db->close();
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 8a17273435e..9127ed614b3 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -366,6 +366,16 @@ class Conf
unset($this->global->CONTACT_USE_SEARCH_TO_SELECT);
}
+ if (! empty($conf->productbatch->enabled))
+ {
+ $this->global->STOCK_CALCULATE_ON_BILL=0;
+ $this->global->STOCK_CALCULATE_ON_VALIDATE_ORDER=0;
+ $this->global->STOCK_CALCULATE_ON_SHIPMENT=1;
+ $this->global->STOCK_CALCULATE_ON_SUPPLIER_BILL=0;
+ $this->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER=0;
+ $this->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER=1;
+ }
+
// conf->currency
if (empty($this->global->MAIN_MONNAIE)) $this->global->MAIN_MONNAIE='EUR';
$this->currency=$this->global->MAIN_MONNAIE;
@@ -373,6 +383,9 @@ class Conf
// conf->global->ACCOUNTING_MODE = Option des modules Comptabilites (simple ou expert). Defini le mode de calcul des etats comptables (CA,...)
if (empty($this->global->ACCOUNTING_MODE)) $this->global->ACCOUNTING_MODE='RECETTES-DEPENSES'; // By default. Can be 'RECETTES-DEPENSES' ou 'CREANCES-DETTES'
+ // By default, suppliers objects can be linked to all projects
+ $conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS = 1;
+
// conf->liste_limit = constante de taille maximale des listes
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) $this->global->MAIN_SIZE_LISTE_LIMIT=25;
$this->liste_limit=$this->global->MAIN_SIZE_LISTE_LIMIT;
diff --git a/htdocs/core/modules/modProductBatch.class.php b/htdocs/core/modules/modProductBatch.class.php
index 0cd30f04d22..6eb358aa99d 100644
--- a/htdocs/core/modules/modProductBatch.class.php
+++ b/htdocs/core/modules/modProductBatch.class.php
@@ -67,7 +67,7 @@ class modProductBatch extends DolibarrModules
$this->config_page_url = array();
// Dependencies
- $this->depends = array("modProduct","modStock"); // List of modules id that must be enabled if this module is enabled
+ $this->depends = array("modProduct","modStock","modExpedition","modSupplier"); // List of modules id that must be enabled if this module is enabled. modExpedition is required to manage batch exit (by manual stock decrease on shipment), modSupplier to manage batch entry (after supplier order).
$this->requiredby = array(); // List of modules id to disable if this one is disabled
$this->phpmin = array(5,0); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(3,0); // Minimum version of Dolibarr required by module
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 8984e4c5424..979ed0491a1 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -84,9 +84,24 @@ if ($id > 0 || ! empty($ref))
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('expeditioncard','globalcard'));
+
/*
* Actions
*/
+
+$warehousecanbeselectedlater=1;
+if (! empty($conf->productbatch->enabled))
+{
+ if (! (GETPOST('entrepot_id','int') > 0))
+ {
+ $langs->load("errors");
+ setEventMessage($langs->trans("WarhouseMustBeSelectedAtFirstStepWhenProductBatchModuleOn"),'errors');
+ header("Location: ".DOL_URL_ROOT.'/expedition/shipment.php?id='.$id);
+ exit;
+ }
+}
+
+
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@@ -593,7 +608,7 @@ if ($action == 'create')
print_fiche_titre($langs->trans("CreateASending"));
if (! $origin)
{
- $mesg='
'.$langs->trans("ErrorBadParameters").'
';
+ setEventMessage($langs->trans("ErrorBadParameters"),'errors');
}
dol_htmloutput_mesg($mesg);
@@ -771,10 +786,13 @@ if ($action == 'create')
print '';
if (! empty($conf->stock->enabled))
{
- if (empty($conf->productbatch->enabled)) {
- print '
';
print $formproduct->selectWarehouses(-1,'entrepot_id','',1);
if (count($formproduct->cache_warehouses) <= 0)
diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang
index 435ceadfbbf..0102f688b1b 100644
--- a/htdocs/langs/en_US/productbatch.lang
+++ b/htdocs/langs/en_US/productbatch.lang
@@ -5,16 +5,17 @@ ProductStatusOnBatch=Managed
ProductStatusNotOnBatch=Not Managed
ProductStatusOnBatchShort=Managed
ProductStatusNotOnBatchShort=Not Managed
-Batch=Batch
-atleast1batchfield= Eat-by date or Sell-by date or Batch number
-batch_number= Batch number
-l_eatby= Eat-by date
-l_sellby= Sell-by date
-DetailBatchNumber= Batch details
-DetailBatchFormat= E:%s S: %s BATCH: %s (Qty : %d)
-printBatch= Batch: %s
-printEatby= Eat-by: %s
-printSellby= Sell-by: %s
-printQty= Qty: %d
+Batch=Batch/Serial
+atleast1batchfield=Eat-by date or Sell-by date or Batch number
+batch_number=Batch/Serial number
+l_eatby=Eat-by date
+l_sellby=Sell-by date
+DetailBatchNumber=Batch/Serial details
+DetailBatchFormat=Batch/Serial: %s - E:%s - S: %s (Qty : %d)
+printBatch=Batch: %s
+printEatby=Eat-by: %s
+printSellby=Sell-by: %s
+printQty=Qty: %d
AddDispatchBatchLine=Add a line for Shelf Life dispatching
-BatchDefaultNumber= Undefined
\ No newline at end of file
+BatchDefaultNumber=Undefined
+WhenProductBatchModuleOnOptionAreForced=When module Batch/Serial is on, increase/decrease stock mode is forced to last choice and can't be edited. Other options can be defined as you want.
diff --git a/htdocs/langs/fr_FR/productbatch.lang b/htdocs/langs/fr_FR/productbatch.lang
index 68e76dca46b..83f37508b8d 100644
--- a/htdocs/langs/fr_FR/productbatch.lang
+++ b/htdocs/langs/fr_FR/productbatch.lang
@@ -10,7 +10,7 @@ batch_number= Numéro de lot
l_eatby= DLC
l_sellby= DLUO
DetailBatchNumber= Détails des lots
-DetailBatchFormat= C:%s UO: %s LOT: %s (Qté : %d)
+DetailBatchFormat= Lot/Serie: %s - C:%s - UO: %s (Qté : %d)
printBatch= Lot: %s
printEatby= DLC: %s
printSellby= DLUO: %s
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index e03eb5fa104..133cd9e20cc 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1122,7 +1122,7 @@ else
// Batch number managment
if ($conf->productbatch->enabled) {
- print '