add custom address field to shop.models.Order and invoice template

This commit is contained in:
Patrick Welzel 2018-08-22 15:41:24 +02:00
parent 09e916571e
commit 8b8191e16d
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 2.1 on 2018-08-22 13:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shop', '0054_auto_20180415_1159'),
]
operations = [
migrations.AddField(
model_name='order',
name='customer_address',
field=models.TextField(blank=True, help_text='The additional customer address for this order'),
),
]

View file

@ -87,6 +87,12 @@ class Order(CreatedUpdatedModel):
default=True, default=True,
) )
customer_address = models.TextField(
help_text=_('The additional customer address for this order'),
blank=True
)
CREDIT_CARD = 'credit_card' CREDIT_CARD = 'credit_card'
BLOCKCHAIN = 'blockchain' BLOCKCHAIN = 'blockchain'
BANK_TRANSFER = 'bank_transfer' BANK_TRANSFER = 'bank_transfer'

View file

@ -14,7 +14,12 @@
</td> </td>
</tr> </tr>
</table> </table>
{% if invoice.order.customer_address %}
<h2>CUSTOMER</h2>
<p class="lead">{{ invoice.order.customer_address|linebreaks }}</p>
{% else %}
<h3>Customer: {{ invoice.order.user.email }}</h3> <h3>Customer: {{ invoice.order.user.email }}</h3>
{% endif %}
<br> <br>
<h2>INVOICE</h2> <h2>INVOICE</h2>
<table style="width:90%; margin:1em;"> <table style="width:90%; margin:1em;">