Merge pull request #5618 from rohitwaghchaure/sq_field_and_rfq_fixes
[Fixes] Fixed linked for MR to SQ from RFQ, changed field name in SQI
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 0826150..c6d04c1 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -2366,6 +2366,31 @@
{
"allow_on_submit": 0,
"bold": 0,
+ "collapsible": 0,
+ "fieldname": "language",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Print Language",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
"collapsible": 1,
"fieldname": "more_info",
"fieldtype": "Section Break",
@@ -3006,7 +3031,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-06-08 17:30:39.470490",
+ "modified": "2016-06-30 13:40:39.440646",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index c68c262..308db38 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -1068,9 +1068,9 @@
{
"allow_on_submit": 0,
"bold": 0,
- "collapsible": 0,
- "collapsible_depends_on": "",
- "depends_on": "eval:doc.total_billing_amount > 0",
+ "collapsible": 1,
+ "collapsible_depends_on": "eval:doc.total_billing_amount > 0",
+ "depends_on": "",
"fieldname": "time_sheet_list",
"fieldtype": "Section Break",
"hidden": 0,
@@ -3676,7 +3676,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-06-27 15:13:36.523798",
+ "modified": "2016-07-02 20:10:14.146763",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
index f35c3b7..32a96bf 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.js
@@ -7,7 +7,7 @@
cur_frm.add_fetch('contact', 'email_id', 'email_id')
frappe.ui.form.on("Request for Quotation",{
- setup: function(frm){
+ setup: function(frm) {
frm.fields_dict["suppliers"].grid.get_field("contact").get_query = function(doc, cdt, cdn){
var d =locals[cdt][cdn];
return {
@@ -29,7 +29,7 @@
];
},
- onload: function(frm){
+ onload: function(frm) {
frm.add_fetch('standard_reply', 'response', 'response');
if(!frm.doc.message_for_supplier) {
@@ -37,7 +37,7 @@
}
},
- refresh: function(frm, cdt, cdn){
+ refresh: function(frm, cdt, cdn) {
if (frm.doc.docstatus === 1) {
frm.add_custom_button(__("Make Supplier Quotation"),
function(){ frm.trigger("make_suppplier_quotation") });
@@ -54,7 +54,7 @@
}
},
- make_suppplier_quotation: function(frm){
+ make_suppplier_quotation: function(frm) {
var doc = frm.doc;
var dialog = new frappe.ui.Dialog({
title: __("For Supplier"),
@@ -93,10 +93,24 @@
})
frappe.ui.form.on("Request for Quotation Supplier",{
- supplier: function(frm, cdt, cdn){
+ supplier: function(frm, cdt, cdn) {
var d = locals[cdt][cdn]
frappe.model.set_value(cdt, cdn, 'contact', '')
frappe.model.set_value(cdt, cdn, 'email_id', '')
+ },
+
+ download_pdf: function(frm, cdt, cdn) {
+ var child = locals[cdt][cdn]
+
+ var w = window.open(
+ frappe.urllib.get_full_url("/api/method/erpnext.buying.doctype.request_for_quotation.request_for_quotation.get_pdf?"
+ +"doctype="+encodeURIComponent(frm.doc.doctype)
+ +"&name="+encodeURIComponent(frm.doc.name)
+ +"&supplier_idx="+encodeURIComponent(child.idx)
+ +"&no_letterhead=0"));
+ if(!w) {
+ msgprint(__("Please enable pop-ups")); return;
+ }
}
})
diff --git a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
index 2cfa902..eea796a 100644
--- a/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
+++ b/erpnext/buying/doctype/request_for_quotation/request_for_quotation.py
@@ -6,8 +6,9 @@
import frappe, json
from frappe import _
from frappe.model.mapper import get_mapped_doc
-from frappe.utils import get_url, random_string
+from frappe.utils import get_url, random_string, cint
from frappe.utils.user import get_user_fullname
+from frappe.utils.print_format import download_pdf
from frappe.desk.form.load import get_attachments
from frappe.core.doctype.communication.email import make
from erpnext.accounts.party import get_party_account_currency, get_party_details
@@ -136,15 +137,20 @@
def get_attachments(self):
attachments = [d.name for d in get_attachments(self.doctype, self.name)]
- attachments.append(frappe.attach_print('Request for Quotation', self.name, doc=self))
+ attachments.append(frappe.attach_print(self.doctype, self.name, doc=self))
return attachments
@frappe.whitelist()
def send_supplier_emails(rfq_name):
+ check_portal_enabled('Request for Quotation')
rfq = frappe.get_doc("Request for Quotation", rfq_name)
if rfq.docstatus==1:
rfq.send_to_supplier()
+def check_portal_enabled(reference_doctype):
+ if not frappe.db.get_value('Portal Menu Item',
+ {'reference_doctype': reference_doctype}, 'enabled'):
+ frappe.throw(_("Request for Quotation is disabled to access from portal, for more check portal settings."))
def get_list_context(context=None):
from erpnext.controllers.website_list_for_contact import get_list_context
@@ -152,7 +158,6 @@
list_context["show_sidebar"] = True
return list_context
-
# This method is used to make supplier quotation from material request form.
@frappe.whitelist()
def make_supplier_quotation(source_name, for_supplier, target_doc=None):
@@ -225,3 +230,16 @@
"request_for_quotation_item": data.name,
"request_for_quotation": data.parent
})
+
+@frappe.whitelist()
+def get_pdf(doctype, name, supplier_idx):
+ doc = get_rfq_doc(doctype, name, supplier_idx)
+ if doc:
+ download_pdf(doctype, name, doc=doc)
+
+def get_rfq_doc(doctype, name, supplier_idx):
+ if cint(supplier_idx):
+ doc = frappe.get_doc(doctype, name)
+ args = doc.get('suppliers')[cint(supplier_idx) - 1]
+ doc.update_supplier_part_no(args)
+ return doc
\ No newline at end of file
diff --git a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
index 5fe7456..bfd5ec1 100644
--- a/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
+++ b/erpnext/buying/doctype/request_for_quotation_supplier/request_for_quotation_supplier.json
@@ -162,6 +162,31 @@
"search_index": 0,
"set_only_once": 0,
"unique": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "download_pdf",
+ "fieldtype": "Button",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Download PDF",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
}
],
"hide_heading": 0,
@@ -174,7 +199,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2016-06-30 02:01:54.130809",
+ "modified": "2016-06-30 12:47:23.564189",
"modified_by": "Administrator",
"module": "Buying",
"name": "Request for Quotation Supplier",
diff --git a/erpnext/docs/user/manual/en/introduction/index.md b/erpnext/docs/user/manual/en/introduction/index.md
index 6471090..f1bcb49 100644
--- a/erpnext/docs/user/manual/en/introduction/index.md
+++ b/erpnext/docs/user/manual/en/introduction/index.md
@@ -14,28 +14,32 @@
Large businesses have the advantage of using advanced data systems to manage
their process efficiently. Small businesses, on the other hand, typically
struggle to keep things organized. They often use a mix of apps like
-spreadsheets, accounting software, web CRM etc to manage.The problem is, not
+spreadsheets, accounting software, web CRM etc to manage. The problem is, not
everyone is on the same page. An ERP changes that.
## What is ERPNext?
-ERPNext helps you to manage all your business information in one application
-and use it to manage operations and take decisions based on data.
+ERPNext is an end-to-end business solution that helps you to manage all your business information in one application
+and use it to not only manage operations but also enables you to take informed decisions well in time to remain ahead of your competition. It forms a backbone of your business to add strength, transparency and control to your enterprise.
Among other things, ERPNext will help you to:
* Track all Invoices and Payments.
* Know what quantity of which product is available in stock.
+ * Identify and track your key performance indicators (KPI's).
* Identify open customer queries.
* Manage payroll.
* Assign tasks and follow up on them.
* Maintain a database of all your customers, suppliers and their contacts.
* Prepare quotes.
+ * Tracking your budgets and spending
+ * Determine effective selling price based on the actual raw material, machinery and effort cost.
* Get reminders on maintenance schedules.
* Publish your website.
And a lot lot lot more.
+
### Topics
{index}
diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py
index eb727e5..8c2b44a 100644
--- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py
+++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py
@@ -14,10 +14,12 @@
def get_timesheet_data(data):
return {
+ 'billable': data.billable,
'from_time': data.from_time,
'hours': data.hours,
'to_time': data.to_time,
'project': data.project,
+ 'task': data.task,
'activity_type': data.activity_type,
'operation': data.operation,
'operation_id': data.operation_id,
diff --git a/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py b/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py
index 097097d..6a50aa2 100644
--- a/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py
+++ b/erpnext/patches/v7_0/convert_timelogbatch_to_timesheet.py
@@ -21,10 +21,12 @@
time_log = frappe.get_doc('Time Log', data.time_log)
return {
+ 'billable': time_log.billable,
'from_time': time_log.from_time,
'hours': time_log.hours,
'to_time': time_log.to_time,
'project': time_log.project,
+ 'task': time_log.task,
'activity_type': time_log.activity_type,
'operation': time_log.operation,
'operation_id': time_log.operation_id,
diff --git a/erpnext/public/js/stock_analytics.js b/erpnext/public/js/stock_analytics.js
index c64a2c9..28ff55d 100644
--- a/erpnext/public/js/stock_analytics.js
+++ b/erpnext/public/js/stock_analytics.js
@@ -1,211 +1,210 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-frappe.require("assets/erpnext/js/stock_grid_report.js", function() {
- erpnext.StockAnalytics = erpnext.StockGridReport.extend({
- init: function(wrapper, opts) {
- var args = {
- title: __("Stock Analytics"),
- page: wrapper,
- parent: $(wrapper).find('.layout-main'),
- page: wrapper.page,
- doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
- "Fiscal Year", "Serial No"],
- tree_grid: {
- show: true,
- parent_field: "parent_item_group",
- formatter: function(item) {
- if(!item.is_group) {
- return repl("<a \
- onclick='frappe.cur_grid_report.show_stock_ledger(\"%(value)s\")'>\
- %(value)s</a>", {
- value: item.name,
- });
- } else {
- return item.name;
- }
- }
- },
- }
-
- if(opts) $.extend(args, opts);
-
- this._super(args);
- },
- setup_columns: function() {
- var std_columns = [
- {id: "_check", name: __("Plot"), field: "_check", width: 30,
- formatter: this.check_formatter},
- {id: "name", name: __("Item"), field: "name", width: 300,
- formatter: this.tree_formatter},
- {id: "brand", name: __("Brand"), field: "brand", width: 100},
- {id: "stock_uom", name: __("UOM"), field: "stock_uom", width: 100},
- {id: "opening", name: __("Opening"), field: "opening", hidden: true,
- formatter: this.currency_formatter}
- ];
-
- this.make_date_range_columns();
- this.columns = std_columns.concat(this.columns);
- },
- filters: [
- {fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
- options:[{label:__("Value"), value:"Value"}, {label:__("Quantity"), value:"Quantity"}],
- filter: function(val, item, opts, me) {
- return me.apply_zero_filter(val, item, opts, me);
- }},
- {fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
- default_value: __("Select Brand..."), filter: function(val, item, opts) {
- return val == opts.default_value || item.brand == val || item._show;
- }, link_formatter: {filter_input: "brand"}},
- {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
- default_value: __("Select Warehouse...")},
- {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
- {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
- {fieldtype:"Select", label: __("Range"), fieldname: "range",
- options:[
- {label:__("Daily"), value:"Daily"},
- {label:__("Weekly"), value:"Weekly"},
- {label:__("Monthly"), value:"Monthly"},
- {label:__("Quarterly"), value:"Quarterly"},
- {label:__("Yearly"), value:"Yearly"},
- ]}
- ],
- setup_filters: function() {
- var me = this;
- this._super();
-
- this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
-
- this.show_zero_check();
- this.setup_chart_check();
- },
- init_filter_values: function() {
- this._super();
- this.filter_inputs.range && this.filter_inputs.range.val('Monthly');
- },
- prepare_data: function() {
- var me = this;
-
- if(!this.data) {
- var items = this.prepare_tree("Item", "Item Group");
-
- me.parent_map = {};
- me.item_by_name = {};
- me.data = [];
-
- $.each(items, function(i, v) {
- var d = copy_dict(v);
-
- me.data.push(d);
- me.item_by_name[d.name] = d;
- if(d.parent_item_group) {
- me.parent_map[d.name] = d.parent_item_group;
- }
- me.reset_item_values(d);
- });
- this.set_indent();
- this.data[0].checked = true;
- } else {
- // otherwise, only reset values
- $.each(this.data, function(i, d) {
- me.reset_item_values(d);
- d["closing_qty_value"] = 0;
- });
- }
-
- this.prepare_balances();
- this.update_groups();
-
- },
- prepare_balances: function() {
- var me = this;
- var from_date = dateutil.str_to_obj(this.from_date);
- var to_date = dateutil.str_to_obj(this.to_date);
- var data = frappe.report_dump.data["Stock Ledger Entry"];
-
- this.item_warehouse = {};
- this.serialized_buying_rates = this.get_serialized_buying_rates();
-
- for(var i=0, j=data.length; i<j; i++) {
- var sl = data[i];
- sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
- var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
-
- if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
- var item = me.item_by_name[sl.item_code];
- if(item.closing_qty_value==undefined) item.closing_qty_value = 0;
-
- if(me.value_or_qty!="Quantity") {
- var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
- var valuation_method = item.valuation_method ?
- item.valuation_method : sys_defaults.valuation_method;
- var is_fifo = valuation_method == "FIFO";
-
- if(sl.voucher_type=="Stock Reconciliation") {
- var diff = (sl.qty_after_transaction * sl.valuation_rate) - item.closing_qty_value;
- wh.fifo_stack = [[sl.qty_after_transaction, sl.valuation_rate, sl.posting_date]];
- wh.balance_qty = sl.qty_after_transaction;
- wh.balance_value = sl.valuation_rate * sl.qty_after_transaction;
- } else {
- var diff = me.get_value_diff(wh, sl, is_fifo);
- }
+erpnext.StockAnalytics = erpnext.StockGridReport.extend({
+ init: function(wrapper, opts) {
+ var args = {
+ title: __("Stock Analytics"),
+ page: wrapper,
+ parent: $(wrapper).find('.layout-main'),
+ page: wrapper.page,
+ doctypes: ["Item", "Item Group", "Warehouse", "Stock Ledger Entry", "Brand",
+ "Fiscal Year", "Serial No"],
+ tree_grid: {
+ show: true,
+ parent_field: "parent_item_group",
+ formatter: function(item) {
+ if(!item.is_group) {
+ return repl("<a \
+ onclick='frappe.cur_grid_report.show_stock_ledger(\"%(value)s\")'>\
+ %(value)s</a>", {
+ value: item.name,
+ });
} else {
- if(sl.voucher_type=="Stock Reconciliation") {
- var diff = sl.qty_after_transaction - item.closing_qty_value;
- } else {
- var diff = sl.qty;
- }
+ return item.name;
}
- if(posting_datetime < from_date) {
- item.opening += diff;
- } else if(posting_datetime <= to_date) {
- item[me.column_map[sl.posting_date].field] += diff;
- } else {
- break;
- }
-
- item.closing_qty_value += diff;
}
+ },
+ }
+
+ if(opts) $.extend(args, opts);
+
+ this._super(args);
+ },
+ setup_columns: function() {
+ var std_columns = [
+ {id: "_check", name: __("Plot"), field: "_check", width: 30,
+ formatter: this.check_formatter},
+ {id: "name", name: __("Item"), field: "name", width: 300,
+ formatter: this.tree_formatter},
+ {id: "brand", name: __("Brand"), field: "brand", width: 100},
+ {id: "stock_uom", name: __("UOM"), field: "stock_uom", width: 100},
+ {id: "opening", name: __("Opening"), field: "opening", hidden: true,
+ formatter: this.currency_formatter}
+ ];
+
+ this.make_date_range_columns();
+ this.columns = std_columns.concat(this.columns);
+ },
+ filters: [
+ {fieldtype:"Select", label: __("Value or Qty"), fieldname: "value_or_qty",
+ options:[{label:__("Value"), value:"Value"}, {label:__("Quantity"), value:"Quantity"}],
+ filter: function(val, item, opts, me) {
+ return me.apply_zero_filter(val, item, opts, me);
+ }},
+ {fieldtype:"Select", label: __("Brand"), link:"Brand", fieldname: "brand",
+ default_value: __("Select Brand..."), filter: function(val, item, opts) {
+ return val == opts.default_value || item.brand == val || item._show;
+ }, link_formatter: {filter_input: "brand"}},
+ {fieldtype:"Select", label: __("Warehouse"), link:"Warehouse", fieldname: "warehouse",
+ default_value: __("Select Warehouse...")},
+ {fieldtype:"Date", label: __("From Date"), fieldname: "from_date"},
+ {fieldtype:"Date", label: __("To Date"), fieldname: "to_date"},
+ {fieldtype:"Select", label: __("Range"), fieldname: "range",
+ options:[
+ {label:__("Daily"), value:"Daily"},
+ {label:__("Weekly"), value:"Weekly"},
+ {label:__("Monthly"), value:"Monthly"},
+ {label:__("Quarterly"), value:"Quarterly"},
+ {label:__("Yearly"), value:"Yearly"},
+ ]}
+ ],
+ setup_filters: function() {
+ var me = this;
+ this._super();
+
+ this.trigger_refresh_on_change(["value_or_qty", "brand", "warehouse", "range"]);
+
+ this.show_zero_check();
+ this.setup_chart_check();
+ },
+ init_filter_values: function() {
+ this._super();
+ this.filter_inputs.range && this.filter_inputs.range.val('Monthly');
+ },
+ prepare_data: function() {
+ var me = this;
+
+ if(!this.data) {
+ var items = this.prepare_tree("Item", "Item Group");
+
+ me.parent_map = {};
+ me.item_by_name = {};
+ me.data = [];
+
+ $.each(items, function(i, v) {
+ var d = copy_dict(v);
+
+ me.data.push(d);
+ me.item_by_name[d.name] = d;
+ if(d.parent_item_group) {
+ me.parent_map[d.name] = d.parent_item_group;
+ }
+ me.reset_item_values(d);
+ });
+ this.set_indent();
+ this.data[0].checked = true;
+ } else {
+ // otherwise, only reset values
+ $.each(this.data, function(i, d) {
+ me.reset_item_values(d);
+ d["closing_qty_value"] = 0;
+ });
+ }
+
+ this.prepare_balances();
+ this.update_groups();
+
+ },
+ prepare_balances: function() {
+ var me = this;
+ var from_date = dateutil.str_to_obj(this.from_date);
+ var to_date = dateutil.str_to_obj(this.to_date);
+ var data = frappe.report_dump.data["Stock Ledger Entry"];
+
+ this.item_warehouse = {};
+ this.serialized_buying_rates = this.get_serialized_buying_rates();
+
+ for(var i=0, j=data.length; i<j; i++) {
+ var sl = data[i];
+ sl.posting_datetime = sl.posting_date + " " + sl.posting_time;
+ var posting_datetime = dateutil.str_to_obj(sl.posting_datetime);
+
+ if(me.is_default("warehouse") ? true : me.warehouse == sl.warehouse) {
+ var item = me.item_by_name[sl.item_code];
+ if(item.closing_qty_value==undefined) item.closing_qty_value = 0;
+
+ if(me.value_or_qty!="Quantity") {
+ var wh = me.get_item_warehouse(sl.warehouse, sl.item_code);
+ var valuation_method = item.valuation_method ?
+ item.valuation_method : sys_defaults.valuation_method;
+ var is_fifo = valuation_method == "FIFO";
+
+ if(sl.voucher_type=="Stock Reconciliation") {
+ var diff = (sl.qty_after_transaction * sl.valuation_rate) - item.closing_qty_value;
+ wh.fifo_stack = [[sl.qty_after_transaction, sl.valuation_rate, sl.posting_date]];
+ wh.balance_qty = sl.qty_after_transaction;
+ wh.balance_value = sl.valuation_rate * sl.qty_after_transaction;
+ } else {
+ var diff = me.get_value_diff(wh, sl, is_fifo);
+ }
+ } else {
+ if(sl.voucher_type=="Stock Reconciliation") {
+ var diff = sl.qty_after_transaction - item.closing_qty_value;
+ } else {
+ var diff = sl.qty;
+ }
+ }
+
+ if(posting_datetime < from_date) {
+ item.opening += diff;
+ } else if(posting_datetime <= to_date) {
+ item[me.column_map[sl.posting_date].field] += diff;
+ } else {
+ break;
+ }
+
+ item.closing_qty_value += diff;
}
- },
- update_groups: function() {
- var me = this;
- $.each(this.data, function(i, item) {
- // update groups
- if(!item.is_group && me.apply_filter(item, "brand")) {
- var balance = item.opening;
- $.each(me.columns, function(i, col) {
- if(col.formatter==me.currency_formatter && !col.hidden) {
- item[col.field] = balance + item[col.field];
- balance = item[col.field];
+ }
+ },
+ update_groups: function() {
+ var me = this;
+ $.each(this.data, function(i, item) {
+ // update groups
+ if(!item.is_group && me.apply_filter(item, "brand")) {
+ var balance = item.opening;
+ $.each(me.columns, function(i, col) {
+ if(col.formatter==me.currency_formatter && !col.hidden) {
+ item[col.field] = balance + item[col.field];
+ balance = item[col.field];
+ }
+ });
+
+ var parent = me.parent_map[item.name];
+ while(parent) {
+ parent_group = me.item_by_name[parent];
+ $.each(me.columns, function(c, col) {
+ if (col.formatter == me.currency_formatter) {
+ parent_group[col.field] =
+ flt(parent_group[col.field])
+ + flt(item[col.field]);
}
});
-
- var parent = me.parent_map[item.name];
- while(parent) {
- parent_group = me.item_by_name[parent];
- $.each(me.columns, function(c, col) {
- if (col.formatter == me.currency_formatter) {
- parent_group[col.field] =
- flt(parent_group[col.field])
- + flt(item[col.field]);
- }
- });
- parent = me.parent_map[parent];
- }
+ parent = me.parent_map[parent];
}
- });
- },
- show_stock_ledger: function(item_code) {
- frappe.route_options = {
- item_code: item_code,
- from_date: this.from_date,
- to_date: this.to_date
- };
- frappe.set_route("query-report", "Stock Ledger");
- }
- });
+ }
+ });
+ },
+ show_stock_ledger: function(item_code) {
+ frappe.route_options = {
+ item_code: item_code,
+ from_date: this.from_date,
+ to_date: this.to_date
+ };
+ frappe.set_route("query-report", "Stock Ledger");
+ }
});
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 62ecee6..f10b634 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -2197,6 +2197,31 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "language",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Print Language",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "other_details",
"fieldtype": "HTML",
"hidden": 1,
@@ -2419,7 +2444,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-06-09 15:11:04.042369",
+ "modified": "2016-06-30 13:42:23.310309",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.js b/erpnext/stock/page/stock_analytics/stock_analytics.js
index f86201f..6deeb7a 100644
--- a/erpnext/stock/page/stock_analytics/stock_analytics.js
+++ b/erpnext/stock/page/stock_analytics/stock_analytics.js
@@ -1,16 +1,16 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-frappe.require("assets/erpnext/js/stock_analytics.js", function() {
- frappe.pages['stock-analytics'].on_page_load = function(wrapper) {
- frappe.ui.make_app_page({
- parent: wrapper,
- title: __('Stock Analytics'),
- single_column: true
- });
-
+frappe.pages['stock-analytics'].on_page_load = function(wrapper) {
+ frappe.ui.make_app_page({
+ parent: wrapper,
+ title: __('Stock Analytics'),
+ single_column: true
+ });
+
+ frappe.require(["assets/erpnext/js/stock_grid_report.js",
+ "assets/erpnext/js/stock_analytics.js"], function() {
new erpnext.StockAnalytics(wrapper);
-
frappe.breadcrumbs.add("Stock")
- };
-});
+ });
+};