From c620ac769e912d2680bfee1e6552d6f8cf842f91 Mon Sep 17 00:00:00 2001
From: Jean-Christophe Engel
- Il sera possible de choisir la date de sortie, d'indiquer - le montant de la cession le cas échéant et de modifier les - comptes associés. + Il sera possible de choisir la date de sortie et d'indiquer + le montant de la cession le cas échéant.
diff --git a/attach_immo.html b/attach_immo.html index 3fa8001..a824041 100644 --- a/attach_immo.html +++ b/attach_immo.html @@ -52,7 +52,7 @@ {{* montant de l'écriture de crédit déjà affecté *}} {{:assign montant_affecte=0}} -{{#load type="immo_link" assign="linked_immo." +{{#load type="credit_link" assign="linked_immo." where="$$.credit_line_id = :credit_line_id" :credit_line_id = $_GET.credit_line_id|intval }} @@ -114,7 +114,7 @@ {{* enregistrer la liaison des lignes d'immo *}} {{:save key=""|uuid - type="immo_link" + type="credit_link" immo_doc_id=$_GET.immo_doc_id|intval credit_line_id=$_GET.credit_line_id|intval amount=$saved_credit diff --git a/link.schema.json b/link.schema.json index 1524b55..88968ed 100644 --- a/link.schema.json +++ b/link.schema.json @@ -5,7 +5,7 @@ "properties": { "type": { "type": "string", - "enum": ["amort_link", "immo_link"] + "enum": ["amort_link", "credit_link", "exit_link"] }, "immo_doc_id" : { "description": "identifiant du document d'immobilisation associé", @@ -13,12 +13,17 @@ "exclusiveMinimum": 0 }, "amort_line_id" : { - "description": "numéro de ligne d'amortissement associée à l'immobilisation", + "description": "ligne d'amortissement associée à l'immobilisation", "type": "integer", "exclusiveMinimum": 0 }, "credit_line_id": { - "description": "numéro de ligne au crédit du compte de l'immobilisation", + "description": "ligne au crédit du compte de l'immobilisation", + "type": "integer", + "exclusiveMinimum": 0 + }, + "exit_line_id": { + "description": "ligne d'amortissement de sortie du bilan de l'immobilisation", "type": "integer", "exclusiveMinimum": 0 }, @@ -31,6 +36,9 @@ "if": {"properties": {"type": {"const": "amort_link"}}, "required": ["type"]}, "then": {"required": ["amort_line_id"]}, "else": - "if": {"properties": {"type": {"const": "immo_link"}}, "required": ["type"]}, + "if": {"properties": {"type": {"const": "credit_link"}}, "required": ["type"]}, "then": {"required": ["credit_line_id"]}, + "else": + "if": {"properties": {"type": {"const": "exit_link"}}, "required": ["type"]}, + "then": {"required": ["exit_line_id"]}, } diff --git a/link_immo.html b/link_immo.html index 2757db0..ef12192 100644 --- a/link_immo.html +++ b/link_immo.html @@ -58,7 +58,7 @@ WHERE account.code = :account_code AND credit > 0 AND credit_line_id NOT IN ( SELECT json_extract(link.document, '$.credit_line_id') AS credit_line_id FROM !table as link - WHERE json_extract(link.document, '$.type') == "immo_link") + WHERE json_extract(link.document, '$.type') == "credit_link") ORDER BY trans.date, trans.label; :account_code = $ligne_immo.account_code !table =$module.table diff --git a/save_amort.html b/save_amort.html index 6a8459c..5b852bc 100644 --- a/save_amort.html +++ b/save_amort.html @@ -57,7 +57,7 @@ *}} {{:assign total_credits=0}} {{#load - type="immo_link" + type="credit_link" where="$$.immo_doc_id = :immo_doc_id" :immo_doc_id = $_GET.immo_doc_id|intval }} {{if $amount == null}}