diff --git a/htdocs/pages/administration/forum_facturation.php b/htdocs/pages/administration/forum_facturation.php deleted file mode 100644 index e192721ce..000000000 --- a/htdocs/pages/administration/forum_facturation.php +++ /dev/null @@ -1,97 +0,0 @@ -invoiceRepository; -$invoiceService = $this->invoiceService; - -$action = verifierAction(['lister', 'telecharger_devis', 'telecharger_facture', 'envoyer_facture', 'facturer_facture', 'supprimer_facture', 'changer_date_reglement']); -$tris_valides = ['date_facture', 'email', 'societe', 'etat']; -$sens_valides = ['asc' , 'desc']; -$smarty->assign('action', $action); - - - -$forum = new Forum($bdd); -$forum_facturation = new Facturation($bdd, $this->pays); - -if ($action == 'lister') { - // Valeurs par défaut des paramètres de tri - $list_champs = 'reference, date_facture, montant, email, societe, etat, facturation, date_reglement, nom, prenom'; - $list_ordre = 'date_facture DESC'; - $list_associatif = false; - $list_filtre = false; - - // Modification des paramètres de tri en fonction des demandes passées en GET - if (isset($_GET['tri']) && in_array($_GET['tri'], $tris_valides) - && isset($_GET['sens']) && in_array($_GET['sens'], $sens_valides)) { - $list_ordre = $_GET['tri'] . ' ' . $_GET['sens']; - } - if (isset($_GET['filtre'])) { - $list_filtre = $_GET['filtre']; - } - - chargerForumId(); - - if (!isset($_GET['id_forum']) || intval($_GET['id_forum']) == 0) { - $_GET['id_forum'] = $forum->obtenirDernier(); - } - $smarty->assign('id_forum', $_GET['id_forum']); - - - // Mise en place de la liste dans le scope de smarty - $smarty->assign('forums', $forum->obtenirListe()); - $smarty->assign('facturations', $forum_facturation->obtenirListe($_GET['id_forum'], $list_champs, $list_ordre, $list_associatif, $list_filtre)); -} elseif ($action == 'telecharger_devis') { - $forum_facturation->genererDevis($_GET['ref']); -} elseif ($action == 'telecharger_facture') { - $forum_facturation->genererFacture($_GET['ref']); - // on évite de renvoyer du html en fin de PDF - exit(0); -} elseif ($action == 'envoyer_facture') { - if ($forum_facturation->envoyerFacture($_GET['ref'])) { - Logs::log('Envoi par email de la facture n°' . $_GET['ref']); - afficherMessage('La facture a été envoyée', 'index.php?page=forum_facturation&action=lister'); - } else { - afficherMessage("La facture n'a pas pu être envoyée", 'index.php?page=forum_facturation&action=lister', true); - } -} elseif ($action == 'facturer_facture') { - if ($forum_facturation->estFacture($_GET['ref'])) { - Logs::log('Facturation => facture n°' . $_GET['ref']); - afficherMessage('La facture est prise en compte', 'index.php?page=forum_facturation&action=lister'); - } else { - afficherMessage("La facture n'a pas pu être prise en compte", 'index.php?page=forum_facturation&action=lister', true); - } -} elseif ($action == 'supprimer_facture') { - $invoice = $invoiceRepository->getByReference($_GET['ref']); - if (null !== $invoice) { - try { - $invoiceService->deleteInvoice($invoice); - Logs::log('Supprimer => facture n°' . $_GET['ref']); - afficherMessage('La facture est supprimée', 'index.php?page=forum_facturation&action=lister'); - } catch (Exception) { - } - } - afficherMessage("La facture n'a pas pu être supprimée", 'index.php?page=forum_facturation&action=lister', true); -} elseif ($action == 'changer_date_reglement') { - $reglement = strtotime(implode('-', array_reverse(explode('/', (string) $_GET['reglement'])))); - if ($forum_facturation->changerDateReglement($_GET['ref'], $reglement)) { - afficherMessage('La date de réglement a été changée', 'index.php?page=forum_facturation&action=lister'); - } else { - afficherMessage('La date de réglement n\'a pas été changée', 'index.php?page=forum_facturation&action=lister', true); - } -} diff --git a/htdocs/templates/administration/forum_facturation.html b/htdocs/templates/administration/forum_facturation.html deleted file mode 100644 index 046352bc0..000000000 --- a/htdocs/templates/administration/forum_facturation.html +++ /dev/null @@ -1,143 +0,0 @@ -{if $action == 'lister'} -

Factures d'évènement

- -
-
- -
-
-
- - -
-
-
-
-
- -
-
- {assign var=tri value=$smarty.get.tri|default:''} - {assign var=sens value=$smarty.get.sens|default:''} - {assign var=filtre value=$smarty.get.filtre|default:''|stripslashes} - - - - -
-
-
- - -
-
- -
-
-
-
- - - - - - - - - - - - - - - {foreach from=$facturations item=facturation} - - - - - - - - - - {foreachelse} - - - - {/foreach} - -
Date factureRéférenceSociété / personne physiqueMontantEtatFacturation
{$facturation.date_facture|date_format:"%d/%m/%Y"}{$facturation.reference}{if $facturation.societe}{$facturation.societe}{else}{$facturation.nom} {$facturation.prenom}{/if}{$facturation.montant} € - {if $facturation.etat == 4}Reglée
- {$facturation.date_reglement|date_format:"%d/%m/%Y"}
{elseif $facturation.etat == 6}En attente règlement{elseif $facturation.etat == 7}Confirmée{else}--{/if} -
- {if $facturation.facturation == 0}A facturer{elseif $facturation.facturation == 1}Facturée{elseif $facturation.facturation == 2}Reçue{else}--{/if} - - - - - {if $facturation.facturation == 0} - - Envoi de la facture par mail - - {/if} - {if $facturation.facturation == 1} - - - - - - - - - - - - {/if} -
Aucune facturation
-
-{/if} - -{literal} - -{/literal}