Compare commits
No commits in common. "main" and "v0.12" have entirely different histories.
69
_amort_exclus.html
Normal file
69
_amort_exclus.html
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
|
{{*
|
||||||
|
Trouver les lignes d'amortissement et d'immobilisation qui sont dans la même écriture
|
||||||
|
- param : aucun
|
||||||
|
- résultat : amort_exclus = tableau des amortissements à exclure
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{* lignes des immo non amorties *}}
|
||||||
|
{{#load type="immo" where="$$.noamort = true"}}
|
||||||
|
{{:assign var="lines." value="'%s'"|args:$line}}
|
||||||
|
{{/load}}
|
||||||
|
{{:assign lines=$lines|implode:","}}
|
||||||
|
{{:assign lines="("|cat:$lines|cat:")"}}
|
||||||
|
{{:assign condition="line.id IN %s"|args:$lines}}
|
||||||
|
{{*:debug condition=$condition*}}
|
||||||
|
|
||||||
|
{{* écritures et comptes associés *}}
|
||||||
|
{{#select
|
||||||
|
line.id as line_id,
|
||||||
|
line.id_transaction as trans_id,
|
||||||
|
account.id as account_id,
|
||||||
|
account.code as account_code,
|
||||||
|
account.id_chart as id_chart
|
||||||
|
FROM acc_transactions_lines AS line
|
||||||
|
INNER JOIN acc_transactions AS trans on trans.id = line.id_transaction
|
||||||
|
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
||||||
|
INNER JOIN acc_years AS years ON trans.id_year = years.id
|
||||||
|
WHERE !condition;
|
||||||
|
!condition=$condition
|
||||||
|
assign="ecriture"
|
||||||
|
}}
|
||||||
|
{{:assign var="ecritures." value="'%s'"|args:$trans_id}}
|
||||||
|
{{* déterminer le numéro du compte d'amortissement associé au compte d'immobilisation *}}
|
||||||
|
{{:include
|
||||||
|
file="./_get_amort_code.html"
|
||||||
|
code_immo=$account_code
|
||||||
|
keep="code_amort"
|
||||||
|
}}
|
||||||
|
{{:assign var="accounts." value="'%s'"|args:$code_amort}}
|
||||||
|
{{/select}}
|
||||||
|
{{*:debug ecritures=$ecritures accounts=$accounts*}}
|
||||||
|
|
||||||
|
{{* écritures d'amortissement avec :
|
||||||
|
- numéro d'écritures obtenus ci-dessus
|
||||||
|
- numéros de comptes d'amortissement déduits des comptes d'immo ci-dessus
|
||||||
|
*}}
|
||||||
|
|
||||||
|
{{:assign ecritures=$ecritures|implode:","}}
|
||||||
|
{{:assign ecritures="("|cat:$ecritures|cat:")"}}
|
||||||
|
{{:assign accounts=$accounts|implode:","}}
|
||||||
|
{{:assign accounts="("|cat:$accounts|cat:")"}}
|
||||||
|
{{:assign condition="line.id_transaction IN %s AND account.code IN %s"|args:$ecritures:$accounts}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
line.id as line_id,
|
||||||
|
line.id_transaction as trans_id,
|
||||||
|
account.id as account_id,
|
||||||
|
account.code as account_code
|
||||||
|
FROM acc_transactions_lines AS line
|
||||||
|
INNER JOIN acc_transactions AS trans on trans.id = line.id_transaction
|
||||||
|
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
||||||
|
INNER JOIN acc_years AS years ON trans.id_year = years.id
|
||||||
|
WHERE !condition;
|
||||||
|
!condition=$condition
|
||||||
|
assign="amort"
|
||||||
|
}}
|
||||||
|
{{:assign var="amort_exclus." value=$trans_id}}
|
||||||
|
{{/select}}
|
@ -16,4 +16,6 @@
|
|||||||
{{:assign nbjours="-1*%d"|math:$nbjours}}
|
{{:assign nbjours="-1*%d"|math:$nbjours}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{* pour simplifier : 360 jours par an *}}
|
{{* pour simplifier : 360 jours par an *}}
|
||||||
{{:assign nbjours="round(%f/365*360)"|math:$nbjours}}
|
{{if $nbjours > 360}}
|
||||||
|
{{:assign nbjours=360}}
|
||||||
|
{{/if}}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{:assign open_years=""}}
|
{{:assign open_years=""}}
|
||||||
{{#years status=false order="start_date"}}
|
{{#years status=false}}
|
||||||
{{:assign open_years=$open_years|cat:"\n"|cat:" - "|cat:$label|cat:" : "}}
|
{{:assign open_years=$open_years|cat:"\n"|cat:" - "|cat:$label|cat:" : "}}
|
||||||
{{:assign debut=$start_date|date_short}}
|
{{:assign debut=$start_date|date_short}}
|
||||||
{{:assign fin=$end_date|date_short}}
|
{{:assign fin=$end_date|date_short}}
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
{{* -*- brindille -*- *}}
|
|
||||||
|
|
||||||
<nav class="tabs">
|
<nav class="tabs">
|
||||||
{{if $current == 'index'}}
|
{{if $current == 'index'}}
|
||||||
<aside>
|
<aside>
|
||||||
@ -18,10 +16,9 @@
|
|||||||
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?amort=fini">Terminées</a></li>
|
<li {{if $subcurrent == 'fini'}}class="current"{{/if}}><a href="index.html?amort=fini">Terminées</a></li>
|
||||||
<li {{if $subcurrent == 'no_amort'}}class="current"{{/if}}><a href="index.html?amort=no_amort">Non amortissables</a></li>
|
<li {{if $subcurrent == 'no_amort'}}class="current"{{/if}}><a href="index.html?amort=no_amort">Non amortissables</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
{{if $subsubcurrent == 'amortization'}}
|
{{if $subsubcurrent == 'amortization'}}
|
||||||
<ul class="sub">
|
<ul class="sub">
|
||||||
<li class="title"><strong>Amortissements</strong></li>
|
<li class="current"><a>Amortissements</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -6,10 +6,6 @@
|
|||||||
{{:include file="_nav.html" current="index"}}
|
{{:include file="_nav.html" current="index"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{:read file="./defaut.json" assign="config_json"}}
|
|
||||||
{{:assign config_defaut=$config_json|json_decode}}
|
|
||||||
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="add"}}
|
{{#form on="add"}}
|
||||||
|
|
||||||
@ -59,6 +55,10 @@
|
|||||||
- est présent dans le PC de l'exercice correspondant à la date
|
- est présent dans le PC de l'exercice correspondant à la date
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
|
{{:read file="./defaut.json" assign="config_json"}}
|
||||||
|
{{:assign config_defaut=$config_json|json_decode}}
|
||||||
|
{{:assign var="prefix_array" value=$config_defaut.prefixes|keys}}
|
||||||
|
|
||||||
{{:include
|
{{:include
|
||||||
file="_check_account.html"
|
file="_check_account.html"
|
||||||
account=$debit_account
|
account=$debit_account
|
||||||
@ -123,28 +123,22 @@
|
|||||||
{{:assign var="projects.%d"|args:$id value=$label}}
|
{{:assign var="projects.%d"|args:$id value=$label}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{#foreach from=$prefix_array item="code"}}
|
|
||||||
{{:assign var="pattern_array." value="%s*"|args:$code}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{:assign patterns=$pattern_array|implode:"|"}}
|
|
||||||
{{:assign date=$now|date:'Y-m-d'}}
|
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Ajouter une immobilisation</legend>
|
<legend>Ajouter une immobilisation</legend>
|
||||||
<dl>
|
<dl>
|
||||||
{{:input id="no_amort" type="checkbox" value=1 name="no_amort" label="Ne pas amortir" help="Cocher pour ne pas amortir" onclick="toggleInputs('f_no_amort_1', ['f_date_mes','f_duree'])"}}
|
{{:input id="no_amort" type="checkbox" value=1 name="no_amort" label="Ne pas amortir" help="Cocher pour ne pas amortir" onclick="toggleInputs('f_no_amort_1', ['f_date_mes','f_duree'])"}}
|
||||||
{{:input type="date" name="date_achat" label="Date d'acquisition" required=true default=$now|date_short onchange="setDate('date_achat', ['credit_account', 'debit_account'])"}}
|
{{:input type="date" name="date_achat" label="Date d'acquisition" required=true default=$now|date_short}}
|
||||||
{{:input type="date" name="date_mes" label="Date de mise en service" help="à renseigner uniquement si différente de la date d'acquisition"}}
|
{{:input type="date" name="date_mes" label="Date de mise en service" help="à renseigner uniquement si différente de la date d'acquisition"}}
|
||||||
{{:input type="text" name="designation" label="Désignation" required=true}}
|
{{:input type="text" name="designation" label="Désignation" required=true}}
|
||||||
{{:input type="money" name="montant" label="Montant" required=true}}
|
{{:input type="money" name="montant" label="Montant" required=true}}
|
||||||
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1 suffix="année(s)"}}
|
{{:input type="number" name="duree" label="Durée d'amortissement" required=true min=0 default=1}}
|
||||||
{{:input
|
{{:input
|
||||||
type="list"
|
type="list"
|
||||||
name="credit_account"
|
name="credit_account"
|
||||||
label="Compte de décaissement"
|
label="Compte de décaissement"
|
||||||
required=true
|
required=true
|
||||||
target="!acc/charts/accounts/selector.php?types=%s&date=%s"|args:"1|2|3":$date
|
target="!acc/charts/accounts/selector.php?targets=1:2:3&key=code"
|
||||||
default=$bank_account
|
default=$bank_account
|
||||||
}}
|
}}
|
||||||
{{:input
|
{{:input
|
||||||
@ -152,7 +146,7 @@
|
|||||||
name="debit_account"
|
name="debit_account"
|
||||||
label="Compte d'immobilisation (20xx, 21xx, ...)"
|
label="Compte d'immobilisation (20xx, 21xx, ...)"
|
||||||
required=true
|
required=true
|
||||||
target="!acc/charts/accounts/selector.php?date=%s&codes=%s"|args:$date:$patterns
|
target="!acc/charts/accounts/selector.php?key=code"
|
||||||
default=$immo_account
|
default=$immo_account
|
||||||
}}
|
}}
|
||||||
{{if $projects != null}}
|
{{if $projects != null}}
|
||||||
@ -167,8 +161,8 @@
|
|||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
{{* activer/désactiver les champs passés en paramètres *}}
|
{{* activer/désactiver les champs passés en paramètres *}}
|
||||||
|
<script type="text/javascript">
|
||||||
function toggleInputs(idcb, idfields) {
|
function toggleInputs(idcb, idfields) {
|
||||||
const noamort = document.getElementById(idcb);
|
const noamort = document.getElementById(idcb);
|
||||||
for (let id of idfields) {
|
for (let id of idfields) {
|
||||||
@ -181,21 +175,6 @@ function toggleInputs(idcb, idfields) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{* fixer la date des sélecteurs *}}
|
|
||||||
function setDate(b_date, button_names) {
|
|
||||||
const elem_date = document.querySelector("input[name=" + b_date + "]");
|
|
||||||
const date_fr = elem_date.value;
|
|
||||||
const new_date = date_fr.replace(/([0-9]+)\/([0-9]+)\/([0-9]+)/, "$3-$2-$1");
|
|
||||||
for (const name of button_names) {
|
|
||||||
const button = document.querySelector("button[data-name=" + name + "]");
|
|
||||||
const b_value = button.value;
|
|
||||||
const new_value = b_value.replace(/date=[0-9]+-[0-9]+-[0-9]+/, 'date=' + new_date);
|
|
||||||
console.log(" date = " + new_date + " old_val = " + b_value + " new_val = " + new_value);
|
|
||||||
button.setAttribute('value', new_value);
|
|
||||||
console.log("button_value = " + button.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{:admin_footer}}
|
{{:admin_footer}}
|
||||||
|
@ -41,11 +41,11 @@
|
|||||||
y.id as year_id,
|
y.id as year_id,
|
||||||
y.end_date as date_amort,
|
y.end_date as date_amort,
|
||||||
project.label as project_label
|
project.label as project_label
|
||||||
FROM acc_transactions_lines AS line
|
from acc_transactions_lines as line
|
||||||
INNER JOIN acc_transactions AS trans ON line.id_transaction = trans.id
|
inner join acc_transactions as trans on line.id_transaction = trans.id
|
||||||
INNER JOIN acc_years AS y ON trans.id_year = y.id
|
inner join acc_years as y on trans.id_year = y.id
|
||||||
LEFT JOIN acc_projects AS project ON line.id_project = project.id
|
left join acc_projects AS project ON line.id_project = project.id
|
||||||
WHERE line.id = :line_id;
|
where line.id = :line_id;
|
||||||
:line_id = $_GET.immo_id|intval
|
:line_id = $_GET.immo_id|intval
|
||||||
assign=ligne_immo
|
assign=ligne_immo
|
||||||
}}
|
}}
|
||||||
@ -70,9 +70,9 @@
|
|||||||
trans.date as amort_date,
|
trans.date as amort_date,
|
||||||
trans.label as trans_label,
|
trans.label as trans_label,
|
||||||
trans.id_year as amort_year,
|
trans.id_year as amort_year,
|
||||||
account.id as account_id,
|
acc.id as account_id,
|
||||||
account.code as account_code,
|
acc.code as account_code,
|
||||||
account.label as account_name
|
acc.label as account_name
|
||||||
FROM
|
FROM
|
||||||
acc_transactions_lines as l_immo
|
acc_transactions_lines as l_immo
|
||||||
INNER JOIN acc_transactions as t_immo on t_immo.id = l_immo.id_transaction
|
INNER JOIN acc_transactions as t_immo on t_immo.id = l_immo.id_transaction
|
||||||
@ -84,13 +84,11 @@
|
|||||||
)
|
)
|
||||||
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
||||||
INNER join acc_transactions as trans on l_amort.id_transaction = trans.id
|
INNER join acc_transactions as trans on l_amort.id_transaction = trans.id
|
||||||
INNER join acc_accounts as account on l_amort.id_account = account.id
|
INNER join acc_accounts as acc on l_amort.id_account = acc.id
|
||||||
WHERE
|
WHERE
|
||||||
l_immo.id = :line_id
|
l_immo.id = :line_id
|
||||||
AND
|
AND
|
||||||
l_amort.credit <> 0
|
l_amort.credit <> 0
|
||||||
AND
|
|
||||||
account.code LIKE '28%'
|
|
||||||
ORDER BY trans.date;
|
ORDER BY trans.date;
|
||||||
:line_id = $_GET.immo_id|intval
|
:line_id = $_GET.immo_id|intval
|
||||||
assign=linked_lines.
|
assign=linked_lines.
|
||||||
@ -101,13 +99,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
<h3>Amortissement de «
|
<h2>Amortissement de « {{$ligne_immo.label}} » d'un montant de {{"%f"|math:$ligne_immo.montant|money_currency}} en date du {{$date_debut|date_short}}{{if $duree != null}} sur {{$duree}} ans{{/if}}</h2>
|
||||||
<a class="num"
|
|
||||||
href={{"%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}>#{{$ligne_immo.trans_id}}</a>
|
|
||||||
{{$ligne_immo.label}} » d'un montant de
|
|
||||||
{{"%f"|math:$ligne_immo.montant|money_currency}}
|
|
||||||
en date du {{$date_debut|date_short}}{{if $duree != null}} sur {{$duree}} ans{{/if}}
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
{{if $duree != null}}
|
{{if $duree != null}}
|
||||||
{{* montant de l'annuité théorique *}}
|
{{* montant de l'annuité théorique *}}
|
||||||
@ -130,7 +122,12 @@
|
|||||||
{{:assign solde=$ligne_immo.montant}}
|
{{:assign solde=$ligne_immo.montant}}
|
||||||
{{if $linked_lines != null}}
|
{{if $linked_lines != null}}
|
||||||
<section class="amortissement">
|
<section class="amortissement">
|
||||||
<h3 class="center-block ruler">Amortissements rattachés</h3>
|
<h3 class="ruler">
|
||||||
|
Amortissements attachés à « <a class="num"
|
||||||
|
href={{"%s/acc/transactions/details.php?id=%s"|args:$admin_url:$ligne_immo.trans_id}}>{{$ligne_immo.trans_id}}</a>
|
||||||
|
{{$ligne_immo.label}} »
|
||||||
|
({{"%f"|math:$ligne_immo.montant|money_currency}}, {{$date_debut|date_short}})
|
||||||
|
</h3>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -185,7 +182,7 @@
|
|||||||
{{:assign nbamort="%d-%d"|math:$duree:$nbamort}}
|
{{:assign nbamort="%d-%d"|math:$duree:$nbamort}}
|
||||||
{{:assign annuite_courante="min(%f,%f)"|math:$annuite_courante:$solde}}
|
{{:assign annuite_courante="min(%f,%f)"|math:$annuite_courante:$solde}}
|
||||||
<section class="amortissement">
|
<section class="amortissement">
|
||||||
<h3 class="center-block ruler">Amortissements à enregistrer</h3>
|
<h3 class="ruler">Amortissements à enregistrer</h3>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -201,7 +198,7 @@
|
|||||||
{{#foreach count="%d+1"|math:$nbamort key="num"}}
|
{{#foreach count="%d+1"|math:$nbamort key="num"}}
|
||||||
{{:assign solde_prec=$solde}}
|
{{:assign solde_prec=$solde}}
|
||||||
{{:assign solde="%f-%d"|math:$solde:$annuite_courante}}
|
{{:assign solde="%f-%d"|math:$solde:$annuite_courante}}
|
||||||
{{#select id FROM acc_years WHERE :amort_date >= start_date AND :amort_date <= end_date AND status == 0; :amort_date=$date_amort|parse_date}}
|
{{#select id from acc_years where :amort_date >= start_date and :amort_date <= end_date and status == 0; :amort_date=$date_amort|parse_date}}
|
||||||
{{:assign enregistrer=1}}
|
{{:assign enregistrer=1}}
|
||||||
{{:assign current_year=$id}}
|
{{:assign current_year=$id}}
|
||||||
{{else}}
|
{{else}}
|
||||||
@ -240,6 +237,12 @@
|
|||||||
|
|
||||||
{{if $_GET.amort == null || $_GET.amort != "fini"}}
|
{{if $_GET.amort == null || $_GET.amort != "fini"}}
|
||||||
|
|
||||||
|
{{* amortissement à exclure *}}
|
||||||
|
{{:include
|
||||||
|
file="_amort_exclus.html"
|
||||||
|
keep="amort_exclus"
|
||||||
|
}}
|
||||||
|
|
||||||
{{* Autres amortissements non rattachés *}}
|
{{* Autres amortissements non rattachés *}}
|
||||||
{{#select
|
{{#select
|
||||||
li.id as l_id,
|
li.id as l_id,
|
||||||
@ -249,32 +252,35 @@
|
|||||||
li.label as l_label,
|
li.label as l_label,
|
||||||
trans.date as t_date,
|
trans.date as t_date,
|
||||||
trans.label as t_label,
|
trans.label as t_label,
|
||||||
account.code as a_code,
|
acc.code as a_code,
|
||||||
account.label as a_label,
|
acc.label as a_label,
|
||||||
y.label as y_label
|
y.label as y_label
|
||||||
FROM acc_transactions_lines AS li
|
from acc_transactions_lines as li
|
||||||
INNER JOIN acc_accounts AS account ON account.id = li.id_account
|
inner join acc_accounts as acc on acc.id = li.id_account
|
||||||
INNER JOIN acc_transactions AS trans ON trans.id = li.id_transaction
|
inner join acc_transactions as trans on trans.id = li.id_transaction
|
||||||
INNER JOIN acc_years AS y ON y.id = trans.id_year
|
inner join acc_years as y on y.id = trans.id_year
|
||||||
WHERE account.code LIKE "28%" AND credit > 0 AND (NOT trans.status & 16)
|
where acc.code like "28%" AND credit > 0
|
||||||
ORDER BY trans.date, trans.label;
|
order by trans.date, trans.label;
|
||||||
assign=autre_amort
|
assign=autre_amort
|
||||||
}}
|
}}
|
||||||
{{#select
|
{{#select
|
||||||
id_transaction,
|
id_transaction,
|
||||||
id_related
|
id_related
|
||||||
FROM acc_transactions_links
|
from acc_transactions_links
|
||||||
WHERE id_transaction = :id_amort OR id_related = :id_amort;
|
where id_transaction = :id_amort or id_related = :id_amort;
|
||||||
:id_amort=$t_id
|
:id_amort=$t_id
|
||||||
}}
|
}}
|
||||||
|
{{else}}
|
||||||
|
{{if $autre_amort.t_id|in:$amort_exclus}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{:assign var="autres_amortissements." value=$autre_amort}}
|
{{:assign var="autres_amortissements." value=$autre_amort}}
|
||||||
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{if $autres_amortissements != null}}
|
{{if $autres_amortissements != null}}
|
||||||
<section class="amortissement">
|
<section class="amortissement">
|
||||||
<h3 class="center-block ruler">Autres amortissements non rattachés</h3>
|
<h3 class="ruler">Autres amortissements non rattachés</h3>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$quote|cat:$code|cat:"%"|cat:$quote|cat:" OR "}}
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
{{:assign condition=$condition|cat:" AND debit > 0 AND NOT (trans.status & 16)"}}
|
{{:assign condition=$condition|cat:" AND debit > 0"}}
|
||||||
|
|
||||||
{{#select
|
{{#select
|
||||||
trans.id as trans_id,
|
trans.id as trans_id,
|
||||||
@ -90,13 +90,10 @@
|
|||||||
t_immo.id = links.id_related
|
t_immo.id = links.id_related
|
||||||
)
|
)
|
||||||
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
INNER JOIN acc_transactions_lines as l_amort on amort_trans_id = l_amort.id_transaction
|
||||||
INNER JOIN acc_accounts AS account ON l_amort.id_account = account.id
|
|
||||||
WHERE
|
WHERE
|
||||||
l_immo.id = :line_id
|
l_immo.id = :line_id
|
||||||
AND
|
AND
|
||||||
l_amort.credit <> 0
|
l_amort.credit <> 0;
|
||||||
AND
|
|
||||||
account.code LIKE '28%';
|
|
||||||
:line_id = $immo_id|intval
|
:line_id = $immo_id|intval
|
||||||
}}
|
}}
|
||||||
{{if $amort_amount == null}}
|
{{if $amort_amount == null}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{{* -*- brindille -*- *}}
|
{{* -*- brindille -*- *}}
|
||||||
|
|
||||||
{{* Liste des immobilisations non amortissables *}}
|
{{* Liste des immobilisations non amortissable *}}
|
||||||
|
|
||||||
<section class="immobilisation">
|
<section class="immobilisation">
|
||||||
<h2 class="ruler">Immobilisations non amortissables</h2>
|
<h2 class="ruler">Immobilisations non amortissables</h2>
|
||||||
|
14
index.html
14
index.html
@ -21,8 +21,8 @@
|
|||||||
<p class="block error">Échec enregistrement immobilisation</p>
|
<p class="block error">Échec enregistrement immobilisation</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#load type="immo"}}
|
|
||||||
{{* supprimer les documents sans écriture associée *}}
|
{{* supprimer les documents sans écriture associée *}}
|
||||||
|
{{#load type="immo"}}
|
||||||
{{#select
|
{{#select
|
||||||
line.id as line_id
|
line.id as line_id
|
||||||
FROM acc_transactions_lines as line
|
FROM acc_transactions_lines as line
|
||||||
@ -33,18 +33,6 @@
|
|||||||
{{else}}
|
{{else}}
|
||||||
{{:delete key=$key}}
|
{{:delete key=$key}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
|
||||||
{{* supprimer les documents correspondant à une écriture de la balance d'ouverture *}}
|
|
||||||
{{#select
|
|
||||||
line.id as line_id,
|
|
||||||
trans.status
|
|
||||||
FROM acc_transactions_lines as line
|
|
||||||
INNER JOIN acc_transactions AS trans on line.id_transaction = trans.id
|
|
||||||
WHERE line.id = :line_id AND (trans.status & 16);
|
|
||||||
:line_id = $line
|
|
||||||
}}
|
|
||||||
{{:delete key=$key}}
|
|
||||||
{{/select}}
|
|
||||||
{{/load}}
|
{{/load}}
|
||||||
|
|
||||||
{{if $amort == "no_amort"}}
|
{{if $amort == "no_amort"}}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name="Amortissements"
|
name="Amortissements"
|
||||||
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.16)"
|
description="Gestion des amortissements pour le logiciel de comptabilité Paheko (v0.12)"
|
||||||
author="Jean-Christophe Engel"
|
author="Jean-Christophe Engel"
|
||||||
author_url="https://git.roflcopter.fr/lesanges"
|
author_url="https://git.roflcopter.fr/lesanges"
|
||||||
home_button=false
|
home_button=false
|
||||||
|
@ -147,7 +147,7 @@
|
|||||||
name="debit_account"
|
name="debit_account"
|
||||||
label="Compte de débit"
|
label="Compte de débit"
|
||||||
required=true
|
required=true
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"68*":$year.id
|
target="!acc/charts/accounts/selector.php?&key=code&year=%d"|args:$year.id
|
||||||
default=$debit_account
|
default=$debit_account
|
||||||
}}
|
}}
|
||||||
{{:input
|
{{:input
|
||||||
@ -155,7 +155,7 @@
|
|||||||
name="credit_account"
|
name="credit_account"
|
||||||
label="Compte d'amortissement (280xx ou 281xx)"
|
label="Compte d'amortissement (280xx ou 281xx)"
|
||||||
required=true
|
required=true
|
||||||
target="!acc/charts/accounts/selector.php?codes=%s&year=%d"|args:"28*":$year.id
|
target="!acc/charts/accounts/selector.php?key=code&year=%d"|args:$year.id
|
||||||
default=$credit_account
|
default=$credit_account
|
||||||
}}
|
}}
|
||||||
</dl>
|
</dl>
|
||||||
|
Loading…
Reference in New Issue
Block a user