Merge pull request #277 from pwelzel/feature_custom_invoice_address
add custom address field to shop.models.Order and invoice template
This commit is contained in:
commit
80e9c01f87
18
src/shop/migrations/0055_order_customer_address.py
Normal file
18
src/shop/migrations/0055_order_customer_address.py
Normal 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'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -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'
|
||||||
|
|
|
@ -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;">
|
||||||
|
|
Loading…
Reference in a new issue