This repository has been archived by the owner on Sep 16, 2023. It is now read-only.
forked from ecmonline/invoice-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
15 changed files
with
570 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
source = | ||
invoice_generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
language: python | ||
cache: pip | ||
sudo: false | ||
python: | ||
- "3.6" | ||
- "3.5" | ||
- "nightly" | ||
- "pypy3" | ||
install: | ||
- pip install codecov coverage | ||
matrix: | ||
allow_failures: | ||
- python: "nightly" | ||
- python: "pypy3" | ||
script: | ||
- pip3 install -e ".[testing]" | ||
- coverage run -m unittest discover -s tests | ||
after_success: | ||
- codecov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,179 +1,180 @@ | ||
{% load i18n %} | ||
|
||
<html> | ||
<head> | ||
<link rel="stylesheet" href="style.css"> | ||
<style> | ||
@page { | ||
margin: 5cm 2cm 5cm 2cm; | ||
<head> | ||
<title> | ||
{% blocktrans with order_id=order.order_id %}Invoice {{ order_id}}{% endblocktrans %} | ||
</title> | ||
<link rel="stylesheet" href="style.css"> | ||
<style> | ||
@page { | ||
margin: 5cm 2cm 5cm 2cm; | ||
|
||
@top-right { | ||
content: url("logo-document.svg"); | ||
} | ||
@top-right { | ||
content: url("logo-document.svg"); | ||
} | ||
|
||
@bottom-left { | ||
white-space: pre; | ||
text-align: left; | ||
font-size: 8pt; | ||
content: "{{ vendor.address.name }}" "\a" | ||
"{{ vendor.address.street }}" "\a" | ||
"{{ vendor.address.postcode }} {{ vendor.address.city }}" "\a" | ||
"{% trans "VAT Number:" %} {{ vendor.vat_number }}" "\a" | ||
"\a" "\a" | ||
} | ||
@bottom-left { | ||
white-space: pre; | ||
text-align: left; | ||
font-size: 8pt; | ||
content: "{{ vendor.address.name }}" "\a" | ||
"{{ vendor.address.street }}" "\a" | ||
"{{ vendor.address.postcode }} {{ vendor.address.city }}" "\a" | ||
"{% trans "VAT Number:" %} {{ vendor.vat_number }}" "\a" | ||
"\a" "\a" | ||
} | ||
|
||
@bottom-center { | ||
white-space: pre; | ||
text-align: center; | ||
font-size: 8pt; | ||
content: {% for text in vendor.additional_text %} "{{ text }}" "\a"{% endfor %} | ||
{{ vendor.additional_text_suffix|safe }} | ||
{% blocktrans %}"Page " counter(page) " of " counter(pages){% endblocktrans %} | ||
} | ||
@bottom-center { | ||
white-space: pre; | ||
text-align: center; | ||
font-size: 8pt; | ||
content: {% for text in vendor.additional_text %} "{{ text }}" "\a"{% endfor %} | ||
{{ vendor.additional_text_suffix|safe }} | ||
{% blocktrans %}"Page " counter(page) " of " counter(pages){% endblocktrans %} | ||
} | ||
|
||
@bottom-right { | ||
white-space: pre; | ||
text-align: left; | ||
font-size: 8pt; | ||
content: "{% trans "Management Board" %}" "\a" | ||
"{{ executive.name }}" "\a" | ||
"{{ executive.text }}" "\a" | ||
"\a\a\a" | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<table class="adressTable"> | ||
<tr> | ||
<td class="small"> | ||
{{ vendor.address.name }}, | ||
{{ vendor.address.street }}, | ||
{{ vendor.address.postcode }} {{ vendor.address.city }} | ||
</td> | ||
</tr> | ||
@bottom-right { | ||
white-space: pre; | ||
text-align: left; | ||
font-size: 8pt; | ||
content: "{% trans "Management Board" %}" "\a" | ||
"{{ executive.name }}" "\a" | ||
"{{ executive.text }}" "\a" | ||
"\a\a\a" | ||
} | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div> | ||
<table class="addressTable"> | ||
<tr> | ||
<td class="small"> | ||
{{ vendor.address.name }}, | ||
{{ vendor.address.street }}, | ||
{{ vendor.address.postcode }} {{ vendor.address.city }} | ||
</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ billing_address.name }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ billing_address.name }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td>{{ billing_address.street }}</td> | ||
</tr> | ||
<tr> | ||
<td>{{ billing_address.street }}</td> | ||
</tr> | ||
|
||
<tr> | ||
<td> | ||
{{ billing_address.postcode }} | ||
{{ billing_address.city }} | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<tr> | ||
<td> | ||
{{ billing_address.postcode }} | ||
{{ billing_address.city }} | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
<div class="section"> | ||
<table class="infoTable"> | ||
<tr> | ||
<td> | ||
<strong> | ||
{% blocktrans with order_id=order.order_id %}Order ID: {{ order_id }}{% endblocktrans %} | ||
</strong> | ||
</td> | ||
<div class="section"> | ||
<table class="infoTable"> | ||
<tr> | ||
<td class="bold"> | ||
{% blocktrans with order_id=order.order_id %}Order ID: {{ order_id }}{% endblocktrans %} | ||
</td> | ||
|
||
<td> | ||
{% blocktrans with customer_id=order.customer_id %}Customer ID: {{ customer_id }}{% endblocktrans %} | ||
</td> | ||
</tr> | ||
<tr> | ||
{% if order.shipping_date_range %} | ||
<td class="small">{% blocktrans %}The order will be shipped upon receipt of payment.{% endblocktrans %}</td> | ||
{% endif %} | ||
<td> | ||
{% blocktrans with date=order.date|date %}Date of Invoice: {{ date }}{% endblocktrans %} | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
<td> | ||
{% blocktrans with customer_id=order.customer_id %}Customer ID: {{ customer_id }}{% endblocktrans %} | ||
</td> | ||
</tr> | ||
<tr> | ||
{% if order.shipping_date_range %} | ||
<td class="small">{% blocktrans %}The order will be shipped upon receipt of payment.{% endblocktrans %}</td> | ||
{% endif %} | ||
<td> | ||
{% blocktrans with date=order.date|date %}Date of Invoice: {{ date }}{% endblocktrans %} | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
|
||
<div class="section"> | ||
<table class="invoiceTable"> | ||
<thead> | ||
<tr> | ||
<td>{% blocktrans %}REF{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Description{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Quantity{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Price per Unit{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Tax Rate{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Net Price{% endblocktrans %}</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for item in invoice.items %} | ||
<tr> | ||
<td class="text-center">{{ item.reference }}</td> | ||
<td>{{ item.text|safe }}</td> | ||
<td class="nowrap text-center">{{ item.quantity }}</td> | ||
<td class="nowrap text-center">{{ item.net_price|floatformat:2 }} {{ currency }}</td> | ||
<td class="nowrap text-center">{{ item.tax_rate }} %</td> | ||
<td class="nowrap text-center">{{ item.total_net|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
{% endfor %} | ||
<tr class="tfoot"> | ||
<td class="padrow"></td> | ||
</tr> | ||
{% if order.total_discounted %} | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Total discounted{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_discounted|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
{% endif %} | ||
{% if order.total_shipping_net %} | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Shipping{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_shipping_net|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
{% endif %} | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Net total{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_net|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3">{% blocktrans with tax=order.tax_rate %}VAT ({{ tax }}%){% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_tax|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
<tr class="tfoot gross-total"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Gross total{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_gross|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="section"> | ||
<p>{% blocktrans %}Thank you for your order.{% endblocktrans %}</p> | ||
<div class="section"> | ||
<table class="invoiceTable"> | ||
<thead> | ||
<tr> | ||
<td>{% blocktrans %}REF{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Description{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Quantity{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Price per Unit{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Tax Rate{% endblocktrans %}</td> | ||
<td>{% blocktrans %}Net Price{% endblocktrans %}</td> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for item in invoice.items %} | ||
<tr> | ||
<td class="text-center">{{ item.reference }}</td> | ||
<td>{{ item.text|safe }}</td> | ||
<td class="nowrap text-center">{{ item.quantity }}</td> | ||
<td class="nowrap text-center">{{ item.net_price|floatformat:2 }} {{ currency }}</td> | ||
<td class="nowrap text-center">{{ item.tax_rate }} %</td> | ||
<td class="nowrap text-center">{{ item.total_net|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
{% endfor %} | ||
<tr class="tfoot"> | ||
<td class="padrow"></td> | ||
</tr> | ||
{% if order.total_discounted %} | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Total discounted{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_discounted|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
{% endif %} | ||
{% if order.total_shipping_net %} | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Shipping{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_shipping_net|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
{% endif %} | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Net total{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_net|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
<tr class="tfoot"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3">{% blocktrans with tax=order.tax_rate %}VAT ({{ tax }}%){% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_tax|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
<tr class="tfoot gross-total bold"> | ||
<td class="noborder"></td> | ||
<td class="noborder"></td> | ||
<td colspan="3"> {% blocktrans %}Gross total{% endblocktrans %}</td> | ||
<td class="nowrap" colspan="2">{{ order.total_gross|floatformat:2 }} {{ currency }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div class="section"> | ||
<p>{% blocktrans %}Thank you for your order.{% endblocktrans %}</p> | ||
|
||
{% if order.pay_until_date %} | ||
<p>{% blocktrans with date=order.pay_until_date|date %}Please settle the payment by {{ date }}{% endblocktrans %}.</p> | ||
{% endif %} | ||
{% if order.pay_until_date %} | ||
<p>{% blocktrans with date=order.pay_until_date|date %}Please settle the payment by {{ date }}{% endblocktrans %}.</p> | ||
{% endif %} | ||
|
||
{% if order.shipping_date_range %} | ||
<p> | ||
{% blocktrans with from=order.shipping_from|date to=order.shipping_to|date %} | ||
Order will be delivered between {{ from }} and {{ to }}. | ||
{% endblocktrans %} | ||
</p> | ||
{% endif %} | ||
</div> | ||
{% if order.shipping_date_range %} | ||
<p> | ||
{% blocktrans with from=order.shipping_from|date to=order.shipping_to|date %} | ||
Order will be delivered between {{ from }} and {{ to }}. | ||
{% endblocktrans %} | ||
</p> | ||
{% endif %} | ||
</div> | ||
|
||
</body> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.