From 1c0480c6d6dd3503b1b332dc66e2f63581cdee22 Mon Sep 17 00:00:00 2001 From: Serghei Mihai Date: Wed, 30 Mar 2016 18:10:17 +0200 Subject: [PATCH] lingo: invoice details if present (#10483) Use invoice status to define line style --- combo/apps/lingo/models.py | 8 ++++++-- combo/apps/lingo/templates/lingo/combo/item.html | 3 +++ combo/apps/lingo/templates/lingo/combo/items.html | 8 ++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/combo/apps/lingo/models.py b/combo/apps/lingo/models.py index 391d25e..eaf49fc 100644 --- a/combo/apps/lingo/models.py +++ b/combo/apps/lingo/models.py @@ -70,7 +70,9 @@ def build_remote_item(data, regie): subject=data.get('label'), has_pdf=data.get('has_pdf'), online_payment=data.get('online_payment'), - payment_date=data.get('payment_date')) + payment_date=data.get('payment_date'), + details=data.get('comment'), + status=data.get('status')) class Regie(models.Model): @@ -229,7 +231,7 @@ class RemoteItem(object): def __init__(self, id, regie, creation_date, payment_limit_date, total_amount, amount, display_id, subject, has_pdf, - online_payment, payment_date): + online_payment, payment_date, status, details): self.id = id self.regie = regie self.creation_date = parser.parse(creation_date) @@ -240,6 +242,8 @@ class RemoteItem(object): self.subject = subject self.has_pdf = has_pdf self.online_payment = online_payment + self.details = details + self.status = status if payment_date: self.payment_date = parser.parse(payment_date) diff --git a/combo/apps/lingo/templates/lingo/combo/item.html b/combo/apps/lingo/templates/lingo/combo/item.html index 13b902e..6c26c37 100644 --- a/combo/apps/lingo/templates/lingo/combo/item.html +++ b/combo/apps/lingo/templates/lingo/combo/item.html @@ -29,6 +29,9 @@ {% if item.payment_date %} {% endif %} + {% if item.details %} +
{% trans "Details:" %} {{ item.details }}
+ {% endif %} {% if item.online_payment and item.amount >= regie.payment_min_amount %} {% csrf_token %} diff --git a/combo/apps/lingo/templates/lingo/combo/items.html b/combo/apps/lingo/templates/lingo/combo/items.html index cd5342a..c90dd2c 100644 --- a/combo/apps/lingo/templates/lingo/combo/items.html +++ b/combo/apps/lingo/templates/lingo/combo/items.html @@ -8,6 +8,7 @@ {% trans "Number" %} {% trans "Label" %} + {% trans "Details" %} {% trans "Issue date" %} {% trans "Payment limit date" %} {% trans "Amount" %} @@ -16,9 +17,12 @@ {% for item in items %} - + {{ item.display_id }} - {{ item.subject }} + + {{ item.subject }} + + {{ item.details }} {{ item.creation_date|date:"SHORT_DATE_FORMAT" }} {{ item.payment_limit_date|date:"SHORT_DATE_FORMAT" }} {% blocktrans with amount=item.total_amount|floatformat:"2" %} -- 2.8.0.rc3