[enhancement] stock balance page

This commit is contained in:
Rushabh Mehta
2016-04-21 19:00:34 +05:30
parent cd3c979207
commit 621283c5c5
25 changed files with 257 additions and 66 deletions

View File

@@ -86,7 +86,7 @@ $.extend(erpnext.utils, {
$(frm.fields_dict['address_html'].wrapper).html("");
frm.fields_dict['contact_html'] && $(frm.fields_dict['contact_html'].wrapper).html("");
},
render_address_and_contact: function(frm) {
// render address
$(frm.fields_dict['address_html'].wrapper)
@@ -132,3 +132,22 @@ $(document).on('app_ready', function() {
});
}
});
erpnext.get_item_dashboard_data = function(data, max_count) {
if(!max_count) max_count = 0;
data.forEach(function(d) {
d.actual_or_pending = d.projected_qty + d.reserved_qty + d.reserved_qty_for_production;
d.pending_qty = 0;
d.total_reserved = d.reserved_qty + d.reserved_qty_for_production;
if(d.actual_or_pending > d.actual_qty) {
d.pending_qty = d.actual_or_pending - d.actual_qty;
}
max_count = Math.max(d.actual_or_pending, d.actual_qty,
d.total_reserved, max_count);
});
return {
data: data,
max_count: max_count
}
}