diff --git a/orchestra/apps/bills/actions.py b/orchestra/apps/bills/actions.py index 4b4d2389..ba471ce4 100644 --- a/orchestra/apps/bills/actions.py +++ b/orchestra/apps/bills/actions.py @@ -1,3 +1,7 @@ +from django.http import HttpResponse + + def generate_bill(modeladmin, request, queryset): - for bill in queryset: - bill.close() + bill = queryset.get() + bill.close() + return HttpResponse(bill.html) diff --git a/orchestra/apps/bills/settings.py b/orchestra/apps/bills/settings.py index 45633671..8817347a 100644 --- a/orchestra/apps/bills/settings.py +++ b/orchestra/apps/bills/settings.py @@ -14,7 +14,7 @@ BILLS_AMENDMENT_FEE_IDENT_PREFIX = getattr(settings, 'BILLS_AMENDMENT_FEE_IDENT_ BILLS_BUDGET_IDENT_PREFIX = getattr(settings, 'BILLS_BUDGET_IDENT_PREFIX', 'Q') -BILLS_INVOICE_TEMPLATE = getattr(settings, 'BILLS_INVOICE_TEMPLATE', 'bills/invoice.html') +BILLS_INVOICE_TEMPLATE = getattr(settings, 'BILLS_INVOICE_TEMPLATE', 'bills/microspective.html') BILLS_CURRENCY = getattr(settings, 'BILLS_CURRENCY', 'euro') diff --git a/orchestra/apps/bills/templates/bills/altinvoice.html b/orchestra/apps/bills/templates/bills/altinvoice.html deleted file mode 100644 index 2888a8a2..00000000 --- a/orchestra/apps/bills/templates/bills/altinvoice.html +++ /dev/null @@ -1,309 +0,0 @@ - - -
- Invoice
-
F20110232

-
- -
- - - - -
- Associacio Pangea - Coordinadora Comunicacio per a la Cooperacio
- ES2323233
-
- Pl eusebi guell 6-7, planta 0
- 08034 - Barcelona
- Spain
-
-
- 93-803-21-32
- sales@pangea.org
- www.pangea.org
-
-
-
-
-
- DUE DATE
- Nov 21, 2011 -
-
- TOTAL
- 122,03 € -
-
- INVOICE DATE
- Oct 20, 2012 -
-
-
-
- Aadults
- ES01939933
- Carrer nnoseque, 0
- 08034 - Barcelona
- Spain
-
-
- -
- id - description - hrs/qty - rate/price - subtotal -
- 1 - Hola que passa - 1 - 1 € - 111 € -
- 1 - Merda pura - 1 - 1 € - 111 € -
- 1 - I tu que et passa - 1 - 1 € - 111 € -
- 1 - Joder hostia puta - 1 - 1 € - 111 € -
-
-
- subtotal - 33,03 € -
- tax - 33,03 € -
- total - 33,03 € -
-
- - - diff --git a/orchestra/apps/bills/templates/bills/base.html b/orchestra/apps/bills/templates/bills/base.html new file mode 100644 index 00000000..5990ab52 --- /dev/null +++ b/orchestra/apps/bills/templates/bills/base.html @@ -0,0 +1,10 @@ + + + {% block title %}Invoice - I20110223{% endblock %} + + {% block head %}{% endblock %} + + + {% block body %}{% endblock %} + + diff --git a/orchestra/apps/bills/templates/bills/microspective-fee.html b/orchestra/apps/bills/templates/bills/microspective-fee.html new file mode 100644 index 00000000..da594219 --- /dev/null +++ b/orchestra/apps/bills/templates/bills/microspective-fee.html @@ -0,0 +1,125 @@ +{% extends 'bills/microspective.html' %} +{% block head %} + +{% endblock %} + +{% block summary %} +
+
+
+ +
+ Aadults
+ ES01939933
+ Carrer nnoseque, 0
+ 08034 - Barcelona
+ Spain
+
+ +
+ Membership Fee
+ Q20110232
+ Nov, 2011
+
+ +
+ 1232,00 €
+ To pay before Oct 20, 2011
+ on 213.232.322.232.332
+
+
+ +
+from Apr 1, 2010 to Apr 1, 2011 +
+{% endblock %} +{% block content %} +
+Con vuestras cuotas, ademas de obtener conexion y multitud de servicios, estais
+ Con vuestras cuotas, ademas de obtener conexion y multitud de servicios,
+ Con vuestras cuotas, ademas de obtener conexion
+ Con vuestras cuotas, ademas de obtener
+
+{% endblock %} +{% block pagination %}
{% endblock %} + diff --git a/orchestra/apps/bills/templates/bills/microspective.css b/orchestra/apps/bills/templates/bills/microspective.css new file mode 100644 index 00000000..2a7e17e1 --- /dev/null +++ b/orchestra/apps/bills/templates/bills/microspective.css @@ -0,0 +1,247 @@ +body { + max-width: 650px; + margin: 40 auto !important; + float: none !important; + font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; +} + +a { + font-size: 100%; + text-decoration: none; + vertical-align: baseline; + margin: 0; + padding: 0; + color: #666; +} + +a:hover { + color: {{ color }}; + text-decoration: underline; +} + +#logo { + float: left; + font-weight: bold; + color: {{ color }}; + margin: 1px 10px 15px 60px; + padding: 1px; +} + +#bill-number { + float: right; + text-align: right; + font-size: 20; + font-weight: bold; + color: grey; + margin-top: 15px; + margin-bottom: 10px; +} + +#bill-number .value { + font-size: 30; + color: {{ color }}; + font-weight: normal; +} + +#pagination { + font-size: small; +} + +/* SUMMARY */ + +#bill-summary > * { + float: right; + border: 1px solid grey; + padding: 7px; + text-align: center; + font-size: large; + width: 100px; +} + +#bill-summary hr { + padding: 0; + margin-top: 20px; + color: #ccc; + margin-bottom: -1px; + float: none; + width: 100%; + border-left: none; + border-right: none; + border-bottom: 1px solid grey; +} + +#bill-summary .title { + color: {{ color }}; + font-size: x-small; + font-weight: bold; + position: relative; + top: -6px; +} + +#bill-summary #total, #total .title { + background-color: {{ color }}; + color: white; + font-weight: bold; +} + +#bill-summary #due-date, #bill-date, #total { + border-bottom: 2px solid grey; + height: 32px; +} + +#bill-summary #due-date { + border-right: 2px solid grey; + font-size: medium; +} + +#bill-summary #bill-date { + border-left: 2px solid grey; + font-size: medium; +} + + +/* DETAILS */ + +#seller-details, #buyer-details { + margin: 40px; +} + +#seller-details p { + margin-top: 5px; +} + +#seller-details .name { + font-weight: bold; + color: {{ color }}; +} + +#seller-details .contact { + float: left; + font-style: italic; + font-size: small; + color: #666; +} + +#buyer-details { + margin: 30px 40px 30px 60px; + font-size: 15; +} + +#buyer-details .name { + font-weight: bold; +} + + +/* LINES */ + +#lines > * { + -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ + -moz-box-sizing: border-box; /* Firefox, other Gecko */ + box-sizing: border-box; /* Opera/IE 8+ */ + padding-left: 10px; + float: left; + padding: 5px; + text-align: center; + font-size: small; +} + +#lines .title { + font-weight: bold; + border-bottom: 2px solid #CCC; + color: {{ color }}; +} + +#lines .value { + border-bottom: 1px solid #CCC; +} + +#lines .column-id { + width: 5%; + text-align: right; +} + +#lines .column-description { + width: 55%; + text-align: left; +} + +#lines .column-quantity { + width: 20%; +} + +#lines .column-rate { + width: 10%; +} + +#lines .column-subtotal { + width: 10%; + text-align: right; +} + + +/* TOTALS */ + +#totals { + padding-top: 100px; +} + +#totals > * { + -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ + -moz-box-sizing: border-box; /* Firefox, other Gecko */ + box-sizing: border-box; /* Opera/IE 8+ */ + padding: 5px; + padding-left: 10px; + text-align: right; + font-size: small; +} + +#totals .column-title { + font-weight: bold; + color: {{ color }}; + width: 86%; + float: left; +} + +#totals .column-value { + width: 14%; + float: left; +} + +#totals .subtotal { + border-bottom: 1px solid #CCC; + font-weight: normal; +} + +#totals .tax { + border-bottom: 2px solid #CCC; + font-weight: normal; +} + +#totals .total { + font-weight: bold; +} + + +/* FOOTER */ + +#footer .title { + color: {{ color }}; + font-weight: bold; +} + +#footer > * > * { + margin: 5px; + color: #666; + font-size: small; +} + + +#footer-column-1 { + float: left; + width: 48%; +} + +#footer-column-2 { + float: right; + width: 48%; +} diff --git a/orchestra/apps/bills/templates/bills/microspective.html b/orchestra/apps/bills/templates/bills/microspective.html new file mode 100644 index 00000000..304f1020 --- /dev/null +++ b/orchestra/apps/bills/templates/bills/microspective.html @@ -0,0 +1,145 @@ +{% extends 'bills/base.html' %} + +{% block head %} + +{% endblock %} + +{% block body %} +{% block header %} + +
+
+ Associacio Pangea -
+ Coordinadora Comunicacio per a la Cooperacio
+
+
+

Pl. Eusebi Guell 6-7, planta 0
+ 08034 - Barcelona
+ Spain
+

+

93-803-21-32
+ sales@pangea.org
+ www.pangea.org

+
+
+{% endblock %} + +{% block summary %} +
+ Invoice
+ F20110232
+ Page 1 of 1 +
+
+
+
+ DUE DATE
+ Nov 21, 2011 +
+
+ TOTAL
+ 122,03 € +
+
+ INVOICE DATE
+ Oct 20, 2012 +
+
+
+ Aadults
+ ES01939933
+ Carrer nnoseque, 0
+ 08034 - Barcelona
+ Spain
+
+{% endblock %} + +{% block content %} +
+ id + description + hrs/qty + rate/price + subtotal +
+ + 1
+  
+ + Hola que passa
+ nosquevols
+ + 1
+  
+ + 1,00 €
+  
+ + 111,00 €
+ -10,00 €
+
+ 1 + Merda pura + 1 + 1,00 € + 111,00 € +
+ 1 + I tu que et passa + 1 + 1,00 € + 111,00 € +
+ 1 + Joder hostia puta + 1 + 1,00 € + 111,00 € +
+
+
+ subtotal + 33,03 € +
+ tax + 33,03 € +
+ total + 33,03 € +
+
+{% endblock %} + +{% block footer %} + +{% endblock %} +{% endblock %} diff --git a/orchestra/apps/bills/templates/bills/plans/PL_EN.html b/orchestra/apps/bills/templates/bills/plans/PL_EN.html deleted file mode 100644 index b190a377..00000000 --- a/orchestra/apps/bills/templates/bills/plans/PL_EN.html +++ /dev/null @@ -1,5 +0,0 @@ -{% extends 'bills/plans/invoice_base.html' %} -{% block title %}{{ invoice.full_number }}{% endblock %} -{% block body %} -{% include 'bills/plans/PL_EN_layout.html' %} -{% endblock %} diff --git a/orchestra/apps/bills/templates/bills/plans/PL_EN_layout.html b/orchestra/apps/bills/templates/bills/plans/PL_EN_layout.html deleted file mode 100644 index b8d9b09d..00000000 --- a/orchestra/apps/bills/templates/bills/plans/PL_EN_layout.html +++ /dev/null @@ -1,171 +0,0 @@ - {% if logo_url %} - company logo - {% endif %} - -
-

- {{ invoice.full_number }} -

-

{% if not copy %}ORYGINAŁ{% else %}KOPIA{% endif %}

-

{{ invoice.issued|date:"Y-m-d" }}

- {% if invoice.type != invoice.INVOICE_TYPES.PROFORMA %}{# Not a PROFORMA #} -

{{ invoice.selling_date|date:"Y-m-d" }}

- {% else %} -

 

- {% endif %} -
- - - - - - - - - - -
- -

- - {{ buyer.name }}
- {{ buyer.address }}
- {{ buyer.zipcode }}
- {{ buyer.country }} - - -
- -

- {{ seller.name }}
- {{ seller.address }}
- {{ seller.zipcode }}
- {{ seller.country }}

- {{ invoice.issuer_tax_number }}
-

- -

- {{ buyer.name }}
- {{ buyer.address }}
- {{ buyer.zipcode }}
- {{ buyer.country }} - - {% if invoice.buyer_tax_number %} -

- - {{ invoice.buyer_tax_number }} - -

- {% endif %} -
-
- - - - - - - - - - - {% if invoice.rebate %} - - - {% endif %} - - - - - - - - - - - - - - - {% if invoice.rebate %} - - {% endif %} - - - - - - - - - - - - - - - -
- L.p. - - Nazwa usługi
- Description - -
- Cena j. netto
- Unit price - -
- - Ilość
- Qty. -
- J.m. - - Rabat
Rebate - -
- Wartość netto
- Subtotal -
- VAT
TAX -
- - Kwota VAT
TAX/VAT Amount -
- - Wartość brutto
- Subtotal with TAX/VAT -
- 1 - {{ invoice.item_description }}{{ invoice.unit_price_net|floatformat:2 }} {{ invoice.currency }}{{ invoice.quantity }}sztuk
units
{{ invoice.rebate|floatformat:2 }} %{{ invoice.total_net|floatformat:2 }} {{ invoice.currency }}{% if invoice.tax != None %}{{ invoice.tax|floatformat:2 }} %{% else %}n.p.
n/a{% endif %}
{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} {{ invoice.currency }}{% else %}n.p.
n/a{% endif %}
{{ invoice.total|floatformat:2 }} {{ invoice.currency }}
{{ invoice.total_net|floatformat:2 }} {{ invoice.currency }}{% if invoice.tax != None %}{{ invoice.tax|floatformat:2 }} %{% else %}n.p.
n/a{% endif %}
{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} {{ invoice.currency }}{% else %}n.p.
n/a{% endif %}
{{ invoice.total|floatformat:2 }} {{ invoice.currency }}
-
- - {% if invoice.type != invoice.INVOICE_TYPES.PROFORMA %} -

- {% endif %} - - - - - {% if invoice.type == invoice.INVOICE_TYPES.PROFORMA %} - - - {% else %} - - {% endif %} - - {{ invoice.payment_date|date:"Y-m-d" }} -

-
- - {% if invoice.type == invoice.INVOICE_TYPES.PROFORMA %}

Ten dokument nie jest fakturą VAT (nie jest dokumentem księgowym).This document is not an invoice.

{% endif %} - - {% if invoice.tax == None and invoice.is_UE_customer %} -

- Odwrotne obciążenie.-Reverse charge. -

- {% endif %} - - -
diff --git a/orchestra/apps/bills/templates/bills/plans/invoice_base.html b/orchestra/apps/bills/templates/bills/plans/invoice_base.html deleted file mode 100644 index 725192e2..00000000 --- a/orchestra/apps/bills/templates/bills/plans/invoice_base.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - {% block title %}{% endblock %} - - - - {% block head %}{% endblock %} - - - -{% block body %}{% endblock %} - -