diff --git a/copanier/reports.py b/copanier/reports.py index 7133fc8..fe664a8 100644 --- a/copanier/reports.py +++ b/copanier/reports.py @@ -67,7 +67,7 @@ def full(delivery): ws.append(row) footer = ( ["Total", "", ""] - + [round(o.total(delivery.products), 2) for o in delivery.orders.values()] + + [round(o.total(delivery.products, delivery), 2) for o in delivery.orders.values()] + [round(delivery.total, 2)] ) footer.insert(1, "") diff --git a/copanier/templates/products/copy_products.html b/copanier/templates/products/copy_products.html index 5e10a92..a208bf5 100644 --- a/copanier/templates/products/copy_products.html +++ b/copanier/templates/products/copy_products.html @@ -4,7 +4,6 @@

Copier les produits d'une autre distribution

-
-
- -
+ + +
Attention !! Copier les produits d'une autre distribution remplacera l'ensemble des producteurs et des produits actuels.
+
+ +

{% endblock body %} diff --git a/copanier/views/delivery.py b/copanier/views/delivery.py index 4bf79cc..36fcac9 100644 --- a/copanier/views/delivery.py +++ b/copanier/views/delivery.py @@ -23,41 +23,9 @@ async def home(request, response): "delivery/list_deliveries.html", incoming=Delivery.incoming(), former=Delivery.former(), - archives=list(Delivery.archived()), ) -@app.route("/archives", methods=["GET"]) -async def list_archives(request, response): - response.html( - "delivery/list_archives.html", {"deliveries": Delivery.archived()} - ) - - -@app.route("/distribution/archive/{id}", methods=["GET"]) -async def view_archive(request, response, id): - delivery = Delivery.load(f"archive/{id}") - response.html("delivery/show_delivery.html", {"delivery": delivery}) - - -@app.route("/distribution/{id}/archiver", methods=["GET"]) -@staff_only -async def archive_delivery(request, response, id): - delivery = Delivery.load(id) - delivery.archive() - response.message("La distribution a été archivée") - response.redirect = f"/distribution/{delivery.id}" - - -@app.route("/distribution/archive/{id}/désarchiver", methods=["GET"]) -@staff_only -async def unarchive_delivery(request, response, id): - delivery = Delivery.load(f"archive/{id}") - delivery.unarchive() - response.message("La distribution a été désarchivée") - response.redirect = f"/distribution/{delivery.id}" - - @app.route("/distribution", methods=["GET"]) async def new_delivery(request, response): response.html("delivery/edit_delivery.html", delivery={}) @@ -330,7 +298,6 @@ async def adjust_product(request, response, id, ref): @app.route("/distribution/{id}/paiements", methods=["GET"]) -@app.route("/distribution/{id}/paiements.pdf", methods=["GET"]) @staff_only async def compute_payments(request, response, id): delivery = Delivery.load(id) @@ -384,11 +351,4 @@ async def compute_payments(request, response, id): "crediters_groups": producer_groups, } - if request.url.endswith(b".pdf"): - response.pdf( - template_name, - template_args, - filename=utils.prefix("répartition-des-chèques.pdf", delivery), - ) - else: - response.html(template_name, template_args) + response.html(template_name, template_args)