From 2c76aec1195a4a0cdc28a84d3119220c4f7ee6f8 Mon Sep 17 00:00:00 2001 From: Ben Cornwell-Mott Date: Fri, 22 Jul 2016 09:56:29 -0700 Subject: [PATCH 01/12] Added Google Chart to compare quotes in Print view --- .../quoted_item_comparison.html | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html new file mode 100644 index 0000000000..4cc54db7ea --- /dev/null +++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html @@ -0,0 +1,110 @@ + + + + + + +
+ {%= frappe.boot.letter_heads[frappe.defaults.get_default("letter_head")] %} +
+

{%= __(report.report_name) %}

+

{%= filters.item %}

+ +
+ + + + {% for(var i=0, l=report.columns.length; i{%= report.columns[i].label %} + {% } %} + + + + + + {% for(var i=0, l=data.length; i + + {% for(var j=0,m=report.columns.length; j{%= data[i][report.columns[j].field] %} + {% } %} + + + {% } %} + +
+ +

Analysis Chart

+
+ + + +

Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}

\ No newline at end of file From fe11e71084873fa162135949a88ddf3a49adaa99 Mon Sep 17 00:00:00 2001 From: Ben Cornwell-Mott Date: Fri, 22 Jul 2016 10:02:41 -0700 Subject: [PATCH 02/12] Removed hover tooltip --- .../report/quoted_item_comparison/quoted_item_comparison.html | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html index 4cc54db7ea..aff388af4a 100644 --- a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html +++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html @@ -64,6 +64,7 @@ width: 652, height: 450, isStacked: false, + enableInteractivity: false, hAxis: {logScale: true, minValue: 1,viewWindow:{ min: 1 } } }; From 590d2d524b6d8f8f4b63c8e30c8d3bd23d1192a7 Mon Sep 17 00:00:00 2001 From: Ben Cornwell-Mott Date: Mon, 25 Jul 2016 18:03:01 -0700 Subject: [PATCH 03/12] Updated html file to use c3.js instead of Google Charts --- .../quoted_item_comparison.html | 135 ++++++++++-------- 1 file changed, 78 insertions(+), 57 deletions(-) diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html index aff388af4a..e26636ea77 100644 --- a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html +++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.html @@ -1,75 +1,96 @@ - + + + + + + + @@ -104,7 +125,7 @@

Analysis Chart

-
+
From 44f85fed26fe14f35680c62b168245bd9345bda6 Mon Sep 17 00:00:00 2001 From: Ben Cornwell-Mott Date: Sun, 7 Aug 2016 10:29:51 -0700 Subject: [PATCH 04/12] Converted to a common currency (company) --- .../quoted_item_comparison/quoted_item_comparison.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py index 5bf9c7b394..1793fc3140 100644 --- a/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py +++ b/erpnext/buying/report/quoted_item_comparison/quoted_item_comparison.py @@ -2,6 +2,8 @@ # For license information, please see license.txt from __future__ import unicode_literals +from erpnext.setup.utils import get_exchange_rate + import frappe def execute(filters=None): @@ -22,6 +24,7 @@ def get_quote_list(item, qty_list): if item: price_data = [] suppliers = [] + company_currency = frappe.db.get_default("currency") # Get the list of suppliers for root in frappe.db.sql("""select parent, qty, rate from `tabSupplier Quotation Item` where item_code=%s and docstatus < 2""", item, as_dict=1): for splr in frappe.db.sql("""SELECT supplier from `tabSupplier Quotation` where name =%s and docstatus < 2""", root.parent, as_dict=1): @@ -35,6 +38,9 @@ def get_quote_list(item, qty_list): #Add a row for each supplier for root in set(suppliers): + supplier_currency = frappe.db.get_value("Supplier",root,"default_currency") + exg = get_exchange_rate(supplier_currency,company_currency) + row = frappe._dict({ "supplier_name": root }) @@ -42,7 +48,7 @@ def get_quote_list(item, qty_list): # Get the quantity for this row for item_price in price_data: if str(item_price.qty) == col.key and item_price.supplier == root: - row[col.key] = item_price.rate + row[col.key] = item_price.rate * exg row[col.key + "QUOTE"] = item_price.parent break else: From d21738740061044f733ddcf714e47df61aeae82d Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 9 Aug 2016 14:15:31 +0530 Subject: [PATCH 05/12] [ui] fix thumbnail for long images in image view --- erpnext/public/css/erpnext.css | 5 +++-- erpnext/public/less/erpnext.less | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css index b8d51c02bd..d67f9e0731 100644 --- a/erpnext/public/css/erpnext.css +++ b/erpnext/public/css/erpnext.css @@ -46,9 +46,10 @@ line-height: 0; color: #d1d8dd; font-size: 30px; - background-size: cover; + background-size: contain; border: 1px solid transparent; - background-position: top center; + background-position: center; + background-repeat: no-repeat; } .pos-item-area { border: 1px solid #d1d8dd; diff --git a/erpnext/public/less/erpnext.less b/erpnext/public/less/erpnext.less index 896aee79d9..d39f92497f 100644 --- a/erpnext/public/less/erpnext.less +++ b/erpnext/public/less/erpnext.less @@ -58,9 +58,10 @@ line-height: 0; color: @text-extra-muted; font-size: 30px; - background-size: cover; + background-size: contain; border: 1px solid transparent; - background-position: top center; + background-position: center; + background-repeat: no-repeat; } .pos-item-area { From ec2d09c557f189ad54eee61f29aad7376cd2a757 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 9 Aug 2016 16:43:15 +0530 Subject: [PATCH 06/12] [minor] setting up website optional in setup wizard --- erpnext/accounts/doctype/account/account.js | 4 +-- .../report/general_ledger/general_ledger.py | 7 +++-- erpnext/portal/doctype/homepage/homepage.json | 29 ++++++++++++++++++- .../homepage_featured_product.json | 27 ++++++++++++++++- erpnext/public/js/setup_wizard.js | 2 ++ erpnext/setup/setup_wizard/setup_wizard.py | 4 ++- erpnext/templates/pages/home.py | 6 ++-- erpnext/tests/test_client.py | 2 +- 8 files changed, 70 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index c3a01b941b..2450a8a909 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -47,7 +47,7 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) { cur_frm.cscript.add_toolbar_buttons = function(doc) { cur_frm.add_custom_button(__('Chart of Accounts'), - function() { frappe.set_route("Tree", "Account"); }, __("View")) + function() { frappe.set_route("Tree", "Account"); }); if (doc.is_group == 1) { cur_frm.add_custom_button(__('Group to Non-Group'), @@ -61,7 +61,7 @@ cur_frm.cscript.add_toolbar_buttons = function(doc) { "company": doc.company }; frappe.set_route("query-report", "General Ledger"); - }, __("View")); + }); cur_frm.add_custom_button(__('Non-Group to Group'), function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet', 'btn-default') diff --git a/erpnext/accounts/report/general_ledger/general_ledger.py b/erpnext/accounts/report/general_ledger/general_ledger.py index d10b3d902b..15fd299022 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.py +++ b/erpnext/accounts/report/general_ledger/general_ledger.py @@ -25,6 +25,9 @@ def execute(filters=None): return columns, res def validate_filters(filters, account_details): + if not filters.get('company'): + frappe.throw(_('{0} is mandatory').format(_('Company'))) + if filters.get("account") and not account_details.get(filters.account): frappe.throw(_("Account {0} does not exists").format(filters.account)) @@ -87,7 +90,7 @@ def get_columns(filters): columns += [ _("Voucher Type") + "::120", _("Voucher No") + ":Dynamic Link/"+_("Voucher Type")+":160", _("Against Account") + "::120", _("Party Type") + "::80", _("Party") + "::150", - _("Project") + ":Link/Project:100", _("Cost Center") + ":Link/Cost Center:100", + _("Project") + ":Link/Project:100", _("Cost Center") + ":Link/Cost Center:100", _("Remarks") + "::400" ] @@ -111,7 +114,7 @@ def get_gl_entries(filters): if filters.get("group_by_voucher") else "group by name" gl_entries = frappe.db.sql(""" - select + select posting_date, account, party_type, party, sum(debit) as debit, sum(credit) as credit, voucher_type, voucher_no, cost_center, project, diff --git a/erpnext/portal/doctype/homepage/homepage.json b/erpnext/portal/doctype/homepage/homepage.json index cbe58c7bf2..51d79553b0 100644 --- a/erpnext/portal/doctype/homepage/homepage.json +++ b/erpnext/portal/doctype/homepage/homepage.json @@ -9,6 +9,7 @@ "docstatus": 0, "doctype": "DocType", "document_type": "Setup", + "editable_grid": 0, "fields": [ { "allow_on_submit": 0, @@ -36,6 +37,31 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "title", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "TItle", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -145,13 +171,14 @@ "hide_heading": 0, "hide_toolbar": 0, "idx": 0, + "image_view": 0, "in_create": 0, "in_dialog": 0, "is_submittable": 0, "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2016-05-12 14:19:41.689519", + "modified": "2016-08-09 05:01:30.287861", "modified_by": "Administrator", "module": "Portal", "name": "Homepage", diff --git a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json index f3f9ce98a6..870c8b194a 100644 --- a/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json +++ b/erpnext/portal/doctype/homepage_featured_product/homepage_featured_product.json @@ -95,6 +95,31 @@ "unique": 0, "width": "150" }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "fieldname": "view", + "fieldtype": "Button", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "View", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -260,7 +285,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-07-11 03:28:00.729983", + "modified": "2016-08-09 06:09:34.731971", "modified_by": "Administrator", "module": "Portal", "name": "Homepage Featured Product", diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js index 55d3296566..0013fdb64b 100644 --- a/erpnext/public/js/setup_wizard.js +++ b/erpnext/public/js/setup_wizard.js @@ -311,6 +311,8 @@ function load_erpnext_slides() { slide.fields.push({fieldtype: "Section Break"}); slide.fields.push({fieldtype: "Check", fieldname: "add_sample_data", label: __("Add a few sample records"), "default": 1}); + slide.fields.push({fieldtype: "Check", fieldname: "setup_website", + label: __("Setup a simple website for my organization"), "default": 1}); }, css_class: "two-column" }, diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py index 97ca7a3fc9..c9679bd9a0 100644 --- a/erpnext/setup/setup_wizard/setup_wizard.py +++ b/erpnext/setup/setup_wizard/setup_wizard.py @@ -41,7 +41,9 @@ def setup_complete(args=None): create_instructor(args) create_room(args) - website_maker(args) + if args.get('setup_website'): + website_maker(args) + create_logo(args) frappe.local.message_log = [] diff --git a/erpnext/templates/pages/home.py b/erpnext/templates/pages/home.py index 00cd3a9aae..9a4c89c812 100644 --- a/erpnext/templates/pages/home.py +++ b/erpnext/templates/pages/home.py @@ -15,6 +15,8 @@ def get_context(context): if route: item.route = '/' + route + context.title = homepage.title or homepage.company + # show atleast 3 products if len(homepage.products) < 3: for i in xrange(3 - len(homepage.products)): @@ -24,6 +26,4 @@ def get_context(context): 'route': '#' }) - return { - 'homepage': homepage - } + context.homepage = homepage diff --git a/erpnext/tests/test_client.py b/erpnext/tests/test_client.py index 153ce751d4..bf8834145f 100644 --- a/erpnext/tests/test_client.py +++ b/erpnext/tests/test_client.py @@ -6,7 +6,7 @@ import unittest, frappe from frappe.utils import sel from frappe.utils import formatdate -selenium_tests = True +#selenium_tests = True # class TestLogin(unittest.TestCase): # def setUp(self): From f44b5152d2d36d51aaf0ca2fdfbcf01e94281554 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 9 Aug 2016 17:07:59 +0530 Subject: [PATCH 07/12] Portal settings for schools --- erpnext/hooks.py | 2 +- erpnext/patches.txt | 1 + .../patches/v7_0/migrate_schools_to_erpnext.py | 13 ++++--------- .../v7_0/rename_examination_to_assessment.py | 3 ++- erpnext/patches/v7_0/set_portal_settings.py | 18 ++++++++++++++++++ 5 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 erpnext/patches/v7_0/set_portal_settings.py diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 566a98ba83..c1cee0c3a4 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -101,7 +101,7 @@ portal_menu_items = [ {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"}, {"title": _("Announcements"), "route": "/announcement", "reference_doctype": "Announcement"}, {"title": _("Courses"), "route": "/course", "reference_doctype": "Course"}, - {"title": _("Assessment Schedule"), "route": "/Assessment", "reference_doctype": "Assessment"}, + {"title": _("Assessment Schedule"), "route": "/assessment", "reference_doctype": "Assessment"}, {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees"} ] diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 00f4095ecd..fd1fc74e91 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -308,5 +308,6 @@ erpnext.patches.v7_0.make_guardian erpnext.patches.v7_0.update_refdoc_in_landed_cost_voucher erpnext.patches.v7_0.set_material_request_type_in_item erpnext.patches.v7_0.rename_examination_to_assessment +erpnext.patches.v7_0.set_portal_settings erpnext.patches.v7_0.repost_future_gle_for_purchase_invoice erpnext.patches.v7_0.fix_duplicate_icons \ No newline at end of file diff --git a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py index 04c65fa0ec..2376cc4661 100644 --- a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py +++ b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals import frappe -from erpnext.setup.setup_wizard import domainify def execute(): reload_doctypes_for_schools_icons() @@ -10,7 +9,6 @@ def execute(): frappe.reload_doc('buying', 'doctype', 'request_for_quotation') if 'schools' in frappe.get_installed_apps(): - frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu() frappe.db.sql("""delete from `tabDesktop Icon`""") if not frappe.db.exists('Module Def', 'Schools'): frappe.get_doc({ @@ -21,12 +19,9 @@ def execute(): frappe.db.sql("""update `tabDocType` set module='Schools' where module='Academics'""") from frappe.installer import remove_from_installed_apps remove_from_installed_apps("schools") - domainify.setup_domain('Education') - else: - frappe.get_doc('Portal Settings', 'Portal Settings').sync_menu() - domainify.setup_sidebar_items(domainify.get_domain('Manufacturing')) def reload_doctypes_for_schools_icons(): - for name in ('student', 'student_group', 'course_schedule', 'student_attendance', 'room', 'program_enrollment', - 'course', 'program', 'student_applicant', 'examination', 'fees', 'instructor', 'announcement'): - frappe.reload_doc('schools', 'doctype', name) + for name in ('student', 'student_group', 'course_schedule', 'student_attendance', 'room', + 'program_enrollment', 'course', 'program', 'student_applicant', 'fees', + 'instructor', 'announcement'): + frappe.reload_doc('schools', 'doctype', name) diff --git a/erpnext/patches/v7_0/rename_examination_to_assessment.py b/erpnext/patches/v7_0/rename_examination_to_assessment.py index 31c8aedc4f..3c79c51763 100644 --- a/erpnext/patches/v7_0/rename_examination_to_assessment.py +++ b/erpnext/patches/v7_0/rename_examination_to_assessment.py @@ -12,4 +12,5 @@ def execute(): frappe.reload_doctype("Assessment") rename_field("Assessment", "exam_name", "assessment_name") rename_field("Assessment", "exam_code", "assessment_code") - \ No newline at end of file + + frappe.db.sql("delete from `tabPortal Menu Item` where route = '/examination'") \ No newline at end of file diff --git a/erpnext/patches/v7_0/set_portal_settings.py b/erpnext/patches/v7_0/set_portal_settings.py new file mode 100644 index 0000000000..3e3b7299a7 --- /dev/null +++ b/erpnext/patches/v7_0/set_portal_settings.py @@ -0,0 +1,18 @@ +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals + +import frappe +from erpnext.setup.setup_wizard import domainify + +def execute(): + for dt in ("assessment", "announcement", "course", "fees"): + frappe.reload_doc("schools", "doctype", dt) + + frappe.get_doc('Portal Settings').sync_menu() + + if 'schools' in frappe.get_installed_apps(): + domainify.setup_domain('Education') + else: + domainify.setup_sidebar_items(domainify.get_domain('Manufacturing')) \ No newline at end of file From 5bbc68df8b7216868ecff5fc418f10cbc3113173 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Wed, 10 Aug 2016 11:06:31 +0530 Subject: [PATCH 08/12] [fix] Issue #6046 group_name replaced with name --- erpnext/schools/doctype/course/course.py | 6 +++--- erpnext/templates/includes/course/course_row.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/schools/doctype/course/course.py b/erpnext/schools/doctype/course/course.py index beeb6ec39c..b590acb52a 100644 --- a/erpnext/schools/doctype/course/course.py +++ b/erpnext/schools/doctype/course/course.py @@ -14,9 +14,9 @@ def get_sg_list(doctype, txt, filters, limit_start, limit_page_length=20): user = frappe.session.user student = frappe.db.sql("select name from `tabStudent` where student_email_id= %s", user) if student: - return frappe.db.sql('''select group_name, course, academic_term, academic_year, SG.name from `tabStudent Group` - as SG, `tabStudent Group Student` as SGS where SG.group_name = SGS.parent and SGS.student = %s - order by SG.group_name asc limit {0} , {1}'''.format(limit_start, limit_page_length), student, as_dict=True) + return frappe.db.sql('''select course, academic_term, academic_year, SG.name from `tabStudent Group` + as SG, `tabStudent Group Student` as SGS where SG.name = SGS.parent and SGS.student = %s + order by SG.name asc limit {0} , {1}'''.format(limit_start, limit_page_length), student, as_dict=True) def get_list_context(context=None): return { diff --git a/erpnext/templates/includes/course/course_row.html b/erpnext/templates/includes/course/course_row.html index 9b9317b60a..fddfc3c17a 100644 --- a/erpnext/templates/includes/course/course_row.html +++ b/erpnext/templates/includes/course/course_row.html @@ -5,7 +5,7 @@ {{ doc.course }}
- {{ doc.group_name }} + {{ doc.name }}
{{doc.academic_term }} From 70be24d6f0f65499bf65f3eaecde136d9bae75aa Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 8 Aug 2016 22:54:38 +0530 Subject: [PATCH 09/12] [Fix] Get account of the mode of payment on sales invoice and pos profile --- .../doctype/payment_entry/payment_entry.js | 17 +------- .../doctype/pos_profile/pos_profile.js | 2 + erpnext/public/js/controllers/accounts.js | 42 +++++++++++++++++++ 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index e2e8340a83..4578f308b3 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -1,5 +1,6 @@ // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt +{% include "erpnext/public/js/controllers/accounts.js" %} frappe.ui.form.on('Payment Entry', { onload: function(frm) { @@ -257,22 +258,6 @@ frappe.ui.form.on('Payment Entry', { } }, - mode_of_payment: function(frm) { - return frappe.call({ - method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account", - args: { - "mode_of_payment": frm.doc.mode_of_payment, - "company": frm.doc.company - }, - callback: function(r, rt) { - if(r.message) { - var payment_account_field = frm.doc.payment_type == "Receive" ? "paid_to" : "paid_from"; - frm.set_value(payment_account_field, r.message['account']); - } - } - }); - }, - paid_from: function(frm) { if(frm.set_party_account_based_on_party) return; diff --git a/erpnext/accounts/doctype/pos_profile/pos_profile.js b/erpnext/accounts/doctype/pos_profile/pos_profile.js index 99438a6a5f..c1aa0c3cb5 100755 --- a/erpnext/accounts/doctype/pos_profile/pos_profile.js +++ b/erpnext/accounts/doctype/pos_profile/pos_profile.js @@ -1,6 +1,8 @@ // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt +{% include "erpnext/public/js/controllers/accounts.js" %} + frappe.ui.form.on("POS Profile", "onload", function(frm) { frm.set_query("selling_price_list", function() { return { filters: { selling: 1 } }; diff --git a/erpnext/public/js/controllers/accounts.js b/erpnext/public/js/controllers/accounts.js index 202000fbe2..37ce5de6cf 100644 --- a/erpnext/public/js/controllers/accounts.js +++ b/erpnext/public/js/controllers/accounts.js @@ -55,6 +55,48 @@ frappe.ui.form.on(cur_frm.doctype, { } }); +frappe.ui.form.on('Sales Invoice Payment', { + mode_of_payment: function(frm, cdt, cdn) { + var d = locals[cdt][cdn]; + get_payment_mode_account(frm, d.mode_of_payment, function(account){ + frappe.model.set_value(cdt, cdn, 'account', account) + }) + } +}) + +frappe.ui.form.on('Purchase Invoice', { + mode_of_payment: function(frm) { + get_payment_mode_account(frm, frm.doc.mode_of_payment, function(account){ + frm.set_value('cash_bank_account', account); + }) + } +}) + +frappe.ui.form.on('Payment Entry', { + mode_of_payment: function(frm) { + get_payment_mode_account(frm, frm.doc.mode_of_payment, function(account){ + var payment_account_field = frm.doc.payment_type == "Receive" ? "paid_to" : "paid_from"; + frm.set_value(payment_account_field, account); + }) + } +}) + +get_payment_mode_account = function(frm, mode_of_payment, callback){ + return frappe.call({ + method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account", + args: { + "mode_of_payment": mode_of_payment, + "company": frm.doc.company + }, + callback: function(r, rt) { + if(r.message) { + callback(r.message.account) + } + } + }); +} + + cur_frm.cscript.account_head = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; if(!d.charge_type && d.account_head){ From 399a4bf2019ea84a843b40025efd4c0a3584a90b Mon Sep 17 00:00:00 2001 From: pawan mehta Date: Wed, 10 Aug 2016 13:17:50 +0530 Subject: [PATCH 10/12] [fix] #5723 --- .../purchase_invoice/purchase_invoice.json | 125 +++++++++--------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index b247e3ebfc..930f25f070 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -9,6 +9,7 @@ "docstatus": 0, "doctype": "DocType", "document_type": "Document", + "editable_grid": 0, "fields": [ { "allow_on_submit": 1, @@ -117,6 +118,33 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "description": "", + "fieldname": "bill_no", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Supplier Invoice No", + "length": 0, + "no_copy": 0, + "oldfieldname": "bill_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -142,6 +170,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "default": "0", + "fieldname": "is_return", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Is Return", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -198,19 +252,18 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "description": "", - "fieldname": "bill_no", - "fieldtype": "Data", + "fieldname": "bill_date", + "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Supplier Invoice No", + "label": "Supplier Invoice Date", "length": 0, "no_copy": 0, - "oldfieldname": "bill_no", - "oldfieldtype": "Data", + "oldfieldname": "bill_date", + "oldfieldtype": "Date", "permlevel": 0, "print_hide": 1, "print_hide_if_no_value": 0, @@ -225,17 +278,17 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "bill_date", + "fieldname": "due_date", "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Supplier Invoice Date", + "label": "Due Date", "length": 0, "no_copy": 0, - "oldfieldname": "bill_date", + "oldfieldname": "due_date", "oldfieldtype": "Date", "permlevel": 0, "print_hide": 1, @@ -299,32 +352,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "default": "0", - "fieldname": "is_return", - "fieldtype": "Check", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Is Return", - "length": 0, - "no_copy": 0, - "permlevel": 0, - "precision": "", - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -2497,32 +2524,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "fieldname": "due_date", - "fieldtype": "Date", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Due Date", - "length": 0, - "no_copy": 0, - "oldfieldname": "due_date", - "oldfieldtype": "Date", - "permlevel": 0, - "print_hide": 1, - "print_hide_if_no_value": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "set_only_once": 0, - "unique": 0 - }, { "allow_on_submit": 0, "bold": 0, @@ -3031,7 +3032,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-06-30 13:40:39.440648", + "modified": "2016-08-10 02:45:28.746569", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", From cc054a5bbcc2b8f318cd4c94d45dea633774fa5d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 10 Aug 2016 14:21:45 +0530 Subject: [PATCH 11/12] [minor] fix reload for school migrate patch --- erpnext/patches/v7_0/migrate_schools_to_erpnext.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py index 2376cc4661..c222da8485 100644 --- a/erpnext/patches/v7_0/migrate_schools_to_erpnext.py +++ b/erpnext/patches/v7_0/migrate_schools_to_erpnext.py @@ -21,7 +21,5 @@ def execute(): remove_from_installed_apps("schools") def reload_doctypes_for_schools_icons(): - for name in ('student', 'student_group', 'course_schedule', 'student_attendance', 'room', - 'program_enrollment', 'course', 'program', 'student_applicant', 'fees', - 'instructor', 'announcement'): - frappe.reload_doc('schools', 'doctype', name) + for d in frappe.get_all('DocType', filters={'module': 'Schools'}): + frappe.reload_doc('schools', 'doctype', d.name) From d908b99b004c4128b2077cd5907afc1f68e66e62 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 10 Aug 2016 15:04:39 +0600 Subject: [PATCH 12/12] bumped to version 7.0.24 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index f5b5ca359f..a16d792e61 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '7.0.23' +__version__ = '7.0.24' def get_default_company(user=None): '''Get default company for user'''