Projet

Général

Profil

0004-lingo-display-comment-for-invoice-if-present-10483.patch

Serghei Mihai, 30 mars 2016 18:12

Télécharger (2,73 ko)

Voir les différences:

Subject: [PATCH 4/4] lingo: display comment for invoice if present (#10483)

Use invoice status to define line style
 combo/apps/lingo/models.py                        | 8 ++++++--
 combo/apps/lingo/templates/lingo/combo/items.html | 9 +++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)
combo/apps/lingo/models.py
70 70
                      subject=data.get('label'),
71 71
                      has_pdf=data.get('has_pdf'),
72 72
                      online_payment=data.get('online_payment'),
73
                      payment_date=data.get('payment_date'))
73
                      payment_date=data.get('payment_date'),
74
                      comment=data.get('comment'),
75
                      status=data.get('status'))
74 76

  
75 77

  
76 78
class Regie(models.Model):
......
229 231

  
230 232
    def __init__(self, id, regie, creation_date, payment_limit_date,
231 233
                 total_amount, amount, display_id, subject, has_pdf,
232
                 online_payment, payment_date):
234
                 online_payment, payment_date, status, comment):
233 235
        self.id = id
234 236
        self.regie = regie
235 237
        self.creation_date = parser.parse(creation_date)
......
240 242
        self.subject = subject
241 243
        self.has_pdf = has_pdf
242 244
        self.online_payment = online_payment
245
        self.comment = comment
246
        self.status = status
243 247
        if payment_date:
244 248
            self.payment_date = parser.parse(payment_date)
245 249

  
combo/apps/lingo/templates/lingo/combo/items.html
16 16
  </thead>
17 17
  <tbody>
18 18
  {% for item in items %}
19
  <tr>
19
  <tr class='{{ item.status }}-invoice'>
20 20
    <td class="invoice-id">{{ item.display_id }}</td>
21
    <td class="invoice-subject">{{ item.subject }}</td>
21
    <td class="invoice-subject">
22
      {{ item.subject }}
23
      {% if item.comment %}
24
      <div class="comment">{{ item.comment }}</div>
25
      {% endif %}
26
    </td>
22 27
    <td class="invoice-creation-date">{{ item.creation_date|date:"SHORT_DATE_FORMAT" }}</td>
23 28
    <td class="invoice-payment-limit-date">{{ item.payment_limit_date|date:"SHORT_DATE_FORMAT" }}</td>
24 29
    <td class="invoice-amount amount">{% blocktrans with amount=item.total_amount|floatformat:"2" %}
25
-