2013-04-03 11:04:23 +00:00
|
|
|
{% extends "app/website/templates/html/page.html" %}
|
2013-03-21 11:42:25 +00:00
|
|
|
|
|
|
|
{% set title="My Orders" %}
|
|
|
|
|
|
|
|
{% block content %}
|
2013-03-22 07:15:44 +00:00
|
|
|
<script>
|
|
|
|
global_number_format = "{{ global_number_format }}";
|
|
|
|
currency = "{{ currency }}";
|
|
|
|
wn.currency_symbols = {{ currency_symbols }};
|
|
|
|
</script>
|
2013-05-22 06:27:05 +00:00
|
|
|
<div class="col col-lg-12">
|
2013-03-21 11:42:25 +00:00
|
|
|
<ul class="breadcrumb">
|
|
|
|
<li><a href="index">Home</a> <span class="divider">/</span></li>
|
|
|
|
<li><a href="account">My Account</a> <span class="divider">/</span></li>
|
|
|
|
<li class="active">My Orders</li>
|
|
|
|
</ul>
|
2013-07-02 06:10:16 +00:00
|
|
|
<h3><i class="icon-list icon-fixed-width"></i> My Orders</h3>
|
2013-03-21 11:42:25 +00:00
|
|
|
<hr>
|
|
|
|
<div id="order-list" style="font-size: 13px;">
|
|
|
|
<div class="progress progress-striped active">
|
2013-06-13 10:41:03 +00:00
|
|
|
<div class="progress-bar progress-bar-info" style="width: 100%;"></div>
|
2013-03-21 11:42:25 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
$(document).ready(function() {
|
|
|
|
var order_start = 0;
|
|
|
|
|
|
|
|
wn.call({
|
|
|
|
method: "selling.doctype.sales_order.sales_order.get_orders",
|
|
|
|
args: {
|
|
|
|
start: order_start
|
|
|
|
},
|
|
|
|
callback: function(r) {
|
|
|
|
$("#order-list .progress").remove();
|
|
|
|
var $list = $("#order-list");
|
|
|
|
|
|
|
|
if(!(r.message && r.message.length)) {
|
|
|
|
$list.html("<div class='alert'>No Orders Yet</div>");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
$.each(r.message, function(i, order) {
|
|
|
|
|
|
|
|
// parent
|
|
|
|
var $order = $(repl('<div class="row">\
|
2013-05-22 06:27:05 +00:00
|
|
|
<div class="col col-lg-3"><a href="order?name=%(name)s">%(name)s</a></div>\
|
|
|
|
<div class="col col-lg-9"></div>\
|
2013-03-21 11:42:25 +00:00
|
|
|
</div>', order)).appendTo($list);
|
|
|
|
|
|
|
|
// items
|
|
|
|
$.each(order.items || [], function(i, item) {
|
2013-03-22 07:15:44 +00:00
|
|
|
item.export_rate = format_currency(item.export_rate, order.currency);
|
2013-03-22 09:26:31 +00:00
|
|
|
item.export_amount = format_currency(item.export_amount, order.currency);
|
2013-03-22 07:15:44 +00:00
|
|
|
var $item = $(repl('<div class="row">\
|
2013-05-22 06:27:05 +00:00
|
|
|
<div class="col col-lg-3">%(item_name)s</div>\
|
|
|
|
<div class="col col-lg-2" style="text-align: right;">%(export_rate)s</div>\
|
|
|
|
<div class="col col-lg-2" style="text-align: right;">%(qty)s %(stock_uom)s</div>\
|
|
|
|
<div class="col col-lg-2" style="text-align: right;">%(export_amount)s</div>\
|
2013-03-21 11:42:25 +00:00
|
|
|
</div>\
|
2013-05-22 06:27:05 +00:00
|
|
|
</div>', item)).appendTo($order.find(".col col-lg-9"));
|
2013-03-21 11:42:25 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
$("<hr>").appendTo($list);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|