diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index fd701cc333b..c5a792121d6 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -222,7 +222,7 @@ if ($action == "confirm_validate" && GETPOST("confirm") == "yes" && $id > 0 && $
if ($emailTo && $emailFrom)
{
$filename=array(); $filedir=array(); $mimetype=array();
-
+
// SUBJECT
$subject = $langs->trans("ExpenseReportWaitingForApproval");
@@ -716,9 +716,9 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
{
$object = new ExpenseReport($db);
$object->fetch($id);
-
+
$result = $object->set_paid($id, $user);
-
+
if ($result > 0)
{
// Define output language
@@ -777,7 +777,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
// SEND
$result=$mailfile->sendfile();
if ($result):
-
+
// Retour
if($result):
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
@@ -785,7 +785,7 @@ if ($action == 'set_paid' && $id > 0 && $user->rights->expensereport->to_paid)
else:
dol_print_error($db);
endif;
-
+
else:
dol_print_error($db,$acct->error);
endif;
@@ -1115,7 +1115,10 @@ if ($action == 'create')
print '
';
$object = new ExpenseReport($db);
$include_users = $object->fetch_users_approver_expensereport();
- $s=$form->select_dolusers((GETPOST('fk_user_validator')?GETPOST('fk_user_validator'):$conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR), "fk_user_validator", 1, "", 0, $include_users);
+ $defaultselectuser=$user->fk_user; // Will work only if supervisor has permission to approve so is inside include_users
+ if (! empty($conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR)) $defaultselectuser=$conf->global->EXPENSEREPORT_DEFAULT_VALIDATOR;
+ if (GETPOST('fk_user_validator') > 0) $defaultselectuser=GETPOST('fk_user_validator');
+ $s=$form->select_dolusers($defaultselectuser, "fk_user_validator", 1, "", 0, $include_users);
print $form->textwithpicto($s, $langs->trans("AnyOtherInThisListCanValidate"));
print ' | ';
print '';
@@ -1392,7 +1395,7 @@ else
print ''.$langs->trans("Statut").' | ';
print ''.$object->getLibStatut(4).' | ';
print '';
-
+
print '';
print '| '.$langs->trans("NotePublic").' | ';
print ''.$object->note_public.' | ';
@@ -1468,7 +1471,7 @@ else
dol_print_error($db);
}
print "";
-
+
print '
';
print '';
print '| '.$langs->trans("AmountVAT").' | ';
@@ -1582,7 +1585,7 @@ else
print ''.$object->date_paiement.' |
';
print '';
}
-
+
print '';
print '
';
@@ -1951,7 +1954,7 @@ if ($action != 'create' && $action != 'edit')
print 'id.'">'.$langs->trans('Delete').'';
}
}
-
+
/* Si l'état est "A payer"
* ET user à droit de "to_paid"
* Afficher : "Annuler" / "Payer" / "Supprimer"
@@ -1967,7 +1970,7 @@ if ($action != 'create' && $action != 'edit')
{
print '';
}
-
+
if (round($remaintopay) == 0 && $object->paid == 0)
{
print '";
@@ -1978,7 +1981,7 @@ if ($action != 'create' && $action != 'edit')
{
print 'id.'">'.$langs->trans('Cancel').'';
}
-
+
// Delete
if($user->rights->expensereport->supprimer)
{
diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php
index e98921362ff..3d94718c9f7 100644
--- a/htdocs/expensereport/index.php
+++ b/htdocs/expensereport/index.php
@@ -120,7 +120,7 @@ if ($conf->use_javascript_ajax)
{
print '| ';
$data=array('series'=>$dataseries);
- dol_print_graph('stats',320,180,$data,1,'pie',0);
+ dol_print_graph('stats',320,180,$data,1,'pie',0,'',0);
print ' |
';
}