Fix: Lost button

This commit is contained in:
Laurent Destailleur 2013-01-06 13:16:25 +01:00
parent 6aebf470f6
commit 4a2c38a1c1
2 changed files with 13 additions and 6 deletions

View File

@ -2911,7 +2911,7 @@ else
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// 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) if ($object->statut == 1)
{ {
// On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees // On verifie si les lignes de factures ont ete exportees en compta et/ou ventilees

View File

@ -581,6 +581,8 @@ elseif ($action == 'edit' && $user->rights->fournisseur->facture->creer)
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
//if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs); //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs);
$action='';
} }
} }
@ -1777,14 +1779,19 @@ else
if ($action != 'presend') if ($action != 'presend')
{ {
/* /*
* Boutons actions * Boutons actions
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
// 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 '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=edit">'.$langs->trans('Modify').'</a>';
}
// 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 (($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 if (! $facidnext && $object->close_code != 'replaced') // Not replaced by another invoice