Ajout et mutualisation contrôles saisie
This commit is contained in:
parent
061a27d40d
commit
d189f6d4c4
5 changed files with 108 additions and 34 deletions
|
|
@ -10,20 +10,8 @@
|
|||
{{#form on="add"}}
|
||||
|
||||
{{* vérifier que la date est située dans un exercice ouvert *}}
|
||||
{{:assign open_years=""}}
|
||||
{{#years closed=false}}
|
||||
{{:assign open_years=$open_years|cat:"\n"|cat:" - "|cat:$label|cat:" : "}}
|
||||
{{:assign debut=$start_date|date_short}}
|
||||
{{:assign fin=$end_date|date_short}}
|
||||
{{:assign open_years=$open_years|cat:$debut|cat:" à "|cat:$fin}}
|
||||
{{if
|
||||
$start_date|strtotime <= $_POST.date|parse_date|strtotime &&
|
||||
$end_date|strtotime >= $_POST.date|parse_date|strtotime
|
||||
}}
|
||||
{{:assign selected_year=$id}}
|
||||
{{:assign selected_chart=$id_chart}}
|
||||
{{/if}}
|
||||
{{/years}}
|
||||
{{:include file="_check_date.html" date=$_POST.date keep="open_years, selected_year, selected_chart"}}
|
||||
|
||||
{{if $selected_year == null}}
|
||||
{{:assign message="La date choisie n'est dans aucun exercice ouvert !!\nExercices ouverts : %s"|args:$open_years}}
|
||||
{{:error message=$message}}
|
||||
|
|
@ -33,23 +21,15 @@
|
|||
- que le compte d'immo débute par 20 ou 21
|
||||
- est présent dans le PC de l'exercice correspondant à la date
|
||||
*}}
|
||||
{{#foreach from=$_POST.debit_account key="account_code"}}
|
||||
{{:assign account_code=$account_code}}
|
||||
{{/foreach}}
|
||||
|
||||
{{#select
|
||||
code
|
||||
FROM acc_accounts
|
||||
WHERE id_chart = :id_chart
|
||||
AND
|
||||
(code LIKE "20%" OR code LIKE "21%");
|
||||
:id_chart = $selected_chart|intval
|
||||
}}
|
||||
{{if $account_code == $code}}
|
||||
{{:assign account_ok=1}}
|
||||
{{:break}}
|
||||
{{/if}}
|
||||
{{/select}}
|
||||
{{:assign var="prefix_array." value="'20%'"}}
|
||||
{{:assign var="prefix_array." value="'21%'"}}
|
||||
{{:include
|
||||
file="_check_account.html"
|
||||
account=$_POST.debit_account
|
||||
chart_id=$selected_chart
|
||||
prefix_array=$prefix_array
|
||||
keep="account_ok"
|
||||
}}
|
||||
|
||||
{{if $account_ok == null}}
|
||||
{{:assign compte=$_POST.debit_account|implode:""}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue