Harmonisation navigation et sélection comptes et sous-comptes crédit
This commit is contained in:
parent
2af96b2796
commit
d4743f3631
6 changed files with 38 additions and 15 deletions
|
|
@ -32,6 +32,7 @@
|
|||
- line.credit < ligne_immo.amount => peut-être un avoir
|
||||
- line.credit = ligne_immo.amount - avoirs => écriture de sortie du bilan
|
||||
*}}
|
||||
{{:assign account_code=$ligne_immo.account_code|cat:"%"}}
|
||||
{{#select
|
||||
trans.id as trans_id,
|
||||
trans.label as trans_label,
|
||||
|
|
@ -40,15 +41,15 @@
|
|||
line.id as credit_line_id,
|
||||
line.label as line_label,
|
||||
line.credit as amount,
|
||||
acc.id as account_id,
|
||||
acc.code as account_code,
|
||||
acc.label as account_label
|
||||
account.id as account_id,
|
||||
account.code as account_code,
|
||||
account.label as account_label
|
||||
FROM acc_transactions AS trans
|
||||
INNER JOIN acc_transactions_lines AS line ON line.id_transaction = trans.id
|
||||
INNER JOIN acc_accounts AS acc ON line.id_account = acc.id
|
||||
INNER JOIN acc_accounts AS account ON line.id_account = account.id
|
||||
LEFT JOIN module_data_amortization AS mda ON json_extract(mda.document, '$.amort_line_id') = line.id
|
||||
WHERE
|
||||
acc.code = :acc_code
|
||||
account.code LIKE :account_code
|
||||
AND line.credit > 0
|
||||
AND credit_line_id NOT IN (
|
||||
SELECT json_extract(credit_link.document, '$.credit_line_id') AS line_id FROM !table as credit_link
|
||||
|
|
@ -58,7 +59,7 @@
|
|||
WHERE json_extract(exit_link.document, '$.type') == "exit_link"
|
||||
)
|
||||
;
|
||||
:acc_code=$ligne_immo.account_code
|
||||
:account_code=$account_code
|
||||
!table =$module.table
|
||||
assign="credit_line"
|
||||
}}
|
||||
|
|
@ -75,7 +76,6 @@
|
|||
}}
|
||||
|
||||
{{* chercher des écritures d'amortissement correspondant au compte d'une immo sans doc associé *}}
|
||||
{{* TODO écritures d'amort pas entièrement affectées *}}
|
||||
{{#select
|
||||
line.id as amort_line_id,
|
||||
line.credit as amort_amount,
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
{{:assign keep_amort=true}}
|
||||
{{#load type="amort_link"
|
||||
where="$$.amort_line_id = :amort_line_id"
|
||||
:amort_line_id=$amort_line.amort_line_id|intval
|
||||
:amort_line_id=$amort_line.amort_line_id
|
||||
assign="amort_link"
|
||||
}}
|
||||
{{if $amort_link.amount == null || $amort_link.amount == 0}}
|
||||
|
|
@ -123,6 +123,7 @@
|
|||
{{/select}}
|
||||
|
||||
{{:admin_header title="Immobilisation sortie du bilan" custom_css="./style.css" current="module_amortization"}}
|
||||
{{:include file="_nav.html" current="archived" subcurrent="exit"}}
|
||||
|
||||
{{if $_GET.ok}}
|
||||
{{if $_GET.msg|match:"attach_avoir"}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue