Overview
Context
Changes
Modified src/templates/acc/accounts/index.tpl
from [93c3d88c2e]
to [57b9ce51f4].
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
52
53
54
55
56
|
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
|
-
+
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
{include file="admin/_head.tpl" title=$chart.label current="acc/charts"}
{include file="admin/_head.tpl" title="Gestion des comptes" current="acc/charts"}
<ul class="actions">
<li><a href="{$admin_url}acc/charts/">Gérer les plans</a></li>
<li><a href="{$admin_url}acc/accounts/">Gestion des comptes</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/">Plans comptables</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>
<td>Position</td>
<td></td>
<td></td>
</thead>
<tbody>
{foreach from=$accounts item="item"}
<tr class="account-level-<?=strlen($item->code)?>">
<td>{$item.code}</td>
<th>{$item.label}</th>
<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}
<form method="post" action="{$self_url_no_qs}">
<fieldset>
<legend>Ajouter un compte au plan comptable</legend>
<legend>Ajouter un compte</legend>
<dl>
{input type="select" name="group" label="Type de compte" options=$accounts_types}
{input type="text" name="code" label="Code" required=1 pattern="\d+" maxlength=6 help="Utilisé pour ordonner la liste des comptes. Seuls les chiffres sont acceptés."}
{input type="text" name="code" label="Code" required=1 pattern="\w+" maxlength=10 help="Utilisé pour ordonner la liste des comptes."}
{input type="text" name="label" label="Libellé" required=1}
{input type="textarea" name="description" label="Description"}
</dl>
<p class="submit">
<input type="submit" value="Créer →" />
</p>
</fieldset>
</form>
{foreach from=$accounts_grouped key="group_name" item="accounts"}
<h2 class="ruler">{$group_name}</h2>
<dl class="list">
{foreach from=$accounts item="account"}
<dt>{$account.label} <em>({$account.code})</em></dt>
<dd class="desc">{$account.description}</dd>
<dd class="actions">
{button shape="menu" label="Journal" href="acc/transactions/journal.php?id=%d"|args:$account.id}
{button shape="edit" label="Modifier" href="acc/accounts/edit.php?id=%d"|args:$account.id}
{button shape="delete" label="Supprimer" href="acc/accounts/delete.php?id=%d"|args:$account.id}
</dd>
{/foreach}
</dl>
{/foreach}
{include file="admin/_foot.tpl"}
|
Modified src/www/admin/acc/accounts/index.php
from [945e0f44db]
to [b1639557bf].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
+
-
-
+
+
+
-
-
+
+
+
-
+
|
<?php
namespace Garradin;
use Garradin\Accounting\Charts;
use Garradin\Accounting\Accounts;
use Garradin\Entities\Accounting\Account;
require_once __DIR__ . '/../_inc.php';
$session->requireAccess('compta', Membres::DROIT_ADMIN);
$chart = (new Charts)->get(qg('id'));
$accounts = new Accounts;
$chart = $year->chart();
$accounts = $chart->accounts();
$tpl->assign('accounts_grouped', $accounts->listCommonGrouped());
$tpl->assign('chart', $chart);
$tpl->assign('accounts', $accounts->listForChart($chart->id()));
$types = array_filter(Account::TYPES_NAMES, function ($v) { return $v !== ''; });
$tpl->assign('accounts_types', $types);
$tpl->display('admin/acc/accounts/index.tpl');
$tpl->display('acc/accounts/index.tpl');
|