';
- if ($num)
+ $var = true;
+ if ($num > 0)
{
$i = 0;
- $var = true;
while ($i < $num)
{
$var=!$var;
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index aa6df1afb2b..44a2b9356e8 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -977,7 +977,12 @@ if ($resql)
}
// Show total line
- if (isset($totalarray['totalhtfield']))
+ if (isset($totalarray['totalhtfield'])
+ || isset($totalarray['totalvatfield'])
+ || isset($totalarray['totalttcfield'])
+ || isset($totalarray['totalamfield'])
+ || isset($totalarray['totalrtpfield'])
+ )
{
print '
';
$i=0;
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index c72671319bc..073a20bc391 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1398,7 +1398,12 @@ if ($resql)
}
// Show total line
- if (isset($totalarray['totalhtfield']))
+ if (isset($totalarray['totalhtfield'])
+ || isset($totalarray['totalvatfield'])
+ || isset($totalarray['totalttcfield'])
+ || isset($totalarray['totalamfield'])
+ || isset($totalarray['totalrtpfield'])
+ )
{
print '
';
$i=0;
diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php
index a709a7aef3a..2b3c69a9e15 100644
--- a/htdocs/core/boxes/box_graph_product_distribution.php
+++ b/htdocs/core/boxes/box_graph_product_distribution.php
@@ -249,6 +249,8 @@ class box_graph_product_distribution extends ModeleBoxes
if (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire))
{
+ $langs->load("orders");
+
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
if ($showordernb)
{
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 745955c45b9..0b5778a512a 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -931,36 +931,40 @@ class Form
/**
* Output html form to select a third party
*
- * @param string $selected Preselected type
- * @param string $htmlname Name of field in form
- * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)')
- * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
- * @param int $showtype Show third party type in combolist (customer, prospect or supplier)
- * @param int $forcecombo Force to use combo box
- * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
- * @param int $limit Maximum number of elements
- * @param string $morecss Add more css styles to the SELECT component
- * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
- * @return string HTML string with select box for thirdparty.
+ * @param string $selected Preselected type
+ * @param string $htmlname Name of field in form
+ * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client IN (1,3)')
+ * @param string $showempty Add an empty field (Can be '1' or text key to use on empty line like 'SelectThirdParty')
+ * @param int $showtype Show third party type in combolist (customer, prospect or supplier)
+ * @param int $forcecombo Force to use combo box
+ * @param array $events Ajax event options to run on change. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
+ * @param int $limit Maximum number of elements
+ * @param string $morecss Add more css styles to the SELECT component
+ * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
+ * @param string $selected_input_value Value of preselected input text (for use with ajax)
+ * @param int $hidelabel Hide label (0=no, 1=yes, 2=show search icon (before) and placeholder, 3 search icon after)
+ * @param array $ajaxoptions Options for ajax_autocompleter
+ * @return string HTML string with select box for thirdparty.
*/
- function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='')
+ function select_company($selected='', $htmlname='socid', $filter='', $showempty='', $showtype=0, $forcecombo=0, $events=array(), $limit=0, $morecss='minwidth100', $moreparam='', $selected_input_value='', $hidelabel=1, $ajaxoptions=array())
{
+ global $conf,$user,$langs;
+
$out='';
- /* TODO Use ajax_autocompleter like for products (not finished)
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT) && ! $forcecombo)
{
$placeholder='';
-
if ($selected && empty($selected_input_value))
{
- require_once DOL_DOCUMENT_ROOT.'/societe/ajaxcompanies.php';
- $societe = new Societe($this->db);
- $societe->fetch($selected);
- $selected_input_value=$societe->ref;
+ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+ $societetmp = new Societe($this->db);
+ $societetmp->fetch($selected);
+ $selected_input_value=$societetmp->name;
+ unset($societetmp);
}
- // mode=1 means customers products
- $urloption='htmlname='.$htmlname.'&outjson=1&price_level='.$price_level.'&type='.$filtertype.'&mode=1&status='.$status.'&finished='.$finished;
+ // mode 1
+ $urloption='htmlname='.$htmlname.'&outjson=1&filter='.$filter;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
if (empty($hidelabel)) print $langs->trans("RefOrLabel").' : ';
else if ($hidelabel > 1) {
@@ -970,15 +974,15 @@ class Form
print img_picto($langs->trans("Search"), 'search');
}
}
- print '';
+ print 'global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
if ($hidelabel == 3) {
print img_picto($langs->trans("Search"), 'search');
}
}
else
- {*/
+ {
$out.=$this->select_thirdparty_list($selected, $htmlname, $filter, $showempty, $showtype, $forcecombo, $events, '', 0, $limit, $morecss, $moreparam);
- //}
+ }
return $out;
}
@@ -1004,7 +1008,8 @@ class Form
{
global $conf,$user,$langs;
- $out=''; $num=0;
+ $out='';
+ $num=0;
$outarray=array();
// On recherche les societes
@@ -1020,19 +1025,18 @@ class Form
if ($filterkey && $filterkey != '')
{
$sql.=" AND (";
- if (! empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)) // Can use index
- {
- $sql.="(s.name LIKE '".$this->db->escape($filterkey)."%')";
+ $prefix=empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE)?'%':''; // Can use index if COMPANY_DONOTSEARCH_ANYWHERE is on
+ // For natural search
+ $scrit = explode(' ', $filterkey);
+ $i=0;
+ if (count($scrit) > 1) $sql.="(";
+ foreach ($scrit as $crit) {
+ if ($i > 0) $sql.=" AND ";
+ $sql.="(s.nom LIKE '".$this->db->escape($prefix.$crit)."%')";
+ $i++;
}
- else
- {
- // For natural search
- $scrit = explode(' ', $filterkey);
- foreach ($scrit as $crit) {
- $sql.=" AND (s.name LIKE '%".$this->db->escape($crit)."%')";
- }
- }
- if (! empty($conf->barcode->enabled))
+ if (count($scrit) > 1) $sql.=")";
+ if (! empty($conf->barcode->enabled))
{
$sql .= " OR s.barcode LIKE '".$this->db->escape($filterkey)."%'";
}
@@ -1041,20 +1045,22 @@ class Form
$sql.=$this->db->order("nom","ASC");
if ($limit > 0) $sql.=$this->db->plimit($limit);
+ // Build output string
dol_syslog(get_class($this)."::select_thirdparty_list", LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
+ $events = null;
+
if ($conf->use_javascript_ajax && ! $forcecombo)
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
$comboenhancement =ajax_combobox($htmlname, $events, $conf->global->COMPANY_USE_SEARCH_TO_SELECT);
$out.= $comboenhancement;
- $nodatarole=($comboenhancement?' data-role="none"':'');
}
// Construct $out and $outarray
- $out.= '
';
}
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 21156abd12f..d27d6c1cdb1 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1725,7 +1725,6 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu
}
$original_file=$conf->expedition->dir_output."/sending/".$original_file;
}
-
// Wrapping pour les bons de livraison
else if ($modulepart == 'livraison' && !empty($conf->expedition->dir_output))
{
diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php
index 123fcef662c..a28bbac5e5a 100644
--- a/htdocs/core/tpl/ajaxrow.tpl.php
+++ b/htdocs/core/tpl/ajaxrow.tpl.php
@@ -40,6 +40,7 @@ $(document).ready(function(){
$(".tdlineupdown").css("background-repeat","no-repeat");
$(".tdlineupdown").css("background-position","center center");
+ console.log("Prepare tableDnd for #");
$("#").tableDnD({
onDrop: function(table, row) {
var reloadpage = "";
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 70c3f1a831a..855357ef2bd 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -1950,7 +1950,7 @@ class CommandeFournisseur extends CommonOrder
}
}
- if (! $error && ! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS_NEED_APPROVE) && ($type == 'tot')) // Accept to move to rception done, only if status of all line are ok (refuse denied)
+ if (! $error && ! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS_NEED_APPROVE) && ($type == 'tot')) // Accept to move to reception done, only if status of all line are ok (refuse denied)
{
$dispatcheddenied=$this->getDispachedLines(2);
if (count($dispatchedlinearray) > 0)
@@ -1989,7 +1989,8 @@ class CommandeFournisseur extends CommonOrder
$result = 0;
$old_statut = $this->statut;
$this->statut = $statut;
-
+ $this->actionmsg2 = $comment;
+
// Call trigger
$result=$this->call_trigger('ORDER_SUPPLIER_RECEIVE',$user);
if ($result < 0) $error++;
@@ -2811,13 +2812,14 @@ class CommandeFournisseur extends CommonOrder
*
* @param User $user User action
* @param int $closeopenorder Close if received
+ * @param string $comment Comment
* @return int <0 if KO, 0 if not applicable, >0 if OK
*/
- public function calcAndSetStatusDispatch(User $user, $closeopenorder=1)
+ public function calcAndSetStatusDispatch(User $user, $closeopenorder=1, $comment='')
{
- global $conf;
+ global $conf, $langs;
- if (! empty($conf->commande->enabled) && ! empty($conf->fournisseur->enabled))
+ if (! empty($conf->fournisseur->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
@@ -2846,14 +2848,18 @@ class CommandeFournisseur extends CommonOrder
foreach($this->lines as $line) {
$qtywished[$line->fk_product]+=$line->qty;
}
+
+ $date_liv = dol_now();
+
//Compare array
$diff_array=array_diff_assoc($qtydelivered,$qtywished);
- if (count($diff_array)==0)
+
+ if (count($diff_array)==0) //No diff => mean everythings is received
{
- //No diff => mean everythings is received
if ($closeopenorder)
{
- $ret=$this->setStatus($user,5);
+ //$ret=$this->setStatus($user,5);
+ $ret = $this->Livraison($user, $date_liv, 'tot', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($ret<0) {
return -1;
}
@@ -2862,7 +2868,8 @@ class CommandeFournisseur extends CommonOrder
else
{
//Diff => received partially
- $ret=$this->setStatus($user,4);
+ //$ret=$this->setStatus($user,4);
+ $ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($ret<0) {
return -1;
}
@@ -2872,7 +2879,7 @@ class CommandeFournisseur extends CommonOrder
else
{
//Diff => received partially
- $ret=$this->setStatus($user,4);
+ $ret = $this->Livraison($user, $date_liv, 'par', $comment); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($ret<0) {
return -1;
}
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index dc34686361f..c87b3a62bed 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -230,7 +230,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
}
if (! $error) {
- $result = $object->calcAndSetStatusDispatch($user, GETPOST('closeopenorder')?1:0);
+ $result = $object->calcAndSetStatusDispatch($user, GETPOST('closeopenorder')?1:0, GETPOST('comment'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error ++;
@@ -340,26 +340,7 @@ if ($id > 0 || ! empty($ref)) {
print '';
print '
';
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 77a99994fef..af18693f9d4 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -184,6 +184,7 @@ ErrorTaskAlreadyAssigned=Task already assigned to user
ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format.
ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (%s) does not match expected name syntax: %s
ErrorDuplicateTrigger=Error, duplicate trigger name %s. Already loaded from %s.
+ErrorNoWarehouseDefined=Error, no warehouses defined.
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang
index 897085ec423..61dddb46691 100644
--- a/htdocs/langs/en_US/mails.lang
+++ b/htdocs/langs/en_US/mails.lang
@@ -79,6 +79,10 @@ MailingModuleDescContactsWithThirdpartyFilter=Contact with customer filters
MailingModuleDescContactsByCompanyCategory=Contacts by third party category
MailingModuleDescContactsByCategory=Contacts by categories
MailingModuleDescContactsByFunction=Contacts by position
+MailingModuleDescEmailsFromFile=Emails from file
+MailingModuleDescEmailsFromUser=Emails input by user
+MailingModuleDescDolibarrUsers=Users with Emails
+MailingModuleDescThirdPartiesByCategories=Third parties (by categories)
# Libelle des modules de liste de destinataires mailing
LineInFile=Line %s in file
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 8ef8e09eba9..d0ab75127ab 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -230,7 +230,7 @@ if ($action == 'create')
}
// Capital
- print '