Update pour Garradin 1.1
This commit is contained in:
parent
1bdc2baf82
commit
11974482f2
|
@ -2,7 +2,7 @@ nom="Facturation"
|
|||
description="Permet d'éditer des factures, devis et reçus à ses membres ainsi qu'à une base de clients supplémentaire."
|
||||
auteur="zou"
|
||||
url="https://gitlab.com/ramoloss/garradin-plugin-facturation/"
|
||||
version="0.4.0"
|
||||
version="0.5.0"
|
||||
menu=1
|
||||
config=1
|
||||
min_version="0.9.2"
|
||||
min_version="1.1.0"
|
|
@ -4,11 +4,11 @@
|
|||
<nav class="tabs">
|
||||
<ul>
|
||||
<li{if $current == 'index'} class="current"{/if}><a href="{plugin_url file=""}">Liste documents</a></li>
|
||||
{if $session->canAccess('compta', Membres::DROIT_ECRITURE)}
|
||||
{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE)}
|
||||
<li{if $current == 'facture'} class="current"{/if}><a href="{plugin_url file="facture_ajouter.php"}">Nouveau document</a></li>
|
||||
{/if}
|
||||
<li{if $current == 'clients'} class="current"{/if}><a href="{plugin_url file="clients.php"}">Liste clients</a></li>
|
||||
{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
|
||||
{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_ADMIN)}
|
||||
<li{if $current == 'config'} class="current"{/if}><a href="{plugin_url file="config.php"}">Configuration</a></li>
|
||||
{/if}
|
||||
<li{if $current == 'aide'} class="current"{/if}><a href="{plugin_url file="aide.php"}">Aide</a></li>
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
<ul>
|
||||
<li{if $current == 'clients'} class="current"{/if}><a href="{plugin_url file="clients.php"}">Liste clients</a></li>
|
||||
<li{if $current == 'client'} class="current"{/if}><a href="{plugin_url file="client.php"}?id={$client.id}">{$client.nom}</a></li>
|
||||
{if $session->canAccess('compta', Membres::DROIT_ECRITURE)}
|
||||
{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE)}
|
||||
<li{if $current == 'client_modifier'} class="current"{/if}>
|
||||
<a href="{plugin_url file="client_modifier.php"}?id={$client.id}">Modifier</a></li>{/if}
|
||||
{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
|
||||
{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_ADMIN)}
|
||||
<li{if $current == 'client_supprimer'} class="current"{/if}>
|
||||
<a href="{plugin_url file="client_supprimer.php"}?id={$client.id}">Supprimer</a></li>{/if}
|
||||
</ul>
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
<br>
|
||||
<p>Hésitez pas à faire des retours, proposer meilleures explications, ou quoi, vous pouvez venir en causer soit <a href="https://gitlab.com/ramoloss/garradin-plugin-facturation">sur mon gitlab</a>, soit sur l'adresse d'entraide de garradin. Si vous êtes un peu dev, le code est un peu cracra mais j'espère que ça vous repoussera pas trop à le bidouiller :)</p>
|
||||
|
||||
<br>
|
||||
<p><i>Remarque : la gestion de la signature pour les reçus fiscaux a été désactivée temporairement, dû au changements de Garradin 1.1 sur les fichiers</i></p>
|
||||
|
||||
</fieldset>
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</dd>
|
||||
|
||||
<dt>Date d'ajout</dt>
|
||||
<dd>{$client.date_creation|date_fr:'d/m/Y'}</dd>
|
||||
<dd>{$client.date_creation|date:'d/m/Y'}</dd>
|
||||
|
||||
</dl>
|
||||
|
||||
|
@ -61,17 +61,17 @@
|
|||
<tr>
|
||||
<td>{$f_obj->types[$facture.type_facture]['label'] }</td>
|
||||
<td><a href="{plugin_url file="facture.php"}?id={$facture.id}">{$facture.numero}</a></td>
|
||||
<td>{$facture.date_emission|date_fr:'d/m/Y'}</td>
|
||||
<td>{$facture.date_echeance|date_fr:'d/m/Y'}</td>
|
||||
<td>{$facture.date_emission|date:'d/m/Y'}</td>
|
||||
<td>{$facture.date_echeance|date:'d/m/Y'}</td>
|
||||
<td>{$facture.reglee}</td>
|
||||
<td>{$facture.archivee}</td>
|
||||
<td>{$facture.moyen_paiement}</td>
|
||||
<td>
|
||||
{foreach from=$facture.contenu item=contenu}
|
||||
<p>{$contenu.designation} : {$contenu.prix|escape|html_money} {$config.monnaie}</p>
|
||||
<p>{$contenu.designation} : {$contenu.prix|escape|money} {$config.monnaie}</p>
|
||||
{/foreach}
|
||||
</td>
|
||||
<td>{$facture.total|escape|html_money} {$config.monnaie}</td>
|
||||
<td>{$facture.total|escape|money} {$config.monnaie}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<table class="list">
|
||||
<thead class="userOrder">
|
||||
<tr>
|
||||
{if $session->canAccess('membres', Membres::DROIT_ADMIN)}<td class="check"><input type="checkbox" title="Tout cocher / décocher" /></td>{/if}
|
||||
{if $session->canAccess($session::SECTION_USERS, $session::ACCESS_ADMIN)}<td class="check"><input type="checkbox" title="Tout cocher / décocher" /></td>{/if}
|
||||
{foreach from=$champs key="c" item="champ"}
|
||||
<td>{if $c == "numero"}#{else}{$champ.title}{/if} </td>
|
||||
{/foreach}
|
||||
|
@ -20,7 +20,7 @@
|
|||
<tbody>
|
||||
{foreach from=$clients item="membre"}
|
||||
<tr>
|
||||
{if $session->canAccess('membres', Membres::DROIT_ADMIN)}<td class="check">
|
||||
{if $session->canAccess($session::SECTION_USERS, $session::ACCESS_ADMIN)}<td class="check">
|
||||
{input type="checkbox" name="selected" value=$membre.id default=0}
|
||||
</td>
|
||||
{/if}
|
||||
|
@ -33,12 +33,12 @@
|
|||
{/foreach}
|
||||
<td class="tabs">
|
||||
<a class="icn" href="{plugin_url file="client.php"}?id={$membre.id}" title="Fiche membre">👤</a>
|
||||
{if $session->canAccess('membres', Membres::DROIT_ECRITURE)}<a class="icn" href="{plugin_url file="client_modifier.php"}?id={$membre.id}" title="Modifier la fiche membre">✎</a>{/if}
|
||||
{if $session->canAccess($session::SECTION_USERS, $session::ACCESS_WRITE)}<a class="icn" href="{plugin_url file="client_modifier.php"}?id={$membre.id}" title="Modifier la fiche membre">✎</a>{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
{if $session->canAccess('membres', Membres::DROIT_ADMIN)}
|
||||
{if $session->canAccess($session::SECTION_USERS, $session::ACCESS_ADMIN)}
|
||||
{include file="%s/templates/_list_actions.tpl"|args:$plugin_root colspan=count((array)$champs)}
|
||||
{/if}
|
||||
</table>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
</p>
|
||||
</form>
|
||||
|
||||
|
||||
{*
|
||||
<form method="post" enctype="multipart/form-data" action="{$self_url|escape}" id="f_upload">
|
||||
<fieldset>
|
||||
<legend>Signature du responsable</legend>
|
||||
|
@ -80,7 +80,7 @@
|
|||
L'image de la signature doit être au format PNG, d'une taille raisonable et doit être dotée d'un fond transparent.
|
||||
|
||||
<br>
|
||||
{* <img src="{$image}" /> *}
|
||||
{* <img src="{$image}" /> * }
|
||||
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="{$max_size|escape}" id="f_maxsize" />
|
||||
<dl>
|
||||
|
@ -93,6 +93,6 @@
|
|||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
*}
|
||||
|
||||
{include file="admin/_foot.tpl"}
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
{form_errors}
|
||||
|
||||
{if $session->canAccess('compta', Membres::DROIT_ECRITURE)}
|
||||
{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE)}
|
||||
<a href="{plugin_url file="facture_modifier.php"}?id={$facture.id}">
|
||||
<button type="button" class="btn btn-primary">Modifier ce document</button></a>
|
||||
{/if}
|
||||
|
|
|
@ -44,17 +44,17 @@
|
|||
{/if}
|
||||
<td>{$facture.receveur.adresse}</td>
|
||||
<td>{$facture.receveur.ville}</td>
|
||||
<td>{$facture.date_emission|date_fr:'d/m/Y'}</td>
|
||||
<td>{$facture.date_echeance|date_fr:'d/m/Y'}</td>
|
||||
<td>{$facture.date_emission|date:'d/m/Y'}</td>
|
||||
<td>{$facture.date_echeance|date:'d/m/Y'}</td>
|
||||
<td><?= $facture->reglee?'Réglée':'Non' ?></td>
|
||||
<td><?= $facture->archivee?'Archivée':'Non' ?></td>
|
||||
<td>{$facture.moyen_paiement}</td>
|
||||
<td>
|
||||
{foreach from=$facture.contenu item=contenu}
|
||||
<p>{$contenu.designation} : {$contenu.prix|escape|html_money} {$config.monnaie}</p>
|
||||
<p>{$contenu.designation} : {$contenu.prix|escape|money} {$config.monnaie}</p>
|
||||
{/foreach}
|
||||
</td>
|
||||
<td>{$facture.total|escape|html_money} {$config.monnaie}</td>
|
||||
<td>{$facture.total|escape|money} {$config.monnaie}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
|
|
|
@ -4,6 +4,6 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/aide.tpl');
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
qv(['id' => 'required|numeric']);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ECRITURE);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE);
|
||||
|
||||
qv(['id' => 'required|numeric']);
|
||||
$id = (int) qg('id');
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ADMIN);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE);
|
||||
|
||||
qv(['id' => 'required|numeric']);
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
if(f('add'))
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ADMIN);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_ADMIN);
|
||||
|
||||
if (f('save') && $form->check('facturation_config'))
|
||||
{
|
||||
|
@ -39,6 +39,7 @@ if (f('save') && $form->check('facturation_config'))
|
|||
|
||||
// Traitement de l'image de signature
|
||||
// Copié du plugin de nfrery
|
||||
/*
|
||||
if (f('upload') || isset($_POST['uploadHelper_status']))
|
||||
{
|
||||
$form->check('signature_config');
|
||||
|
@ -115,12 +116,12 @@ else
|
|||
{
|
||||
$tpl->assign('image', false);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
$tpl->assign('ok', qg('ok') !== null);
|
||||
|
||||
$tpl->assign('max_size', Utils::getMaxUploadSize());
|
||||
// $tpl->assign('max_size', Utils::getMaxUploadSize());
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
use Garradin\Membres;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ECRITURE);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE);
|
||||
|
||||
use Garradin\DB;
|
||||
use stdClass;
|
||||
|
@ -223,7 +223,7 @@ $tpl->assign('date', $date->format('d/m/Y'));
|
|||
$tpl->assign('designations', $designations);
|
||||
$tpl->assign('prix', $prix);
|
||||
$tpl->assign('identite', $identite);
|
||||
$tpl->assign('membres', $db->getAssoc('SELECT id, '.$identite.' FROM membres WHERE id_categorie != -2 NOT IN (SELECT id FROM membres_categories WHERE cacher = 1);'));
|
||||
$tpl->assign('membres', $db->getAssoc('SELECT id, '.$identite.' FROM membres WHERE id_category != -2 NOT IN (SELECT id FROM users_categories WHERE hidden = 1);'));
|
||||
$tpl->assign('clients', $db->getAssoc('SELECT id, nom FROM plugin_facturation_clients;'));
|
||||
|
||||
$tpl->display(PLUGIN_ROOT . '/templates/facture_ajouter.tpl');
|
||||
|
|
|
@ -4,7 +4,7 @@ namespace Garradin;
|
|||
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ECRITURE);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE);
|
||||
|
||||
use Garradin\DB;
|
||||
|
||||
|
@ -262,7 +262,7 @@ if ($f->type_facture != COTIS)
|
|||
$tpl->assign('designations', $designations??[]);
|
||||
$tpl->assign('prix', $prix??[]);
|
||||
$tpl->assign('identite', $identite);
|
||||
$tpl->assign('membres', $db->getAssoc('SELECT id, '.$identite.' FROM membres WHERE id_categorie != -2 NOT IN (SELECT id FROM membres_categories WHERE cacher = 1);'));
|
||||
$tpl->assign('membres', $db->getAssoc('SELECT id, '.$identite.' FROM membres WHERE id_category != -2 NOT IN (SELECT id FROM users_categories WHERE hidden = 1);'));
|
||||
$tpl->assign('clients', $db->getAssoc('SELECT id, nom FROM plugin_facturation_clients;'));
|
||||
|
||||
$date = new \DateTime;
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Garradin;
|
|||
require_once __DIR__ . '/_upgrade_trick.php';
|
||||
require_once __DIR__ . '/_inc.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
$membres = new Membres;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace Garradin;
|
|||
require_once __DIR__ . '/_inc.php';
|
||||
require_once PLUGIN_ROOT . '/lib/MPDF/vendor/autoload.php';
|
||||
|
||||
$session->requireAccess('compta', Membres::DROIT_ACCES);
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
$membres = new Membres;
|
||||
|
||||
|
@ -306,6 +306,7 @@ elseif ($f->type_facture == 2)
|
|||
$pdf->WriteText(160, 246.2, utf8_decode($f->date_echeance->format('Y')));
|
||||
|
||||
// Signature
|
||||
/*
|
||||
$img = new Fichiers($plugin->getConfig('signaturetxt'));
|
||||
$cache_id = 'fichiers.' . $img->id_contenu;
|
||||
if (!Static_Cache::exists($cache_id))
|
||||
|
@ -316,7 +317,7 @@ elseif ($f->type_facture == 2)
|
|||
}
|
||||
$uri = Static_Cache::getPath($cache_id);
|
||||
$pdf->Image($uri, 150, 245, 32, 0, 'PNG' ); // Emplacement de la signature avec restriction de largeur pour tenir dans sur la case.
|
||||
|
||||
*/
|
||||
} // End if cerfa
|
||||
elseif ($f->type_facture == 3)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue