From b942cb86ae8f61f0a673ba1e95d5a273e28ee786 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 12 Jan 2015 12:18:54 +0530 Subject: [PATCH 1/7] [minor] auto-create Fiscal Year, loading, general ledger --- erpnext/accounts/doctype/fiscal_year/fiscal_year.py | 8 ++++---- .../accounts/report/general_ledger/general_ledger.js | 10 +++++----- erpnext/templates/includes/transactions.html | 4 +--- erpnext/templates/pages/addresses.html | 4 +--- erpnext/templates/pages/cart.html | 4 +--- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 45494980d6..3459918be5 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -35,7 +35,7 @@ class FiscalYear(Document): if (getdate(self.year_end_date) - getdate(self.year_start_date)).days > 366: frappe.throw(_("Fiscal Year Start Date and Fiscal Year End Date cannot be more than a year apart.")) - + check_duplicate_fiscal_year(self) @frappe.whitelist() @@ -60,7 +60,7 @@ def auto_create_fiscal_year(): start_year = new_fy.year_start_date[:4] end_year = new_fy.year_end_date[:4] new_fy.year = start_year if start_year==end_year else (start_year + "-" + end_year) - + new_fy.insert() - except: - pass \ No newline at end of file + except frappe.NameError: + pass diff --git a/erpnext/accounts/report/general_ledger/general_ledger.js b/erpnext/accounts/report/general_ledger/general_ledger.js index b4f283e08a..cae4cc5350 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.js +++ b/erpnext/accounts/report/general_ledger/general_ledger.js @@ -27,9 +27,6 @@ frappe.query_reports["General Ledger"] = { "reqd": 1, "width": "60px" }, - { - "fieldtype": "Break", - }, { "fieldname":"account", "label": __("Account"), @@ -38,7 +35,7 @@ frappe.query_reports["General Ledger"] = { "get_query": function() { var company = frappe.query_report.filters_by_name.company.get_value(); return { - "doctype": "Account", + "doctype": "Account", "filters": { "company": company, } @@ -50,6 +47,9 @@ frappe.query_reports["General Ledger"] = { "label": __("Voucher No"), "fieldtype": "Data", }, + { + "fieldtype": "Break", + }, { "fieldname":"group_by_voucher", "label": __("Group by Voucher"), @@ -62,4 +62,4 @@ frappe.query_reports["General Ledger"] = { "fieldtype": "Check", } ] -} \ No newline at end of file +} diff --git a/erpnext/templates/includes/transactions.html b/erpnext/templates/includes/transactions.html index b0eda195b0..fb570cd20b 100644 --- a/erpnext/templates/includes/transactions.html +++ b/erpnext/templates/includes/transactions.html @@ -6,9 +6,7 @@
-
-
-
+
{{ _("Loading") }}...
diff --git a/erpnext/templates/pages/addresses.html b/erpnext/templates/pages/addresses.html index 5cb56c03c9..997143a05f 100644 --- a/erpnext/templates/pages/addresses.html +++ b/erpnext/templates/pages/addresses.html @@ -9,9 +9,7 @@

New Address


-
-
-
+
{{ _("Loading") }}...
diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html index a8dc03e1ae..07e956027d 100644 --- a/erpnext/templates/pages/cart.html +++ b/erpnext/templates/pages/cart.html @@ -6,9 +6,7 @@ {% block content %}
-
-
-
+
{{ _("Loading") }}...

From f02e142d5d68e80e9cb5b540d36801468d97860a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 13 Jan 2015 18:41:40 +0530 Subject: [PATCH 2/7] [design] mobile --- .../sales_invoice/sales_invoice_list.js | 3 ++- erpnext/public/js/conf.js | 2 +- erpnext/templates/form_grid/item_grid.html | 23 ++++++++++++------- .../templates/form_grid/stock_entry_grid.html | 12 +++++----- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index 6f194760ae..efc3eb4597 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -14,5 +14,6 @@ frappe.listview_settings['Sales Invoice'] = { } else if (doc.outstanding_amount > 0 && doc.due_date <= frappe.datetime.get_today()) { return [__("Overdue"), "red", "oustanding_amount,>,0|due_date,<=,Today"] } - } + }, + right_column: "grand_total_export" }; diff --git a/erpnext/public/js/conf.js b/erpnext/public/js/conf.js index ac896b8edf..397c36bc6e 100644 --- a/erpnext/public/js/conf.js +++ b/erpnext/public/js/conf.js @@ -7,7 +7,7 @@ frappe.provide('erpnext'); $(document).bind('toolbar_setup', function() { frappe.app.name = "ERPNext"; - $('.navbar-brand').html('ERPNext'); + $('.navbar-brand').html(''); $('[data-link="docs"]').attr("href", "https://erpnext.com/user-guide") }); diff --git a/erpnext/templates/form_grid/item_grid.html b/erpnext/templates/form_grid/item_grid.html index 2803550484..939d8809e5 100644 --- a/erpnext/templates/form_grid/item_grid.html +++ b/erpnext/templates/form_grid/item_grid.html @@ -2,14 +2,14 @@ {% if(!doc) { %}
-
{%= __("Items") %}
-
{%= __("Qty") %}
-
{%= __("Rate") %}
-
{%= __("Amount") %}
+
{%= __("Items") %}
+ + +
{%= __("Amount") %}
{% } else { %}
-
{%= doc.item_code %} +
{%= doc.item_code %} {% if(doc.item_name != doc.item_code) { %}
{%= doc.item_name %}{% } %} {% if(doc.item_name != doc.description) { %} @@ -56,7 +56,7 @@
-
+ -
+ -
+
{% if (!frappe.perm.is_visible("amount", doc, frm.perm)) { %} {%= __("hidden") %} {% } else { %} @@ -102,6 +102,13 @@
  {% include "templates/form_grid/includes/progress.html" %} {% } %} + + {% if (frappe.perm.is_visible("rate", doc, frm.perm)) { %} +
+ {%= doc.get_formatted("qty") %} {%= doc.uom || doc.stock_uom %} + x {%= doc.get_formatted("rate") %} +
+ {% } %}
{% } %} diff --git a/erpnext/templates/form_grid/stock_entry_grid.html b/erpnext/templates/form_grid/stock_entry_grid.html index 9f913087c5..cf9b260f80 100644 --- a/erpnext/templates/form_grid/stock_entry_grid.html +++ b/erpnext/templates/form_grid/stock_entry_grid.html @@ -5,13 +5,13 @@ {% if(!doc) { %}
-
{%= __("Item") %}
-
{%= __("Qty") %}
-
{%= __("Amount") %}
+
{%= __("Item") %}
+
{%= __("Qty") %}
+
{%= __("Amount") %}
{% } else { %}
-
{%= doc.item_code %} +
{%= doc.item_code %} {% if(doc.item_name != doc.item_code) { %}
{%= doc.item_name %}{% } %} {% if(doc.item_name != doc.description) { %} @@ -31,13 +31,13 @@
-
+
{%= doc.get_formatted("qty") %}
{%= doc.uom || doc.stock_uom %}
-
+
{%= doc.get_formatted("amount") %}
{%= doc.get_formatted("incoming_rate") %} From 938ed1a57deb3935304a061be8e3579379252673 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 19 Jan 2015 16:20:26 +0530 Subject: [PATCH 3/7] [minor] fixed patch update_companywise_payment_account --- erpnext/patches/v5_0/update_companywise_payment_account.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v5_0/update_companywise_payment_account.py b/erpnext/patches/v5_0/update_companywise_payment_account.py index 71d755229b..0c1705f923 100644 --- a/erpnext/patches/v5_0/update_companywise_payment_account.py +++ b/erpnext/patches/v5_0/update_companywise_payment_account.py @@ -6,6 +6,7 @@ import frappe def execute(): frappe.reload_doc('accounts', 'doctype', 'mode_of_payment') + frappe.reload_doc('accounts', 'doctype', 'mode_of_payment_account') mode_of_payment_list = frappe.db.sql("""select name, default_account from `tabMode of Payment`""", as_dict=1) @@ -14,7 +15,7 @@ def execute(): if d.get("default_account"): parent_doc = frappe.get_doc("Mode of Payment", d.get("name")) - parent_doc.set("mode_of_payment_details", + parent_doc.set("accounts", [{"company": frappe.db.get_value("Account", d.get("default_account"), "company"), "default_account": d.get("default_account")}]) parent_doc.save() From 81e972eac4b0a2c6fbad6426cafc24b5cdaf1920 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 19 Jan 2015 17:34:33 +0530 Subject: [PATCH 4/7] [cleanups] --- .../in_indian_chart_template_schedule6.json | 349 ------------------ .../page/accounts_browser/accounts_browser.js | 2 +- erpnext/config/desktop.py | 8 - .../page/sales_browser/sales_browser.js | 10 +- .../setup/page/setup_wizard/setup_wizard.js | 11 +- .../setup/page/setup_wizard/setup_wizard.py | 2 + 6 files changed, 13 insertions(+), 369 deletions(-) delete mode 100644 erpnext/accounts/doctype/account/chart_of_accounts/in_indian_chart_template_schedule6.json diff --git a/erpnext/accounts/doctype/account/chart_of_accounts/in_indian_chart_template_schedule6.json b/erpnext/accounts/doctype/account/chart_of_accounts/in_indian_chart_template_schedule6.json deleted file mode 100644 index b450cad87d..0000000000 --- a/erpnext/accounts/doctype/account/chart_of_accounts/in_indian_chart_template_schedule6.json +++ /dev/null @@ -1,349 +0,0 @@ -{ - "country_code": "in", - "name": "Indian Chart of Accounts - Schedule VI", - "is_active": "Yes", - "tree": { - "Assets": { - "Current Assets": { - "Cash And Cash Equivalent": { - "Bank Balance": { - "Balance Account": {}, - "Balance Account 9876543211": {} - }, - "Cash-In-Hand": { - "Cash Balance": { - "account_type": "Cash" - }, - "Petty Cash Balance": { - "account_type": "Cash" - }, - "account_type": "Cash" - }, - "Cheques On Hand": { - "Cheque With Account": {} - } - }, - "Current Investment": { - "In Short Term Fixed Deposits": {}, - "Investment In Debentures And Bonds": {}, - "Investment In Equity": {}, - "Investment In Government Securities": {}, - "Investment In Mutual Fund": {}, - "Investment In Partnership Firm": {}, - "Investment In Preference Shares": {} - }, - "Inventories": { - "account_type": "Stock", - "group_or_ledger": "Group" - }, - "Other Current Assets": { - "Duties and Taxes": { - "Excise Duty Receivable": { - "Education Cess Receivable On Excise Duty": {}, - "Excise Duty Receivable": {}, - "Higher Education Cess Receivable On Excise Duty": {} - }, - "Sales Tax Receivable": {}, - "Service Tax Receivable": { - "Education Cess Receivable On Service Tax": {}, - "Higher Education Cess Receivable On Service Tax": {}, - "Service Tax Receivable": {} - }, - "TDS Receivable": {}, - "VAT Receivable": {} - }, - "Miscellaneous Expense to the Extent Not Written Off": { - "Preliminary Expense": {} - } - }, - "Short Terms Loans And Advances": { - "Advances with Revenue Authority": { - "Advance Income Tax/Refund Due": {}, - "Advance To Suppliers": {}, - "Balance With Revenue Authorities (Indirect Taxes)": {}, - "Prepaid Expenses": {} - }, - "Loans And Advances From Related Parties": { - "Doubtful": {}, - "Other Advances Unsecured and Considered as Good": { - "Unsecured Recoverable in Cash or in Kind or for Value to be Received": {} - }, - "Secured, Considered Good": { - "Advance To Associate Concerns": {} - } - } - }, - "Trade Recievables": { - "Others": { - "Doubtful": {}, - "Secured, Considered Good": {}, - "Unsecured, Considered Good": {} - }, - "Outstanding For More Than Six Months": { - "Doubtful": {}, - "Secured, Considered Good": {}, - "Unsecured, Considered Good": {} - }, - "Sundry Debtors": { - "account_type": "Receivable" - } - } - }, - "Non-Current Assets": { - "Deferred Tax Assets (Net)": {}, - "Fixed Assets": { - "Capital Work-In-Progress": { - "Building Under Construction": {} - }, - "Intangible Assets": { - "Goodwill": {} - }, - "Intangible Assets Under Development": {}, - "Tangible Assets": { - "Buildings": {}, - "Computer/Laptops": {}, - "Furnitures And Fixtures": {}, - "Land": {}, - "Office Equipments": {}, - "Plant And Equipments": {}, - "Vehicles": {} - } - }, - "Long Term Loans And Advances": { - "Capital Assets": { - "Doubtful": {}, - "Secured, Considered Good": {}, - "Unsecured, Considered Good": {} - }, - "Loans And Advances To Related Parties": {}, - "Other Loans And Advances": {}, - "Security Deposit": { - "Doubtful": {}, - "Secured, Considered Good": { - "Earnest Money Deposit": {}, - "Other Deposit": {} - }, - "Unsecured, Considered Good": {} - } - }, - "Non-Current Investments": { - "Investment In Debentures And Bonds": {}, - "Investment In Equity Instrument": {}, - "Investment In Government Or Trust Securities": {}, - "Investment In Mutual Fund": {}, - "Investment In Partnership Firm": {}, - "Investment In Preference Shares": {}, - "Investment In Property": {}, - "Other": { - "Fixed Deposit With Banks-Earmarked": {}, - "Gold": {} - } - }, - "Other Non Current Assets": { - "Long Term Trade Recievables": { - "Doubtful": {}, - "Secured, Considered Good": {}, - "Unsecured, Considered Good": {} - }, - "Miscellaneous Exps to the Extent Not Written Off": { - "Preliminery Expense": {}, - "Software": {} - }, - "Others": {} - } - }, - "root_type": "Asset" - }, - "Equity And Liabilities": { - "Current Liabilities": { - "Other Current Liabilities": { - "Advance From Customers": {}, - "Duties and Taxes": { - "Central Sales Tax Payable": {}, - "Excise Duty Payable": { - "Education Cess Payable On Excise Duty": {}, - "Excise Duty Payable": {}, - "Higher Education Cess Payable On Excise Duty": {} - }, - "Service Tax Payable": { - "Education Cess Payable On Service Tax": {}, - "Higher Education Cess Payable On Service Tax": {}, - "Service Tax Payable": {} - }, - "TDS Paybale": {}, - "VAT Payable": {} - }, - "Out Standing Cheques for Clearance": {} - }, - "Short Term Borrowings": { - "Depsoits": {}, - "Loans And Advances From Related Parties": {}, - "Others": {}, - "Secured Loans From Bank": { - "Bank Loan (Short Term)": {} - } - }, - "Short Term Provisions": { - "Other Provisions": { - "Electricity And Power Charges Payable": {}, - "Employee Providend Fund Payable": {}, - "Internet Expenses Payable": {}, - "Mobile Expenses Payable": {}, - "Provision For Expenses": {}, - "Provision For Taxation": {}, - "Secueity Expenses Payable": {}, - "Telephone Expenses Payable": {}, - "Wages Payable": {} - }, - "Provision For Employees Benefit": { - "EPF Payable": {}, - "Unpaid Remuneration": {} - } - }, - "Trade Payables": { - "Sundry Creditors For Material/Supplies": { - "account_type": "Payable" - }, - "Sundry Creditors For Services": { - "account_type": "Payable" - } - } - }, - "Non-Current Liabilities": { - "Deferred Tax Liabilities (Net)": {}, - "Long Term Borrowings": { - "Secured Loans From Bank": { - "Bank Loan (Long Term)": {} - }, - "Unsecured Loans": { - "From Others": {} - } - }, - "Long Term Provisions": {}, - "Other Long Term Liabilities": {} - }, - "Share Application Money Pending Allotment": { - "Share Application Money Pending Allotment": {} - }, - "Shareholder's Funds": { - "Money Received Against Share Warrants": {}, - "Reserve And Surplus": { - "Capital Redemption Reserve": {}, - "Capital Reserve": {}, - "Debenture Redeemption Reserve": {}, - "Other Reserve": {}, - "Revaluation Reserve": {}, - "Securities Premium Reserve": {}, - "Shares Option Outstanding Account": {}, - "Surplus (Profit and Loss Account)": {} - }, - "Share Capital": { - "Authorised Share Capital": {}, - "Issued, Subscribed And Paid Up Capital": {} - } - }, - "root_type": "Liability" - }, - "Total Expenses": { - "Changes In Inventories of Finished Goods, Work-In-Progress And Stock-In-Trade": {}, - "Cost of Materials Consumed": { - "Closing Stock": {}, - "Opening Stock": {}, - "Purchases of Raw Materials And Stores": { - "Raw Material": {}, - "Stores And Consumables": {} - } - }, - "Depreciation And Amortization Expense": { - "Depreciation": {}, - "Preliminary Expenses": {} - }, - "Employement Benefit Expenses": { - "Commision To Joint M.D": {}, - "Commision To M.D": {}, - "Directors Remuneration": {}, - "Directors Setting Fees": {}, - "Salaries, Bonus, PF And ESIC": {}, - "Staff Welfare Expense": {} - }, - "Financial Cost": { - "Bank Charges": {}, - "Bank Gurantee Charges": {}, - "Interest On Car Loan": {}, - "Interest On Cash Credit Facality": {}, - "Interest On Other Loans": {} - }, - "Other Expenses": { - "Administrative and Selling Expenses": { - "Advertisement And Publicity": {}, - "Annual Service Fees": {}, - "Auditors Remuneration": {}, - "Car Expenses (Including Insurance)": {}, - "Computer Maintenace": {}, - "Conveyance Expense": {}, - "Custom Duty": {}, - "Donation": {}, - "Excise/ Service Tax Expenses": {}, - "Export Expenses": {}, - "General Expenses": {}, - "Insurance Expenses": {}, - "Interest On Delayed Payment of Taxes": {}, - "Internal Audit Fee": {}, - "Internet And Website Expenses": {}, - "Labour Welfare Expenses": {}, - "Legal Expenses": {}, - "Loan Processing Fees": {}, - "Office Cleaning Expense": {}, - "Packing and Forwarding Expense": {}, - "Post and Courrier Charges": {}, - "Postage And Telegram": {}, - "Prelimenary Expense W/Off": {}, - "Professional Charges": {}, - "Rent Rates And Taxes": {}, - "Repair And Maintenance Building": {}, - "Security Expesnes": {}, - "Software Expense W/Off": {}, - "Stamping Charge": {}, - "Stationery Expenses": {}, - "Telephone Expense": {}, - "Tender Fee And Testing Charges": {}, - "Travelling Expenses (Including Foreign Travelling)": {} - }, - "Direct Expenses": { - "Centeral Sales Tax": {}, - "Electrical Repairing Expense": {}, - "Freight Forwarding and Octroi Expenses (Local)": {}, - "Jobwork Charges": {}, - "Machinery Repair and Maintenance": {}, - "Material Testing Expense": {}, - "Measuring Expense": {}, - "Packing Material Expense": {}, - "Power and Fuel Charges": {}, - "Processing Labour Charges": {}, - "Stores and Spares": {}, - "Workshop Expense": {} - } - }, - "Purchase of Stock-In-Trade": { - "Purchase of Stock-In-Trade": {} - }, - "root_type": "Expense" - }, - "Total Revenue": { - "Other Income": { - "Interest": {}, - "Other Financial Services": {}, - "Other Non Operating Income": {} - }, - "Revenue From Operations": { - "Central Sales(Exclusive of Excise Duty)": {}, - "Export Sales": {}, - "Job Work Receipts": {}, - "Other Operating Income": {}, - "Product Sales": {}, - "Sales of Services": {} - }, - "root_type": "Income" - } - } -} diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index efbb13a5dc..98fc58e73b 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -15,7 +15,7 @@ pscript['onload_Accounts Browser'] = function(wrapper){ frappe.add_breadcrumbs("Accounts"); - var main = $(wrapper).find(".layout-main"), + var main = wrapper.page.main, chart_area = $("
") .css({"margin-bottom": "15px", "min-height": "200px"}) .appendTo(main), diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py index 968473ed47..7d2a620f4e 100644 --- a/erpnext/config/desktop.py +++ b/erpnext/config/desktop.py @@ -56,13 +56,5 @@ def get_data(): "icon": "icon-phone", "icon": "octicon octicon-issue-opened", "type": "module" - }, - "Shopping Cart": { - "color": "#B7E090", - "icon": "icon-shopping-cart", - "icon": "octicon octicon-gift", - "label": _("Shopping Cart"), - "link": "Form/Shopping Cart Settings", - "type": "module" } } diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js index f716b84d7a..5ad60f1d5f 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.js +++ b/erpnext/selling/page/sales_browser/sales_browser.js @@ -21,12 +21,10 @@ pscript['onload_Sales Browser'] = function(wrapper){ callback: function(r) { var root = r.message[0]["value"]; erpnext.sales_chart = new erpnext.SalesChart(ctype, root, page, - $(wrapper) - .find(".layout-main-section") - .css({ - "min-height": "300px", - "padding-bottom": "25px" - })); + page.main.css({ + "min-height": "300px", + "padding-bottom": "25px" + })); } }); } diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.js b/erpnext/setup/page/setup_wizard/setup_wizard.js index 9a557c2a43..2ba6dd4a22 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.js +++ b/erpnext/setup/page/setup_wizard/setup_wizard.js @@ -43,7 +43,7 @@ frappe.pages['setup-wizard'].onload = function(wrapper) {

' + __('Sit tight while your system is being setup. This may take a few moments.') + '

' }, - complete_html: function() { return '

\ + complete_html: function() { return '

\

'+__('Setup Complete')+'

\

' + __('Your setup is complete. Refreshing...') + @@ -210,6 +210,8 @@ frappe.pages['setup-wizard'].onload = function(wrapper) { placeholder: __('e.g. "My Company LLC"')}, {fieldname:'company_abbr', label: __('Company Abbreviation'), fieldtype:'Data', description: __('Max 5 characters'), placeholder: __('e.g. "MC"'), reqd:1}, + {fieldname:'bank_account', label: __('Bank Account'), fieldtype:'Data', + placeholder: __('e.g. "XYZ National Bank"'), reqd:1 }, {fieldname:'fy_start_date', label:__('Financial Year Start Date'), fieldtype:'Date', description: __('Your financial year begins on'), reqd:1}, {fieldname:'fy_end_date', label:__('Financial Year End Date'), fieldtype:'Date', @@ -236,7 +238,7 @@ frappe.pages['setup-wizard'].onload = function(wrapper) { var year_end_date = frappe.datetime.add_days(frappe.datetime.add_months( frappe.datetime.user_to_obj(slide.get_input("fy_start_date").val()), 12), -1); - slide.get_field("fy_end_date").set_input(frappe.datetime.obj_to_user(year_end_date)); + slide.get_field("fy_end_date").set_input(year_end_date); }); } @@ -371,12 +373,11 @@ frappe.wiz.Wizard = Class.extend({ frappe.set_route(this.page_name, "0"); }, make: function() { - frappe.ui.set_user_background(null, "#page-setup-wizard"); this.parent = $('

').appendTo(this.parent); }, get_message: function(html) { - return $(repl('
\ -
%(html)s
\ + return $(repl('
\ +
%(html)s
\
', {html:html})) }, show_working: function() { diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index bf0793b894..d234f4fc3d 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -142,6 +142,8 @@ def create_fiscal_year_and_company(args): 'chart_of_accounts': args.get(('chart_of_accounts')), }).insert() + # Bank Account + args["curr_fiscal_year"] = curr_fiscal_year def create_price_lists(args): From 71a6b93d894b6bfdc170f196cf2a4339bdf7ac65 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 19 Jan 2015 17:35:05 +0530 Subject: [PATCH 5/7] [cleanups] --- erpnext/config/website.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 erpnext/config/website.py diff --git a/erpnext/config/website.py b/erpnext/config/website.py new file mode 100644 index 0000000000..45fad66db0 --- /dev/null +++ b/erpnext/config/website.py @@ -0,0 +1,18 @@ +from frappe import _ + +def get_data(): + return [ + { + "label": _("Shopping Cart"), + "icon": "icon-wrench", + "items": [ + { + "type": "doctype", + "name": "Shopping Cart Settings", + "label": _("Shopping Cart Settings"), + "description": _("Settings for online shopping cart such as shipping rules, price list etc."), + "hide_count": True + } + ] + } + ] From 0a3e5653baed4cf2ac8f781f44b4a28d60ebb48e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 19 Jan 2015 14:21:02 +0530 Subject: [PATCH 6/7] bank reconciliation fix --- .../bank_reconciliation.js | 17 ++ .../bank_reconciliation.json | 164 +++++++++--------- 2 files changed, 99 insertions(+), 82 deletions(-) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js index b4e8f1d90e..972eece1d9 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.js @@ -16,3 +16,20 @@ cur_frm.cscript.onload = function(doc, cdt, cdn){ }; }); } + +frappe.ui.form.on("Bank Reconciliation", "update_clearance_date", function(frm) { + return frappe.call({ + method: "update_details", + doc: frm.doc + }) +}) + +frappe.ui.form.on("Bank Reconciliation", "get_relevant_entries", function(frm) { + return frappe.call({ + method: "get_details", + doc: frm.doc, + callback: function(r, rt) { + frm.refresh() + } + }) +}) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json index 8e02873b77..c5a2a96a73 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json @@ -1,108 +1,108 @@ { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "creation": "2013-01-10 16:34:05", - "docstatus": 0, - "doctype": "DocType", + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "creation": "2013-01-10 16:34:05", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "description": "Select account head of the bank where cheque was deposited.", - "fieldname": "bank_account", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Bank Account", - "options": "Account", - "permlevel": 0, + "description": "Select account head of the bank where cheque was deposited.", + "fieldname": "bank_account", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Bank Account", + "options": "Account", + "permlevel": 0, "reqd": 1 - }, + }, { - "fieldname": "company", - "fieldtype": "Link", - "hidden": 1, - "in_list_view": 1, - "label": "Company", - "options": "Company", - "permlevel": 0, - "print_hide": 1, + "fieldname": "company", + "fieldtype": "Link", + "hidden": 1, + "in_list_view": 1, + "label": "Company", + "options": "Company", + "permlevel": 0, + "print_hide": 1, "reqd": 0 - }, + }, { - "fieldname": "from_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "From Date", - "permlevel": 0, + "fieldname": "from_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "From Date", + "permlevel": 0, "reqd": 1 - }, + }, { - "fieldname": "to_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "To Date", - "permlevel": 0, + "fieldname": "to_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "To Date", + "permlevel": 0, "reqd": 1 - }, + }, { - "fieldname": "include_reconciled_entries", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Include Reconciled Entries", + "fieldname": "include_reconciled_entries", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Include Reconciled Entries", "permlevel": 0 - }, + }, { - "fieldname": "get_relevant_entries", - "fieldtype": "Button", - "label": "Get Relevant Entries", - "options": "get_details", + "fieldname": "get_relevant_entries", + "fieldtype": "Button", + "label": "Get Relevant Entries", + "options": "", "permlevel": 0 - }, + }, { - "fieldname": "journal_entries", - "fieldtype": "Table", - "label": "Journal Entries", - "options": "Bank Reconciliation Detail", + "fieldname": "journal_entries", + "fieldtype": "Table", + "label": "Journal Entries", + "options": "Bank Reconciliation Detail", "permlevel": 0 - }, + }, { - "fieldname": "update_clearance_date", - "fieldtype": "Button", - "label": "Update Clearance Date", - "options": "update_details", + "fieldname": "update_clearance_date", + "fieldtype": "Button", + "label": "Update Clearance Date", + "options": "", "permlevel": 0 - }, + }, { - "fieldname": "total_amount", - "fieldtype": "Currency", - "label": "Total Amount", - "options": "Company:company:default_currency", - "permlevel": 0, + "fieldname": "total_amount", + "fieldtype": "Currency", + "label": "Total Amount", + "options": "Company:company:default_currency", + "permlevel": 0, "read_only": 1 } - ], - "hide_heading": 1, - "hide_toolbar": 1, - "icon": "icon-check", - "idx": 1, - "issingle": 1, - "modified": "2014-12-25 13:16:16.711609", - "modified_by": "Administrator", - "module": "Accounts", - "name": "Bank Reconciliation", - "owner": "Administrator", + ], + "hide_heading": 1, + "hide_toolbar": 1, + "icon": "icon-check", + "idx": 1, + "issingle": 1, + "modified": "2015-01-19 07:49:15.830001", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Reconciliation", + "owner": "Administrator", "permissions": [ { - "amend": 0, - "apply_user_permissions": 0, - "cancel": 0, - "create": 1, - "permlevel": 0, - "read": 1, - "report": 0, - "role": "Accounts User", - "submit": 0, + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "Accounts User", + "submit": 0, "write": 1 } - ], + ], "read_only": 1 -} +} \ No newline at end of file From 963393409e94bc54fdee509b83f417a8aa15170f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Jan 2015 17:22:11 +0530 Subject: [PATCH 7/7] minor fix: child table length --- .../doctype/purchase_invoice/purchase_invoice.js | 2 +- .../doctype/purchase_common/purchase_common.js | 12 ++++++------ erpnext/public/js/transaction.js | 16 ++++++++-------- erpnext/selling/sales_common.js | 14 +++++++------- .../landed_cost_voucher/landed_cost_voucher.js | 6 +++--- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index c2632bf441..95bfad57c1 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -109,7 +109,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ }, on_submit: function() { - $.each(this.frm.doc["items"], function(i, row) { + $.each(this.frm.doc["items"] || [], function(i, row) { if(row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt) }) } diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 1651e15e84..544a17ad6d 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -154,7 +154,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ project_name: function(doc, cdt, cdn) { var item = frappe.get_doc(cdt, cdn); if(item.project_name) { - $.each(this.frm.doc["items"], + $.each(this.frm.doc["items"] || [], function(i, other_item) { if(!other_item.project_name) { other_item.project_name = item.project_name; @@ -180,7 +180,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ calculate_item_values: function() { var me = this; - $.each(this.frm.doc["items"], function(i, item) { + $.each(this.frm.doc["items"] || [], function(i, item) { frappe.model.round_floats_in(item); item.amount = flt(item.rate * item.qty, precision("amount", item)); item.item_tax_amount = 0.0; @@ -196,7 +196,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ var me = this; this.frm.doc.net_total = this.frm.doc.net_total_import = 0.0; - $.each(this.frm.doc["items"], function(i, item) { + $.each(this.frm.doc["items"] || [], function(i, item) { me.frm.doc.net_total += item.base_amount; me.frm.doc.net_total_import += item.amount; }); @@ -205,7 +205,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ }, calculate_totals: function() { - var tax_count = this.frm.doc["taxes"].length; + var tax_count = this.frm.doc["taxes"] ? this.frm.doc["taxes"].length : 0; this.frm.doc.grand_total = flt(tax_count ? this.frm.doc["taxes"][tax_count - 1].total : this.frm.doc.net_total); this.frm.doc.grand_total_import = flt(tax_count ? @@ -255,7 +255,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ if(this.frm.doc["items"].length) { if(!frappe.meta.get_docfield(this.frm.doc["items"][0].doctype, "item_tax_amount", this.frm.doctype)) { - $.each(this.frm.doc["items"], function(i, item) { + $.each(this.frm.doc["items"] || [], function(i, item) { delete item["item_tax_amount"]; }); } @@ -263,7 +263,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ if(this.frm.doc["taxes"].length) { if(!frappe.meta.get_docfield(this.frm.doc["taxes"][0].doctype, "tax_amount_after_discount_amount", this.frm.doctype)) { - $.each(this.frm.doc["taxes"], function(i, tax) { + $.each(this.frm.doc["taxes"] || [], function(i, tax) { delete tax["tax_amount_after_discount_amount"]; }); } diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index e5fef9ce12..f202fb74a9 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -363,7 +363,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ if (item) { append_item(item); } else { - $.each(this.frm.doc["items"], function(i, d) { + $.each(this.frm.doc["items"] || [], function(i, d) { append_item(d); }); } @@ -478,7 +478,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ var tax_accounts = []; var company_currency = this.get_company_currency(); - $.each(this.frm.doc["taxes"], function(i, tax) { + $.each(this.frm.doc["taxes"] || [], function(i, tax) { var tax_amount_precision = precision("tax_amount", tax); var tax_rate_precision = precision("rate", tax); $.each(JSON.parse(tax.item_wise_tax_detail || '{}'), @@ -507,7 +507,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ var distinct_item_names = []; var distinct_items = []; - $.each(this.frm.doc["items"], function(i, item) { + $.each(this.frm.doc["items"] || [], function(i, item) { if(distinct_item_names.indexOf(item.item_code || item.item_name)===-1) { distinct_item_names.push(item.item_code || item.item_name); distinct_items.push(item); @@ -592,7 +592,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ initialize_taxes: function() { var me = this; - $.each(this.frm.doc["taxes"], function(i, tax) { + $.each(this.frm.doc["taxes"] || [], function(i, tax) { tax.item_wise_tax_detail = {}; tax_fields = ["total", "tax_amount_after_discount_amount", "tax_amount_for_current_item", "grand_total_for_current_item", @@ -614,16 +614,16 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ var actual_tax_dict = {}; // maintain actual tax rate based on idx - $.each(this.frm.doc["taxes"], function(i, tax) { + $.each(this.frm.doc["taxes"] || [], function(i, tax) { if (tax.charge_type == "Actual") { actual_tax_dict[tax.idx] = flt(tax.rate, precision("tax_amount", tax)); } }); - $.each(this.frm.doc["items"], function(n, item) { + $.each(this.frm.doc["items"] || [], function(n, item) { var item_tax_map = me._load_item_tax_rate(item.item_tax_rate); - $.each(me.frm.doc["taxes"], function(i, tax) { + $.each(me.frm.doc["taxes"] || [], function(i, tax) { // tax_amount represents the amount of tax for the current step var current_tax_amount = me.get_current_tax_amount(item, tax, item_tax_map); @@ -726,7 +726,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ }, _cleanup: function() { - $.each(this.frm.doc["taxes"], function(i, tax) { + $.each(this.frm.doc["taxes"] || [], function(i, tax) { $.each(["tax_amount_for_current_item", "grand_total_for_current_item", "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"], function(i, fieldname) { delete tax[fieldname]; }); diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 48c378fb82..3c048743ad 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -248,7 +248,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ var me = this; if (!this.discount_amount_applied) { - $.each(this.frm.doc["items"], function(i, item) { + $.each(this.frm.doc["items"] || [], function(i, item) { frappe.model.round_floats_in(item); item.amount = flt(item.rate * item.qty, precision("amount", item)); @@ -261,11 +261,11 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ determine_exclusive_rate: function() { var me = this; - $.each(me.frm.doc["items"], function(n, item) { + $.each(me.frm.doc["items"] || [], function(n, item) { var item_tax_map = me._load_item_tax_rate(item.item_tax_rate); var cumulated_tax_fraction = 0.0; - $.each(me.frm.doc["taxes"], function(i, tax) { + $.each(me.frm.doc["taxes"] || [], function(i, tax) { tax.tax_fraction_for_current_item = me.get_current_tax_fraction(tax, item_tax_map); if(i==0) { @@ -325,7 +325,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ var me = this; this.frm.doc.net_total = this.frm.doc.net_total_export = 0.0; - $.each(this.frm.doc["items"], function(i, item) { + $.each(this.frm.doc["items"] || [], function(i, item) { me.frm.doc.net_total += item.base_amount; me.frm.doc.net_total_export += item.amount; }); @@ -335,7 +335,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ calculate_totals: function() { var me = this; - var tax_count = this.frm.doc["taxes"].length; + var tax_count = this.frm.doc["taxes"] ? this.frm.doc["taxes"].length: 0; this.frm.doc.grand_total = flt(tax_count ? this.frm.doc["taxes"][tax_count - 1].total : this.frm.doc.net_total); this.frm.doc.grand_total_export = flt(this.frm.doc.grand_total / this.frm.doc.conversion_rate); @@ -364,7 +364,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ var grand_total_for_discount_amount = this.get_grand_total_for_discount_amount(); // calculate item amount after Discount Amount if (grand_total_for_discount_amount) { - $.each(this.frm.doc["items"], function(i, item) { + $.each(this.frm.doc["items"] || [], function(i, item) { distributed_amount = flt(me.frm.doc.base_discount_amount) * item.base_amount / grand_total_for_discount_amount; item.base_amount = flt(item.base_amount - distributed_amount, precision("base_amount", item)); }); @@ -382,7 +382,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ var total_actual_tax = 0.0; var actual_taxes_dict = {}; - $.each(this.frm.doc["taxes"], function(i, tax) { + $.each(this.frm.doc["taxes"] || [], function(i, tax) { if (tax.charge_type == "Actual") actual_taxes_dict[tax.idx] = tax.tax_amount; else if (actual_taxes_dict[tax.row_id] !== null) { diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js index e29dde0bad..6cc68e7548 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js +++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js @@ -73,7 +73,7 @@ erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({ set_total_taxes_and_charges: function() { total_taxes_and_charges = 0.0; - $.each(this.frm.doc.taxes, function(i, d) { + $.each(this.frm.doc.taxes || [], function(i, d) { total_taxes_and_charges += flt(d.amount) }); cur_frm.set_value("total_taxes_and_charges", total_taxes_and_charges); @@ -83,11 +83,11 @@ erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({ var me = this; if(this.frm.doc.taxes.length) { var total_item_cost = 0.0; - $.each(this.frm.doc.items, function(i, d) { + $.each(this.frm.doc.items || [], function(i, d) { total_item_cost += flt(d.amount) }); - $.each(this.frm.doc.items, function(i, item) { + $.each(this.frm.doc.items || [], function(i, item) { item.applicable_charges = flt(item.amount) * flt(me.frm.doc.total_taxes_and_charges) / flt(total_item_cost) }); refresh_field("items");