added listviews for sales, purchase

This commit is contained in:
Rushabh Mehta
2014-07-30 18:32:08 +05:30
committed by Anand Doshi
parent 67af99794d
commit 18eb4f5015
31 changed files with 427 additions and 57 deletions

View File

@@ -0,0 +1,8 @@
<div class="progress" title="{%= title %}"
style="margin-bottom: 4px;">
<div class="progress-bar" role="progressbar"
aria-valuenow="{%= completed %}"
aria-valuemin="0" aria-valuemax="100"
style="width: {%= completed %}%">
</div>
</div>

View File

@@ -1,12 +1,12 @@
{% $.each(visible_columns || [], function(i, df) { %}
{% var val = row.get_formatted(df.fieldname);
{% var val = doc.get_formatted(df.fieldname);
if(val) { %}
<div class="row">
<div class="col-xs-3">
<strong>{%= __(df.label) %}:</strong>
</div>
<div class="col-xs-9">
{%= row.get_formatted(df.fieldname) %}
{%= doc.get_formatted(df.fieldname) %}
</div>
</div>
{% } %}

View File

@@ -27,30 +27,23 @@
(frappe.datetime.get_diff(doc.schedule_date) < 1
&& doc.received_qty < doc.qty)
? "label-danger" : "label-default" %}">
{%= row.get_formatted("schedule_date") %}</span>
{%= doc.get_formatted("schedule_date") %}</span>
{% } %}
</div>
<!-- qty -->
<div class="col-sm-2 text-right">
{%= row.get_formatted("qty") %}
{%= doc.get_formatted("qty") %}
<br><small>{%= doc.uom || doc.stock_uom %}</small>
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
doc.doctype) && frm.doc.docstatus===1) {
var delivered = doc.doctype==="Sales Order Item" ?
doc.delivered_qty : doc.received_qty,
percent_delivered =
100 - cint((doc.qty - delivered) * 100 / doc.qty);
completed =
100 - cint((doc.qty - delivered) * 100 / doc.qty),
title = __("Delivered");
%}
<div class="progress" title="% {%= __("Delivered") %}"
style="margin-bottom: 4px;">
<div class="progress-bar" role="progressbar"
aria-valuenow="{%= percent_delivered %}"
aria-valuemin="0" aria-valuemax="100"
style="width: {%= percent_delivered %}%">
{%= percent_delivered %}%
</div>
</div>
{% include "templates/form_grid/includes/progress.html" %}
{% } %}
{% if(doc.warehouse) {
var label_class = "label-default",
@@ -78,7 +71,7 @@
<!-- rate -->
<div class="col-sm-2 text-right">
{%= row.get_formatted("rate") %}
{%= doc.get_formatted("rate") %}
{% if(doc.discount_percentage) { %}
<br><span class="label label-default pull-right"
title="{%= __("Discount") %}">
@@ -88,21 +81,15 @@
<!-- amount -->
<div class="col-sm-2 text-right">
{%= row.get_formatted("amount") %}
{%= doc.get_formatted("amount") %}
{% if(in_list(["Sales Order Item", "Purchase Order Item"],
doc.doctype) && frm.doc.docstatus===1 && doc.amount) {
var percent_billed =
100 - cint((doc.amount - doc.billed_amt) * 100 / doc.amount);
var completed =
100 - cint((doc.amount - doc.billed_amt) * 100 / doc.amount),
title = __("Billed");
%}
<br><small>&nbsp;</small>
<div class="progress" title="% {%= __("Billed") %}">
<div class="progress-bar" role="progressbar"
aria-valuenow="{%= percent_billed %}"
aria-valuemin="0" aria-valuemax="100"
style="width: {%= percent_billed %}%">
{%= percent_billed %}%
</div>
</div>
{% include "templates/form_grid/includes/progress.html" %}
{% } %}
</div>
</div>

View File

@@ -1,4 +1,4 @@
{% var visible_columns = row.get_visible_columns(["item_code",
{% var visible_columns = row.get_visible_columns(["item_code", "warehouse",
"item_name", "description", "amount", "stock_uom", "uom", "qty"]); %}
{% if(!doc) { %}
@@ -16,28 +16,21 @@
{% include "templates/form_grid/includes/visible_cols.html" %}
{% if(doc.schedule_date) { %}
<br><span title="{%= __("Reqd By Date") %}" class="label {%=
(frappe.datetime.get_diff(doc.schedule_date) < 1
(frappe.datetime.get_diff(doc.schedule_date) < 0
&& doc.ordered_qty < doc.qty)
? "label-danger" : "label-default" %}">
{%= row.get_formatted("schedule_date") %}</span>
{%= doc.get_formatted("schedule_date") %}</span>
{% } %}
</div>
<!-- qty -->
<div class="col-sm-3 text-right">
{%= row.get_formatted("qty") %}
{%= doc.get_formatted("qty") %}
<small>{%= doc.uom || doc.stock_uom %}</small>
{% var percent_delivered =
100 - cint((doc.qty - cint(doc.ordered_qty)) * 100 / doc.qty); %}
<div class="progress" title="% {%= __("Ordered") %}"
style="margin-bottom: 4px;">
<div class="progress-bar" role="progressbar"
aria-valuenow="{%= percent_delivered %}"
aria-valuemin="0" aria-valuemax="100"
style="width: {%= percent_delivered %}%">
{%= percent_delivered %}%
</div>
</div>
{% var completed =
100 - cint((doc.qty - cint(doc.ordered_qty)) * 100 / doc.qty),
title = __("Ordered"); %}
{% include "templates/form_grid/includes/progress.html" %}
{% if(doc.warehouse) { %}
<div style="overflow:hidden; min-height: 25px;
white-space:nowrap; text-overflow: ellipsis;"

View File

@@ -28,15 +28,15 @@
<!-- qty -->
<div class="col-sm-2 text-right">
{%= row.get_formatted("qty") %}
{%= doc.get_formatted("qty") %}
<br><small>{%= doc.uom || doc.stock_uom %}</small>
</div>
<!-- amount -->
<div class="col-sm-2 text-right">
{%= row.get_formatted("amount") %}
{%= doc.get_formatted("amount") %}
<div class="small text-muted">
{%= row.get_formatted("incoming_rate") %}</div>
{%= doc.get_formatted("incoming_rate") %}</div>
</div>
</div>
{% } %}