Upload plugin files but mPDF folder
This commit is contained in:
parent
ba5c48b8e8
commit
9ac4bbce8a
36 changed files with 2864 additions and 0 deletions
57
www/admin/facture.php
Normal file
57
www/admin/facture.php
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
|
||||
namespace Garradin;
|
||||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
|
||||
use Garradin\Membres;
|
||||
|
||||
$membres = new Membres;
|
||||
|
||||
qv(['id' => 'required|numeric']);
|
||||
$id = (int) qg('id');
|
||||
|
||||
$f = $facture->get($id);
|
||||
|
||||
if (!$f)
|
||||
{
|
||||
throw new UserException("Ce document n'existe pas.");
|
||||
}
|
||||
|
||||
$cats = new Compta\Categories;
|
||||
$tpl->assign('moyens_paiement', $cats->listMoyensPaiement());
|
||||
$tpl->assign('moyen_paiement', $cats->getMoyenPaiement($f->moyen_paiement));
|
||||
|
||||
try
|
||||
{
|
||||
if ($f->receveur_membre)
|
||||
{
|
||||
$c = $membres->get($f->receveur_id);
|
||||
foreach(['ville','code_postal','adresse'] as $v)
|
||||
{
|
||||
if($c->$v == '')
|
||||
{
|
||||
$c->$v = '[A RENSEIGNER DANS LA FICHE MEMBRE]';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$c = $client->get($f->receveur_id);
|
||||
}
|
||||
|
||||
$tpl->assign('facture', $f);
|
||||
$tpl->assign('client', $c);
|
||||
}
|
||||
catch(UserException $e)
|
||||
{
|
||||
$form->addError("Pas de document correspondant à cet id trouvée.");
|
||||
}
|
||||
|
||||
$tpl->assign('id', $id);
|
||||
$tpl->assign('footer', $cfg->get('footer')?:'');
|
||||
$tpl->assign('siret_asso', $cfg->get('siret_asso')?:'');
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/facture.tpl');
|
||||
Loading…
Add table
Add a link
Reference in a new issue