diff --git a/lib/Facture.php b/lib/Facture.php index 619b34c..dedf83b 100644 --- a/lib/Facture.php +++ b/lib/Facture.php @@ -343,5 +343,10 @@ class Facture $db = DB::getInstance(); return $db->firstColumn('SELECT nom FROM plugin_facturation_paiement WHERE code = ?;', $code); } + + public function delete($id) + { + return DB::getInstance()->delete('plugin_facturation_factures', 'id = '. (int)$id); + } } diff --git a/templates/facture.tpl b/templates/facture.tpl index a3f1dbc..6aec27e 100644 --- a/templates/facture.tpl +++ b/templates/facture.tpl @@ -4,12 +4,12 @@ {form_errors} {if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE)} - - +{linkbutton shape="edit" href="%sfacture_modifier.php?id=%d"|args:$plugin_url,$facture.id label="Modifier ce document"} {/if} - - +{linkbutton shape="download" href="%spdf.php?d&id=%d"|args:$plugin_url,$facture.id label="Télécharger ce document"} + +{linkbutton shape="delete" href="%sfacture_supprimer.php?id=%d"|args:$plugin_url,$facture.id label="Supprimer ce document"}