Compare commits
6 commits
b8ff213645
...
a043e893c5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a043e893c5 | ||
|
|
4ac6cbb1a6 | ||
|
|
bdef57545c | ||
|
|
b50de139f8 | ||
|
|
6fe88739c1 | ||
|
|
ec54c90440 |
12 changed files with 156 additions and 101 deletions
|
|
@ -19,7 +19,7 @@
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
|
|
||||||
{{:assign account_code=$account|keys|key:0}}
|
{{:assign account_code=$account|keys|value:0}}
|
||||||
{{#sql
|
{{#sql
|
||||||
select="code"
|
select="code"
|
||||||
tables="acc_accounts"
|
tables="acc_accounts"
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,13 @@
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
déterminer le numéro du compte passé en paramètre dans un tableau
|
déterminer le numéro du compte passé en paramètre dans un tableau
|
||||||
|
la clé est parfois l'identifiant du compte, parfois son code...
|
||||||
|
d'où l'obligation d'extraire le code de la valeur qui a toujours
|
||||||
|
la forme : code — libellé
|
||||||
*}}
|
*}}
|
||||||
|
|
||||||
{{:assign label=$account|values|key:0}}
|
{{:assign values=$account|values}}
|
||||||
|
{{:assign label=$values.0}}
|
||||||
{{:assign pos=$label|strpos:" "}}
|
{{:assign pos=$label|strpos:" "}}
|
||||||
{{:assign account_code=$label|substr:0:$pos}}
|
{{:assign account_code=$label|substr:0:$pos}}
|
||||||
{{:assign var="account_code.%s"|args:$account_code value=$label}}
|
{{:assign var="account_code.%s"|args:$account_code value=$label}}
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,12 @@
|
||||||
</p>
|
</p>
|
||||||
<div class="shortFormRight informations" id="total_amount">
|
<div class="shortFormRight informations" id="total_amount">
|
||||||
<legend>Montants sélectionnés</legend>
|
<legend>Montants sélectionnés</legend>
|
||||||
<ul>
|
<table class="montant">
|
||||||
<li> </li>
|
<tbody>
|
||||||
</ul>
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p class="submit">
|
<p class="submit">
|
||||||
|
|
@ -181,15 +184,13 @@
|
||||||
<script type="text/javascript" src="scripts.js"></script>
|
<script type="text/javascript" src="scripts.js"></script>
|
||||||
<script type="text/javascript" async="async">
|
<script type="text/javascript" async="async">
|
||||||
|
|
||||||
let lines = document.querySelectorAll('.list tbody tr');
|
let lines = document.querySelectorAll('.list tbody tr');
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
let button = line.querySelector('input[type=checkbox]');
|
let button = line.querySelector('input[type=checkbox]');
|
||||||
|
|
||||||
button.onchange = () => {
|
button.onchange = () => {
|
||||||
computeTotal('total_amount', 'transfer');
|
computeTotal('total_amount', 'transfer');
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function changeVisibility(evt, idcheck = 'f_unhide_1') {
|
function changeVisibility(evt, idcheck = 'f_unhide_1') {
|
||||||
this.form.dispatchEvent(new Event('submit'));
|
this.form.dispatchEvent(new Event('submit'));
|
||||||
|
|
|
||||||
|
|
@ -93,8 +93,8 @@
|
||||||
date=$_POST.date_achat
|
date=$_POST.date_achat
|
||||||
label=$_POST.designation
|
label=$_POST.designation
|
||||||
amount=$_POST.montant
|
amount=$_POST.montant
|
||||||
debit=$debit_account|keys|key:0
|
debit=$debit_account|keys|value:0
|
||||||
credit=$credit_account|keys|key:0
|
credit=$credit_account|keys|value:0
|
||||||
id_project=$_POST.id_project
|
id_project=$_POST.id_project
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,9 +104,9 @@
|
||||||
<legend>Classement</legend>
|
<legend>Classement</legend>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><label>Faites un choix</label> <b>(obligatoire)</b></dt>
|
<dt><label>Faites un choix</label> <b>(obligatoire)</b></dt>
|
||||||
{{:input type="radio-btn" name="classify" value="managed" label="Amortir" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
{{:input type="radio-btn" name="classify" value="managed" label="Amortir" default=$default}}
|
||||||
{{:input type="radio-btn" name="classify" value="amortized" label="Amortissement terminé" help="Cette immobilisation sera classée parmi les immobilisations amorties" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
{{:input type="radio-btn" name="classify" value="amortized" label="Amortissement terminé" help="Cette immobilisation sera classée parmi les immobilisations amorties" default=$default}}
|
||||||
{{:input type="radio-btn" name="classify" value="ignored" label="Ignorer l'écriture" help="Cette écriture n'apparaitra plus dans la liste des immobilisations" default=$default onclick="toggleInputs('div_inputs','f_classify_managed', 'f_classify_amortized')"}}
|
{{:input type="radio-btn" name="classify" value="ignored" label="Ignorer l'écriture" help="Cette écriture n'apparaitra plus dans la liste des immobilisations" default=$default}}
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
@ -132,11 +132,12 @@
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
{{:admin_footer}}
|
||||||
|
|
||||||
{{* activer/désactiver les champs de saisie *}}
|
{{* activer/désactiver les champs de saisie *}}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function toggleInputs(idiv, idrb1, idrb2) {
|
function toggleInputFields(idiv, idrb1) {
|
||||||
const rb1 = document.getElementById(idrb1);
|
const rb1 = document.getElementById(idrb1);
|
||||||
const rb2 = document.getElementById(idrb2);
|
|
||||||
const fs = document.getElementById(idiv);
|
const fs = document.getElementById(idiv);
|
||||||
for (let field of fs.querySelectorAll("input")) {
|
for (let field of fs.querySelectorAll("input")) {
|
||||||
if (! rb1.checked) {
|
if (! rb1.checked) {
|
||||||
|
|
@ -147,6 +148,16 @@ function toggleInputs(idiv, idrb1, idrb2) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
|
||||||
{{:admin_footer}}
|
function toggleInputs(event) {
|
||||||
|
toggleInputFields('div_inputs', 'f_classify_managed');
|
||||||
|
}
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
const radios = document.querySelectorAll('input[name="classify"]');
|
||||||
|
radios.forEach(radio => {
|
||||||
|
radio.addEventListener("change", toggleInputs);
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -71,18 +71,13 @@
|
||||||
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$amort_amount}}
|
{{:assign valeur_nette="%f-%f"|math:$ligne_immo.montant:$amort_amount}}
|
||||||
|
|
||||||
{{*
|
{{*
|
||||||
lister les exercices ouverts :
|
lister les exercices ouverts dont la date de fin est postérieure à la date du dernier amortissment
|
||||||
- dont la date de fin est postérieure à la date du dernier amortissment
|
|
||||||
- dont la date de début est antérieure ou égale à la date du jour
|
|
||||||
*}}
|
*}}
|
||||||
{{:assign default_exit_date=""}}
|
{{:assign default_exit_date=""}}
|
||||||
{{#years closed=false order="start_date" where=":debut <= end_date" :debut=$date_debut}}
|
{{#years closed=false order="start_date" where=":debut <= end_date" :debut=$date_debut}}
|
||||||
{{if $start_date|strtotime <= $now && $now <= $end_date|strtotime}}
|
{{if $start_date|strtotime <= $now && $now <= $end_date|strtotime}}
|
||||||
{{:assign default_exit_date=$now|date_short}}
|
{{:assign default_exit_date=$now|date_short}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $start_date|strtotime > $now}}
|
|
||||||
{{:break}}
|
|
||||||
{{/if}}
|
|
||||||
{{:assign var="years." id=$id label=$label start_date=$start_date end_date=$end_date}}
|
{{:assign var="years." id=$id label=$label start_date=$start_date end_date=$end_date}}
|
||||||
{{: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,5 @@
|
||||||
name="Amortissements"
|
name="Amortissements"
|
||||||
description="Immobilisations et amortissements\nversion 0.24"
|
description="Immobilisations et amortissements\nversion 0.25"
|
||||||
author="Jean-Christophe Engel"
|
author="Jean-Christophe Engel"
|
||||||
author_url="https://gitea.zaclys.com/lesanges"
|
author_url="https://gitea.zaclys.com/lesanges"
|
||||||
home_button=false
|
home_button=false
|
||||||
|
|
|
||||||
|
|
@ -181,14 +181,14 @@
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
debit=$_POST.montant
|
debit=$_POST.montant
|
||||||
account=$debit_account|keys|key:0
|
account=$debit_account|keys|value:0
|
||||||
id_project=$_GET.project_id
|
id_project=$_GET.project_id
|
||||||
label=$_POST.designation
|
label=$_POST.designation
|
||||||
}}
|
}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
credit=$_POST.montant
|
credit=$_POST.montant
|
||||||
account=$credit_account|keys|key:0
|
account=$credit_account|keys|value:0
|
||||||
id_project=$_GET.project_id
|
id_project=$_GET.project_id
|
||||||
label=$_POST.designation
|
label=$_POST.designation
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
55
scripts.js
55
scripts.js
|
|
@ -189,11 +189,29 @@ function addLine(button, codes) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// afficher le montant
|
||||||
|
function addAmountLine(amount, label, parent) {
|
||||||
|
const node = document.createElement("tr");
|
||||||
|
const col_compte = document.createElement("td");
|
||||||
|
col_compte.classList.add("label");
|
||||||
|
const col_montant = document.createElement("td");
|
||||||
|
col_montant.classList.add("money");
|
||||||
|
const span = document.createElement("strong");
|
||||||
|
const montant = document.createTextNode(new Intl.NumberFormat("fr-FR", { style: "currency", currency: "EUR" }).format(amount / 100., ));
|
||||||
|
span.appendChild(montant);
|
||||||
|
col_compte.appendChild(document.createTextNode(label));
|
||||||
|
col_montant.appendChild(span);
|
||||||
|
node.appendChild(col_compte);
|
||||||
|
node.appendChild(col_montant);
|
||||||
|
parent.appendChild(node);
|
||||||
|
}
|
||||||
|
|
||||||
// calculer et afficher le total des lignes sélectionnées
|
// calculer et afficher le total des lignes sélectionnées
|
||||||
function computeTotal(id_total, id_url) {
|
function computeTotal(id_total, id_url) {
|
||||||
|
|
||||||
// calculer le total par compte
|
// calculer le total par compte et le total général
|
||||||
let total = new Object;
|
let total = new Object;
|
||||||
|
let total_general = 0;
|
||||||
const transactions = [];
|
const transactions = [];
|
||||||
let lines = document.querySelectorAll('.list tbody tr');
|
let lines = document.querySelectorAll('.list tbody tr');
|
||||||
for (const line of lines) {
|
for (const line of lines) {
|
||||||
|
|
@ -206,28 +224,31 @@ function computeTotal(id_total, id_url) {
|
||||||
} else {
|
} else {
|
||||||
total[code] = getNumber(money.innerText) * 100;
|
total[code] = getNumber(money.innerText) * 100;
|
||||||
}
|
}
|
||||||
|
total_general += getNumber(money.innerText) * 100;
|
||||||
const number = line.querySelector('.num a').innerText.slice(1);
|
const number = line.querySelector('.num a').innerText.slice(1);
|
||||||
transactions.push(number);
|
transactions.push(number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// afficher les totaux
|
// afficher les totaux
|
||||||
const liste = document.getElementById(id_total).querySelector('ul');
|
const body = document.getElementById(id_total).querySelector('table tbody');
|
||||||
while (liste.firstChild) {
|
const new_body = document.createElement('tbody');
|
||||||
liste.removeChild(liste.firstChild);
|
|
||||||
}
|
|
||||||
for (const code in total) {
|
|
||||||
const node = document.createElement("li");
|
|
||||||
const para = document.createElement("p");
|
|
||||||
const libelle = document.createTextNode("Compte " + code + " : ");
|
|
||||||
const span = document.createElement("strong");
|
|
||||||
span.classList.add("money");
|
|
||||||
const montant = document.createTextNode(new Intl.NumberFormat("fr-FR", { style: "currency", currency: "EUR" }).format(total[code] / 100., ));
|
|
||||||
|
|
||||||
span.appendChild(montant);
|
for (const code in total) {
|
||||||
para.appendChild(libelle);
|
addAmountLine(total[code], "Compte " + code + " : ", new_body);
|
||||||
para.appendChild(span);
|
}
|
||||||
node.appendChild(para);
|
body.parentNode.replaceChild(new_body, body);
|
||||||
liste.appendChild(node);
|
|
||||||
|
// et le total général
|
||||||
|
const foot = document.getElementById(id_total).querySelector('table tfoot');
|
||||||
|
if (Object.keys(total).length > 1) {
|
||||||
|
const new_foot = document.createElement('tfoot');
|
||||||
|
addAmountLine(total_general, "Total : ", new_foot);
|
||||||
|
foot.parentNode.replaceChild(new_foot, foot);
|
||||||
|
} else {
|
||||||
|
// pas besoin de total général si moins de 2 comptes
|
||||||
|
for (const e of foot.children) {
|
||||||
|
foot.removeChild(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mettre à jour les paramètres de l'url
|
// mettre à jour les paramètres de l'url
|
||||||
|
|
|
||||||
|
|
@ -55,3 +55,8 @@ fieldset.shortFormLeft div.informations {
|
||||||
span.strong {
|
span.strong {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.montant td.label {
|
||||||
|
text-align : right;
|
||||||
|
padding-right : 1em;
|
||||||
|
}
|
||||||
|
|
|
||||||
108
transfer.html
108
transfer.html
|
|
@ -17,8 +17,59 @@
|
||||||
{{:error message="Aucun exercice ouvert"}}
|
{{:error message="Aucun exercice ouvert"}}
|
||||||
{{/years}}
|
{{/years}}
|
||||||
|
|
||||||
|
{{* déterminer les comptes d'immo en cours *}}
|
||||||
|
{{:include file="_get_config.html" keep="module.config.unfinished"}}
|
||||||
|
{{:assign condition="("}}
|
||||||
|
{{#foreach from=$module.config.unfinished item="elem"}}
|
||||||
|
{{:assign code=$elem.code|cat:"%"|quote_sql}}
|
||||||
|
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
||||||
|
{{/foreach}}
|
||||||
|
{{:assign condition=$condition|cat:"0)"}}
|
||||||
|
|
||||||
|
{{* détails des écritures paramètres *}}
|
||||||
|
{{:assign trans=$_GET.trans|explode:","}}
|
||||||
|
{{:assign var="trans_list" value=$trans|map:quote_sql}}
|
||||||
|
{{:assign trans_list=$trans_list|implode:","}}
|
||||||
|
{{:assign trans_list="("|cat:$trans_list|cat:")"}}
|
||||||
|
{{:assign condition=$condition|cat:" AND trans.id IN "|cat:$trans_list}}
|
||||||
|
{{:assign condition=$condition|cat:" AND NOT (trans.status & 16)"}}
|
||||||
|
|
||||||
|
{{#select
|
||||||
|
trans.id as trans_id,
|
||||||
|
trans.label AS trans_label,
|
||||||
|
trans.date AS trans_date,
|
||||||
|
SUM(line.debit) AS line_debit,
|
||||||
|
account.code AS account_code,
|
||||||
|
account.label AS account_label,
|
||||||
|
line.id_project as project_id
|
||||||
|
FROM acc_transactions AS trans
|
||||||
|
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||||
|
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
||||||
|
WHERE !condition
|
||||||
|
GROUP BY trans.id
|
||||||
|
;
|
||||||
|
!condition=$condition
|
||||||
|
}}
|
||||||
|
{{:assign var="transactions.%s"|args:$trans_id
|
||||||
|
amount=$line_debit
|
||||||
|
date=$trans_date
|
||||||
|
code=$account_code
|
||||||
|
label=$account_label
|
||||||
|
project=$project_id
|
||||||
|
}}
|
||||||
|
{{if $max_date == null || $trans_date > $max_date}}
|
||||||
|
{{:assign max_date=$trans_date}}
|
||||||
|
{{/if}}
|
||||||
|
{{/select}}
|
||||||
|
|
||||||
{{* Traiter l'envoi du formulaire *}}
|
{{* Traiter l'envoi du formulaire *}}
|
||||||
{{#form on="transfer"}}
|
{{#form on="transfer"}}
|
||||||
|
{{* vérifier que la date de mise en service est postérieure aux dates d'acquisition *}}
|
||||||
|
{{if $_POST.date_mes|parse_date < $max_date}}
|
||||||
|
{{:assign dacq=$max_date|date_short}}
|
||||||
|
{{:error message="La date de mise en service (%s) doit être postérieure à la date d'acquisition d'immobilisation la plus récente (%s) !"|args:$_POST.date_mes:$dacq}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{* vérifier que la date de mise en service est située dans l'exercice sélectionné *}}
|
{{* vérifier que la date de mise en service est située dans l'exercice sélectionné *}}
|
||||||
{{:assign ts_date = $_POST.date_mes|parse_date|strtotime}}
|
{{:assign ts_date = $_POST.date_mes|parse_date|strtotime}}
|
||||||
{{:assign ok=false}}
|
{{:assign ok=false}}
|
||||||
|
|
@ -54,7 +105,7 @@
|
||||||
account=$elem
|
account=$elem
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign debit_account=$account_code|keys|key:0}}
|
{{:assign debit_account=$account_code|keys|value:0}}
|
||||||
{{:assign var="amount" from="_POST.credit_lines.%s"|args:$rang}}
|
{{:assign var="amount" from="_POST.credit_lines.%s"|args:$rang}}
|
||||||
{{:assign var="label" from="_POST.line_labels.%s"|args:$rang}}
|
{{:assign var="label" from="_POST.line_labels.%s"|args:$rang}}
|
||||||
{{:assign
|
{{:assign
|
||||||
|
|
@ -71,7 +122,7 @@
|
||||||
account=$_POST.debit_account
|
account=$_POST.debit_account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign credit_account=$account_code|keys|key:0}}
|
{{:assign credit_account=$account_code|keys|value:0}}
|
||||||
{{:assign var="amount" from="_POST.debit_lines.%s"|args:0}}
|
{{:assign var="amount" from="_POST.debit_lines.%s"|args:0}}
|
||||||
{{:assign count=$_POST.line_labels|count}}
|
{{:assign count=$_POST.line_labels|count}}
|
||||||
{{:assign count="%d-1"|math:$count}}
|
{{:assign count="%d-1"|math:$count}}
|
||||||
|
|
@ -120,7 +171,6 @@
|
||||||
{{:assign lines_count=$lines|count}}
|
{{:assign lines_count=$lines|count}}
|
||||||
{{:assign lines_count="%d-1"|math:$lines_count}}
|
{{:assign lines_count="%d-1"|math:$lines_count}}
|
||||||
{{:assign var="immo_id" from="result.lines.%s.id"|args:$lines_count}}
|
{{:assign var="immo_id" from="result.lines.%s.id"|args:$lines_count}}
|
||||||
|
|
||||||
{{* enregistrer les infos de l'immobilisation *}}
|
{{* enregistrer les infos de l'immobilisation *}}
|
||||||
{{:save
|
{{:save
|
||||||
key=""|uuid
|
key=""|uuid
|
||||||
|
|
@ -137,7 +187,6 @@
|
||||||
{{:assign type_immo="other"}}
|
{{:assign type_immo="other"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}}
|
{{:redirect force="index.html?ok=1&msg=immobilisation&type_immo=%s"|args:$type_immo}}
|
||||||
|
|
||||||
{{/form}}
|
{{/form}}
|
||||||
|
|
||||||
{{* barre de navigation *}}
|
{{* barre de navigation *}}
|
||||||
|
|
@ -148,6 +197,15 @@
|
||||||
{{:form_errors}}
|
{{:form_errors}}
|
||||||
|
|
||||||
{{* formulaire d'ajout d'immobilisation *}}
|
{{* formulaire d'ajout d'immobilisation *}}
|
||||||
|
{{if $_GET.trans == null}}
|
||||||
|
{{:error message="Vous n'avez sélectionné aucune écriture !"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{if $max_date|strtotime > $now}}
|
||||||
|
{{:assign default_date=$max_date}}
|
||||||
|
{{else}}
|
||||||
|
{{:assign default_date=$now|date_short}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
{{#select id,label FROM acc_projects WHERE archived = 0;}}
|
{{#select id,label FROM acc_projects WHERE archived = 0;}}
|
||||||
{{:assign var="projects.%d"|args:$id value=$label}}
|
{{:assign var="projects.%d"|args:$id value=$label}}
|
||||||
|
|
@ -162,53 +220,13 @@
|
||||||
<p class="block error">La date choisie n'est dans aucun exercice ouvert !</p>
|
<p class="block error">La date choisie n'est dans aucun exercice ouvert !</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{if $_GET.trans == null}}
|
|
||||||
{{:error message="Vous n'avez sélectionné aucune écriture !"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{* déterminer les comptes d'immo en cours *}}
|
|
||||||
{{:include file="_get_config.html" keep="module.config.unfinished"}}
|
|
||||||
{{:assign condition="("}}
|
|
||||||
{{#foreach from=$module.config.unfinished item="elem"}}
|
|
||||||
{{:assign code=$elem.code|cat:"%"|quote_sql}}
|
|
||||||
{{:assign condition=$condition|cat:" account.code LIKE "|cat:$code|cat:" OR "}}
|
|
||||||
{{/foreach}}
|
|
||||||
{{:assign condition=$condition|cat:"0)"}}
|
|
||||||
|
|
||||||
{{* détails des écritures paramètres *}}
|
|
||||||
{{:assign trans=$_GET.trans|explode:","}}
|
|
||||||
{{:assign var="trans_list" value=$trans|map:quote_sql}}
|
|
||||||
{{:assign trans_list=$trans_list|implode:","}}
|
|
||||||
{{:assign trans_list="("|cat:$trans_list|cat:")"}}
|
|
||||||
{{:assign condition=$condition|cat:" AND trans.id IN "|cat:$trans_list}}
|
|
||||||
{{:assign condition=$condition|cat:" AND NOT (trans.status & 16)"}}
|
|
||||||
|
|
||||||
{{#select
|
|
||||||
trans.id as trans_id,
|
|
||||||
trans.label AS trans_label,
|
|
||||||
trans.date AS trans_date,
|
|
||||||
SUM(line.debit) AS line_debit,
|
|
||||||
account.code AS account_code,
|
|
||||||
account.label AS account_label,
|
|
||||||
line.id_project as project_id
|
|
||||||
FROM acc_transactions AS trans
|
|
||||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
|
||||||
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
|
||||||
WHERE !condition
|
|
||||||
GROUP BY trans.id
|
|
||||||
;
|
|
||||||
!condition=$condition
|
|
||||||
}}
|
|
||||||
{{:assign var="transactions.%s"|args:$trans_id amount=$line_debit date=$trans_date code=$account_code label=$account_label project=$project_id}}
|
|
||||||
{{/select}}
|
|
||||||
|
|
||||||
<form method="post" action="">
|
<form method="post" action="">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Données de l'immobilisation</legend>
|
<legend>Données de l'immobilisation</legend>
|
||||||
<dl>
|
<dl>
|
||||||
{{:input type="select" name="id_year" label="Exercice" default=$selected_year required=true
|
{{:input type="select" name="id_year" label="Exercice" default=$selected_year required=true
|
||||||
default_empty="— Faire un choix —" options=$open_years}}
|
default_empty="— Faire un choix —" options=$open_years}}
|
||||||
{{:input type="date" name="date_mes" label="Date de mise en service" required=true default=$now|date_short}}
|
{{:input type="date" name="date_mes" label="Date de mise en service" required=true default=$default_date}}
|
||||||
{{:input type="text" name="designation" label="Libellé" required=true}}
|
{{:input type="text" name="designation" label="Libellé" required=true}}
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
account=$account
|
account=$account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign amort_account_code=$account_code|keys|key:0}}
|
{{:assign amort_account_code=$account_code|keys|value:0}}
|
||||||
|
|
||||||
{{if $valeur_nette > 0}}
|
{{if $valeur_nette > 0}}
|
||||||
{{* immo non totalement amortie *}}
|
{{* immo non totalement amortie *}}
|
||||||
|
|
@ -84,7 +84,7 @@
|
||||||
account=$_POST.comp_account
|
account=$_POST.comp_account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign comp_account_code=$account_code|keys|key:0}}
|
{{:assign comp_account_code=$account_code|keys|value:0}}
|
||||||
|
|
||||||
{{:assign libelle="Amortissement complémentaire "|cat:$ligne_immo.label}}
|
{{:assign libelle="Amortissement complémentaire "|cat:$ligne_immo.label}}
|
||||||
{{:assign
|
{{:assign
|
||||||
|
|
@ -110,7 +110,7 @@
|
||||||
account=$_POST.except_account
|
account=$_POST.except_account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign except_account_code=$account_code|keys|key:0}}
|
{{:assign except_account_code=$account_code|keys|value:0}}
|
||||||
{{:assign libelle="Amortissement exceptionnel "|cat:$ligne_immo.label}}
|
{{:assign libelle="Amortissement exceptionnel "|cat:$ligne_immo.label}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
|
|
@ -150,7 +150,7 @@
|
||||||
account=$_POST.immo_account
|
account=$_POST.immo_account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign immo_account_code=$account_code|keys|key:0}}
|
{{:assign immo_account_code=$account_code|keys|value:0}}
|
||||||
{{:assign libelle="Sortie du bilan de "|cat:$ligne_immo.label}}
|
{{:assign libelle="Sortie du bilan de "|cat:$ligne_immo.label}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
account=$_POST.vnc_account
|
account=$_POST.vnc_account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign vnc_account_code=$account_code|keys|key:0}}
|
{{:assign vnc_account_code=$account_code|keys|value:0}}
|
||||||
{{:assign
|
{{:assign
|
||||||
var="lines."
|
var="lines."
|
||||||
account=$vnc_account_code
|
account=$vnc_account_code
|
||||||
|
|
@ -203,13 +203,13 @@
|
||||||
account=$_POST.creance_account
|
account=$_POST.creance_account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign creance_account=$account_code|keys|key:0}}
|
{{:assign creance_account=$account_code|keys|value:0}}
|
||||||
{{:include
|
{{:include
|
||||||
file="_get_codes.html"
|
file="_get_codes.html"
|
||||||
account=$_POST.cession_account
|
account=$_POST.cession_account
|
||||||
keep="account_code"
|
keep="account_code"
|
||||||
}}
|
}}
|
||||||
{{:assign cession_account=$account_code|keys|key:0}}
|
{{:assign cession_account=$account_code|keys|value:0}}
|
||||||
{{:api
|
{{:api
|
||||||
method="POST"
|
method="POST"
|
||||||
path="accounting/transaction"
|
path="accounting/transaction"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue