Reviewed calculation for HT, HT NET, TVA and TTC amounts
This commit is contained in:
parent
4a642fa654
commit
317a7312cc
1 changed files with 6 additions and 16 deletions
|
|
@ -345,13 +345,9 @@ def _lire_document_sql(cursor, numero: str, type_doc: int):
|
|||
doc["lignes"] = lignes
|
||||
doc["nb_lignes"] = len(lignes)
|
||||
|
||||
total_ht_calcule = sum(ligne.get("montant_ligne_ht", 0) for ligne in lignes)
|
||||
total_ttc_calcule = sum(ligne.get("montant_ligne_ttc", 0) for ligne in lignes)
|
||||
total_taxes_calcule = sum(ligne.get("total_taxes", 0) for ligne in lignes)
|
||||
|
||||
doc["total_ht_calcule"] = total_ht_calcule
|
||||
doc["total_ttc_calcule"] = total_ttc_calcule
|
||||
doc["total_taxes_calcule"] = total_taxes_calcule
|
||||
doc["total_ht_calcule"] = doc["total_ht_net"]
|
||||
doc["total_ttc_calcule"] = doc["total_ttc"]
|
||||
doc["total_taxes_calcule"] = doc["total_ttc"] - doc["total_ht_net"]
|
||||
|
||||
return doc
|
||||
|
||||
|
|
@ -756,15 +752,9 @@ def _lister_documents_avec_lignes_sql(
|
|||
doc["lignes"].append(ligne)
|
||||
|
||||
doc["nb_lignes"] = len(doc["lignes"])
|
||||
doc["total_ht_calcule"] = sum(
|
||||
ligne.get("montant_ligne_ht", 0) for ligne in doc["lignes"]
|
||||
)
|
||||
doc["total_ttc_calcule"] = sum(
|
||||
ligne.get("montant_ligne_ttc", 0) for ligne in doc["lignes"]
|
||||
)
|
||||
doc["total_taxes_calcule"] = sum(
|
||||
ligne.get("total_taxes", 0) for ligne in doc["lignes"]
|
||||
)
|
||||
doc["total_ht_calcule"] = doc["total_ht_net"]
|
||||
doc["total_ttc_calcule"] = doc["total_ttc"]
|
||||
doc["total_taxes_calcule"] = doc["total_ttc"] - doc["total_ht_net"]
|
||||
|
||||
logger.debug(
|
||||
f"[SQL LIST] {numero} : {doc['nb_lignes']} lignes chargées"
|
||||
|
|
|
|||
Loading…
Reference in a new issue