From dc7004e0833b711de87df0aa1db081406b8a0d5f Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 31 Jul 2018 16:01:02 +0530 Subject: [PATCH 1/9] [Fix] Patient Appointment Calendar not showing data properly (#15052) --- .../doctype/patient_appointment/patient_appointment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py index 4379986ddc..a25928b8e5 100755 --- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py +++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py @@ -292,10 +292,10 @@ def get_events(start, end, filters=None): conditions = get_event_conditions("Patient Appointment", filters) data = frappe.db.sql("""select name, patient, physician, status, duration, timestamp(appointment_date, appointment_time) as - 'start' from `tabPatient Appointment` where + 'appointment_date' from `tabPatient Appointment` where (appointment_date between %(start)s and %(end)s) and docstatus < 2 {conditions}""".format(conditions=conditions), {"start": start, "end": end}, as_dict=True, update={"allDay": 0}) for item in data: - item.end = item.start + datetime.timedelta(minutes = item.duration) + item.appointment_datetime = item.appointment_date + datetime.timedelta(minutes = item.duration) return data From 0452b405f4b25eaa4d295523ab94b27cc8123961 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 1 Aug 2018 17:45:51 +0530 Subject: [PATCH 2/9] [Fix] Not able to submit the expense claim (#15057) --- erpnext/hr/doctype/expense_claim/expense_claim.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index f674a61d91..4d1b19abdc 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -30,7 +30,7 @@ class ExpenseClaim(AccountsController): self.validate_expense_approver() self.calculate_total_amount() set_employee_name(self) - self.set_expense_account() + self.set_expense_account(validate=True) self.set_payable_account() self.set_cost_center() self.set_status() @@ -235,9 +235,9 @@ class ExpenseClaim(AccountsController): if flt(d.sanctioned_amount) > flt(d.claim_amount): frappe.throw(_("Sanctioned Amount cannot be greater than Claim Amount in Row {0}.").format(d.idx)) - def set_expense_account(self): + def set_expense_account(self, validate=False): for expense in self.expenses: - if not expense.default_account: + if not expense.default_account or not validate: expense.default_account = get_expense_claim_account(expense.expense_type, self.company)["account"] def update_reimbursed_amount(doc): From ae4ff5a4035f834c548b2a72d3fd3a25e23ef292 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 1 Aug 2018 18:09:51 +0530 Subject: [PATCH 3/9] [Fix] In words showing grand total instead of rounded total (#15065) --- .../purchase_invoice/purchase_invoice.js | 2 - .../purchase_order/purchase_order.json | 63 ++++++- .../supplier_quotation.json | 173 ++++++++++++------ erpnext/controllers/buying_controller.py | 11 +- erpnext/public/js/controllers/buying.js | 4 + 5 files changed, 192 insertions(+), 61 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 26cc59892f..c384ec3b45 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -21,8 +21,6 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ if(!this.frm.doc.supplier && this.frm.doc.credit_to) { this.frm.set_df_property("credit_to", "print_hide", 0); } - } else { - this.frm.set_value("disable_rounded_total", cint(frappe.sys_defaults.disable_rounded_total)); } }, diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json index 1c44f3e31e..87e5455574 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.json +++ b/erpnext/buying/doctype/purchase_order/purchase_order.json @@ -2378,6 +2378,37 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "rounded_total", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rounded Total", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2409,6 +2440,36 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "disable_rounded_total", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Disable Rounded Total", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -3293,7 +3354,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2018-07-18 07:49:53.131408", + "modified": "2018-08-01 15:18:33.155409", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index bee6553515..b889c94503 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -1983,6 +1983,37 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "rounded_total", + "fieldtype": "Currency", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Rounded Total", + "length": 0, + "no_copy": 0, + "options": "currency", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2014,6 +2045,36 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "disable_rounded_total", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Disable Rounded Total", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_bulk_edit": 0, "allow_on_submit": 0, @@ -2177,65 +2238,65 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "group_same_items", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Group same items", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "fieldname": "group_same_items", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Group same items", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_72", - "fieldtype": "Column Break", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "read_only": 0, - "remember_last_selected_value": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_72", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, "unique": 0 - }, + }, { - "allow_bulk_edit": 0, - "allow_on_submit": 1, - "bold": 0, - "collapsible": 0, - "columns": 0, + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, "fieldname": "letter_head", "fieldtype": "Link", "hidden": 0, @@ -2549,7 +2610,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-07-06 02:45:48.616334", + "modified": "2018-08-01 15:18:23.265621", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 38beccdce0..cd3cbe97c9 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -99,9 +99,16 @@ class BuyingController(StockController): def set_total_in_words(self): from frappe.utils import money_in_words if self.meta.get_field("base_in_words"): - self.base_in_words = money_in_words(self.base_grand_total, self.company_currency) + amount = (self.base_rounded_total + if not self.get("disable_rounded_total") else self.base_grand_total) + + self.base_in_words = money_in_words(amount, self.company_currency) + if self.meta.get_field("in_words"): - self.in_words = money_in_words(self.grand_total, self.currency) + amount = (self.rounded_total + if not self.get("disable_rounded_total") else self.grand_total) + + self.in_words = money_in_words(amount, self.currency) # update valuation rate def update_valuation_rate(self, parentfield): diff --git a/erpnext/public/js/controllers/buying.js b/erpnext/public/js/controllers/buying.js index 9d92b9f667..20ac6b4f18 100644 --- a/erpnext/public/js/controllers/buying.js +++ b/erpnext/public/js/controllers/buying.js @@ -26,6 +26,10 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ }; }); + if (this.frm.doc.__islocal) { + this.frm.set_value("disable_rounded_total", cint(frappe.sys_defaults.disable_rounded_total)); + } + /* eslint-disable */ // no idea where me is coming from if(this.frm.get_field('shipping_address')) { From 86217ca96c860e276b45b3646d7763f5be824624 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Thu, 2 Aug 2018 16:41:53 +0530 Subject: [PATCH 4/9] [Fix] Task email alert on status change not working if we change the task status from the project form --- erpnext/projects/doctype/project/project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 3cb91018b6..cc04ea2289 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -120,7 +120,7 @@ class Project(Document): "modified": now() }) - task.validate() + task.run_method("validate") task.db_update() else: task.save(ignore_permissions = True) From 15f52e7b71a4bb411ca3a0a6c56d90cc91a02807 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 6 Aug 2018 14:29:34 +0530 Subject: [PATCH 5/9] [Fix] Incorrect tax amount calculation because of same fieldname in the code --- .../item_wise_sales_register/item_wise_sales_register.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py index d5b708fec5..05ad741a3d 100644 --- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py +++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py @@ -223,13 +223,13 @@ def get_tax_accounts(item_list, columns, company_currency, item_tax_amount = flt((tax_amount * d.base_net_amount) / item_net_amount) \ if item_net_amount else 0 if item_tax_amount: - tax_amount = flt(item_tax_amount, tax_amount_precision) - tax_amount = (tax_amount * -1 - if (doctype == 'Purchase Invoice' and name in deducted_tax) else tax_amount) + tax_value = flt(item_tax_amount, tax_amount_precision) + tax_value = (tax_value * -1 + if (doctype == 'Purchase Invoice' and name in deducted_tax) else tax_value) itemised_tax.setdefault(d.name, {})[description] = frappe._dict({ "tax_rate": tax_rate, - "tax_amount": tax_amount + "tax_amount": tax_value }) except ValueError: From fc682c86c659757331a8dc66d7d74428d4c1cb70 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 6 Aug 2018 14:29:46 +0530 Subject: [PATCH 6/9] [Fix] Inactive student validation issue while disabling the student group (#15095) --- erpnext/education/doctype/student_group/student_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/education/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py index d508589409..465a72d84e 100644 --- a/erpnext/education/doctype/student_group/student_group.py +++ b/erpnext/education/doctype/student_group/student_group.py @@ -33,7 +33,7 @@ class StudentGroup(Document): program_enrollment = get_program_enrollment(self.academic_year, self.academic_term, self.program, self.batch, self.course) students = [d.student for d in program_enrollment] if program_enrollment else [] for d in self.students: - if not frappe.db.get_value("Student", d.student, "enabled") and d.active: + if not frappe.db.get_value("Student", d.student, "enabled") and d.active and not self.disabled: frappe.throw(_("{0} - {1} is inactive student".format(d.group_roll_number, d.student_name))) if (self.group_based_on == "Batch") and cint(frappe.defaults.get_defaults().validate_batch)\ From f0ef673498b5ae1547de7c731892e316aa36d64d Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Mon, 6 Aug 2018 14:42:35 +0530 Subject: [PATCH 7/9] Accounts receivable aging based on supplier due date (#15080) * Accounts receivable aging based on supplier due date (#13801) * Remove spaces --- .../report/accounts_payable/accounts_payable.js | 2 +- .../accounts_receivable/accounts_receivable.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.js b/erpnext/accounts/report/accounts_payable/accounts_payable.js index 63ef83263c..e95b0f3adb 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.js +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.js @@ -32,7 +32,7 @@ frappe.query_reports["Accounts Payable"] = { "fieldname":"ageing_based_on", "label": __("Ageing Based On"), "fieldtype": "Select", - "options": 'Posting Date\nDue Date', + "options": 'Posting Date\nDue Date\nSupplier Invoice Date', "default": "Posting Date" }, { diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 0befa5d057..8135abcc28 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -151,6 +151,7 @@ class ReceivablePayableReport(object): # get due date due_date = voucher_details.get(gle.voucher_no, {}).get("due_date", "") + bill_date = voucher_details.get(gle.voucher_no, {}).get("bill_date", "") row += [gle.voucher_type, gle.voucher_no, due_date] @@ -167,15 +168,25 @@ class ReceivablePayableReport(object): row += [invoiced_amount, paid_amt, credit_note_amount, outstanding_amount] # ageing data - entry_date = due_date if self.filters.ageing_based_on == "Due Date" else gle.posting_date + if self.filters.ageing_based_on == "Due Date": + entry_date = due_date + elif self.filters.ageing_based_on == "Supplier Invoice Date": + entry_date = bill_date + else: + entry_date = gle.posting_date row += get_ageing_data(cint(self.filters.range1), cint(self.filters.range2), cint(self.filters.range3), self.age_as_on, entry_date, outstanding_amount) + # issue 6371-Ageing buckets should not have amounts if due date is not reached if self.filters.ageing_based_on == "Due Date" \ and getdate(due_date) > getdate(self.filters.report_date): row[-1]=row[-2]=row[-3]=row[-4]=0 + if self.filters.ageing_based_on == "Supplier Invoice Date" \ + and getdate(bill_date) > getdate(self.filters.report_date): + row[-1]=row[-2]=row[-3]=row[-4]=0 + if self.filters.get(scrub(args.get("party_type"))): row.append(gle.account_currency) else: From 11dd3ffdb539253e721929d3a1e58e55cde3c766 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Mon, 6 Aug 2018 14:43:00 +0530 Subject: [PATCH 8/9] Force delete item on deletion of Lab test template (#15079) --- .../healthcare/doctype/lab_test_template/lab_test_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py index bb0ead62cf..35eb7f56b8 100644 --- a/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py +++ b/erpnext/healthcare/doctype/lab_test_template/lab_test_template.py @@ -34,7 +34,7 @@ class LabTestTemplate(Document): # remove template refernce from item and disable item if(self.item): try: - frappe.delete_doc("Item",self.item) + frappe.delete_doc("Item",self.item, force=True) except Exception: frappe.throw("""Not permitted. Please disable the Test Template""") From 6ec558bd5917728b41b23b3639301c0ee4c2b28b Mon Sep 17 00:00:00 2001 From: Saurabh Date: Tue, 7 Aug 2018 13:25:51 +0600 Subject: [PATCH 9/9] bumped to version 10.1.46 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 862ac94ba9..3f0838da63 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '10.1.45' +__version__ = '10.1.46' def get_default_company(user=None): '''Get default company for user'''