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
|
|
|
|
|
|
|
if (f('save') && $form->check('facturation_config'))
|
|
|
|
{
|
2019-11-03 17:51:31 +01:00
|
|
|
try {
|
2020-10-24 01:57:41 +02:00
|
|
|
$plugin->setConfig('rna_asso', trim(f('rna_asso')));
|
|
|
|
$plugin->setConfig('siret_asso', trim(f('siret_asso')));
|
2022-01-10 06:40:40 +01:00
|
|
|
$plugin->setConfig('ttc', (bool)trim(f('ttc')));
|
2020-10-24 03:22:22 +02:00
|
|
|
|
2020-12-29 18:07:26 +01:00
|
|
|
$plugin->setConfig('numero_rue_asso', trim(f('numero_rue_asso')));
|
|
|
|
$plugin->setConfig('rue_asso', trim(f('rue_asso')));
|
|
|
|
$plugin->setConfig('cp_asso', trim(f('cp_asso')));
|
|
|
|
$plugin->setConfig('ville_asso', trim(f('ville_asso')));
|
2020-10-24 03:22:22 +02:00
|
|
|
|
|
|
|
$plugin->setConfig('droit_art200', (bool)f('droit_art200'));
|
|
|
|
$plugin->setConfig('droit_art238bis', (bool)f('droit_art238bis'));
|
|
|
|
$plugin->setConfig('droit_art885-0VbisA', (bool)f('droit_art885-0VbisA'));
|
|
|
|
$plugin->setConfig('objet_0', trim(f('objet_0')));
|
|
|
|
$plugin->setConfig('objet_1', trim(f('objet_1')));
|
|
|
|
$plugin->setConfig('objet_2', trim(f('objet_2')));;
|
|
|
|
|
2020-10-24 01:00:48 +02:00
|
|
|
$plugin->setConfig('footer', f('footer'));
|
2020-10-24 03:22:22 +02:00
|
|
|
|
|
|
|
$plugin->setConfig('validate_cp', (bool)f('validate_cp'));
|
2020-12-29 18:07:26 +01:00
|
|
|
$plugin->setConfig('unique_client_name', (bool)f('unique_client_name'));
|
2019-11-02 17:53:27 +01:00
|
|
|
|
2021-12-17 21:10:54 +01:00
|
|
|
$plugin->setConfig('pattern', f('pattern'));
|
|
|
|
|
2023-08-01 22:56:38 +02:00
|
|
|
Utils::redirect(PLUGIN_ADMIN_URL . 'config.php?ok');
|
2019-11-02 17:53:27 +01:00
|
|
|
}
|
|
|
|
catch (UserException $e)
|
|
|
|
{
|
2019-11-03 17:51:31 +01:00
|
|
|
$form->addError($e->getMessage());
|
2019-11-02 17:53:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-24 03:22:22 +02:00
|
|
|
|
2019-11-02 17:53:27 +01:00
|
|
|
$tpl->assign('ok', qg('ok') !== null);
|
|
|
|
|
2023-08-01 22:56:38 +02:00
|
|
|
$tpl->assign('patterns', \Paheko\Plugin\Facturation\PATTERNS_LIST);
|
2021-12-17 21:10:54 +01:00
|
|
|
|
2019-11-02 17:53:27 +01:00
|
|
|
$tpl->display(PLUGIN_ROOT . '/templates/config.tpl');
|