From 5c82e9ef8bda3c27da4548da3c5b5950ba8c0103 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Thu, 29 Dec 2016 17:30:18 +0530 Subject: [PATCH 1/4] Fetching the item details from the reference doctype in quality inspection Error Report [2016-12-29] --- erpnext/stock/doctype/quality_inspection/quality_inspection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/quality_inspection/quality_inspection.js b/erpnext/stock/doctype/quality_inspection/quality_inspection.js index 5d7b6b41535..53579fb0ff6 100644 --- a/erpnext/stock/doctype/quality_inspection/quality_inspection.js +++ b/erpnext/stock/doctype/quality_inspection/quality_inspection.js @@ -9,7 +9,7 @@ cur_frm.fields_dict['item_code'].get_query = function(doc, cdt, cdn) { return { query: "erpnext.stock.doctype.quality_inspection.quality_inspection.item_query", filters: { - "from": doc.reference_type, + "from": doc.reference_type + " Item", "parent": doc.reference_name } } From 9646be1d5d80a81ac718da862060bb1e3a4c5058 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 30 Dec 2016 11:14:11 +0530 Subject: [PATCH 2/4] [fix] Make Journal Entry against SO --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index cd793635029..1dd1ee9678f 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -651,7 +651,8 @@ def get_payment_entry(ref_doc, args): if args.get("party_account"): # Modified to include the posting date for which the exchange rate is required. # Assumed to be the posting date in the reference document - exchange_rate = get_exchange_rate(ref_doc.posting_date, args.get("party_account"), args.get("party_account_currency"), + exchange_rate = get_exchange_rate(ref_doc.get("posting_date") or ref_doc.get("transaction_date"), + args.get("party_account"), args.get("party_account_currency"), ref_doc.company, ref_doc.doctype, ref_doc.name) je = frappe.new_doc("Journal Entry") @@ -686,7 +687,8 @@ def get_payment_entry(ref_doc, args): bank_row.update(bank_account) # Modified to include the posting date for which the exchange rate is required. # Assumed to be the posting date of the reference date - bank_row.exchange_rate = get_exchange_rate(ref_doc.posting_date, bank_account["account"], + bank_row.exchange_rate = get_exchange_rate(ref_doc.get("posting_date") + or ref_doc.get("transaction_date"), bank_account["account"], bank_account["account_currency"], ref_doc.company) bank_row.cost_center = cost_center From 7b29dc72080861c9c62bf6ac11b13c3e279c33bc Mon Sep 17 00:00:00 2001 From: Kanchan Chauhan Date: Fri, 30 Dec 2016 12:19:09 +0530 Subject: [PATCH 3/4] [Fix] Monthly Salary Register Fix --- .../monthly_salary_register.js | 21 +++++++++---------- .../monthly_salary_register.py | 19 +++++++---------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js index 6d9111f7eeb..a879b39a6c1 100644 --- a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js +++ b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.js @@ -4,19 +4,18 @@ frappe.query_reports["Monthly Salary Register"] = { "filters": [ { - "fieldname":"month", - "label": __("Month"), - "fieldtype": "Select", - "options": "\nJan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec", - "default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", - "Dec"][frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth()], + "fieldname":"from_date", + "label": __("From"), + "fieldtype": "Date", + "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1), + "reqd": 1 }, { - "fieldname":"fiscal_year", - "label": __("Fiscal Year"), - "fieldtype": "Link", - "options": "Fiscal Year", - "default": sys_defaults.fiscal_year, + "fieldname":"to_date", + "label": __("To"), + "fieldtype": "Date", + "default": frappe.datetime.get_today(), + "reqd": 1 }, { "fieldname":"employee", diff --git a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.py b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.py index 1e9d03ee043..e8d0a0bf2f7 100644 --- a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.py +++ b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.py @@ -18,7 +18,7 @@ def execute(filters=None): data = [] for ss in salary_slips: row = [ss.name, ss.employee, ss.employee_name, ss.branch, ss.department, ss.designation, - ss.company, ss.month, ss.leave_withut_pay, ss.payment_days] + ss.company, ss.start_date, ss.end_date, ss.leave_withut_pay, ss.payment_days] for e in earning_types: row.append(ss_earning_map.get(ss.name, {}).get(e)) @@ -38,7 +38,7 @@ def get_columns(salary_slips): columns = [ _("Salary Slip ID") + ":Link/Salary Slip:150",_("Employee") + ":Link/Employee:120", _("Employee Name") + "::140", _("Branch") + ":Link/Branch:120", _("Department") + ":Link/Department:120", _("Designation") + ":Link/Designation:120", - _("Company") + ":Link/Company:120", _("Month") + "::80", _("Leave Without Pay") + ":Float:130", + _("Company") + ":Link/Company:120", _("Start Date") + "::80", _("End Date") + "::80", _("Leave Without Pay") + ":Float:130", _("Payment Days") + ":Float:120" ] @@ -60,23 +60,18 @@ def get_columns(salary_slips): def get_salary_slips(filters): conditions, filters = get_conditions(filters) salary_slips = frappe.db.sql("""select * from `tabSalary Slip` where docstatus = 1 %s - order by employee, month""" % conditions, filters, as_dict=1) + order by employee""" % conditions, filters, as_dict=1) if not salary_slips: - frappe.throw(_("No salary slip found for month {0} and year {1}").format( - filters.get("month"), filters.get("fiscal_year"))) + frappe.throw(_("No salary slip found between {0} and {1}").format( + filters.get("from_date"), filters.get("to_date"))) return salary_slips def get_conditions(filters): conditions = "" - if filters.get("month"): - month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", - "Dec"].index(filters["month"]) + 1 - filters["month"] = month - conditions += " and month = %(month)s" - - if filters.get("fiscal_year"): conditions += " and fiscal_year = %(fiscal_year)s" + if filters.get("from_date"): conditions += " and start_date >= %(from_date)s" + if filters.get("to_date"): conditions += " and end_date <= %(to_date)s" if filters.get("company"): conditions += " and company = %(company)s" if filters.get("employee"): conditions += " and employee = %(employee)s" From 5105b1e789e455a3331d11f743a4109f41957a8c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 30 Dec 2016 15:26:19 +0600 Subject: [PATCH 4/4] bumped to version 7.2.4 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 5b26c086d5c..79a8fe1830c 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.2.3' +__version__ = '7.2.4' def get_default_company(user=None): '''Get default company for user'''