diff --git a/erpnext/__version__.py b/erpnext/__version__.py index c8b2f49e37..2c86e6c90a 100644 --- a/erpnext/__version__.py +++ b/erpnext/__version__.py @@ -1,2 +1,2 @@ from __future__ import unicode_literals -__version__ = '5.1.3' +__version__ = '5.1.4' diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.json b/erpnext/accounts/doctype/pos_profile/pos_profile.json index ad224f1908..0c5a4bbc7e 100644 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.json +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.json @@ -77,6 +77,51 @@ "read_only": 0, "reqd": 1 }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "Letter Head", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms and Conditions", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "in_filter": 0, + "label": "Print Heading", + "oldfieldname": "select_print_heading", + "oldfieldtype": "Select", + "options": "Print Heading", + "permlevel": 0, + "read_only": 0 + }, { "fieldname": "column_break0", "fieldtype": "Column Break", @@ -105,6 +150,14 @@ "read_only": 0, "reqd": 0 }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "options": "Mode of Payment", + "permlevel": 0, + "precision": "" + }, { "fieldname": "cash_bank_account", "fieldtype": "Link", @@ -139,17 +192,6 @@ "read_only": 0, "reqd": 0 }, - { - "fieldname": "warehouse", - "fieldtype": "Link", - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "permlevel": 0, - "read_only": 0, - "reqd": 0 - }, { "fieldname": "cost_center", "fieldtype": "Link", @@ -161,16 +203,6 @@ "read_only": 0, "reqd": 1 }, - { - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "charge", - "oldfieldtype": "Link", - "options": "Sales Taxes and Charges Template", - "permlevel": 0, - "read_only": 0 - }, { "fieldname": "write_off_account", "fieldtype": "Link", @@ -190,43 +222,19 @@ "reqd": 1 }, { - "allow_on_submit": 1, - "fieldname": "letter_head", + "fieldname": "taxes_and_charges", "fieldtype": "Link", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "Letter Head", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms and Conditions", - "oldfieldname": "tc_name", + "label": "Taxes and Charges", + "oldfieldname": "charge", "oldfieldtype": "Link", - "options": "Terms and Conditions", - "permlevel": 0, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "fieldname": "select_print_heading", - "fieldtype": "Link", - "in_filter": 0, - "label": "Print Heading", - "oldfieldname": "select_print_heading", - "oldfieldtype": "Select", - "options": "Print Heading", + "options": "Sales Taxes and Charges Template", "permlevel": 0, "read_only": 0 } ], "icon": "icon-cog", "idx": 1, - "modified": "2015-05-20 05:38:44.482696", + "modified": "2015-07-07 08:56:04.381471", "modified_by": "Administrator", "module": "Accounts", "name": "POS Profile", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 50a79ec01b..af144cbf40 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -124,20 +124,11 @@ class PurchaseInvoice(BuyingController): } }) - if cint(frappe.defaults.get_global_default('maintain_same_rate')): - super(PurchaseInvoice, self).validate_with_previous_doc({ - "Purchase Order Item": { - "ref_dn_field": "po_detail", - "compare_fields": [["rate", "="]], - "is_child_table": True, - "allow_duplicate_prev_row_id": True - }, - "Purchase Receipt Item": { - "ref_dn_field": "pr_detail", - "compare_fields": [["rate", "="]], - "is_child_table": True - } - }) + if cint(frappe.db.get_single_value('Buying Settings', 'maintain_same_rate')): + self.validate_rate_with_reference_doc([ + ["Purchase Order", "purchase_order", "po_detail"], + ["Purchase Receipt", "purchase_receipt", "pr_detail"] + ]) def set_against_expense_account(self): auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 604370b326..f3acc74c00 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -169,6 +169,7 @@ class SalesInvoice(SellingController): if pos: if not for_validate and not self.customer: self.customer = pos.customer + self.mode_of_payment = pos.mode_of_payment # self.set_customer_defaults() for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name', @@ -263,20 +264,11 @@ class SalesInvoice(SellingController): }, }) - if cint(frappe.defaults.get_global_default('maintain_same_sales_rate')): - super(SalesInvoice, self).validate_with_previous_doc({ - "Sales Order Item": { - "ref_dn_field": "so_detail", - "compare_fields": [["rate", "="]], - "is_child_table": True, - "allow_duplicate_prev_row_id": True - }, - "Delivery Note Item": { - "ref_dn_field": "dn_detail", - "compare_fields": [["rate", "="]], - "is_child_table": True - } - }) + if cint(frappe.db.get_single_value('Selling Settings', 'maintain_same_sales_rate')): + self.validate_rate_with_reference_doc([ + ["Sales Order", "sales_order", "so_detail"], + ["Delivery Note", "delivery_note", "dn_detail"] + ]) def set_against_income_account(self): """Set against account for debit to account""" diff --git a/erpnext/change_log/v5/v5_1_4.md b/erpnext/change_log/v5/v5_1_4.md new file mode 100644 index 0000000000..c11af81329 --- /dev/null +++ b/erpnext/change_log/v5/v5_1_4.md @@ -0,0 +1,4 @@ +- Mode of Payment added to POS Profile +- Expired Batch is not allowed in stock entry of type manufacturing / repack +- Validate item rate against reference document with tolerance 0.009 +- Set Customer name in opportunity as per company name in lead \ No newline at end of file diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 4f35fea38a..801f6f28ed 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -229,9 +229,10 @@ def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, }, { "start": start, "page_len": page_len, "txt": ("%%%s%%" % txt) }) def get_batch_no(doctype, txt, searchfield, start, page_len, filters): - if not filters.get("posting_date"): - filters["posting_date"] = nowdate() - + cond = "" + if filters.get("posting_date"): + cond = "and (ifnull(batch.expiry_date, '')='' or batch.expiry_date >= %(posting_date)s)" + batch_nos = None args = { 'item_code': filters.get("item_code"), @@ -251,23 +252,23 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters): and sle.warehouse = %(warehouse)s and sle.batch_no like %(txt)s and batch.docstatus < 2 - and (ifnull(batch.expiry_date, '')='' or batch.expiry_date >= %(posting_date)s) + {0} {match_conditions} group by batch_no having sum(sle.actual_qty) > 0 order by batch.expiry_date, sle.batch_no desc - limit %(start)s, %(page_len)s""".format(match_conditions=get_match_cond(doctype)), args) + limit %(start)s, %(page_len)s""".format(cond, match_conditions=get_match_cond(doctype)), args) if batch_nos: return batch_nos else: - return frappe.db.sql("""select name, expiry_date from `tabBatch` + return frappe.db.sql("""select name, expiry_date from `tabBatch` batch where item = %(item_code)s and name like %(txt)s and docstatus < 2 - and (ifnull(expiry_date, '')='' or expiry_date >= %(posting_date)s) + {0} {match_conditions} order by expiry_date, name desc - limit %(start)s, %(page_len)s""".format(match_conditions=get_match_cond(doctype)), args) + limit %(start)s, %(page_len)s""".format(cond, match_conditions=get_match_cond(doctype)), args, debug=1) def get_account_list(doctype, txt, searchfield, start, page_len, filters): filter_list = [] diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 022539817e..78729a3bcb 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -79,7 +79,8 @@ class Opportunity(TransactionBase): if self.customer: self.customer_name = frappe.db.get_value("Customer", self.customer, "customer_name") elif self.lead: - self.customer_name = frappe.db.get_value("Lead", self.lead, "lead_name") + lead_name, company_name = frappe.db.get_value("Lead", self.lead, ["lead_name", "company_name"]) + self.customer_name = company_name or lead_name def get_cust_address(self,name): details = frappe.db.sql("""select customer_name, address, territory, customer_group diff --git a/erpnext/hooks.py b/erpnext/hooks.py index a05e5aeafb..ef1afa301a 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors" app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "5.1.3" +app_version = "5.1.4" error_report_email = "support@erpnext.com" @@ -25,8 +25,13 @@ on_logout = "erpnext.shopping_cart.utils.clear_cart_count" # website update_website_context = "erpnext.shopping_cart.utils.update_website_context" my_account_context = "erpnext.shopping_cart.utils.update_my_account_context" + email_append_to = ["Job Applicant", "Opportunity", "Issue"] +calendars = ["Task", "Production Order", "Time Log", "Leave Application"] + +website_generators = ["Item Group", "Item", "Sales Partner"] + website_context = { "favicon": "/assets/erpnext/images/favicon.png", "splash_image": "/assets/erpnext/images/splash.png" @@ -52,14 +57,10 @@ dump_report_map = "erpnext.startup.report_data_map.data_map" before_tests = "erpnext.setup.utils.before_tests" -website_generators = ["Item Group", "Item", "Sales Partner"] - standard_queries = { "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list" } -communication_covert_to = ["Lead", "Issue", "Job Application"] - doc_events = { "Stock Entry": { "on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty", @@ -106,4 +107,3 @@ get_translated_dict = { ("page", "setup-wizard"): "frappe.geo.country_info.get_translated_dict", ("doctype", "Global Defaults"): "frappe.geo.country_info.get_translated_dict" } - diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.js b/erpnext/hr/doctype/salary_manager/salary_manager.js index 240547c679..ca702265d4 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.js +++ b/erpnext/hr/doctype/salary_manager/salary_manager.js @@ -1,30 +1,44 @@ // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt -var display_activity_log = function(msg) { +cur_frm.cscript.display_activity_log = function(msg) { if(!cur_frm.ss_html) cur_frm.ss_html = $a(cur_frm.fields_dict['activity_log'].wrapper,'div'); - cur_frm.ss_html.innerHTML = - '
No employee for the above selected criteria OR salary slip already created
" if ss_list: log = "Salary Slip Created For\ -