2019-11-02 17:53:27 +01:00
|
|
|
<?php
|
|
|
|
|
2023-08-01 22:56:38 +02:00
|
|
|
namespace Paheko;
|
2019-11-02 17:53:27 +01:00
|
|
|
|
|
|
|
require_once __DIR__ . '/_inc.php';
|
|
|
|
|
2021-04-11 14:25:59 +02:00
|
|
|
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_ADMIN);
|
2019-11-02 17:53:27 +01:00
|
|
|
|
2023-08-04 18:00:08 +02:00
|
|
|
$form->runIf('save', function () use ($plugin) {
|
|
|
|
$plugin->setConfigProperty('rna_asso', trim(f('rna_asso')));
|
|
|
|
$plugin->setConfigProperty('siret_asso', trim(f('siret_asso')));
|
|
|
|
$plugin->setConfigProperty('ttc', (bool) f('ttc'));
|
2019-11-02 17:53:27 +01:00
|
|
|
|
2023-08-04 18:00:08 +02:00
|
|
|
$plugin->setConfigProperty('numero_rue_asso', trim(f('numero_rue_asso')));
|
|
|
|
$plugin->setConfigProperty('rue_asso', trim(f('rue_asso')));
|
|
|
|
$plugin->setConfigProperty('cp_asso', trim(f('cp_asso')));
|
|
|
|
$plugin->setConfigProperty('ville_asso', trim(f('ville_asso')));
|
2020-10-24 03:22:22 +02:00
|
|
|
|
2023-08-04 18:00:08 +02:00
|
|
|
$plugin->setConfigProperty('droit_art200', (bool)f('droit_art200'));
|
|
|
|
$plugin->setConfigProperty('droit_art238bis', (bool)f('droit_art238bis'));
|
|
|
|
$plugin->setConfigProperty('droit_art885_0VbisA', (bool)f('droit_art885_0VbisA'));
|
|
|
|
$plugin->setConfigProperty('objet_0', trim(f('objet_0')));
|
|
|
|
$plugin->setConfigProperty('objet_1', trim(f('objet_1')));
|
|
|
|
$plugin->setConfigProperty('objet_2', trim(f('objet_2')));;
|
|
|
|
|
|
|
|
$plugin->setConfigProperty('footer', f('footer'));
|
|
|
|
|
|
|
|
$plugin->setConfigProperty('validate_cp', (bool)f('validate_cp'));
|
|
|
|
$plugin->setConfigProperty('unique_client_name', (bool)f('unique_client_name'));
|
|
|
|
|
|
|
|
$plugin->setConfigProperty('pattern', f('pattern'));
|
2019-11-02 17:53:27 +01:00
|
|
|
|
2023-08-04 18:00:08 +02:00
|
|
|
$plugin->save();
|
|
|
|
}, 'facturation_config', PLUGIN_ADMIN_URL . 'config.php?ok');
|
|
|
|
|
|
|
|
|
|
|
|
$tpl->assign('ok', qg('ok') !== null);
|
|
|
|
$tpl->assign('conf', $plugin->getConfig());
|
2023-08-01 22:56:38 +02:00
|
|
|
$tpl->assign('patterns', \Paheko\Plugin\Facturation\PATTERNS_LIST);
|
2021-12-17 21:10:54 +01:00
|
|
|
|
2023-08-04 18:00:08 +02:00
|
|
|
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');
|