diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 7378e35db80..90596b54197 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1208,20 +1208,12 @@ if ($id > 0) // Affichage fiche action en mode visu print ''; - // Ref - /*print '';*/ - // Type if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { print ''; } - // Title - //print ''; - // Full day event print ''; @@ -1243,11 +1235,6 @@ if ($id > 0) if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); print ''; - // Status - /*print '';*/ - // Location if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { @@ -1281,7 +1268,7 @@ if ($id > 0) print '
'; 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 '
'.$langs->trans("Ref").''; - print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', ''); - print '
'.$langs->trans("Type").''.$object->type.'
'.$langs->trans("Title").''.dol_htmlentities($object->label).'
'.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent, 3).'
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - print $object->getLibStatut(4); - print '
'; -/* - // Ref - print ''; - print ''; - print ''; - // Fournisseur - print '"; - print ''; - print ''; - - // Statut - print ''; - print ''; - print '"; -*/ // Date if ($object->methode_commande_id > 0) { 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 '
' . $langs->trans("Ref") . ''; - print $form->showrefnav($object, 'ref', '', 1, 'ref', 'ref'); - print '
' . $langs->trans("Supplier") . "' . $soc->getNomUrl(1, 'supplier') . '
' . $langs->trans("Status") . ''; - print $object->getLibStatut(4); - 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 "
'; print ''; - print ''; + print ''; if (! empty($conf->productbatch->enabled)) { print ''; print ''; @@ -705,7 +687,7 @@ if ($id > 0 || ! empty($ref)) { print ''; // Comment - print ''; + print ''; // 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.
' . $langs->trans("Description") . '' . $langs->trans("Product") . '' . $langs->trans("batch_number") . '' . $langs->trans("EatByDate") . '' . dol_trunc($objp->comment) . '' . $objp->comment . '