Adds external user sale

This commit is contained in:
nikolark committed 2014-10-05 23:39:18 +02:00
1 parent 1a68e4b95b
commit ea7174815b
7 files changed
+227 -47

No files matched your search

+6 -7
View File
@@ -20,8 +20,8 @@
<tr>
<th>Vare</th>
<th>Beholdning</th>
<th>Pris (intern)</th>
<th>Salgsverdi (intern)</th>
<th>Innkjøpspris</th>
<th>Verdi</th>
<th>I salg</th>
<th>Sist oppdatert</th>
</tr>
@@ -31,19 +31,18 @@
<tr class="{% if not product.active %}info inactive{% elif product.inventory_amount <= 0 %}warning{% else %}success{% endif %}">
<td>{{ product.name }}</td>
<td class="product-amount">{{ product.inventory_amount }}</td>
<td>{{ product.sale_price_int }}</td>
<td>{{ product.inventory_value }}</td>
<td>{{ product.wholesale_unit_price|default:"-" }}</td>
<td>{{ product.wholesale_value|default:"-" }}</td>
<td class="product-active">{% if product.active %}<i class="glyphicon glyphicon-ok"></i>{% endif %}</td>
<td>{{ product.updated }}</td>
</tr>
{% endfor %}
<tr>
<td><em>Sum</em></td>
<td> {{ num_products }}</td>
<td></td>
<td><b>{{ inventory_value }}</b></td>
<td>{{ num_products }} totalt</td>
<td></td>
<td>{{ wholesale_value }}</td>
<td></td>
</tr>
</tbody>
+1 -1
View File
@@ -38,7 +38,7 @@
{% for order in orders %}
<tr>
<td>{{ order.created }}</td>
<td>{% if order.customer.get_profile.image %}<img src="{{ order.customer.get_profile.image }}" class="customer" title="{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}" />{% else %}{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}{% endif %}</td>
<td>{% if order.customer %}{% if order.customer.get_profile.image %}<img src="{{ order.customer.get_profile.image }}" class="customer" title="{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}" />{% else %}{{ order.customer.first_name }} {{ order.customer.last_name|slice:":1"}}{% endif %}{% else %}Ekstern{% endif %}</td>
<td>{% for line in order.orderline_set.all %}
<span class="amount">{{ line.amount}}</span> <a href="#" class="product" title="{{ line.unit_price}} per">{{ line.product }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>
<td>{{ order.order_sum }}</td>
+9 -3
View File
@@ -9,7 +9,7 @@
<section class="row">
<div class="col-xs-4">
{% for message in messages %}
<div {% if message.tags %}class="alert alert-{{ message.tags }}"{% endif %}>{{ message }}<a class="close" data-dismiss="alert">×</a></div>
<div{% if message.tags %} class="alert alert-{{ message.tags }}"{% endif %}>{{ message }}<a class="close" data-dismiss="alert">×</a></div>
{% endfor %}
</div>
</section>
@@ -41,6 +41,11 @@
<div class="row">
<div class="col-md-12">
<ul class="well">
<li class="customer">{% spaceless %}
<img class="profile" src="{{ STATIC_URL }}img/unknown_person.png" alt="Profile picture" /><br />
<span class="name">Ekstern</span><br />
<span class="balance">&nbsp;</span>
{% endspaceless %}</li>
{% for user in users %}<li class="customer{% if user.get_profile.last_purchase_date < half_a_year_ago and not user.get_profile.last_purchase == None %} infrequent hidden{% endif %}">{% spaceless %}
{% if user.get_profile.image %}
  <img class="profile" src="{{ user.get_profile.image }}" alt="Profile picture" /><br />
@@ -74,14 +79,15 @@
{% for product in products %}
<li id="form-{{forloop.counter0}}" class="product"><input type="hidden" name="form-{{ forloop.counter0 }}-product" value="{{product.id }}" />
<input type="hidden" id="form-{{ forloop.counter0 }}-amount" name="form-{{ forloop.counter0 }}-amount" value="0" class="span2" size="2" />
<input type="hidden" name="form-{{ forloop.counter0 }}-unit_price" value="{{product.sale_price_int }}" />
<input type="hidden" name="form-{{ forloop.counter0 }}-unit_price_int" value="{{product.sale_price_int }}" />
<input type="hidden" name="form-{{ forloop.counter0 }}-unit_price_ext" value="{{product.sale_price_ext }}" />
<span class="qty">0</span>
{% if product.image %}
<img class="product" src="{{ product.image.url }}" /><br />
{% else %}
<img class="product" src="{{ STATIC_URL }}img/product.png" /><br />
{% endif %}
<span class="name">{{ product.name }}</span> - <span class="sale_price_int">{{product.sale_price_int|floatformat:0}}</span>
<span class="name">{{ product.name }}</span> - <span class="sale_price_ext">{{product.sale_price_ext|floatformat:0}}</span>/<span class="sale_price_int">{{product.sale_price_int|floatformat:0}}</span>
</li>
{% endfor %}
</ul>