From 6f61220363e5d196cd4b7c79a0dc899d98b2241a Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Mon, 30 May 2016 18:09:21 +0200 Subject: [PATCH] commit some more invoice stuff --- shop/email.py | 17 ++++----- shop/management/commands/invoice-worker.py | 3 +- shop/templates/emails/invoice_email.html | 16 +++++++++ shop/templates/emails/invoice_email.txt | 19 ++++++++++ shop/templates/emails/testmail.txt | 1 + shop/templates/invoice.html | 42 ++++++++++++++++++++++ 6 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 shop/templates/emails/invoice_email.html create mode 100644 shop/templates/emails/invoice_email.txt create mode 100644 shop/templates/emails/testmail.txt create mode 100644 shop/templates/invoice.html diff --git a/shop/email.py b/shop/email.py index c679fc94..66e0d9e2 100644 --- a/shop/email.py +++ b/shop/email.py @@ -8,9 +8,9 @@ def send_email(emailtype, recipient, formatdict, subject, sender='BornHack +
+This email contains the invoice for your purchase from BornHack.
+Your order number is {{ ordernumber }} and your invoice number is {{ invoicenumber }}.
+
+Your order has been paid in full. The invoice is attached in PDF format with the filename {{ filename }}.
+
+Tickets will be generated closer to the event. Ticket holders will receive an email when tickets can be downloaded from the webshop. Merchandise can be picked up from the info booth during the event.
+
+Thank your for your purchase!
+
+
+Best regards,
+
+The BornHack Team
+
\ No newline at end of file diff --git a/shop/templates/emails/invoice_email.txt b/shop/templates/emails/invoice_email.txt new file mode 100644 index 00000000..e4f74ee5 --- /dev/null +++ b/shop/templates/emails/invoice_email.txt @@ -0,0 +1,19 @@ +Hello! + +This email contains the invoice for your purchase from BornHack. +Your order number is {{ ordernumber }} and your invoice number is {{ invoicenumber }}. + +Your order has been paid in full. The invoice is attached in PDF +format with the filename {{ filename }}. + +Tickets will be generated closer to the event. Ticket +holders will receive an email when tickets can be downloaded +from the webshop. Merchandise can be picked up from the info +booth during the event. + +Thank your for your purchase! + + +Best regards, + +The BornHack Team diff --git a/shop/templates/emails/testmail.txt b/shop/templates/emails/testmail.txt new file mode 100644 index 00000000..e594893e --- /dev/null +++ b/shop/templates/emails/testmail.txt @@ -0,0 +1 @@ +testmail from bornhack website diff --git a/shop/templates/invoice.html b/shop/templates/invoice.html new file mode 100644 index 00000000..64807bee --- /dev/null +++ b/shop/templates/invoice.html @@ -0,0 +1,42 @@ +{% load shop_tags %} +This is an invoice. + + + + + +{% for order_product in invoice.order.orderproductrelation_set.all %} + + + +
+ Name + + Quantity + + Price + + Total +
+ {{ order_product.product.name }} + + {{ order_product.quantity }} + + {{ order_product.product.price|currency }} + + {{ order_product.total|currency }} +{% endfor %} + +
+ + Hereof VAT (25%) + + {{ order.vat|currency }} + +
+ + Total + + {{ order.total|currency }} + +