From 567cd00f5c4c7bb6162fabdc39304017e5c855b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 6 Jan 2013 13:33:09 +0100 Subject: [PATCH] Fix: Lost button Conflicts: htdocs/compta/facture.php htdocs/fourn/facture/fiche.php --- htdocs/fourn/facture/fiche.php | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 4b3adfe8de5..8e6b66e71bd 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -236,7 +236,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) $action='create'; $error++; } - + if ($datefacture == '') { $mesg='
'.$langs->trans('ErrorFieldRequired',$langs->transnoentities('DateInvoice')).'
'; @@ -291,7 +291,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) if ($element == 'project') { $element = 'projet'; - } + } $object->origin = $_POST['origin']; $object->origin_id = $_POST['originid']; @@ -613,6 +613,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, $hidedetails, $hidedesc, $hideref, $hookmanager); + + $action=''; } } @@ -959,7 +961,7 @@ if ($action == 'create') if ($element == 'project') { $projectid=GETPOST('originid'); - $element = 'projet'; + $element = 'projet'; } else if (in_array($element,array('order_supplier'))) { @@ -1382,7 +1384,7 @@ else // Local taxes // TODO I use here $societe->localtax1_assuj. Before it was $mysoc->localtax1_assuj, but this is a supplier invoice, so made by supplier, so depends on supplier properties - + if ($mysoc->country_code=='ES') { if($mysoc->localtax1_assuj=="1") $nbrows++; @@ -1517,7 +1519,7 @@ else print ''.$langs->trans("Currency".$conf->currency).''; } } - else + else { if ($societe->localtax1_assuj=="1") //Localtax1 RE { @@ -1858,7 +1860,7 @@ else print ''; print ''; print ''; - + print ''; - + $var=! $var; print ''; print ''; @@ -1908,14 +1910,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 @@ -2107,4 +2114,4 @@ else // End of page llxFooter(); $db->close(); -?> \ No newline at end of file +?>