From fdf38dab6ffb5b48de646459b689ecf7f83a35f1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Jun 2014 12:42:36 +0530 Subject: [PATCH 1/6] stock entry incoming rate based on precision --- erpnext/stock/doctype/stock_entry/stock_entry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 297542b50f..125a293586 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -220,8 +220,8 @@ class StockEntry(StockController): # get incoming rate if not d.bom_no: if not flt(d.incoming_rate) or d.s_warehouse or self.purpose == "Sales Return": - incoming_rate = self.get_incoming_rate(args) - if flt(incoming_rate) > 0: + incoming_rate = flt(self.get_incoming_rate(args), self.precision("incoming_rate", d)) + if incoming_rate > 0: d.incoming_rate = incoming_rate d.amount = flt(d.transfer_qty) * flt(d.incoming_rate) From 21efc93e5424c2505a2c2a5a3f59b964f4b6dc49 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Jun 2014 12:44:49 +0530 Subject: [PATCH 2/6] Allowed renaming for project --- erpnext/projects/doctype/project/project.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json index 5489d33468..c894bb8b26 100644 --- a/erpnext/projects/doctype/project/project.json +++ b/erpnext/projects/doctype/project/project.json @@ -1,6 +1,7 @@ { "allow_attach": 1, "allow_import": 1, + "allow_rename": 1, "autoname": "field:project_name", "creation": "2013-03-07 11:55:07", "docstatus": 0, @@ -258,7 +259,7 @@ "icon": "icon-puzzle-piece", "idx": 1, "max_attachments": 4, - "modified": "2014-05-27 03:49:15.252736", + "modified": "2014-06-24 12:44:19.530707", "modified_by": "Administrator", "module": "Projects", "name": "Project", From d0bf91d6399b891fc687e2aa858dacea14331a10 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Jun 2014 16:19:16 +0530 Subject: [PATCH 3/6] Fixes for recurring invoice --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 0f11af42c9..348543ee28 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -732,7 +732,7 @@ def notify_errors(inv, customer, owner): frappe.sendmail(recipients + [frappe.db.get_value("User", owner, "email")], subject="[Urgent] Error while creating recurring invoice for %s" % inv, - message = frappe.get_template("template/emails/recurring_invoice_failed.html").render({ + message = frappe.get_template("templates/emails/recurring_invoice_failed.html").render({ "name": inv, "customer": customer })) From e9b95bbfe86919b9a0ca70fdc7e2c569a812a139 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Jun 2014 16:35:00 +0530 Subject: [PATCH 4/6] Fixed address deletion issue --- .../doctype/contact_control/contact_control.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/erpnext/setup/doctype/contact_control/contact_control.js b/erpnext/setup/doctype/contact_control/contact_control.js index 6b6878ffd5..b053541683 100755 --- a/erpnext/setup/doctype/contact_control/contact_control.js +++ b/erpnext/setup/doctype/contact_control/contact_control.js @@ -139,19 +139,10 @@ cur_frm.cscript.delete_doc = function(doctype, name) { var go_ahead = confirm(__("Delete {0} {1}?", [doctype, name])); if (!go_ahead) return; - return frappe.call({ - method: 'frappe.model.delete_doc', - args: { - dt: doctype, - dn: name - }, - callback: function(r) { - //console.log(r); - if (!r.exc) { - // run the correct list - var list_name = doctype.toLowerCase() + '_list'; - cur_frm[list_name].run(); - } + frappe.model.delete_doc(doctype, name, function(r) { + if (!r.exc) { + var list_name = doctype.toLowerCase() + '_list'; + cur_frm[list_name].run(); } }); } From 0b15755441c09a316a7bc48d60c90f9381dca5dd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Jun 2014 17:02:45 +0530 Subject: [PATCH 5/6] Cost center-wise net profit in financial analytics report --- .../financial_analytics.js | 4 +- erpnext/selling/sales_common.js | 45 +++++++++---------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.js b/erpnext/accounts/page/financial_analytics/financial_analytics.js index 4574390ce1..2da93813e9 100644 --- a/erpnext/accounts/page/financial_analytics/financial_analytics.js +++ b/erpnext/accounts/page/financial_analytics/financial_analytics.js @@ -232,7 +232,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({ indent: 0, opening: 0, checked: false, - report_type: me.pl_or_bs, + report_type: me.pl_or_bs=="Balance Sheet"? "Balance Sheet" : "Profit and Loss", }; me.item_by_name[net_profit.name] = net_profit; @@ -244,7 +244,7 @@ erpnext.FinancialAnalytics = erpnext.AccountTreeGrid.extend({ $.each(me.data, function(i, ac) { if(!ac.parent_account && me.apply_filter(ac, "company") && - ac.report_type==me.pl_or_bs) { + ac.report_type==net_profit.report_type) { $.each(me.columns, function(i, col) { if(col.formatter==me.currency_formatter && col.balance_type=="Dr") { var bal = net_profit[col.date+"_dr"] - diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 63ffb36fb0..aba390e281 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -481,7 +481,27 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ set_dynamic_labels: function() { this._super(); - set_sales_bom_help(this.frm.doc); + this.set_sales_bom_help(this.frm.doc); + }, + + set_sales_bom_help: function(doc) { + if(!cur_frm.fields_dict.packing_list) return; + if ((doc.packing_details || []).length) { + $(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true); + + if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) { + help_msg = "
" + + __("For 'Sales BOM' items, warehouse, serial no and batch no will be considered from the 'Packing List' table. If warehouse and batch no are same for all packing items for any 'Sales BOM' item, those values can be entered in the main item table, values will be copied to 'Packing List' table.")+ + "
"; + frappe.meta.get_docfield(doc.doctype, 'sales_bom_help', doc.name).options = help_msg; + } + } else { + $(cur_frm.fields_dict.packing_list.row.wrapper).toggle(false); + if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) { + frappe.meta.get_docfield(doc.doctype, 'sales_bom_help', doc.name).options = ''; + } + } + refresh_field('sales_bom_help'); }, change_form_labels: function(company_currency) { @@ -574,26 +594,5 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ var df = frappe.meta.get_docfield(fname[0], fname[1], me.frm.doc.name); if(df) df.label = label; }); - }, -}); - -// Help for Sales BOM items -var set_sales_bom_help = function(doc) { - if(!cur_frm.fields_dict.packing_list) return; - if ((doc.packing_details || []).length) { - $(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true); - - if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) { - help_msg = "
" + - __("For 'Sales BOM' items, warehouse, serial no and batch no will be considered from the 'Packing List' table. If warehouse and batch no are same for all packing items for any 'Sales BOM' item, those values can be entered in the main item table, values will be copied to 'Packing List' table.")+ - "
"; - frappe.meta.get_docfield(doc.doctype, 'sales_bom_help', doc.name).options = help_msg; - } - } else { - $(cur_frm.fields_dict.packing_list.row.wrapper).toggle(false); - if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) { - frappe.meta.get_docfield(doc.doctype, 'sales_bom_help', doc.name).options = ''; - } } - refresh_field('sales_bom_help'); -} +}); From 60c48fee16a936a967500a4008484fd7804acf74 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Jun 2014 17:34:52 +0530 Subject: [PATCH 6/6] minor fixes --- erpnext/selling/sales_common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index aba390e281..2021490bb7 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -491,7 +491,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) { help_msg = "
" + - __("For 'Sales BOM' items, warehouse, serial no and batch no will be considered from the 'Packing List' table. If warehouse and batch no are same for all packing items for any 'Sales BOM' item, those values can be entered in the main item table, values will be copied to 'Packing List' table.")+ + __("For 'Sales BOM' items, Warehouse, Serial No and Batch No will be considered from the 'Packing List' table. If Warehouse and Batch No are same for all packing items for any 'Sales BOM' item, those values can be entered in the main Item table, values will be copied to 'Packing List' table.")+ "
"; frappe.meta.get_docfield(doc.doctype, 'sales_bom_help', doc.name).options = help_msg; }