aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--servo/models/note.py2
-rw-r--r--servo/models/order.py5
-rwxr-xr-xservo/templates/orders/print_confirmation.html40
-rw-r--r--servo/views/order.py3
4 files changed, 23 insertions, 27 deletions
diff --git a/servo/models/note.py b/servo/models/note.py
index ab6b622..e7ab2dd 100644
--- a/servo/models/note.py
+++ b/servo/models/note.py
@@ -145,7 +145,7 @@ class Note(MPTTModel):
(T_NOTE, _("Technician's Note")),
(T_CUSTOMER_NOTE, _("Customer's Note")),
(T_PROBLEM, _("Customer Reported Issue")),
- (T_VERIFIED_PROBLEM, _("Verified Verified Issue")),
+ (T_VERIFIED_PROBLEM, _("Technician Verified Issue")),
(T_DIAGNOSIS, _("Diagnosis")),
(T_ESCALATION, _("Escalation")),
)
diff --git a/servo/models/order.py b/servo/models/order.py
index 574637d..8bf4dd6 100644
--- a/servo/models/order.py
+++ b/servo/models/order.py
@@ -287,10 +287,13 @@ class Order(models.Model):
r = {'order': self}
r['conf'] = Configuration.conf()
r['title'] = _(u"Service Order #%s") % self.code
+
r['notes'] = self.note_set.filter(is_reported=True)
+
# TODO: replace with constants
- r['issues'] = r['notes'].filter(type=2)
+ r['issues'] = r['notes'].filter(type=1)
r['diagnoses'] = r['notes'].filter(type=3)
+ r['tech_notes'] = r['notes'].filter(type=0)
r['verified_issues'] = r['notes'].filter(type=4)
r['customer_notes'] = r['notes'].filter(type=5)
diff --git a/servo/templates/orders/print_confirmation.html b/servo/templates/orders/print_confirmation.html
index b82cc70..1bd0844 100755
--- a/servo/templates/orders/print_confirmation.html
+++ b/servo/templates/orders/print_confirmation.html
@@ -7,22 +7,20 @@
{% block content %}
{% with order.location as location %}
<div class="row">
- <div class="span4">
+ <div class="span6">
{% if conf.company_logo %}
<img src="{% get_media_prefix %}{{ conf.company_logo }}" alt="logo" title="logo" class="media-object pull-left span2" style="margin:10px"/>
{% endif %}
- </div>
- <div class="span4">
- {{ location.title }}<br/>
+ <b>{{ location.title }}</b><br/>
{{ location.address }}<br/>
- {{ location.zip_code }}, {{ location.city }}<br/>
- {{ location.notes }}
+ {{ location.zip_code }}, {{ location.city }}
+ {{ location.email }}<br/>
+ {{ location.phone }}
</div>
- <div class="span4">
+ <div class="span6">
+ {{ location.notes }}
{% block location_info %}
{% endblock location_info %}
- {% trans "Email" %}: {{ location.email }}<br/>
- {% trans "Phone" %}: {{ location.phone }}<br/><br/>
</div>
</div>
{% endwith %}
@@ -86,36 +84,32 @@
</div>
<div class="row">
<div class="span12">
- {% block work_description %}
+ {% block work_description %}
{% if order.reported_notes.count > 0 %}
<h4>{% trans "Problem Description" %}</h4>
<hr/>
<p>
- {%trans "Customer Reported Issue" %}:
- {% for n in data.issues %}
- {{ n.body }}
- {% endfor %}
+ {% trans "Customer Reported Issue" %}:
+ {% for n in issues %} {{ n.body }} {% endfor %}
</p>
<p>
- {%trans "Technician Verified Issue" %}:
- {% for n in data.verified_issues %}
- {{ n.body }}
- {% endfor %}
+ {% trans "Technician Verified Issue" %}:
+ {% for n in verified_issues %} {{ n.body }} {% endfor %}
</p>
<p>
- {%trans "Customer Notes" %}:
- {% for n in data.customer_notes %}
+ {% trans "Customer Notes" %}:
+ {% for n in customer_notes %}
{{ n.body }}
{% endfor %}
</p>
<p>
- {%trans "Technician Notes" %}:
- {% for n in order.reported_notes %}
+ {% trans "Technician Notes" %}:
+ {% for n in tech_notes %}
{{ n.body }}
{% endfor %}
</p>
{% endif %}
- {% endblock work_description %}
+ {% endblock work_description %}
</div>
</div>
<div class="row">
diff --git a/servo/views/order.py b/servo/views/order.py
index b6fae0a..18c2e3a 100644
--- a/servo/views/order.py
+++ b/servo/views/order.py
@@ -564,8 +564,7 @@ def put_on_paper(request, pk, kind="confirmation", fmt='html'):
if fmt == 'pdf':
fn = data.get('title') + '.pdf'
- view = PDFTemplateView(request=request, template_name=template,
- filename=fn)
+ view = PDFTemplateView(request=request, template_name=template, filename=fn)
return view.render_to_response(data)
return render(request, template, data)