Overview
Comment:Don't require an open year to display the list of years, d'oh
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev
Files: files | file ages | folders
SHA1: b93f899b48109fad28686578c89e3cc03a06fb80
User & Date: bohwaz on 2020-10-10 19:18:04
Other Links: branch diff | manifest | tags
Context
2020-10-10
23:22
Move account management to charts management, instead show current accounts sum for current year check-in: 4082ed3ad9 user: bohwaz tags: dev
19:18
Don't require an open year to display the list of years, d'oh check-in: b93f899b48 user: bohwaz tags: dev
2020-10-09
14:36
Add balance sheet check-in: 58f7cb1c31 user: bohwaz tags: dev
Changes

Modified src/templates/acc/years/index.tpl from [30fe9a1ee3] to [0c5e4eb3eb].

1
2

3
4
5
6
7
8










9
10
11
12
13
14
15
{include file="admin/_head.tpl" title="Exercices" current="acc/years"}


<nav class="tabs">
	<ul>
		<li class="current"><a href="{$self_url}">Exercices</a></li>
		<li><a href="{$admin_url}acc/years/new.php">Nouvel exercice</a></li>
	</ul>
</nav>











{if !empty($list)}
	<dl class="list">
	{foreach from=$list item="year"}
		<dt>{$year.label}</dt>
		<dd class="desc">
			{if $year.closed}Clôturé{else}En cours{/if}


>






>
>
>
>
>
>
>
>
>
>







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
{include file="admin/_head.tpl" title="Exercices" current="acc/years"}

{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
<nav class="tabs">
	<ul>
		<li class="current"><a href="{$self_url}">Exercices</a></li>
		<li><a href="{$admin_url}acc/years/new.php">Nouvel exercice</a></li>
	</ul>
</nav>
{/if}

{if $_GET.msg == 'OPEN'}
<p class="error">
	Il n'existe aucun exercice ouvert.
	{if $session->canAccess('compta', Membres::DROIT_ADMIN)}
		Merci d'en <a href="{$admin_url}acc/years/new.php">créer un nouveau</a> pour pouvoir saisir des écritures.
	{/if}
</p>
{/if}

{if !empty($list)}
	<dl class="list">
	{foreach from=$list item="year"}
		<dt>{$year.label}</dt>
		<dd class="desc">
			{if $year.closed}Clôturé{else}En cours{/if}

Modified src/templates/acc/years/new.tpl from [b98b76fbf1] to [16b237797f].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
{include file="admin/_head.tpl" title="Commencer un exercice" current="acc/years" js=1}

{if $_GET.msg == 'FIRST'}
<p class="alert">
	Merci de créer un premier exercice pour commencer.
</p>
{/if}

{form_errors}

<form method="post" action="{$self_url}">

	<fieldset>
		<legend>Commencer un nouvel exercice</legend>
		<dl>
			{input type="select_groups" options=$charts name="id_chart" label="Plan comptable" required=true}

			{input type="text" name="label" label="Libellé" required=true}
			{input type="date" label="Début de l'exercice" name="start_date" required=true default=$start_date}
			{input type="date" label="Fin de l'exercice" name="end_date" required=true default=$end_date}
		</dl>
	</fieldset>

	<p class="submit">


<
<
<
<
<
<








>







1
2






3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{include file="admin/_head.tpl" title="Commencer un exercice" current="acc/years" js=1}







{form_errors}

<form method="post" action="{$self_url}">

	<fieldset>
		<legend>Commencer un nouvel exercice</legend>
		<dl>
			{input type="select_groups" options=$charts name="id_chart" label="Plan comptable" required=true}
			<dd class="help">{linkbutton shape="settings" label="Gestion des plans comptables" href="acc/charts/"}</dd>
			{input type="text" name="label" label="Libellé" required=true}
			{input type="date" label="Début de l'exercice" name="start_date" required=true default=$start_date}
			{input type="date" label="Fin de l'exercice" name="end_date" required=true default=$end_date}
		</dl>
	</fieldset>

	<p class="submit">

Modified src/www/admin/acc/_inc.php from [2c4d0e7b86] to [711ad2f597].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
	}
}

if (!$current_year_id) {
	$current_year = Years::getCurrentOpenYear();

	if (!$current_year) {
		Utils::redirect(ADMIN_URL . 'acc/years/new.php?msg=FIRST');
	}

	$current_year_id = $current_year->id();
}

if ($session->get('acc_year') != $current_year_id) {
	$session->set('acc_year', $current_year_id);
}

define('Garradin\CURRENT_YEAR_ID', $current_year->id());

$tpl->assign('current_year', $current_year);







|












20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
	}
}

if (!$current_year_id) {
	$current_year = Years::getCurrentOpenYear();

	if (!$current_year) {
		Utils::redirect(ADMIN_URL . 'acc/years/?msg=OPEN');
	}

	$current_year_id = $current_year->id();
}

if ($session->get('acc_year') != $current_year_id) {
	$session->set('acc_year', $current_year_id);
}

define('Garradin\CURRENT_YEAR_ID', $current_year->id());

$tpl->assign('current_year', $current_year);

Modified src/www/admin/acc/charts/index.php from [a56aa48374] to [121458847d].

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('acc/charts/index.tpl');





|










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('acc/charts/index.tpl');

Modified src/www/admin/acc/reports/_inc.php from [5f03524436] to [c98212b23a].

1
2
3
4
5
6
7
8


9
10
11
12
13
14
15
<?php

namespace Garradin;

use Garradin\Accounting\Years;
use Garradin\Accounting\Accounts;

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



$criterias = [];

if (qg('analytical'))
{
	$account = Accounts::get((int) qg('analytical'));








|
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

namespace Garradin;

use Garradin\Accounting\Years;
use Garradin\Accounting\Accounts;

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

$session->requireAccess('compta', Membres::DROIT_ACCES);

$criterias = [];

if (qg('analytical'))
{
	$account = Accounts::get((int) qg('analytical'));

Modified src/www/admin/acc/years/index.php from [cf4f0ea6a4] to [7a17ddf96c].

1
2
3
4
5
6


7
8
9
10
11
12
<?php
namespace Garradin;

use Garradin\Accounting\Years;

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



$years = new Years;

$tpl->assign('list', $years->list(true));

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





|
>
>






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

use Garradin\Accounting\Years;

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

$session->requireAccess('compta', Membres::DROIT_ACCES);

$years = new Years;

$tpl->assign('list', $years->list(true));

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