Overview
Comment:Fix negative cash account alerts
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 8d62be76d22ae7571fce5c376f11acaba0ed395bd80d8a2e00d9a2c69001b1d5
User & Date: bohwaz on 2022-03-10 15:37:32
Other Links: manifest | tags
Context
2022-03-10
17:54
Fix comparison for projects check-in: 39d89740cc user: bohwaz tags: trunk, stable
15:37
Fix negative cash account alerts check-in: 8d62be76d2 user: bohwaz tags: trunk, stable
02:38
Implement import/export in XLSX/XLS/ODS check-in: f33b996e34 user: bohwaz tags: trunk, stable
Changes

Modified src/templates/acc/accounts/index.tpl from [dab73670d6] to [bc10ab9cdd].

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54


55
56
57
58
59
60
61
			</tr>
			{foreach from=$group.accounts item="account"}
				<tr>
					<td class="num"><a href="{$admin_url}acc/accounts/journal.php?id={$account.id}&amp;year={$current_year.id}">{$account.code}</a></td>
					<th><a href="{$admin_url}acc/accounts/journal.php?id={$account.id}&amp;year={$current_year.id}">{$account.label}</a></th>
					<td class="money">
						{if $account.balance < 0
							|| ($account.balance > 0 && $account.position == Account::LIABILITY && ($account.type == Account::TYPE_BANK || $account.type == Account::TYPE_THIRD_PARTY))}
							<strong class="error">{$account.balance|raw|money_currency:false}</strong>
						{else}
							{$account.balance|raw|money_currency:false}
						{/if}
					</td>
					<td>
						{if $account.type == Account::TYPE_THIRD_PARTY && $account.balance > 0}
							{if $account.position == Account::LIABILITY}<em class="alert">(Dette)</em>
							{elseif $account.position == Account::ASSET}<em class="alert">(Créance)</em>
							{/if}
						{elseif $account.type == Account::TYPE_BANK && $account.balance > 0 && $account.position == Account::LIABILITY}
							<em class="alert">(Découvert)</em>


						{/if}
					</td>
					<td class="actions">
						{linkbutton label="Journal" shape="menu" href="journal.php?id=%d&year=%d"|args:$account.id,$current_year.id}
						{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_ADMIN)}
							{if $account.type == Entities\Accounting\Account::TYPE_BANK && ($account.debit || $account.credit)}
								{linkbutton label="Rapprochement" shape="check" href="reconcile.php?id=%d"|args:$account.id}







|
|











>
>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
			</tr>
			{foreach from=$group.accounts item="account"}
				<tr>
					<td class="num"><a href="{$admin_url}acc/accounts/journal.php?id={$account.id}&amp;year={$current_year.id}">{$account.code}</a></td>
					<th><a href="{$admin_url}acc/accounts/journal.php?id={$account.id}&amp;year={$current_year.id}">{$account.label}</a></th>
					<td class="money">
						{if $account.balance < 0
							|| ($account.balance > 0 && $account.position == Account::LIABILITY && ($account.type == Account::TYPE_BANK || $account.type == Account::TYPE_THIRD_PARTY || $account.type == Account::TYPE_CASH))}
							<strong class="error">-{$account.balance|raw|money_currency:false}</strong>
						{else}
							{$account.balance|raw|money_currency:false}
						{/if}
					</td>
					<td>
						{if $account.type == Account::TYPE_THIRD_PARTY && $account.balance > 0}
							{if $account.position == Account::LIABILITY}<em class="alert">(Dette)</em>
							{elseif $account.position == Account::ASSET}<em class="alert">(Créance)</em>
							{/if}
						{elseif $account.type == Account::TYPE_BANK && $account.balance > 0 && $account.position == Account::LIABILITY}
							<em class="alert">(Découvert)</em>
						{elseif $account.type == Account::TYPE_CASH && $account.balance > 0 && $account.position == Account::LIABILITY}
							<em class="alert">(Anomalie)</em>
						{/if}
					</td>
					<td class="actions">
						{linkbutton label="Journal" shape="menu" href="journal.php?id=%d&year=%d"|args:$account.id,$current_year.id}
						{if $session->canAccess($session::SECTION_ACCOUNTING, $session::ACCESS_ADMIN)}
							{if $account.type == Entities\Accounting\Account::TYPE_BANK && ($account.debit || $account.credit)}
								{linkbutton label="Rapprochement" shape="check" href="reconcile.php?id=%d"|args:$account.id}

Modified src/templates/acc/accounts/journal.tpl from [4af6b4a4bc] to [a4a61762be].

25
26
27
28
29
30
31
32
33
34
35


36
37
38
39
40
41
42
		{elseif $account.type == $account::TYPE_BANK}
			{if $account->getPosition($year->id) == $account::ASSET && $sum.balance > 0}
				<p class="confirm block">Ce compte est créditeur de <strong>{$sum.balance|abs|raw|money_currency}</strong> à la banque.</p>
			{elseif $account->getPosition($year->id) == $account::LIABILITY && $sum.balance > 0}
				<p class="error block">Ce compte est à découvert de <strong>{$sum.balance|abs|raw|money_currency}</strong> à la banque.</p>
			{/if}
		{elseif $account.type == $account::TYPE_CASH}
			{if $sum.balance < 0}
				<p class="error block">Cette caisse est débiteur de <strong>{$sum.balance|abs|raw|money_currency}</strong>. Est-ce normal&nbsp;? Une vérification est peut-être nécessaire&nbsp;?</p>
			{elseif $sum.balance > 0}
				<p class="confirm block">Cette caisse est créditrice de <strong>{$sum.balance|abs|raw|money_currency}</strong>.</p>


			{/if}
		{elseif $account.type == $account::TYPE_OUTSTANDING}
			{if $sum.balance < 0}
				<p class="error block">Ce compte est débiteur <strong>{$sum.balance|abs|raw|money_currency}</strong>. Est-ce normal&nbsp;? Une vérification est peut-être nécessaire&nbsp;?</p>
			{elseif $sum.balance > 0}
				<p class="confirm block">Ce compte d'attente est créditeur de <strong>{$sum.balance|abs|raw|money_currency}</strong>. {if $sum.balance > 200}Un dépôt à la banque serait peut-être une bonne idée&nbsp;?{/if}</p>
			{/if}







<
<
|

>
>







25
26
27
28
29
30
31


32
33
34
35
36
37
38
39
40
41
42
		{elseif $account.type == $account::TYPE_BANK}
			{if $account->getPosition($year->id) == $account::ASSET && $sum.balance > 0}
				<p class="confirm block">Ce compte est créditeur de <strong>{$sum.balance|abs|raw|money_currency}</strong> à la banque.</p>
			{elseif $account->getPosition($year->id) == $account::LIABILITY && $sum.balance > 0}
				<p class="error block">Ce compte est à découvert de <strong>{$sum.balance|abs|raw|money_currency}</strong> à la banque.</p>
			{/if}
		{elseif $account.type == $account::TYPE_CASH}


			{if $account->getPosition($year->id) == $account::ASSET && $sum.balance > 0}
				<p class="confirm block">Cette caisse est créditrice de <strong>{$sum.balance|abs|raw|money_currency}</strong>.</p>
			{elseif $account->getPosition($year->id) == $account::LIABILITY && $sum.balance > 0}
				<p class="error block">Cette caisse est débiteur de <strong>{$sum.balance|abs|raw|money_currency}</strong>. Est-ce normal&nbsp;? Une vérification est peut-être nécessaire&nbsp;?</p>
			{/if}
		{elseif $account.type == $account::TYPE_OUTSTANDING}
			{if $sum.balance < 0}
				<p class="error block">Ce compte est débiteur <strong>{$sum.balance|abs|raw|money_currency}</strong>. Est-ce normal&nbsp;? Une vérification est peut-être nécessaire&nbsp;?</p>
			{elseif $sum.balance > 0}
				<p class="confirm block">Ce compte d'attente est créditeur de <strong>{$sum.balance|abs|raw|money_currency}</strong>. {if $sum.balance > 200}Un dépôt à la banque serait peut-être une bonne idée&nbsp;?{/if}</p>
			{/if}