Ajout et mutualisation contrôles saisie
This commit is contained in:
parent
061a27d40d
commit
d189f6d4c4
5 changed files with 108 additions and 34 deletions
36
_check_account.html
Normal file
36
_check_account.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{{* -*- brindille -*- *}}
|
||||
|
||||
{{*
|
||||
vérifier :
|
||||
- que le compte débute par le préfixe corect
|
||||
(20 ou 21 pour un compte d'immo, 280 ou 281 pour un compte d'amortissement)
|
||||
- est présent dans le PC indiqué
|
||||
paramètres :
|
||||
- account : tableau avec un identifiant de compte
|
||||
- chart_id : identifiant de plan comptable
|
||||
- prefix_array : tableau des préfixes
|
||||
résultat :
|
||||
- account_ok
|
||||
*}}
|
||||
|
||||
{{#foreach from=$account key="account_code"}}
|
||||
{{:assign account_code=$account_code}}
|
||||
{{/foreach}}
|
||||
|
||||
{{:assign condition=" AND ("}}
|
||||
{{#foreach from=$prefix_array item="code"}}
|
||||
{{:assign condition=$condition|cat:" code LIKE "|cat:$code|cat:" OR "}}
|
||||
{{/foreach}}
|
||||
{{:assign condition=$condition|cat:"0)"}}
|
||||
|
||||
{{#sql
|
||||
select="code"
|
||||
tables="acc_accounts"
|
||||
where="id_chart = :id_chart %s"|args:$condition
|
||||
:id_chart = $selected_chart|intval
|
||||
}}
|
||||
{{if $account_code == $code}}
|
||||
{{:assign account_ok=1}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/sql}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue