aboutsummaryrefslogtreecommitdiffstats
path: root/servo/templates/products
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-08-04 10:11:24 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-08-04 10:11:24 +0300
commit63b0fc6269b38edf7234b9f151b80d81f614c0a3 (patch)
tree555de3068f33f8dddb4619349bbea7d9b7c822fd /servo/templates/products
downloadServo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.gz
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.tar.bz2
Servo-63b0fc6269b38edf7234b9f151b80d81f614c0a3.zip
Initial commit
First public commit
Diffstat (limited to 'servo/templates/products')
-rwxr-xr-xservo/templates/products/category_form.html13
-rwxr-xr-xservo/templates/products/choose-list.html9
-rwxr-xr-xservo/templates/products/choose.html25
-rwxr-xr-xservo/templates/products/delete_category.html17
-rwxr-xr-xservo/templates/products/form.html90
-rwxr-xr-xservo/templates/products/get_info.html59
-rwxr-xr-xservo/templates/products/index.html104
-rwxr-xr-xservo/templates/products/index_outgoing.html56
-rwxr-xr-xservo/templates/products/list.html27
-rwxr-xr-xservo/templates/products/list_rows.html55
-rwxr-xr-xservo/templates/products/receive_item.html51
-rwxr-xr-xservo/templates/products/remove.html13
-rwxr-xr-xservo/templates/products/search.html20
-rwxr-xr-xservo/templates/products/tabs.html21
-rwxr-xr-xservo/templates/products/upload_gsx_parts.html13
-rwxr-xr-xservo/templates/products/upload_products.html13
-rwxr-xr-xservo/templates/products/view.html205
-rwxr-xr-xservo/templates/products/view_incoming.html1
18 files changed, 792 insertions, 0 deletions
diff --git a/servo/templates/products/category_form.html b/servo/templates/products/category_form.html
new file mode 100755
index 0000000..72ec93a
--- /dev/null
+++ b/servo/templates/products/category_form.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Edit Product Group" %}
+{% endblock header %}
+
+{% block body %}
+ <form action="{{ request.path }}" method="post" class="form-horizontal">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ </form>
+{% endblock body %}
diff --git a/servo/templates/products/choose-list.html b/servo/templates/products/choose-list.html
new file mode 100755
index 0000000..3188808
--- /dev/null
+++ b/servo/templates/products/choose-list.html
@@ -0,0 +1,9 @@
+{% load i18n %}
+{% load servo_tags %}
+<ul class="nav nav-pills nav-stacked">
+{% for i in products %}
+ <li><a href="{% url target_url order i.pk %}"><strong>{{ i.code}}</strong><br/>{{ i.title }}<span class="pull-right">{{ i.price_sales_stock|currency }}</span></a></li>
+{% empty %}
+ <li style="text-align:center">{% trans "No products found" %}</li>
+{% endfor %}
+</ul>
diff --git a/servo/templates/products/choose.html b/servo/templates/products/choose.html
new file mode 100755
index 0000000..a34834b
--- /dev/null
+++ b/servo/templates/products/choose.html
@@ -0,0 +1,25 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Search for a product" %}
+{% endblock header %}
+
+{% block body %}
+ <form method="post" action="{{ action }}" accept-charset="utf-8" data-target="#search-results" id="search-form">
+ {% csrf_token %}
+ <input type="text" style="width:500px" class="search-query" name="q" autocomplete="off" placeholder="{% trans "Code, title or category" %}"/>
+ </form>
+ <div id="search-results"></div>
+{% endblock body %}
+
+{% block footer %}
+ <button class="btn" data-dismiss="modal" aria-hidden="true">{% trans "Close" %}</button>
+ <a class="btn btn-primary submit-search" href="#">{% trans "Search" %}</a>
+ <script type="text/javascript">
+ $('.submit-search').click(function(e){
+ $('#search-form').submit();
+ e.preventDefault();
+ });
+ </script>
+{% endblock footer %} \ No newline at end of file
diff --git a/servo/templates/products/delete_category.html b/servo/templates/products/delete_category.html
new file mode 100755
index 0000000..e9aed7b
--- /dev/null
+++ b/servo/templates/products/delete_category.html
@@ -0,0 +1,17 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Delete product category?" %}
+{% endblock header %}
+
+{% block body %}
+ {% trans "This action will not delete the products in this category." %}
+{% endblock body %}
+
+{% block footer %}
+ <form method="post" action="{{ action }}">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</button>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/products/form.html b/servo/templates/products/form.html
new file mode 100755
index 0000000..0429e6a
--- /dev/null
+++ b/servo/templates/products/form.html
@@ -0,0 +1,90 @@
+{% extends "products/view.html" %}
+{% load i18n %}
+
+{% block third_column %}
+<div class="span6">
+ <form method="post" action="" class="form-horizontal" enctype="multipart/form-data">
+ {% csrf_token %}
+ {{ formset.management_form }}
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "General" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Exchange Price" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Stock Price" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Stock" %}</a></li>
+ <li><a href="#tab5" data-toggle="tab">{% trans "Details" %}</a></li>
+ <li><a href="#tab6" data-toggle="tab">{% trans "GSX" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ {% include "form_field_snippet.html" with field=form.code %}
+ {% include "form_field_snippet.html" with field=form.title %}
+ {% include "form_field_snippet.html" with field=form.description %}
+ {% include "form_field_snippet.html" with field=form.is_service %}
+ </div>
+ <div class="tab-pane calculate" id="tab2">
+ {% include "form_field_snippet.html" with field=form.price_purchase_exchange %}
+ {% include "form_field_snippet.html" with field=form.pct_margin_exchange %}
+ {% include "form_field_snippet.html" with field=form.price_notax_exchange %}
+ {% include "form_field_snippet.html" with field=form.price_sales_exchange %}
+ </div>
+ <div class="tab-pane calculate" id="tab3">
+ {% include "form_field_snippet.html" with field=form.price_purchase_stock %}
+ {% include "form_field_snippet.html" with field=form.pct_margin_stock %}
+ {% include "form_field_snippet.html" with field=form.price_notax_stock %}
+ {% include "form_field_snippet.html" with field=form.price_sales_stock %}
+ </div>
+ <div class="tab-pane" id="tab4">
+ {% for f in formset %}
+ <div class="table">
+ {% include "form_snippet.html" with form=f %}
+ </div>
+ {% endfor %}
+ <a class="btn" id="add_more"><i class="icon-plus"></i> {% trans "Add" %}</a>
+ </div>
+ <div class="tab-pane" id="tab5">
+ {% include "form_field_snippet.html" with field=form.pct_vat %}
+ {% include "form_field_snippet.html" with field=form.shipping %}
+ {% include "form_field_snippet.html" with field=form.warranty_period %}
+ {% include "form_field_snippet.html" with field=form.brand %}
+ {% include "form_field_snippet.html" with field=form.categories %}
+ <div class="control-group">
+ <label class="control-label">{% trans "Tags" %}</label>
+ <div class="controls">
+ <input type="text" name="tag" class="input typeahead" placeholder="{% trans "Enter tag" %}" data-provide="typeahead" data-source="{% url 'products-tags' %}" autocomplete="off"/>
+ <div style="margin-top:10px">
+ {% for t in product.tags.all %}
+ <span class="label"><div class="pull-left">{{ t.tag }}</div><a class="close" href="{% url 'tags-clear' t.pk %}"><i class="icon-remove icon-white"></i></a></span>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ {% include "form_field_snippet.html" with field=form.photo %}
+ {% include "form_field_snippet.html" with field=form.fixed_price %}
+ {% include "form_field_snippet.html" with field=form.is_serialized %}
+ </div>
+ <div class="tab-pane" id="tab6">
+ {% include "form_field_snippet.html" with field=form.part_type %}
+ {% include "form_field_snippet.html" with field=form.labour_tier %}
+ {% include "form_field_snippet.html" with field=form.component_code %}
+ {% include "form_field_snippet.html" with field=form.eee_code %}
+ </div>
+ </div>
+ <div class="form-actions">
+ {% if product.pk %}
+ <a class="btn" href="{% url 'products-view_product' product.pk %}">{% trans "Cancel" %}</a>
+ {% else %}
+ <a class="btn" href="{% url 'products-list_products' %}">{% trans "Cancel" %}</a>
+ {% endif %}
+ <button type="submit" class="btn btn-primary">{% trans "Save" %}</button>
+ </div>
+ </form>
+</div>
+{% endblock third_column %}
+
+{% block media %}
+<script type="text/javascript">
+ $('#add_more').click(function() {
+ cloneMore('div.table:last', 'inventory_set');
+ });
+</script>
+{% endblock media %}
diff --git a/servo/templates/products/get_info.html b/servo/templates/products/get_info.html
new file mode 100755
index 0000000..be024e2
--- /dev/null
+++ b/servo/templates/products/get_info.html
@@ -0,0 +1,59 @@
+{% extends "modal.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block header %}
+{% trans "Product Info" %}
+{% endblock header %}
+
+{% block body %}
+<div class="media">
+ <a class="pull-left" href="#">
+ <img class="media-object" src="{{ product.get_photo }}" data-src="{{ product.get_photo }}" width="64px"/>
+ </a>
+ <div class="media-body">
+ <h4 class="media-heading">{{ product.code }}</h4>
+ <p>{{ product.title }}</p>
+ <p>{{ product.description|default:"" }}</p>
+ </div>
+</div>
+<dl class="dl-horizontal">
+ <dt>{% trans "Stock Price" %}</dt>
+ <dd>{{ product.price_sales_stock|currency }}</dd>
+ <dt>{% trans "Exchange Price" %}</dt>
+ <dd>{{ product.price_sales_exchange|currency }}</dd>
+ {% if product.component_code %}
+ <dt>{% trans "Component Group" %}</dt>
+ <dd>{{ product.get_component_code_display }} ({{ product.get_part_type_display }})</dd>
+ {% endif %}
+</dl>
+<dl class="dl-horizontal">
+ <dt>{% trans "EEE Code" %}</dt>
+ <dd>{{ product.eee_code|default:"-"|addspace }}</dd>
+</dl>
+{% for i in inventory %}
+{% ifchanged i.location.id %}
+<hr/>
+<h4>{{ i.location.title }}</h4>
+{% endifchanged %}
+<dl class="dl-horizontal">
+ <dt>{% trans "Stocked" %}</dt>
+ <dd>{{ i.amount_stocked }}</dd>
+ <dt>{% trans "Ordered" %}</dt>
+ <dd>{{ i.amount_ordered|default:"-" }}</dd>
+ <dt>{% trans "Reserved" %}</dt>
+ <dd>{{ i.amount_reserved|default:"-" }}</dd>
+</dl>
+{% empty %}
+ <hr/>
+ <div class="muted text-center">{% trans "Product not in inventory" %}</div>
+{% endfor %}
+{% endblock body %}
+
+{% block footer %}
+{% if product.pk %}
+ <a class="btn btn-default" href="{{ product.get_absolute_url }}">{% trans "View" %}</a>
+ <a class="btn btn-default" href="{% url 'products-edit_product' pk=product.pk group='all' %}">{% trans "Edit" %}</a>
+{% endif %}
+ <button type="submit" class="btn btn-primary" data-dismiss="modal">{% trans "Done" %}</button>
+{% endblock footer %} \ No newline at end of file
diff --git a/servo/templates/products/index.html b/servo/templates/products/index.html
new file mode 100755
index 0000000..fefcecd
--- /dev/null
+++ b/servo/templates/products/index.html
@@ -0,0 +1,104 @@
+{% extends "default.html" %}
+{% load i18n %}
+{% load mptt_tags %}
+{% load servo_tags %}
+
+{% block toolbar %}
+<div class="btn-group">
+ {% if perms.servo.add_product %}
+ <a class="btn" href="{% url 'products-create' group=group.slug %}"><i class="icon-plus"></i> {% trans "New Product" %}</a>
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'products-create_category' %}" data-modal="#modal">{% trans "New Category" %}</a></li>
+ <li class="divider"></li>
+ {% if product.id and perms.servo.add_purchaseorder %}
+ <li><a href="{% url 'orders-create_with_product' product_id=product.id %}">{% trans "New Sales Order" %}</a></li>
+ <li><a href="{% url 'purchases-create_po' product_id=product.id %}">{% trans "New Purchase Order" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="">{% trans "New Sales Order" %}</a></li>
+ <li class="disabled"><a href="">{% trans "New Purchase Order" %}</a></li>
+ {% endif %}
+ </ul>
+ {% endif %}
+</div>
+<div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if group.pk and perms.servo.add_product %}
+ <li><a href="{% url 'products-edit_category' group.slug %}" data-modal="#modal">{% trans "Edit Category" %}</a></li>
+ <li><a href="{% url 'products-delete_category' group.slug %}" data-modal="#modal">{% trans "Delete Category" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Edit Category" %}</a></li>
+ <li class="disabled"><a href="#">{% trans "Delete Category" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'products-download' %}">{% trans "Download Products" %}</a></li>
+ <li><a href="{% url 'products-upload_products' %}" data-modal="#modal">{% trans "Upload Products" %}</a></li>
+ <li><a href="{% url 'products-upload_gsx_parts' %}" data-modal="#modal">{% trans "Upload Parts Database" %}</a></li>
+ </ul>
+</div>
+{% endblock toolbar %}
+
+{% block content %}
+<div class="row-fluid row-header">
+ <div class="span12">
+ <form class="form-search pull-right">
+ <div class="input-append">
+ <input type="text" class="search-query filter" placeholder="{% trans "Filter results" %}"/>
+ <button type="button" class="btn" data-toggle="collapse" data-target="#collapsable"><i class="icon-search"></i></button>
+ </div>
+ </form>
+ </div>
+</div>
+{% include "products/tabs.html" %}
+<div class="row-fluid">
+ {% block second_column %}
+ <div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Categories" %}</li>
+ <li class="{% active request 'all' %}"><a href="{% url 'products-list_products' %}">{% trans "All" %}</a></li>
+ {% recursetree categories %}
+ <li class="{% active request 'products' node.slug %}">
+ <a href="{% url 'products-list_products' group=node.slug %}">{{ node.title }}</a>
+ {% if not node.is_leaf_node %}
+ <ul class="nav nav-list">{{ children }}</ul>
+ {% endif %}
+ </li>
+ {% endrecursetree %}
+ </ul>
+ </div>
+ <div class="span9">
+ <div id="collapsable" class="collapse out">
+ <form method="post" action="" class="form-inline">
+ {% csrf_token %}
+ {% for field in form %}
+ <div class="control-group pull-left">
+ <label class="control-label">{{ field.label|default:"&nbsp;" }}</label>
+ <div class="controls">{{ field }}</div>
+ </div>
+ {% endfor %}
+ <p class="clearfix"><hr/></p>
+ <div class="pull-right">
+ <button type="submit" class="btn btn-primary"><i class="icon-search icon-white"></i> {% trans "Search" %}</button>
+ </div>
+ </form>
+ </div>
+ {% include "products/list.html" %}
+ {% include "pagination.html" with items=products %}
+ </div>
+ {% endblock second_column %}
+
+ {% block third_column %}
+
+ {% endblock third_column %}
+</div>
+{% endblock content %}
+
+{% block crumbs %}
+<li><a href="{% url 'products-list_products' %}">{% trans "Products" %}</a></li>
+{% block breadcrumb %}
+<li class="active"><span class="divider">/</span>{{ group_name }}</li>
+{% endblock breadcrumb %}
+{% endblock crumbs %}
diff --git a/servo/templates/products/index_outgoing.html b/servo/templates/products/index_outgoing.html
new file mode 100755
index 0000000..5b1d007
--- /dev/null
+++ b/servo/templates/products/index_outgoing.html
@@ -0,0 +1,56 @@
+{% extends "products/index.html" %}
+{% load i18n %}
+
+{% block toolbar %}
+
+{% endblock toolbar %}
+
+{% block first_column %}
+<ul class="nav nav-list">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Outgoing" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Shipped" %}</a></li>
+</ul>
+{% endblock first_column %}
+
+{% block second_column %}
+<div class="span9">
+ <form method="post" action="">
+ {% csrf_token %}
+ <table class="table table-hover">
+ <thead>
+ <tr>
+ <th><input type="checkbox" class="toggle_column"/></th>
+ <th>{% trans "Code" %}</th>
+ <th>{% trans "Title" %}</th>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Return Order" %}</th>
+ <th>{% trans "Register For Return" %}</th>
+ <th>{% trans "Serial Number" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for p in parts %}
+ <tr>
+ <td><input type="checkbox" name="items" value="{{ p.returnOrderNumber }}"/></td>
+ <td>{{ p.partNumber }}</td>
+ <td>{{ p.partDescription|truncatechars:42 }}</td>
+ <td>{{ p.purchaseOrderNumber }}</td>
+ <td><a href="{% url 'products-return_label' p.partNumber p.returnOrderNumber %}" class="window">{{ p.returnOrderNumber }}</a></td>
+ <td>{{ p.registeredForReturn }}</td>
+ <td>{{ p.kbbSerialNumber }}</td>
+ </tr>
+ {% empty %}
+ <tr>
+ <td colspan="7" class="muted empty">{% trans "No parts pending return" %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <button type="submit" class="btn btn-primary pull-right" disabled="disabled">{% trans "Submit" %}</button>
+ </form>
+</div>
+{% endblock second_column %}
+
+{% block breadcrumb %}
+ <li><a href="{% url 'products-outgoing' %}">{% trans "Outgoing" %}</a></li>
+{% endblock breadcrumb %}
diff --git a/servo/templates/products/list.html b/servo/templates/products/list.html
new file mode 100755
index 0000000..bac34ec
--- /dev/null
+++ b/servo/templates/products/list.html
@@ -0,0 +1,27 @@
+{% load i18n %}
+{% load servo_tags %}
+<table class="table table-hover sortable">
+ <thead>
+ <tr>
+ <th style="width:80px" data-defaultsort="disabled"></th>
+ <th>{% trans "Product" %}</th>
+ <th>{% trans "Stock Price" %}</th>
+ <th>{% trans "Exchange Price" %}</th>
+ <th style="width:80px">{% trans "In Stock" %}</th>
+ <th data-defaultsort="disabled"></th>
+ </tr>
+ </thead>
+ <tbody class="searchable">
+ {% include "products/list_rows.html" %}
+ </tbody>
+ <tfoot>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td><strong>{{ total_sales_value|currency }}</strong><br/><strong>{{ total_purchase_value|currency }}</strong></td>
+ <td></td>
+ <td></td>
+ </tr>
+ </tfoot>
+</table>
diff --git a/servo/templates/products/list_rows.html b/servo/templates/products/list_rows.html
new file mode 100755
index 0000000..a753687
--- /dev/null
+++ b/servo/templates/products/list_rows.html
@@ -0,0 +1,55 @@
+{% load i18n %}
+{% load servo_tags %}
+{% for p in products %}
+{% with p.get_pk as product_id %}
+<tr>
+ <td><img src="{{ p.get_photo }}" alt="{{ product }}" class="img-icon"/></td>
+ <td data-value="{{ p.code }}">
+ <a href="{% url 'products-view_product' pk=p.pk group=group.slug %}"><strong>{{ p.code }}</strong></a><br/>
+ {{ p.title }}<br/><small class="muted">{{ p.eee_code|default:""|addspace }}</small>
+ </td>
+ <td data-value="{{ p.price_sales_stock|safe }}">{{ p.price_sales_stock|currency }}</td>
+ <td data-value="{{ p.price_sales_exchange|safe }}">{{ p.price_sales_exchange|currency }}</td>
+ {% if p.is_service %}
+ <td>&infin;</td>
+ {% else %}
+ <td>{{ p|amount_in_location:request.user }}</td>
+ {% endif %}
+ <td>
+ <div class="btn-group pull-right">
+ {% if perms.servo.change_product %}
+ <a class="btn" href="{% url 'products-edit_product' pk=product_id group=group.slug %}"><i class="icon-pencil"></i></a>
+ {% else %}
+ <a class="btn disabled" href="#"><i class="icon-pencil"></i></a>
+ {% endif %}
+ <button class="btn dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </button>
+ <ul class="dropdown-menu">
+ {% with request.session.current_order_id as co %}
+ {% if co %}
+ <li><a href="{% url 'orders-add_product' co product_id %}">{% trans "Use in Service Order" %} #{{ request.session.current_order_code }}</a></li>
+ <li class="divider"></li>
+ {% endif %}
+ {% endwith %}
+ <li><a href="{% url 'orders-create_with_product' product_id %}">{% trans "Create Sales Order" %}</a></li>
+ <li><a href="{% url 'purchases-create_po' product_id=product_id %}">{% trans "Create Purchase Order" %}</a></li>
+ {% with request.session.current_po as po %}
+ {% if po %}
+ <li><a href="{% url 'purchases-add_to_po' pk=po.id product_id=product_id %}">{% trans "Use in Purchase Order" %}</a></li>
+ {% endif %}
+ {% endwith %}
+ <li class="divider"></li>
+ {% if perms.servo.delete_product %}
+ <li><a href="{% url 'products-delete_product' pk=product_id group=group.slug %}" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ </td>
+</tr>
+{% endwith %}
+{% empty %}
+<tr><td colspan="6" class="muted empty">{% trans "No products found" %}</td></tr>
+{% endfor %}
diff --git a/servo/templates/products/receive_item.html b/servo/templates/products/receive_item.html
new file mode 100755
index 0000000..275fbd2
--- /dev/null
+++ b/servo/templates/products/receive_item.html
@@ -0,0 +1,51 @@
+{% extends "modal.html" %}
+{% load servo_tags %}
+{% load i18n %}
+
+{% block header %}
+ {{ item.code }}
+{% endblock header %}
+
+{% block body %}
+ <form method="post" action="{{ url }}" class="form-horizontal">
+ {% csrf_token %}
+ <h4>{{ item.title }}</h4>
+ <dl class="dl-horizontal">
+ {% with item.purchase_order as po %}
+ <dt>{% trans "Ordered" %}</dt>
+ <dd>{{ po.created_at|date:"SHORT_DATE_FORMAT" }}, {{ po.created_by }}</dd>
+ <dt>{% trans "Service Order" %}</dt>
+ {% if po.sales_order %}
+ <dd><a href="{% url 'orders-edit' po.sales_order.pk %}">{{ po.sales_order.code }}</a></dd>
+ {% else %}
+ <dd>{% trans "Stocking Order" %} {{ po.reference }}</dd>
+ {% endif %}
+ <dt>{% trans "Reference" %}</dt>
+ <dd>{{ po.reference|default:"-" }}</dd>
+ {% if item.received_at %}
+ <dt>{% trans "Received" %}</dt>
+ <dd>{{ item.received_at|date:"SHORT_DATE_FORMAT" }}, {{ item.received_by }}</dd>
+ {% endif %}
+ {% if item.reference %}
+ <dt>{% trans "Reference" %}</dt>
+ <dd>{{ item.reference }}</dd>
+ {% endif %}
+ <dt>{% trans "Confirmation" %}</dt>
+ <dd>{{ po.confirmation|default:"-" }}</dd>
+ {% endwith %}
+ <dt>{% trans "Purchase Price" %}</dt>
+ <dd>{{ form.instance.price|currency|default:"-" }}</dd>
+ </dl>
+ {% include "form_field_snippet.html" with field=form.amount %}
+ {% if item.product.is_serialized %}
+ {% include "form_field_snippet.html" with field=form.sn %}
+ {% endif %}
+ </form>
+{% endblock body %}
+
+{% block footer %}
+ <button class="btn" data-dismiss="modal">{% trans "Cancel" %}</button>
+{% if not item.received_at %}
+ <button type="submit" class="btn btn-primary">{% trans "Receive" %}</button>
+{% endif %}
+{% endblock footer %}
diff --git a/servo/templates/products/remove.html b/servo/templates/products/remove.html
new file mode 100755
index 0000000..e951656
--- /dev/null
+++ b/servo/templates/products/remove.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% blocktrans with code=product.code %}Really delete product "{{ code }}"?{% endblocktrans %}
+{% endblock header %}
+
+{% block footer %}
+ <form action="{{ action }}" method="post">
+ {% csrf_token %}
+ <button type="submit" class="btn btn-danger">{% trans "Delete" %}</buttom>
+ </form>
+{% endblock footer %}
diff --git a/servo/templates/products/search.html b/servo/templates/products/search.html
new file mode 100755
index 0000000..1e6485b
--- /dev/null
+++ b/servo/templates/products/search.html
@@ -0,0 +1,20 @@
+{% extends "two_column_layout.html" %}
+{% load i18n %}
+
+{% block first_column %}
+ <input type="text" class="input-large search-query filter" placeholder="{% trans "Filter results" %}"/>
+{% endblock first_column %}
+
+{% block second_column %}
+ {% if products %}
+ {% include "products/list.html" %}
+ {% include "pagination.html" with items=products %}
+ {% else %}
+ <h1 class="muted text-center">{% trans "No products found" %}</h1>
+ {% endif %}
+{% endblock second_column %}
+
+{% block crumbs %}
+ <li><a href="{% url 'products-list_products' %}">{% trans "Products" %}</a> <span class="divider">/</span></li>
+ <li class="active">{{ title }}</li>
+{% endblock crumbs %}
diff --git a/servo/templates/products/tabs.html b/servo/templates/products/tabs.html
new file mode 100755
index 0000000..9bd871d
--- /dev/null
+++ b/servo/templates/products/tabs.html
@@ -0,0 +1,21 @@
+{% load i18n %}
+{% load servo_tags %}
+
+<div class="row-fluid">
+ <div class="span12">
+ <ul class="nav nav-tabs">
+ <li class="{% active request "products" %}">
+ <a href="{% url 'products-list_products' %}">{% trans "Products" %}</a>
+ </li>
+ <li class="{% active request "shipments" %}">
+ <a href="{% url 'shipments-list_incoming' %}">{% trans "Shipments" %}</a>
+ </li>
+ <li class="{% active request "purchases" %}">
+ <a href="{% url 'purchases-list_pos' %}">{% trans "Purchase Orders" %}</a>
+ </li>
+ <li class="{% active request "invoices" %}">
+ <a href="{% url 'invoices-index' %}">{% trans "Invoices" %}</a>
+ </li>
+ </ul>
+ </div>
+</div>
diff --git a/servo/templates/products/upload_gsx_parts.html b/servo/templates/products/upload_gsx_parts.html
new file mode 100755
index 0000000..1807343
--- /dev/null
+++ b/servo/templates/products/upload_gsx_parts.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {% trans "Upload GSX Parts" %}
+{% endblock header %}
+
+{% block body %}
+ <form method="post" action="{{ action }}" enctype="multipart/form-data" class="form-horizontal" accept-charset="utf-8">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+ </form>
+{% endblock body %}
diff --git a/servo/templates/products/upload_products.html b/servo/templates/products/upload_products.html
new file mode 100755
index 0000000..746842b
--- /dev/null
+++ b/servo/templates/products/upload_products.html
@@ -0,0 +1,13 @@
+{% extends "modal.html" %}
+{% load i18n %}
+
+{% block header %}
+ {{ title }}
+{% endblock header %}
+
+{% block body %}
+<form method="post" action="{{ action }}" enctype="multipart/form-data" class="form-horizontal" accept-charset="utf-8">
+ {% csrf_token %}
+ {% include "form_snippet.html" %}
+</form>
+{% endblock body %}
diff --git a/servo/templates/products/view.html b/servo/templates/products/view.html
new file mode 100755
index 0000000..7f5f355
--- /dev/null
+++ b/servo/templates/products/view.html
@@ -0,0 +1,205 @@
+{% extends "products/index.html" %}
+{% load servo_tags %}
+{% load mptt_tags %}
+{% load i18n %}
+
+{% block second_column %}
+{% block category_block %}
+<div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Categories" %}</li>
+ <li class="{% active request 'all' %}"><a href="{% url 'products-list_products' %}">{% trans "All" %}</a></li>
+ {% recursetree categories %}
+ <li class="{% active request 'products' node.slug '/' %}">
+ <a href="{% url 'products-list_products' group=node.slug %}">{{ node.title }}</a>
+ {% if not node.is_leaf_node %}
+ <ul class="nav nav-list">{{ children }}</ul>
+ {% endif %}
+ </li>
+ {% endrecursetree %}
+ </ul>
+</div>
+{% endblock category_block %}
+<div class="span3">
+ <ul class="nav nav-list">
+ <li class="nav-header">{% trans "Products" %}</li>
+ {% for i in products %}
+ <li class="{% active request group.slug i.pk %}">
+ <a href="{% url 'products-view_product' pk=i.pk group=group.slug %}">
+ <strong>{{ i.code }}</strong><span class="pull-right">{{ i.price_sales_stock|currency }}</span>
+ <br/>
+ <small>{{ i.title|truncatechars:30 }}</small>
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% include "pagination.html" with items=products %}
+</div>
+{% endblock second_column %}
+
+{% block third_column %}
+<div class="span6">
+ <ul class="nav nav-tabs">
+ <li class="active"><a href="#tab1" data-toggle="tab">{% trans "Product" %}</a></li>
+ <li><a href="#tab2" data-toggle="tab">{% trans "Sales" %}</a></li>
+ <li><a href="#tab3" data-toggle="tab">{% trans "Purchases" %}</a></li>
+ <li><a href="#tab4" data-toggle="tab">{% trans "Invoices" %}</a></li>
+ </ul>
+ <div class="tab-content">
+ <div class="tab-pane active" id="tab1">
+ <div class="media">
+ <a class="pull-left" href="#">
+ <img class="media-object" src="{{ product.get_photo }}" data-src="{{ product.get_photo }}" width="64px"/>
+ </a>
+ <div class="media-body">
+ <h4 class="media-heading">{{ product.code }}</h4>
+ <p>{{ product.title }}</p>
+ <p>{{ product.description|default:"" }}</p>
+ </div>
+ </div>
+ <hr/>
+ <dl class="dl-horizontal">
+ <dt>{% trans "Stock Price" %}</dt>
+ <dd>{{ product.price_sales_stock|currency }}</dd>
+ <dt>{% trans "Exchange Price" %}</dt>
+ <dd>{{ product.price_sales_exchange|currency }}</dd>
+ {% if product.component_code %}
+ <dt>{% trans "Component Group" %}</dt>
+ <dd>{{ product.get_component_code_display }} ({{ product.get_part_type_display }})</dd>
+ {% endif %}
+ <dt>&nbsp;</dt>
+ <dd>
+ {% for t in product.tags.all %}
+ <span class="label">{{ t.tag }}</span>
+ {% endfor %}
+ </dd>
+ {% for i in inventory %}
+ {% ifchanged i.location.id %}
+ <hr/>
+ <h4>{{ i.location.title }}</h4>
+ {% endifchanged %}
+ <dl class="dl-horizontal">
+ <dt>{% trans "Stocked" %}</dt>
+ <dd>{{ i.amount_stocked }}</dd>
+ <dt>{% trans "Ordered" %}</dt>
+ <dd>{{ i.amount_ordered|default:"-" }}</dd>
+ <dt>{% trans "Reserved" %}</dt>
+ <dd>{{ i.amount_reserved|default:"-" }}</dd>
+ </dl>
+ {% endfor %}
+ <hr/>
+ {% with request.session.current_order_id as co %}
+ {% if co and product.pk %}
+ <a href="{% url 'orders-add_product' co product.pk %}" class="btn btn-primary"><i class="icon-share-alt icon-white"></i> {% trans "Use in" %} #{{ request.session.current_order_code }}</a>
+ {% endif %}
+ {% endwith %}
+ <a href="{% url 'orders-create_with_product' product.pk %}" class="btn">{% trans "Create Sales Order" %}</a>
+ <div class="btn-group">
+ <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
+ <i class="icon-cog"></i> <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu">
+ {% if perms.servo.change_product %}
+ {% if product.can_update_price %}
+ <li><a href="{% url 'products-update_price' product.pk %}">{% trans "Update Price" %}</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">{% trans "Update Price" %}</a></li>
+ {% endif %}
+ <li class="divider"></li>
+ <li><a href="{% url 'products-delete_product' pk=product.pk group=group.slug %}" data-modal="#modal"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% else %}
+ <li><a href="#" class="disabled">{% trans "Update Price" %}</a></li>
+ <li class="divider"></li>
+ <li><a href="#" class="disabled"><i class="icon-trash"></i> {% trans "Delete" %}</a></li>
+ {% endif %}
+ </ul>
+ </div>
+ <div class="pull-right">
+ {% if perms.servo.change_product %}
+ <a href="{% url 'products-edit_product' pk=product.pk group=group.slug %}" class="btn">{% trans "Edit" %}</a>
+ {% else %}
+ <a href="#" class="btn disabled">{% trans "Edit" %}</a>
+ {% endif %}
+ </div>
+ </div>
+ <div class="tab-pane" id="tab2">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Customer" %}</th>
+ <th>{% trans "Price" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Dispatched" %}</th>
+ </tr>
+ </thead>
+ {% for i in product.serviceorderitem_set.all reversed %}
+ <tr>
+ {% with i.order as order %}
+ <td><a href="{{ order.get_absolute_url }}">{{ order.code }}</a></td>
+ <td>{{ order.customer_name|default:"-" }}</td>
+ <td>{{ i.price|currency }}</td>
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.dispatched_at|date:"SHORT_DATE_FORMAT" }}</td>
+ {% endwith %}
+ </tr>
+ {% empty %}
+ <tr><td colspan="5" class="empty muted">{% trans "No Sales Orders" %}</td></tr>
+ {% endfor %}
+ </table>
+ </div>
+ <div class="tab-pane" id="tab3">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Price" %}</th>
+ <th>{% trans "Received" %}</th>
+ </tr>
+ </thead>
+ {% for i in product.purchaseorderitem_set.all reversed %}
+ <tr>
+ {% with i.purchase_order as order %}
+ <td><a href="{{ order.get_absolute_url }}">{{ order.pk }}</a></td>
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.price|currency }}</td>
+ <td>{{ i.received_at|date:"SHORT_DATE_FORMAT" }}</td>
+ {% endwith %}
+ </tr>
+ {% empty %}
+ <tr><td colspan="4" class="empty muted">{% trans "No Purchase Orders" %}</td></tr>
+ {% endfor %}
+ </table>
+ </div>
+ <div class="tab-pane" id="tab4">
+ <table class="table">
+ <thead>
+ <tr>
+ <th>{% trans "Invoice" %}</th>
+ <th>{% trans "Order" %}</th>
+ <th>{% trans "Created" %}</th>
+ <th>{% trans "Price" %}</th>
+ </tr>
+ </thead>
+ {% for i in product.invoiceitem_set.all reversed %}
+ <tr>
+ <td><a href="{{ i.invoice.get_absolute_url }}">{{ i.invoice.pk }}</a></td>
+ {% with i.invoice.order as order %}
+ <td><a href="{{ order.get_absolute_url }}">{{ order.code }}</a></td>
+ {% endwith %}
+ <td>{{ i.created_at|date:"SHORT_DATE_FORMAT" }}</td>
+ <td>{{ i.price|currency }}</td>
+ </tr>
+ {% empty %}
+ <tr><td colspan="4" class="empty muted">{% trans "No invoices" %}</td></tr>
+ {% endfor %}
+ </table>
+ </div>
+ </div>
+</div>
+{% endblock third_column %}
+
+{% block breadcrumb %}
+<li class="active"><span class="divider">/</span>{{ product.title }}</li>
+{% endblock breadcrumb %}
diff --git a/servo/templates/products/view_incoming.html b/servo/templates/products/view_incoming.html
new file mode 100755
index 0000000..8404ab3
--- /dev/null
+++ b/servo/templates/products/view_incoming.html
@@ -0,0 +1 @@
+{% extends "shipments/list_incoming.html" %}