From b34ba6bd6e479db98555d636a81ad23b745bc082 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 1 Sep 2016 18:01:27 +0530 Subject: [PATCH 1/7] [RFQ] Web form alignment issue --- erpnext/templates/includes/rfq.js | 6 ++++-- erpnext/templates/includes/rfq/rfq_items.html | 16 ++++++++-------- erpnext/templates/pages/rfq.html | 12 ++++++------ 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/erpnext/templates/includes/rfq.js b/erpnext/templates/includes/rfq.js index 3e9c261a200..c63226c9bd0 100644 --- a/erpnext/templates/includes/rfq.js +++ b/erpnext/templates/includes/rfq.js @@ -30,9 +30,10 @@ rfq = Class.extend({ var me = this; $('.rfq-items').on("change", ".rfq-qty", function(){ me.idx = parseFloat($(this).attr('data-idx')); - me.qty = parseFloat($(this).val()); + me.qty = parseFloat($(this).val()) || 0; me.rate = parseFloat($(repl('.rfq-rate[data-idx=%(idx)s]',{'idx': me.idx})).val()); me.update_qty_rate(); + $(this).val(format_number(me.qty, 2)); }) }, @@ -40,9 +41,10 @@ rfq = Class.extend({ var me = this; $(".rfq-items").on("change", ".rfq-rate", function(){ me.idx = parseFloat($(this).attr('data-idx')); - me.rate = parseFloat($(this).val()); + me.rate = parseFloat($(this).val()) || 0; me.qty = parseFloat($(repl('.rfq-qty[data-idx=%(idx)s]',{'idx': me.idx})).val()); me.update_qty_rate(); + $(this).val(format_number(me.rate, 2)); }) }, diff --git a/erpnext/templates/includes/rfq/rfq_items.html b/erpnext/templates/includes/rfq/rfq_items.html index 1e99a7671b7..cb77f7eea5c 100644 --- a/erpnext/templates/includes/rfq/rfq_items.html +++ b/erpnext/templates/includes/rfq/rfq_items.html @@ -3,26 +3,26 @@ {% for d in doc.items %}
-
+
{{ item_name_and_description(d, doc) }}
-
- +

- {{_("UOM") + ": "+ d.uom}} + {{_("UOM") + ":"+ d.uom}}

-
- {{doc.currency_symbol}} +
-
+
{{doc.currency_symbol}} 0.00
diff --git a/erpnext/templates/pages/rfq.html b/erpnext/templates/pages/rfq.html index 5729e89d408..b151987052d 100644 --- a/erpnext/templates/pages/rfq.html +++ b/erpnext/templates/pages/rfq.html @@ -33,16 +33,16 @@
-
+
Items
-
+
Qty
-
+
Rate
-
+
Amount
@@ -55,8 +55,8 @@
{% if doc.items %}
-
{{ _("Grand Total") }}
-
+
{{ _("Grand Total") }}
+
{{doc.currency_symbol}} 0.0
From 13b37c634613e59d15d1d260ca35d05663cca391 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2016 11:25:28 +0530 Subject: [PATCH 2/7] Default letter head in report printing based on selected company --- .../report/accounts_receivable/accounts_receivable.html | 2 +- erpnext/accounts/report/financial_statements.html | 4 +++- erpnext/accounts/report/general_ledger/general_ledger.html | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html index 712d35b38ee..75c3e8c2054 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.html +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.html @@ -1,5 +1,5 @@
- {%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %} + {%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}

{%= __(report.report_name) %}

{%= filters.customer || filters.supplier %}

diff --git a/erpnext/accounts/report/financial_statements.html b/erpnext/accounts/report/financial_statements.html index 84cad1610d3..6959e5d3ed9 100644 --- a/erpnext/accounts/report/financial_statements.html +++ b/erpnext/accounts/report/financial_statements.html @@ -13,7 +13,9 @@ height: 37px; } - +
+ {%= frappe.boot.letter_heads[frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %} +

{%= __(report.report_name) %}

{%= filters.company %}

{%= filters.fiscal_year %}

diff --git a/erpnext/accounts/report/general_ledger/general_ledger.html b/erpnext/accounts/report/general_ledger/general_ledger.html index f22e7212707..7552eed1ac3 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.html +++ b/erpnext/accounts/report/general_ledger/general_ledger.html @@ -1,5 +1,5 @@
- {%= frappe.boot.letter_heads[filters.letter_head || frappe.defaults.get_default("letter_head")] %} + {%= frappe.boot.letter_heads[filters.letter_head || frappe.get_doc(":Company", filters.company).default_letter_head || frappe.defaults.get_default("letter_head")] %}

{%= __("Statement of Account") %}

{%= (filters.party || filters.account) && ((filters.party || filters.account) + ", ") || "" %} {%= filters.company %}

From d07557eaf6ffc3c5c285b9101346b8be9d4514d0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 2 Sep 2016 12:24:54 +0530 Subject: [PATCH 3/7] [Fix] Updated timesheet status --- erpnext/patches.txt | 3 ++- erpnext/patches/v7_0/convert_timelog_to_timesheet.py | 6 +++--- erpnext/patches/v7_0/update_status_for_timesheet.py | 11 +++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 erpnext/patches/v7_0/update_status_for_timesheet.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 68a717b1f7f..6483ecd7f4b 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -313,4 +313,5 @@ erpnext.patches.v7_0.set_portal_settings erpnext.patches.v7_0.repost_future_gle_for_purchase_invoice erpnext.patches.v7_0.fix_duplicate_icons erpnext.patches.v7_0.repost_gle_for_pos_sales_return -erpnext.patches.v7_0.update_missing_employee_in_timesheet \ No newline at end of file +erpnext.patches.v7_0.update_missing_employee_in_timesheet +erpnext.patches.v7_0.update_status_for_timesheet \ No newline at end of file diff --git a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py index 6a6fa26d8ed..a176a8f349c 100644 --- a/erpnext/patches/v7_0/convert_timelog_to_timesheet.py +++ b/erpnext/patches/v7_0/convert_timelog_to_timesheet.py @@ -19,13 +19,14 @@ def execute(): time_sheet.employee = data.employee time_sheet.note = data.note time_sheet.company = company - + time_sheet.set_status() + time_sheet.set_dates() time_sheet.update_cost() time_sheet.calculate_total_amounts() time_sheet.flags.ignore_validate = True time_sheet.save(ignore_permissions=True) - + # To ignore validate_mandatory_fields function if data.docstatus == 1: time_sheet.db_set("docstatus", 1) @@ -33,7 +34,6 @@ def execute(): d.db_set("docstatus", 1) time_sheet.update_production_order(time_sheet.name) time_sheet.update_task_and_project() - def get_timelog_data(data): return { diff --git a/erpnext/patches/v7_0/update_status_for_timesheet.py b/erpnext/patches/v7_0/update_status_for_timesheet.py new file mode 100644 index 00000000000..117c40c59f2 --- /dev/null +++ b/erpnext/patches/v7_0/update_status_for_timesheet.py @@ -0,0 +1,11 @@ +from __future__ import unicode_literals +import frappe + +def execute(): + frappe.db.sql("""update + `tabTimesheet` as ts, + ( + select min(from_time)as from_time, max(to_time) as to_time, parent from `tabTimesheet Detail` group by parent + ) as tsd + set ts.status = 'Submitted', ts.start_date = tsd.from_time, ts.end_date = tsd.to_time + where tsd.parent = ts.name and ts.status = 'Draft' and ts.docstatus =1""") \ No newline at end of file From 5c69fed218aaf6e0405333173e0e9660500f708a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2016 12:53:18 +0530 Subject: [PATCH 4/7] Ignore closed sales/purchase order in trends report --- erpnext/controllers/trends.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py index 2298c3fc3e1..080d7499aa0 100644 --- a/erpnext/controllers/trends.py +++ b/erpnext/controllers/trends.py @@ -39,6 +39,7 @@ def validate_filters(filters): frappe.throw(_("'Based On' and 'Group By' can not be same")) def get_data(filters, conditions): + data = [] inc, cond= '','' query_details = conditions["based_on_select"] + conditions["period_wise_select"] @@ -49,6 +50,9 @@ def get_data(filters, conditions): if conditions["based_on_select"] in ["t1.project,", "t2.project,"]: cond = 'and '+ conditions["based_on_select"][:-1] +' IS Not NULL' + + if conditions.get('trans') in ['Sales Order', 'Purchase Order']: + cond += "and t1.status != 'Closed'" year_start_date, year_end_date = frappe.db.get_value("Fiscal Year", filters.get('fiscal_year'), ["year_start_date", "year_end_date"]) @@ -85,10 +89,10 @@ def get_data(filters, conditions): #to get distinct value of col specified by group_by in filter row = frappe.db.sql("""select DISTINCT(%s) from `tab%s` t1, `tab%s Item` t2 %s where t2.parent = t1.name and t1.company = %s and %s between %s and %s - and t1.docstatus = 1 and %s = %s %s + and t1.docstatus = 1 and %s = %s %s %s """ % (sel_col, conditions["trans"], conditions["trans"], conditions["addl_tables"], - "%s", posting_date, "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")), + "%s", posting_date, "%s", "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond"), cond), (filters.get("company"), year_start_date, year_end_date, data1[d][0]), as_list=1) for i in range(len(row)): @@ -97,11 +101,11 @@ def get_data(filters, conditions): #get data for group_by filter row1 = frappe.db.sql(""" select %s , %s from `tab%s` t1, `tab%s Item` t2 %s where t2.parent = t1.name and t1.company = %s and %s between %s and %s - and t1.docstatus = 1 and %s = %s and %s = %s %s + and t1.docstatus = 1 and %s = %s and %s = %s %s %s """ % (sel_col, conditions["period_wise_select"], conditions["trans"], conditions["trans"], conditions["addl_tables"], "%s", posting_date, "%s","%s", sel_col, - "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond")), + "%s", conditions["group_by"], "%s", conditions.get("addl_tables_relational_cond"), cond), (filters.get("company"), year_start_date, year_end_date, row[i][0], data1[d][0]), as_list=1) From ff910f4c72f5536317ffabbd4c2f30064f104b37 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 2 Sep 2016 13:39:05 +0530 Subject: [PATCH 5/7] [fixes] set filter for warehouse --- erpnext/accounts/doctype/asset/asset.js | 8 ++++++-- .../accounts/doctype/asset_movement/asset_movement.js | 5 ++++- .../doctype/purchase_invoice/purchase_invoice.js | 10 ++++++++-- .../doctype/production_order/production_order.js | 3 ++- .../stock/doctype/purchase_receipt/purchase_receipt.js | 10 ++++++++-- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/doctype/asset/asset.js b/erpnext/accounts/doctype/asset/asset.js index 38be2637a2c..8ff4b83d681 100644 --- a/erpnext/accounts/doctype/asset/asset.js +++ b/erpnext/accounts/doctype/asset/asset.js @@ -18,7 +18,8 @@ frappe.ui.form.on('Asset', { frm.set_query("warehouse", function() { return { "filters": { - "company": frm.doc.company + "company": frm.doc.company, + "is_group": 0 } }; }); @@ -232,7 +233,10 @@ erpnext.asset.transfer_asset = function(frm) { "options": "Warehouse", "get_query": function () { return { - filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]] + filters: [ + ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]], + ["Warehouse", "is_group", "=", 0] + ] } }, "reqd": 1 diff --git a/erpnext/accounts/doctype/asset_movement/asset_movement.js b/erpnext/accounts/doctype/asset_movement/asset_movement.js index 680eedc9bc6..808f01a40ce 100644 --- a/erpnext/accounts/doctype/asset_movement/asset_movement.js +++ b/erpnext/accounts/doctype/asset_movement/asset_movement.js @@ -7,7 +7,10 @@ frappe.ui.form.on('Asset Movement', { frm.set_query("target_warehouse", function() { return { - filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]] + filters: [ + ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]], + ["Warehouse", "is_group", "=", 0] + ] } }) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index c51231e881a..ccdd87ff1d5 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -340,14 +340,20 @@ frappe.ui.form.on("Purchase Invoice", { $.each(["warehouse", "rejected_warehouse"], function(i, field) { frm.set_query(field, "items", function() { return { - filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]] + filters: [ + ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]], + ["Warehouse", "is_group", "=", 0] + ] } }) }) frm.set_query("supplier_warehouse", function() { return { - filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]] + filters: [ + ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]], + ["Warehouse", "is_group", "=", 0] + ] } }) }, diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index 9b97bd1cd27..d0e0d86d2e3 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -174,7 +174,8 @@ erpnext.production_order = { var company_filter = function(doc) { return { filters: { - 'company': frm.doc.company + 'company': frm.doc.company, + 'is_group': 0 } } } diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 792f269bcf5..d477189c62a 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -25,14 +25,20 @@ frappe.ui.form.on("Purchase Receipt", { $.each(["warehouse", "rejected_warehouse"], function(i, field) { frm.set_query(field, "items", function() { return { - filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]] + filters: [ + ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]], + ["Warehouse", "is_group", "=", 0] + ] } }) }) frm.set_query("supplier_warehouse", function() { return { - filters: [["Warehouse", "company", "in", ["", cstr(frm.doc.company)]]] + filters: [ + ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]], + ["Warehouse", "is_group", "=", 0] + ] } }) } From 5a4ca64c4a48828526e3cca2b1dbdc8f7cb2f103 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2016 12:15:41 +0530 Subject: [PATCH 6/7] Party name in Payment Entry and cheque print format --- .../cheque_print_template.py | 2 +- .../doctype/payment_entry/payment_entry.json | 81 ++++++++++++++++++- .../doctype/payment_entry/payment_entry.py | 3 + erpnext/patches.txt | 3 +- .../v7_0/set_party_name_in_payment_entry.py | 18 +++++ 5 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 erpnext/patches/v7_0/set_party_name_in_payment_entry.py diff --git a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py index a6cc8baa9c8..752ecdaeb7c 100644 --- a/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py +++ b/erpnext/accounts/doctype/cheque_print_template/cheque_print_template.py @@ -43,7 +43,7 @@ def create_or_update_cheque_print_format(template_name): - {{doc.party}} + {{doc.party_name}} Date: Fri, 2 Sep 2016 14:56:33 +0600 Subject: [PATCH 7/7] bumped to version 7.0.37 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index cbc8ad66422..b9c80226d55 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.36' +__version__ = '7.0.37' def get_default_company(user=None): '''Get default company for user'''