From 3d5af4ebb07afe1de94493d85fcd167db5d8306c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Engel Date: Thu, 20 Jun 2024 15:55:33 +0200 Subject: [PATCH] Ajout impression logo avec option de configuration --- admin/config.php | 5 +++-- admin/pdf.php | 18 +++++++++++++++--- templates/config.tpl | 3 ++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/admin/config.php b/admin/config.php index 0987bde..c709f53 100644 --- a/admin/config.php +++ b/admin/config.php @@ -23,8 +23,9 @@ $form->runIf('save', function () use ($plugin) { $plugin->setConfigProperty('objet_1', trim(f('objet_1'))); $plugin->setConfigProperty('objet_2', trim(f('objet_2')));; + $plugin->setConfigProperty('logo', (bool)f('logo')); $plugin->setConfigProperty('footer', f('footer')); - + $plugin->setConfigProperty('validate_cp', (bool)f('validate_cp')); $plugin->setConfigProperty('unique_client_name', (bool)f('unique_client_name')); @@ -38,4 +39,4 @@ $tpl->assign('ok', qg('ok') !== null); $tpl->assign('conf', $plugin->getConfig()); $tpl->assign('patterns', \Paheko\Plugin\Facturation\PATTERNS_LIST); -$tpl->display(PLUGIN_ROOT . '/templates/config.tpl'); \ No newline at end of file +$tpl->display(PLUGIN_ROOT . '/templates/config.tpl'); diff --git a/admin/pdf.php b/admin/pdf.php index b2e6d50..b32a39a 100644 --- a/admin/pdf.php +++ b/admin/pdf.php @@ -61,17 +61,17 @@ if ($f->type_facture != CERFA) $doc = 'Facture n° '. $f->numero; $txtemis = $doc . " - Émise le " . $emission; $txtdest = "Adressée à :"; - break; + break; case DEVIS: $doc = 'Devis n° '. $f->numero; $txtemis = $doc . " - Émis le " . $emission; $txtdest = "Adressé à :"; - break; + break; case COTIS: $doc = 'Reçu de cotisation n° '. $f->numero; $txtemis = $doc . " - Émis le " . $emission; $txtdest = "Adressé à :"; - break; + break; } // utiliser l'adresse configurée dans le plugin sinon celle de l'asso sinon rien ! @@ -93,6 +93,10 @@ if ($f->type_facture != CERFA) $adresse = ""; } + $logo=''; + if ($plugin->getConfig('logo')) { + $logo = ''; + } $asso = // 'Émis par :

'. ''.$config->get('org_name')."
". @@ -267,6 +271,13 @@ EOF; width: 40%; vertical-align: top; } + .adressage td#logo { + width: 20%; + vertical-align: top; + } + .adressage img#logo { + height : 3cm; + } .contenuTexte { padding: 0 6mm; @@ -318,6 +329,7 @@ EOF; + diff --git a/templates/config.tpl b/templates/config.tpl index de55d71..f750784 100644 --- a/templates/config.tpl +++ b/templates/config.tpl @@ -47,11 +47,12 @@ - + input type="checkbox" name
Factures
+ {input type="checkbox" name="logo" value="1" source=$conf label="Imprimer le logo de l'association"} {input type="textarea" class="full-width" rows="10" name="footer" source=$conf label="Pied de document — informations légales" required=true}
$asso $receveur