diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index a0c7591cc34..1be97f480a4 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2911,7 +2911,7 @@ else
{
print '
';
- // Editer une facture deja validee, sans paiement effectue et pas exporte en compta
+ // Modify a validated invoice with no payments and not already exported into accountancy
if ($object->statut == 1)
{
// On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees
diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php
index f6f7178ce31..1a41598c5b3 100644
--- a/htdocs/fourn/facture/fiche.php
+++ b/htdocs/fourn/facture/fiche.php
@@ -581,6 +581,8 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer)
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
}
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs);
+
+ $action='';
}
}
@@ -1749,7 +1751,7 @@ else
$form->select_produits_fournisseurs($object->socid,'','idprodfournprice','',$filtre);
if (empty($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)) print '
';
-
+
if (is_object($hookmanager))
{
$parameters=array('filtre'=>$filtre,'htmlname'=>'idprodfournprice');
@@ -1760,7 +1762,7 @@ else
if (! empty($conf->global->MAIN_INPUT_DESC_HEIGHT)) $nbrows=$conf->global->MAIN_INPUT_DESC_HEIGHT;
$doleditor = new DolEditor('np_desc', GETPOST('np_desc'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, $nbrows, 70);
$doleditor->Create();
-
+
print '';
print '
| ';
print '
| ';
@@ -1777,14 +1779,19 @@ else
if ($action != 'presend')
{
-
/*
* Boutons actions
- */
+ */
print '
';
- // Reopen a standard paid invoice
+ // Modify a validated invoice with no payments
+ if ($object->statut == 1 && $action != 'edit' && $object->getSommePaiement() == 0 && $user->rights->fournisseur->facture->creer)
+ {
+ print '
'.$langs->trans('Modify').'';
+ }
+
+ // Reopen a standard paid invoice
if (($object->type == 0 || $object->type == 1) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely)
{
if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice