';
print $form->select_dolusers_forevent('view', 'assignedtouser', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
print '
';
- if (in_array($user->id,array_keys($listofuserid)))
+ if ($object->datep != $object->datef && in_array($user->id,array_keys($listofuserid)))
{
print '';
print $langs->trans("MyAvailability").': '.(($object->userassigned[$user->id]['transparency'] > 0)?$langs->trans("Busy"):$langs->trans("Available")); // We show nothing if event is assigned to nobody
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 98939ee01f2..676ca9f23ab 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -1949,7 +1949,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)
@@ -1988,7 +1988,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++;
@@ -2810,13 +2811,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';
@@ -2845,14 +2847,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;
}
@@ -2861,7 +2867,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;
}
@@ -2871,7 +2878,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 '
';
-/*
- // Ref
- print '' . $langs->trans("Ref") . ' ';
- print '';
- print $form->showrefnav($object, 'ref', '', 1, 'ref', 'ref');
- print ' ';
- print ' ';
- // Fournisseur
- print '' . $langs->trans("Supplier") . " ";
- print '' . $soc->getNomUrl(1, 'supplier') . ' ';
- print ' ';
-
- // Statut
- print '';
- print '' . $langs->trans("Status") . ' ';
- print '';
- print $object->getLibStatut(4);
- print " ";
-*/
// Date
if ($object->methode_commande_id > 0) {
print '' . $langs->trans("Date") . ' ';
@@ -585,7 +566,8 @@ if ($id > 0 || ! empty($ref)) {
} elseif (count($listwarehouses) == 1) {
print $formproduct->selectWarehouses(GETPOST("entrepot" . $suffix), "entrepot" . $suffix, '', 0, 0, $objp->fk_product);
} else {
- print $langs->trans("NoWarehouseDefined");
+ $langs->load("errors");
+ print $langs->trans("ErrorNoWarehouseDefined");
}
print " \n";
@@ -609,7 +591,7 @@ if ($id > 0 || ! empty($ref)) {
print '';
print $langs->trans("Comment") . ' : ';
- print '
trans("DispatchSupplierOrder", $object->ref);
// print ' / '.$object->ref_supplier; // Not yet available
print '" class="flat">
';
@@ -662,7 +644,7 @@ if ($id > 0 || ! empty($ref)) {
print '
';
print '';
- print '' . $langs->trans("Description") . ' ';
+ print '' . $langs->trans("Product") . ' ';
if (! empty($conf->productbatch->enabled)) {
print '' . $langs->trans("batch_number") . ' ';
print '' . $langs->trans("EatByDate") . ' ';
@@ -705,7 +687,7 @@ if ($id > 0 || ! empty($ref)) {
print '';
// Comment
- print '' . dol_trunc($objp->comment) . ' ';
+ print '' . $objp->comment . ' ';
// Status
if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) {
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.