Skip to content

Commit

Permalink
Invoice pdf fixes (#1666)
Browse files Browse the repository at this point in the history
* Fixed image on pdf's

* Ok i will sneak it in here

* Fixed price alignment

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Changed the order back pice, quantity

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
zarya and pre-commit-ci[bot] authored Sep 28, 2024
1 parent 3737f49 commit e8445bf
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 47 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,4 @@ You can also specify details like:
* Thomas Steen Rasmusssen https://github.com/tykling
* Víðir Valberg Guðmundsson https://github.com/valberg
* Ximin Luo https://github.com/infinity0
* zarya https://github.com/zarya
38 changes: 21 additions & 17 deletions src/shop/templates/pdf/creditnote.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
display: block;
height: 150px;
background: no-repeat top center url('{% static 'img/bornhack-2024/logo/bornhack-2024-logo-s.png' %}');
background-size: 100% 100%;
background-size: 571px 150px;
}

.footer {
Expand All @@ -57,6 +57,10 @@
/*display: block;*/
text-align: center;
}

.alignRight {
text-align: right;
}
</style>

<header>
Expand Down Expand Up @@ -85,13 +89,13 @@ <h2>CREDITNOTE</h2>
<td>
<b>Product</b>
</td>
<td align="right">
<b>Price</b>
</td>
<td>
<b>Quantity</b>
</td>
<td align="right">
<td align="right" class="alignRight">
<b>Price</b>
</td>
<td align="right" class="alignRight">
<b>Total</b>
</td>
</tr>
Expand All @@ -104,13 +108,13 @@ <h2>CREDITNOTE</h2>
<td>
{{ rpr.opr.product.name }}
</td>
<td align="right">
{{ rpr.opr.product.price|currency }}
</td>
<td>
{{ rpr.quantity }}
</td>
<td align="right">
<td align="right" class="alignRight">
{{ rpr.opr.product.price|currency }}
</td>
<td align="right" class="alignRight">
{{ rpr.total|currency }}
</td>
</tr>
Expand All @@ -121,37 +125,37 @@ <h2>CREDITNOTE</h2>
<td>
{{ creditnote.text }}
</td>
<td align="right">
{{ creditnote.amount|currency }}
</td>
<td>
1
</td>
<td align="right">
<td align="right" class="alignRight">
{{ creditnote.amount|currency }}
</td>
<td align="right" class="alignRight">
{{ creditnote.amount|currency }}
</td>
</tr>
{% endif %}
<tr><td style="height: 1px; line-height: 1px; border-top: 1pt solid black;" colspan="4">&nbsp;</td></tr>

<tr>
<td align="right" colspan="3">
<td align="right" colspan="3" class="alignRight">
{% if creditnote.danish_vat %}
<strong>Danish VAT (25%)</strong>
{% else %}
<strong>No VAT</strong>
{% endif %}
</td>
<td align="right">
<td align="right" class="alignRight">
{{ creditnote.vat|currency }}
</td>
</tr>

<tr>
<td align="right" colspan="3">
<td align="right" colspan="3" class="alignRight">
<strong>Total</strong>
</td>
<td align="right">
<td align="right" class="alignRight">
{{ creditnote.amount|currency }}
</td>
</tr>
Expand Down
16 changes: 10 additions & 6 deletions src/shop/templates/pdf/custominvoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
display: block;
height: 150px;
background: no-repeat top center url('{% static 'img/bornhack-2024/logo/bornhack-2024-logo-s.png' %}');
background-size: 100% 100%;
background-size: 571px 150px;
}

.footer {
Expand All @@ -57,6 +57,10 @@
/*display: block;*/
text-align: center;
}

.alignRight {
text-align: right;
}
</style>

<header>
Expand Down Expand Up @@ -97,28 +101,28 @@ <h2>INVOICE</h2>
<td>
{{ invoice.customorder.text|linebreaks }}
</td>
<td align="right">
<td align="right" class="alignRight">
{{ invoice.customorder.amount|currency }}
</td>
</tr>
<tr>
<td align="right">
<td align="right" class="alignRight">
{% if invoice.customorder.danish_vat %}
<strong>Included Danish VAT (25%)</strong>
{% else %}
<strong>No VAT</strong>
{% endif %}
</td>
<td align="right">
<td align="right" class="alignRight">
{{ invoice.customorder.vat|currency }}
</td>
</tr>

<tr>
<td align="right">
<td align="right" class="alignRight">
<strong>Total</strong>
</td>
<td align="right">
<td align="right" class="alignRight">
{{ invoice.customorder.amount|currency }}
</td>
</tr>
Expand Down
26 changes: 15 additions & 11 deletions src/shop/templates/pdf/invoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
display: block;
height: 150px;
background: no-repeat top center url('{% static 'img/bornhack-2024/logo/bornhack-2024-logo-s.png' %}');
background-size: 100% 100%;
background-size: 571px 150px;
}

.footer {
Expand All @@ -58,6 +58,10 @@
/*display: block;*/
text-align: center;
}

.alignRight {
text-align: right;
}
</style>

<header>
Expand Down Expand Up @@ -91,13 +95,13 @@ <h2>INVOICE</h2>
<td>
<b>Name</b>
</td>
<td align="right">
<b>Price</b>
</td>
<td>
<b>Quantity</b>
</td>
<td align="right">
<td align="right" class="alignRight">
<b>Price</b>
</td>
<td align="right" class="alignRight">
<b>Total</b>
</td>
</tr>
Expand All @@ -110,13 +114,13 @@ <h2>INVOICE</h2>
<td>
{{ order_product.product.name }}
</td>
<td align="right">
{{ order_product.product.price|currency }}
</td>
<td>
{{ order_product.quantity }}
</td>
<td align="right">
<td align="right" class="alignRight">
{{ order_product.product.price|currency }}
</td>
<td align="right" class="alignRight">
{{ order_product.total|currency }}
</td>
</tr>
Expand All @@ -130,7 +134,7 @@ <h2>INVOICE</h2>
<td>
<strong>Included Danish VAT (25%)</strong>
</td>
<td align="right">
<td align="right" class="alignRight">
{{ invoice.order.vat|currency }}
</td>
</tr>
Expand All @@ -141,7 +145,7 @@ <h2>INVOICE</h2>
<td>
<strong>Invoice Total</strong>
</td>
<td align="right">
<td align="right" class="alignRight">
{{ invoice.order.total|currency }}
</td>
</tr>
Expand Down
28 changes: 16 additions & 12 deletions src/shop/templates/pdf/proforma_invoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
display: block;
height: 150px;
background: no-repeat top center url('{% static 'img/bornhack-2024/logo/bornhack-2024-logo-s.png' %}');
background-size: 100% 100%;
background-size: 571px 150px;
}

.footer {
Expand All @@ -57,6 +57,10 @@
/*display: block;*/
text-align: center;
}

.alignRight {
text-align: right;
}
</style>
<header>
<div>
Expand Down Expand Up @@ -89,13 +93,13 @@ <h2>PROFORMA INVOICE</h2>
<td>
<b>Name</b>
</td>
<td align="right">
<b>Price
<td>
<b>Quantity
</td>
<td>
<b>Quantity
<td align="right" class="alignRight">
<b>Price
</td>
<td align="right">
<td align="right" class="alignRight">
<b>Total
</td>
</tr>
Expand All @@ -109,13 +113,13 @@ <h2>PROFORMA INVOICE</h2>
<td>
{{ order_product.product.name }}
</td>
<td align="right">
{{ order_product.product.price|currency }}
</td>
<td>
{{ order_product.quantity }}
</td>
<td align="right">
<td align="right" class="alignRight">
{{ order_product.product.price|currency }}
</td>
<td align="right" class="alignRight">
{{ order_product.total|currency }}
</td>
</tr>
Expand All @@ -130,7 +134,7 @@ <h2>PROFORMA INVOICE</h2>
<td>
<strong>Included Danish VAT (25%)</strong>
</td>
<td align="right">
<td align="right" class="alignRight">
{{ order.vat|currency }}
</td>

Expand All @@ -141,7 +145,7 @@ <h2>PROFORMA INVOICE</h2>
<td>
<strong>Invoice Total</strong>
</td>
<td align="right">
<td align="right" class="alignRight">
{{ order.total|currency }}
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/tickets/templates/pdf/ticket.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
display: block;
height: 150px;
background: no-repeat top center url('{% static 'img/bornhack-2024/logo/bornhack-2024-logo-s.png' %}');
background-size: 100% 100%;
background-size: 571px 150px;
}

.footer {
Expand Down

0 comments on commit e8445bf

Please sign in to comment.