diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index 0592b738fdd..84e0574032f 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -139,6 +139,8 @@ print "
| \n";
print ''."\n";
$var=true;
+$found=0;
+
if (! empty($conf->facture->enabled))
{
$var=!$var;
@@ -151,6 +153,7 @@ if (! empty($conf->facture->enabled))
print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
print '';
print "\n\n\n";
+ $found++;
}
if (! empty($conf->commande->enabled))
@@ -165,6 +168,7 @@ if (! empty($conf->commande->enabled))
print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
print '';
print "\n\n\n";
+ $found++;
}
if (! empty($conf->expedition->enabled))
@@ -179,7 +183,17 @@ if (! empty($conf->expedition->enabled))
print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
print '';
print "\n\n\n";
+ $found++;
}
+
+if (! $found)
+{
+ $var=!$var;
+ print "";
+ print '| '.$langs->trans("NoModueToManageStockDecrease").' | ';
+ print "
\n";
+}
+
print '';
print '
';
@@ -192,6 +206,8 @@ print " | \n";
print ''."\n";
$var=true;
+$found=0;
+
if (! empty($conf->fournisseur->enabled))
{
$var=!$var;
@@ -204,6 +220,7 @@ if (! empty($conf->fournisseur->enabled))
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
print '';
print "\n\n\n";
+ $found++;
}
if (! empty($conf->fournisseur->enabled))
@@ -218,6 +235,7 @@ if (! empty($conf->fournisseur->enabled))
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
print '';
print "\n\n\n";
+ $found++;
}
if (! empty($conf->fournisseur->enabled))
{
@@ -231,65 +249,76 @@ if (! empty($conf->fournisseur->enabled))
print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
print '';
print "\n\n\n";
+ $found++;
+}
+
+if (! $found)
+{
+ $var=!$var;
+ print "";
+ print '| '.$langs->trans("NoModueToManageStockIncrease").' | ';
+ print "
\n";
}
print '';
// Optio to force stock to be enough before adding a line into document
-print '
';
-print '';
-print '';
-print " | ".$langs->trans("RuleForStockAvailability")." | \n";
-print " | \n";
-print '
'."\n";
+if ($conf->invoice->enabled || $conf->order->enabled || $conf->expedition->enabled)
+{
+ print '
';
+ print '';
+ print '';
+ print " | ".$langs->trans("RuleForStockAvailability")." | \n";
+ print " | \n";
+ print '
'."\n";
-if($conf->invoice->enabled) {
- $var = !$var;
- print "";
- print '| '.$langs->trans("StockMustBeEnoughForInvoice").' | ';
- print '';
- print "';
- print " | \n";
- print "
\n";
+ if($conf->invoice->enabled) {
+ $var = !$var;
+ print "";
+ print '| '.$langs->trans("StockMustBeEnoughForInvoice").' | ';
+ print '';
+ print "';
+ print " | \n";
+ print "
\n";
+ }
+
+ if($conf->order->enabled) {
+ $var = !$var;
+ print "";
+ print '| '.$langs->trans("StockMustBeEnoughForOrder").' | ';
+ print '';
+ print "';
+ print " | \n";
+ print "
\n";
+ }
+
+ if($conf->expedition->enabled) {
+ $var = !$var;
+ print "";
+ print '| '.$langs->trans("StockMustBeEnoughForShipment").' | ';
+ print '';
+ print "';
+ print " | \n";
+ print "
\n";
+ }
+ print '
';
}
-if($conf->order->enabled) {
- $var = !$var;
- print "";
- print '| '.$langs->trans("StockMustBeEnoughForOrder").' | ';
- print '';
- print "';
- print " | \n";
- print "
\n";
-}
-
-if($conf->expedition->enabled) {
- $var = !$var;
- print "";
- print '| '.$langs->trans("StockMustBeEnoughForShipment").' | ';
- print '';
- print "';
- print " | \n";
- print "
\n";
-}
-print '
';
-
-
$virtualdiffersfromphysical=0;
if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|| ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index 63ad32f9bf9..4306f7c1fe1 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -1259,7 +1259,7 @@ class BonPrelevement extends CommonObject
$sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_country as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1";
$resql=$this->db->query($sql);
if ($resql)
- {
+ {
$num = $this->db->num_rows($resql);
while ($j < $num)
{
diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
index 2efb6996993..d9d972cc25c 100755
--- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql
@@ -1095,6 +1095,9 @@ ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_task (fk_task);
ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date);
ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour);
+ALTER TABLE llx_projet_task CHANGE COLUMN duration_effective real DEFAULT 0 NULL;
+ALTER TABLE llx_projet_task CHANGE COLUMN planned_workload real DEFAULT 0 NULL;
+
-- add extrafield on ficheinter lines
CREATE TABLE llx_fichinterdet_extrafields
diff --git a/htdocs/install/mysql/tables/llx_projet_task.sql b/htdocs/install/mysql/tables/llx_projet_task.sql
index 98c8845974e..5b9decd23ef 100644
--- a/htdocs/install/mysql/tables/llx_projet_task.sql
+++ b/htdocs/install/mysql/tables/llx_projet_task.sql
@@ -31,10 +31,10 @@ create table llx_projet_task
datev datetime, -- date validation
label varchar(255) NOT NULL,
description text,
- duration_effective real DEFAULT 0 NOT NULL,
- planned_workload real DEFAULT 0 NOT NULL,
- progress integer DEFAULT 0, -- percentage increase
- priority integer DEFAULT 0, -- priority
+ duration_effective real DEFAULT 0,
+ planned_workload real DEFAULT 0,
+ progress integer DEFAULT 0, -- percentage increase
+ priority integer DEFAULT 0, -- priority
fk_user_creat integer, -- user who created the task
fk_user_valid integer, -- user who validated the task
fk_statut smallint DEFAULT 0 NOT NULL,
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 017c819d85e..1335239fd8d 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1590,3 +1590,5 @@ TypePaymentDesc=0:Customer payment type, 1:Supplier payment type, 2:Both custome
IncludePath=Include path (defined into variable %s)
ExpenseReportsSetup=Setup of module Expense Reports
TemplatePDFExpenseReports=Document templates to generate expense report document
+NoModueToManageStockDecrease=No module able to manage automatic stock decrease has been activated. Stock decrease will be done on manual input only.
+NoModueToManageStockIncrease=No module able to manage automatic stock increase has been activated. Stock increase will be done on manual input only.
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 05123fb222c..65351b70638 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -25,6 +25,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@@ -50,6 +51,7 @@ $sortorder = GETPOST("sortorder",'alpha');
$socstatic=new Societe($db);
$projectstatic=new Project($db);
$userstatic=new User($db);
+$tasktmp=new Task($db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$mine:(empty($user->rights->projet->all->lire)?0:2)),1);
//var_dump($projectsListId);
@@ -227,7 +229,9 @@ if (empty($conf->global->PROJECT_HIDE_TASKS))
print '';
if (! empty($obj->taskid))
{
- print ''.$obj->label.'';
+ $tasktmp->id = $obj->taskid;
+ $tasktmp->ref = $obj->label;
+ print $tasktmp->getNomUrl(1,'withproject');
}
else print $langs->trans("NoTasks");
print ' | ';