Overview
Comment:List of all accounts
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: b55259b64f51ec9039344da0a17e14292d270c15
User & Date: bohwaz on 2020-09-15 02:15:40
Other Links: branch diff | manifest | tags
Context
2020-09-15
18:03
Adding a file to a transaction check-in: 5f4849e067 user: bohwaz tags: dev
02:15
List of all accounts check-in: b55259b64f user: bohwaz tags: dev
01:09
Working multi-lines transactions! check-in: 2841f04851 user: bohwaz tags: dev
Changes

Modified src/include/lib/Garradin/Accounting/Accounts.php from [1cd9093a01] to [c4161ad58e].

87
88
89
90
91
92
93
94
95
96
		}

		return $out;
	}

	public function getTypesParents(): array
	{
		return $this->em->DB()->getAssoc($this->em->formatQuery('SELECT type, code FROM @TABLE WHERE type_parent = 1 AND id_chart = ? ORDER BY type;', $this->chart_id));
	}
}







|


87
88
89
90
91
92
93
94
95
96
		}

		return $out;
	}

	public function getTypesParents(): array
	{
		return $this->em->DB()->getAssoc($this->em->formatQuery('SELECT type_parent, code FROM @TABLE WHERE type_parent != 0 AND id_chart = ? ORDER BY type_parent;'), $this->chart_id);
	}
}

Added src/templates/acc/accounts/all.tpl version [19af6de602].











































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
{include file="acc/_head.tpl" title="Comptes favoris" current="acc/charts"}

<ul class="actions">
	<li><a href="{$admin_url}acc/accounts/">Comptes favoris</a></li>
	<li class="current"><a href="{$admin_url}acc/accounts/all.php">Tous les comptes</a></li>
	{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
	<li><a href="{$admin_url}acc/accounts/new.php"><strong>Ajouter un compte</strong></a></li>
	<li><a href="{$admin_url}acc/charts/">Plans comptables</a></li>
	<li><a href="{$admin_url}acc/charts/import.php">Importer un plan comptable</a></li>
	{/if}
</ul>


<table class="accounts">
	<tbody>
	{foreach from=$accounts item="account"}
		<tr class="account-level-{$account.code|strlen}">
			<td>{$account.code}</td>
			<th>{$account.label}</th>
			<td>
				{if $account.type}
					<?=Entities\Accounting\Account::TYPES_NAMES[$account->type]?>
				{/if}
			</td>
			<td class="actions">
				{icon shape="menu" label="Journal" href="acc/transactions/journal.php?id=%d"|args:$account.id}
				{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
					{icon shape="edit" label="Modifier" href="acc/accounts/edit.php?id=%d"|args:$account.id}
					{icon shape="delete" label="Supprimer" href="acc/accounts/delete.php?id=%d"|args:$account.id}
				{/if}
			</td>
		</tr>
	{/foreach}
	</tbody>
</table>

{include file="admin/_foot.tpl"}

Modified src/templates/acc/accounts/index.tpl from [293e1594ea] to [61257fa6a8].

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
{include file="acc/_head.tpl" title="Comptes favoris" current="acc/charts"}

<ul class="actions">
	<li class="current"><a href="{$admin_url}acc/accounts/">Comptes favoris</a></li>
	<li><a href="{$admin_url}acc/accounts/all.php">Tous les comptes</a></li>


	<li><a href="{$admin_url}acc/charts/">Plans comptables</a></li>
	<li><a href="{$admin_url}acc/charts/import.php">Importer un plan comptable</a></li>

</ul>

<form method="post" action="{$self_url_no_qs}">
	<fieldset>
		<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="\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 &rarr;" />
		</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"}





>
>


>


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<









>
|
|
>






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
{include file="acc/_head.tpl" title="Comptes favoris" current="acc/charts"}

<ul class="actions">
	<li class="current"><a href="{$admin_url}acc/accounts/">Comptes favoris</a></li>
	<li><a href="{$admin_url}acc/accounts/all.php">Tous les comptes</a></li>
	{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
	<li><a href="{$admin_url}acc/accounts/new.php"><strong>Ajouter un compte</strong></a></li>
	<li><a href="{$admin_url}acc/charts/">Plans comptables</a></li>
	<li><a href="{$admin_url}acc/charts/import.php">Importer un plan comptable</a></li>
	{/if}
</ul>
















{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}
			{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
				{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}
			{/if}
		</dd>
	{/foreach}
	</dl>
{/foreach}

{include file="admin/_foot.tpl"}

Modified src/templates/acc/accounts/selector.tpl from [43c8d365c5] to [4c975a28aa].

29
30
31
32
33
34
35

36
37
38
39
40
41
42
		<tbody>
		{foreach from=$accounts item="account"}
			<tr class="account-level-{$account.code|strlen}">
				<td>{$account.code}</td>
				<th>{$account.label}</th>
				<td class="actions">
					<button class="icn-btn" value="{$account.code}" data-label="{$account.code}" data-icon="&rarr;">Sélectionner</button>

				</td>
			</tr>
		{/foreach}
		</tbody>
	</table>

{/if}







>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
		<tbody>
		{foreach from=$accounts item="account"}
			<tr class="account-level-{$account.code|strlen}">
				<td>{$account.code}</td>
				<th>{$account.label}</th>
				<td class="actions">
					<button class="icn-btn" value="{$account.code}" data-label="{$account.code}" data-icon="&rarr;">Sélectionner</button>
					}
				</td>
			</tr>
		{/foreach}
		</tbody>
	</table>

{/if}

Added src/www/admin/acc/accounts/all.php version [b85e2dedd8].

































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
namespace Garradin;

use Garradin\Accounting\Charts;
use Garradin\Accounting\Accounts;
use Garradin\Entities\Accounting\Account;

require_once __DIR__ . '/../_inc.php';

$chart = $year->chart();
$accounts = $chart->accounts();

$tpl->assign('chart', $chart);
$tpl->assign('accounts', $accounts->listAll());

$tpl->display('acc/accounts/all.tpl');

Modified src/www/admin/acc/accounts/index.php from [518368b4c7] to [0645380a69].

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

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 = $year->chart();
$accounts = $chart->accounts();

$tpl->assign('chart', $chart);
$tpl->assign('accounts_grouped', $accounts->listCommonGrouped());

$types = $accounts->getTypesParents();
$types = array_map(function ($v, $k) { return sprintf('%s (%s)', Account::TYPES_NAMES[$k], $v); }, $types, array_keys($types));
$tpl->assign('accounts_types', $types);

$tpl->display('acc/accounts/index.tpl');







<
<






<
<
<
<

3
4
5
6
7
8
9


10
11
12
13
14
15




16

use Garradin\Accounting\Charts;
use Garradin\Accounting\Accounts;
use Garradin\Entities\Accounting\Account;

require_once __DIR__ . '/../_inc.php';



$chart = $year->chart();
$accounts = $chart->accounts();

$tpl->assign('chart', $chart);
$tpl->assign('accounts_grouped', $accounts->listCommonGrouped());





$tpl->display('acc/accounts/index.tpl');