diff --git a/backend/src/contracts/generate_contract.py b/backend/src/contracts/generate_contract.py index 3facdcf..9e132ff 100644 --- a/backend/src/contracts/generate_contract.py +++ b/backend/src/contracts/generate_contract.py @@ -421,7 +421,7 @@ def generate_recap( product for product in first_contract.products if product.product.type == models.ProductType.RECCURENT ], - key=lambda x: x.product.name + key=lambda x: (x.product.name, x.product.quantity) ) recurrents = [ f'{pr.product.name}{f' - {pr.product.quantity}{pr.product.quantity_unit}' @@ -515,7 +515,7 @@ def generate_recap( product for product in contract.products if product.product.type == models.ProductType.RECCURENT ], - key=lambda x: x.product.name + key=lambda x: (x.product.name, x.product.quantity) ) main_data.append([ @@ -581,8 +581,6 @@ def generate_recap( 4, 5, 6, - len(info_header) + len(payment_header), - len(info_header) + len(payment_header) + 1 + len(occasionnals), ] ) doc.body.append(sheet)