diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index fbae72d390f48..e63965056e5c8 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -5,7 +5,7 @@ * Copyright (C) 2015-2023 Alexandre Spangaro * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -142,7 +142,7 @@ if ($user->hasRight('expensereport', 'supprimer')) { $candelete = 1; } -if ($object->statut == ExpenseReport::STATUS_DRAFT && $user->hasRight('expensereport', 'write') && in_array($object->fk_user_author, $childids)) { +if ($object->status == ExpenseReport::STATUS_DRAFT && $user->hasRight('expensereport', 'write') && in_array($object->fk_user_author, $childids)) { $candelete = 1; } @@ -1567,7 +1567,7 @@ $head = expensereport_prepare_head($object); - if ($action == 'edit' && ($object->status < 3 || $object->status == 99)) { + if ($action == 'edit' && ($object->status < 3 || $object->status == ExpenseReport::STATUS_REFUSED)) { print "
\n"; print ''; print ''; @@ -1575,7 +1575,7 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ExpenseReport"), 0, 'trip'); - if ($object->status == 99) { + if ($object->status == ExpenseReport::STATUS_REFUSED) { print ''; } else { print ''; @@ -1641,7 +1641,7 @@ print ''; } - if ($object->status == 6) { + if ($object->status == ExpenseReport::STATUS_CLOSED) { print ''; print ''.$langs->trans("AUTHORPAIEMENT").''; print ''; @@ -1781,10 +1781,10 @@ print ''; print ''.$langs->trans("DATE_SAVE").''; print ''.dol_print_date($object->date_valid, 'dayhour', 'tzuser'); - if ($object->status == 2 && $object->hasDelay('toapprove')) { + if ($object->status == ExpenseReport::STATUS_VALIDATED && $object->hasDelay('toapprove')) { print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToApprove")); } - if ($object->status == 5 && $object->hasDelay('topay')) { + if ($object->status == ExpenseReport::STATUS_APPROVED && $object->hasDelay('topay')) { print ' '.img_warning($langs->trans("Late").' - '.$langs->trans("ToPay")); } print ''; @@ -1847,7 +1847,7 @@ print ''; } - if ($object->status == 99 || !empty($object->detail_refuse)) { + if ($object->status == ExpenseReport::STATUS_REFUSED || !empty($object->detail_refuse)) { print ''; print ''.$langs->trans("REFUSEUR").''; print ''; @@ -2051,7 +2051,7 @@ print '
'; $actiontouse = 'updateline'; - if (($object->status == 0 || $object->status == 99) && $action != 'editline') { + if (($object->status == ExpenseReport::STATUS_DRAFT || $object->status == ExpenseReport::STATUS_REFUSED) && $action != 'editline') { $actiontouse = 'addline'; } @@ -2099,7 +2099,7 @@ print ''; // Ajout des boutons de modification/suppression - if (($object->status < 2 || $object->status == 99) && $user->hasRight('expensereport', 'creer')) { + if (($object->status < ExpenseReport::STATUS_VALIDATED || $object->status == ExpenseReport::STATUS_REFUSED) && $user->hasRight('expensereport', 'creer')) { print ''; } print '';