Comment: | Renommer "Plans" en "Charts" (anglais correct) |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | dev |
Files: | files | file ages | folders |
SHA1: |
70ab5d00ecfca8c58615321e986dd605 |
User & Date: | bohwaz on 2020-04-24 02:23:56 |
Other Links: | branch diff | manifest | tags |
2020-06-22
| ||
21:27 | Simplification des cibles check-in: a3184ce2f1 user: bohwaz tags: dev | |
2020-04-24
| ||
02:23 | Renommer "Plans" en "Charts" (anglais correct) check-in: 70ab5d00ec user: bohwaz tags: dev | |
02:09 | Fix: les comptes analytiques sont le type 4 check-in: 966fde3400 user: bohwaz tags: dev | |
Modified src/include/data/1.0.0_migration.sql from [f8f1e149af] to [eac19def50].
1 2 3 4 5 6 7 8 9 10 11 12 | ALTER TABLE membres_operations RENAME TO membres_operations_old; ALTER TABLE membres_categories RENAME TO membres_categories_old; DROP TABLE fichiers_compta_journal; -- Inutilisé à ce jour -- N'est pas utilisé DELETE FROM config WHERE cle = 'categorie_dons' OR cle = 'categorie_cotisations'; .read 1.0.0_schema.sql -- FIXME: insertion en comptes analytiques des projets et associations dans transactions | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | ALTER TABLE membres_operations RENAME TO membres_operations_old; ALTER TABLE membres_categories RENAME TO membres_categories_old; DROP TABLE fichiers_compta_journal; -- Inutilisé à ce jour -- N'est pas utilisé DELETE FROM config WHERE cle = 'categorie_dons' OR cle = 'categorie_cotisations'; .read 1.0.0_schema.sql -- FIXME: insertion en comptes analytiques des projets et associations dans transactions INSERT INTO acc_charts (id, country, code, label) VALUES (1, 'FR', 'PCGA1999', 'Plan comptable associatif 1999'); --.read plan_comptable_1999.sql --.read plan_comptable_2020.sql -- Migration comptes de code comme identifiant à ID unique INSERT INTO acc_accounts (id, id_chart, code, label, position, user) SELECT NULL, 1, id, libelle, position, CASE WHEN plan_comptable = 1 THEN 0 ELSE 1 END FROM compta_comptes; -- Migrations projets vers comptes analytiques INSERT INTO acc_accounts (id_chart, code, label, position, user, type) VALUES (1, '99', 'Projets', 0, 1, 0); INSERT INTO acc_accounts (id_chart, code, label, position, user, type) SELECT 1, '99' || substr('0000' || id, -4), libelle, 0, 1, 4 FROM compta_projets; -- Suppression des positions "actif ou passif" et "charge ou produit" UPDATE acc_accounts SET position = 0 WHERE position = 3 OR position = 12; -- Modification des valeurs de la position (qui n'est plus un champ binaire) UPDATE acc_accounts SET position = 3 WHERE position = 4; |
︙ | ︙ | |||
65 66 67 68 69 70 71 | -- Recopie des opérations, mais le nom a changé pour "mouvements" INSERT INTO membres_mouvements SELECT * FROM membres_operations_old; -- FIXME: ajout d'entrées dans le le log utilisateur à partir de id_auteur -- Recopie des exercices, mais la date de fin ne peut être nulle | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | -- Recopie des opérations, mais le nom a changé pour "mouvements" INSERT INTO membres_mouvements SELECT * FROM membres_operations_old; -- FIXME: ajout d'entrées dans le le log utilisateur à partir de id_auteur -- Recopie des exercices, mais la date de fin ne peut être nulle INSERT INTO acc_years (id, label, start_date, end_date, closed, id_chart) SELECT id, libelle, debut, CASE WHEN fin IS NULL THEN date(debut, '+1 year') ELSE fin END, cloture, 1 FROM compta_exercices; -- Recopie des catégories, on supprime la colonne id_cotisation_obligatoire INSERT INTO membres_categories SELECT id, nom, droit_wiki, droit_membres, droit_compta, droit_inscription, droit_connexion, droit_config, cacher FROM membres_categories_old; DROP TABLE compta_journal; |
︙ | ︙ |
Modified src/include/data/1.0.0_schema.sql from [28a5a4a85e] to [2862cb96ce].
︙ | ︙ | |||
176 177 178 179 180 181 182 | UPDATE wiki_recherche SET contenu = '' WHERE id = new.id_page; END; -- -- COMPTA -- | | | > | | | | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | UPDATE wiki_recherche SET contenu = '' WHERE id = new.id_page; END; -- -- COMPTA -- CREATE TABLE IF NOT EXISTS acc_charts -- Plans comptables : il peut y en avoir plusieurs ( id INTEGER NOT NULL PRIMARY KEY, country TEXT NOT NULL, code TEXT NULL, -- NULL = plan comptable créé par l'utilisateur label TEXT NOT NULL, archived INTEGER NOT NULL DEFAULT 0 -- 1 = archivé, non-modifiable ); CREATE TABLE IF NOT EXISTS acc_accounts -- Comptes des plans comptables ( id INTEGER NOT NULL PRIMARY KEY, id_chart INTEGER NOT NULL REFERENCES acc_charts, code TEXT NOT NULL, -- peut contenir des lettres, eg. 53A, 53B, etc. label TEXT NOT NULL, description TEXT NULL, position INTEGER NOT NULL, -- position actif/passif/charge/produit type INTEGER NOT NULL DEFAULT 0, -- Type de compte spécial : banque, caisse, en attente d'encaissement, favori, etc. user INTEGER NOT NULL DEFAULT 1 -- 1 = fait partie du plan comptable original, 0 = a été ajouté par l'utilisateur ); CREATE UNIQUE INDEX IF NOT EXISTS acc_accounts_codes ON acc_accounts (code, id_chart); CREATE TABLE IF NOT EXISTS acc_years -- Exercices ( id INTEGER NOT NULL PRIMARY KEY, label TEXT NOT NULL, start_date TEXT NOT NULL CHECK (date(start_date) IS NOT NULL AND date(start_date) = start_date), end_date TEXT NOT NULL CHECK (date(end_date) IS NOT NULL AND date(end_date) = end_date), closed INTEGER NOT NULL DEFAULT 0, id_chart INTEGER NOT NULL REFERENCES acc_charts (id) ); CREATE TABLE IF NOT EXISTS acc_transactions -- Opérations comptables ( id INTEGER PRIMARY KEY NOT NULL, |
︙ | ︙ |
Modified src/include/lib/Garradin/Entities/Accounting/Account.php from [194cded00d] to [098abf148d].
︙ | ︙ | |||
52 53 54 55 56 57 58 | 'Attente d\'encaissement', 'Analytique', 'Bénévolat', 'Favori', ]; protected $id; | | | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | 'Attente d\'encaissement', 'Analytique', 'Bénévolat', 'Favori', ]; protected $id; protected $id_chart; protected $code; protected $label; protected $description; protected $position; protected $type; protected $user; protected $_types = [ 'id' => 'int', 'id_chart' => 'int', 'code' => 'string', 'label' => 'string', 'description' => '?string', 'position' => 'int', 'type' => 'int', 'user' => 'int', ]; protected $_validation_rules = [ 'id_chart' => 'required|integer|in_table:acc_charts,id', 'code' => 'required|string|alpha_num|max:6', 'label' => 'required|string|max:200', 'description' => 'string|max:2000', 'position' => 'required|integer', 'type' => 'required|integer', 'user' => 'integer|min:0|max:1', ]; } |
Modified src/include/lib/Garradin/Entities/Accounting/Chart.php from [14aba1b6ca] to [2ddf8263f9].
1 2 3 4 5 | <?php namespace Garradin\Entities\Accounting; use Garradin\Entity; | < < < | | > | | | | > | | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | <?php namespace Garradin\Entities\Accounting; use Garradin\Entity; class Chart extends Entity { const TABLE = 'acc_charts'; protected $id; protected $label; protected $country; protected $code; protected $archived; protected $_types = [ 'id' => 'integer', 'label' => 'string', 'country' => 'string', 'code' => '?string', 'archived' => 'integer', ]; protected $_validation_rules = [ 'label' => 'required|string|max:200', 'country' => 'required|string|size:2', 'code' => 'string', 'archived' => 'integer|required|max:1|min:0', ]; public function selfCheck(): void { parent::selfCheck(); $this->assert(Utils::getCountryName($this->country), 'Le code pays doit être un code ISO valide'); } } |
Modified src/templates/admin/_head.tpl from [51d0a149c7] to [eaf03f63a4].
︙ | ︙ | |||
79 80 81 82 83 84 85 | <ul> {if $session->canAccess('compta', Membres::DROIT_ECRITURE)} <li class="compta new{if $current == 'acc/new'} current{/if}"><a href="{$admin_url}acc/transactions/new.php">Saisie</a></li> {/if} <li class="compta journals{if $current == 'acc/journals'} current{/if}"><a href="{$admin_url}acc/transactions/">Journaux</a></li> <li class="compta admin reports{if $current == 'acc/years'} current{/if}"><a href="{$admin_url}acc/years/">Exercices & rapports</a></li> {if $session->canAccess('compta', Membres::DROIT_ADMIN)} | | | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | <ul> {if $session->canAccess('compta', Membres::DROIT_ECRITURE)} <li class="compta new{if $current == 'acc/new'} current{/if}"><a href="{$admin_url}acc/transactions/new.php">Saisie</a></li> {/if} <li class="compta journals{if $current == 'acc/journals'} current{/if}"><a href="{$admin_url}acc/transactions/">Journaux</a></li> <li class="compta admin reports{if $current == 'acc/years'} current{/if}"><a href="{$admin_url}acc/years/">Exercices & rapports</a></li> {if $session->canAccess('compta', Membres::DROIT_ADMIN)} <li class="compta admin config{if $current == 'acc/charts'} current{/if}"><a href="{$admin_url}acc/charts/">Plans comptables</a></li> {/if} </ul> </li> {/if} {if $session->canAccess('wiki', Membres::DROIT_ACCES)} <li class="wiki{if $current == 'wiki'} current{elseif $current_parent == 'wiki'} current_parent{/if}"><a href="{$admin_url}wiki/"><b class="icn">✎</b><i> Wiki</i></a> <ul> |
︙ | ︙ |
Modified src/templates/admin/acc/accounts/index.tpl from [5b106875a2] to [93c3d88c2e].
|
| | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {include file="admin/_head.tpl" title=$chart.label current="acc/charts"} <ul class="actions"> <li><a href="{$admin_url}acc/charts/">Gérer les plans</a></li> <li class="current"><a href="{$admin_url}acc/accounts/?id={$chart.id}">Modifier le plan</a></li> <li><a href="{$admin_url}acc/charts/export.php?id={$chart.id}">Exporter ce plan en CSV</a></li> <li><a href="{$admin_url}acc/charts/import.php?id={$chart.id}">Importer</a></li> <li><a href="{$admin_url}acc/charts/delete.php?id={$chart.id}">Supprimer</a></li> <li><a href="{$admin_url}acc/charts/reset.php?id={$chart.id}">Remettre à zéro</a></li> </ul> {if count($accounts)} <table class="list accounts"> <thead> <td>Code</td> <th>Libellé</th> |
︙ | ︙ | |||
26 27 28 29 30 31 32 | <td>{$item.position|account_position}</td> <td> {if $item.type == $item::TYPE_BOOKMARK}{icon shape="star"}{/if} {$item.type|account_type} </td> <td class="actions"> {if $item.user} | | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | <td>{$item.position|account_position}</td> <td> {if $item.type == $item::TYPE_BOOKMARK}{icon shape="star"}{/if} {$item.type|account_type} </td> <td class="actions"> {if $item.user} {icon shape="delete" label="Supprimer" href="acc/charts/accounts/delete.php?id=%d"|args:$item.id} {/if} {icon shape="edit" label="Modifier" href="acc/charts/accounts/edit.php?id=%d"|args:$item.id} </td> </tr> {/foreach} </tbody> </table> {/if} |
︙ | ︙ |
Modified src/templates/admin/acc/charts/index.tpl from [79693cc5d5] to [c2019af16c].
|
| | | | | | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | {include file="admin/_head.tpl" title="Gestion des plans comptables" current="acc/charts"} <ul class="actions"> <li class="current"><a href="{$admin_url}acc/charts/">Gérer les plans</a></li> <li><a href="{$admin_url}acc/charts/import.php">Importer</a></li> </ul> {if count($list)} <table class="list"> <thead> <td>Pays</td> <th>Libellé</th> <td></td> </thead> <tbody> {foreach from=$list item="item"} <tr> <td>{$item.country|get_country_name}</td> <th><a href="{$admin_url}acc/accounts/?id={$item.id}">{$item.label}</a> <em>{if $item.code}(officiel){else}(copie){/if}</em></th> <td class="actions"> {icon shape="menu" label="Gérer les comptes" href="acc/accounts/?id=%d"|args:$item.id} {icon shape="edit" label="Renommer" href="acc/charts/edit.php?id=%d"|args:$item.id} {icon shape="export" label="Exporter en CSV" href="acc/charts/export.php?id=%d"|args:$item.id} {if empty($item.code)} {icon shape="upload" label="Importer" href="acc/charts/import.php?id=%d"|args:$item.id} {icon shape="delete" label="Supprimer" href="acc/charts/delete.php?id=%d"|args:$item.id} {else} {icon shape="reset" label="Remettre à zéro" href="acc/charts/reset.php?id=%d"|args:$item.id} {/if} </td> </tr> {/foreach} </tbody> </table> {/if} <form method="post" action="{$self_url_no_qs}"> <fieldset> <legend>Créer un nouveau plan comptable</legend> <dl> {input type="select_groups" name="plan" options=$charts_groupped label="Recopier depuis" required=1} {input type="text" name="label" label="Libellé" required=1} {input type="select" name="country" label="Pays" required=1 options=$country_list default=$config.pays} </dl> <p class="submit"> <input type="submit" value="Créer →" /> </p> </fieldset> </form> {include file="admin/_foot.tpl"} |
Modified src/www/admin/acc/accounts/index.php from [2fec0ea51f] to [945e0f44db].
1 2 3 | <?php namespace Garradin; | | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | <?php namespace Garradin; use Garradin\Accounting\Charts; use Garradin\Accounting\Accounts; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('compta', Membres::DROIT_ADMIN); $chart = (new Charts)->get(qg('id')); $accounts = new Accounts; $tpl->assign('chart', $chart); $tpl->assign('accounts', $accounts->listForChart($chart->id())); $tpl->display('admin/acc/accounts/index.tpl'); |
Modified src/www/admin/acc/charts/index.php from [c25cd6a200] to [b524fa30f8].
1 2 3 | <?php namespace Garradin; | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <?php namespace Garradin; use Garradin\Accounting\Charts; require_once __DIR__ . '/../_inc.php'; $session->requireAccess('compta', Membres::DROIT_ADMIN); $charts = new Charts; $tpl->assign('list', $charts->list()); $tpl->assign('charts_groupped', $charts->listByCountry()); $tpl->assign('country_list', Utils::getCountryList()); $tpl->display('admin/acc/charts/index.tpl'); |