From a43b29e4b1bbbbef6ac9d7a00c1a3aecbd38a632 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 20 Feb 2013 15:55:10 +0530 Subject: [PATCH 1/4] get label from doctype's doclist --- stock/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock/utils.py b/stock/utils.py index 62c2a1794f..3ab26ced1e 100644 --- a/stock/utils.py +++ b/stock/utils.py @@ -30,7 +30,7 @@ def validate_end_of_life(item_code, end_of_life=None, verbose=1): "in Item master") % { "item_code": item_code, "date": formatdate(end_of_life), - "end_of_life_label": webnotes.get_label("Item", "end_of_life") + "end_of_life_label": webnotes.get_doctype("Item").get_label("end_of_life") } _msgprint(msg, verbose) From 6f1a5ec209999eb363b7d432d11d6044642af7da Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 20 Feb 2013 16:25:05 +0530 Subject: [PATCH 2/4] Disable rounded total feature --- .../doctype/sales_invoice/sales_invoice.js | 1 + controllers/selling_controller.py | 12 +++++++++--- selling/doctype/quotation/quotation.js | 1 + selling/doctype/sales_common/sales_common.js | 18 ++++++++++++++---- selling/doctype/sales_order/sales_order.js | 2 ++ .../doctype/global_defaults/global_defaults.py | 3 ++- .../global_defaults/global_defaults.txt | 18 +++++++++++------- stock/doctype/delivery_note/delivery_note.js | 1 + 8 files changed, 41 insertions(+), 15 deletions(-) diff --git a/accounts/doctype/sales_invoice/sales_invoice.js b/accounts/doctype/sales_invoice/sales_invoice.js index 8df91a5cb4..a24e256ec9 100644 --- a/accounts/doctype/sales_invoice/sales_invoice.js +++ b/accounts/doctype/sales_invoice/sales_invoice.js @@ -29,6 +29,7 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js'); // On Load // ------- cur_frm.cscript.onload = function(doc,dt,dn) { + cur_frm.cscript.manage_rounded_total(); if(!doc.customer && doc.debit_to) wn.meta.get_docfield(dt, 'debit_to', dn).print_hide = 0; if (doc.__islocal) { if(!doc.due_date) set_multiple(dt,dn,{due_date:get_today()}); diff --git a/controllers/selling_controller.py b/controllers/selling_controller.py index 5ff5637baf..94a56e3300 100644 --- a/controllers/selling_controller.py +++ b/controllers/selling_controller.py @@ -16,6 +16,7 @@ from __future__ import unicode_literals import webnotes +from webnotes.utils import cint from setup.utils import get_company_currency from controllers.accounts_controller import AccountsController @@ -27,8 +28,13 @@ class SellingController(AccountsController): def set_total_in_words(self): from webnotes.utils import money_in_words company_currency = get_company_currency(self.doc.company) + + disable_rounded_total = cint(webnotes.conn.get_value("Global Defaults", None, + "disable_rounded_total")) + if self.meta.get_field("in_words"): - self.doc.in_words = money_in_words(self.doc.rounded_total, company_currency) + self.doc.in_words = money_in_words(disable_rounded_total and + self.doc.grand_total or self.doc.rounded_total, company_currency) if self.meta.get_field("in_words_export"): - self.doc.in_words_export = money_in_words(self.doc.rounded_total_export, - self.doc.currency) \ No newline at end of file + self.doc.in_words_export = money_in_words(disable_rounded_total and + self.doc.grand_total_export or self.doc.rounded_total_export, self.doc.currency) \ No newline at end of file diff --git a/selling/doctype/quotation/quotation.js b/selling/doctype/quotation/quotation.js index a4d8ee6b0e..cf7b515d08 100644 --- a/selling/doctype/quotation/quotation.js +++ b/selling/doctype/quotation/quotation.js @@ -28,6 +28,7 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js'); // ONLOAD // =================================================================================== cur_frm.cscript.onload = function(doc, cdt, cdn) { + cur_frm.cscript.manage_rounded_total(); if(!doc.quotation_to) hide_field(['customer','customer_address','contact_person','customer_name','lead', 'lead_name', 'address_display', 'contact_display', 'contact_mobile', 'contact_email', 'territory', 'customer_group']); if(!doc.price_list_name) set_multiple(cdt,cdn,{price_list_name:sys_defaults.price_list_name}); if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'}); diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js index 6a618c9a1a..867a711fe4 100644 --- a/selling/doctype/sales_common/sales_common.js +++ b/selling/doctype/sales_common/sales_common.js @@ -182,27 +182,37 @@ cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) { if (doc.plc_conversion_rate != 1) set_multiple(cdt, cdn, {plc_conversion_rate:1}) hide_field(['price_list_currency', 'plc_conversion_rate']); - } + } } if (r.message[1] == doc.currency) { if (doc.conversion_rate != 1) set_multiple(cdt, cdn, {conversion_rate:1}); hide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); - } else unhide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); - + } else { + unhide_field(['conversion_rate', 'grand_total_export', 'in_words_export']); + if(!cint(sys_defaults.disable_rounded_total)) + unhide_field("rounded_total_export"); + } if (r.message[1] == doc.price_list_currency) { if (doc.plc_conversion_rate != 1) set_multiple(cdt, cdn, {plc_conversion_rate:1}); hide_field('plc_conversion_rate'); } else unhide_field('plc_conversion_rate'); - cur_frm.cscript.dynamic_label(doc, cdt, cdn, r.message[1], callback1); } }) } } +cur_frm.cscript.manage_rounded_total = function() { + if(cint(sys_defaults.disable_rounded_total)) { + cur_frm.set_df_property("rounded_total", "print_hide", 1); + cur_frm.set_df_property("rounded_total_export", "print_hide", 1); + hide_field(["rounded_total", "rounded_total_export"]); + } +} + // TRIGGERS FOR CALCULATIONS // ===================================================================================================== diff --git a/selling/doctype/sales_order/sales_order.js b/selling/doctype/sales_order/sales_order.js index 55854b5b92..9b1df88f87 100644 --- a/selling/doctype/sales_order/sales_order.js +++ b/selling/doctype/sales_order/sales_order.js @@ -28,6 +28,8 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js'); cur_frm.cscript.onload = function(doc, cdt, cdn) { + cur_frm.cscript.manage_rounded_total(); + if(!doc.status) set_multiple(cdt,cdn,{status:'Draft'}); if(!doc.transaction_date) set_multiple(cdt,cdn,{transaction_date:get_today()}); if(!doc.price_list_currency) set_multiple(cdt, cdn, {price_list_currency: doc.currency, plc_conversion_rate: 1}); diff --git a/setup/doctype/global_defaults/global_defaults.py b/setup/doctype/global_defaults/global_defaults.py index 1b93e7e268..69961e88a7 100644 --- a/setup/doctype/global_defaults/global_defaults.py +++ b/setup/doctype/global_defaults/global_defaults.py @@ -40,7 +40,8 @@ keydict = { 'account_url':'account_url', 'allow_negative_stock' : 'allow_negative_stock', 'maintain_same_rate' : 'maintain_same_rate', - 'session_expiry': 'session_expiry' + 'session_expiry': 'session_expiry', + 'disable_rounded_total': 'disable_rounded_total', } class DocType: diff --git a/setup/doctype/global_defaults/global_defaults.txt b/setup/doctype/global_defaults/global_defaults.txt index 3344a87f46..68f6459170 100644 --- a/setup/doctype/global_defaults/global_defaults.txt +++ b/setup/doctype/global_defaults/global_defaults.txt @@ -1,8 +1,8 @@ [ { - "creation": "2013-01-29 19:25:56", + "creation": "2013-02-19 12:28:27", "docstatus": 0, - "modified": "2013-02-13 09:56:28", + "modified": "2013-02-20 14:08:59", "modified_by": "Administrator", "owner": "Administrator" }, @@ -27,6 +27,8 @@ "permlevel": 0 }, { + "amend": 0, + "cancel": 0, "create": 1, "doctype": "DocPerm", "name": "__common__", @@ -332,6 +334,13 @@ "label": "Delivery Note Required", "options": "No\nYes" }, + { + "description": "If disable, 'Rounded Total' field will not be visible in any transaction", + "doctype": "DocField", + "fieldname": "disable_rounded_total", + "fieldtype": "Check", + "label": "Disable Rounded Total" + }, { "doctype": "DocField", "fieldname": "buying", @@ -408,11 +417,6 @@ "fieldtype": "Data", "label": "SMS Sender Name" }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm" - }, { "doctype": "DocPerm" } diff --git a/stock/doctype/delivery_note/delivery_note.js b/stock/doctype/delivery_note/delivery_note.js index 09a7de2021..a8af1073fe 100644 --- a/stock/doctype/delivery_note/delivery_note.js +++ b/stock/doctype/delivery_note/delivery_note.js @@ -27,6 +27,7 @@ wn.require('app/utilities/doctype/sms_control/sms_control.js'); // ONLOAD // ================================================================================================ cur_frm.cscript.onload = function(doc, dt, dn) { + cur_frm.cscript.manage_rounded_total(); if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); if(!doc.transaction_date) set_multiple(dt,dn,{transaction_date:get_today()}); if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()}); From bd03b899b3a79a1f692217b28d1743e180db385c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 20 Feb 2013 17:03:51 +0530 Subject: [PATCH 3/4] updated latest_updates page --- home/page/latest_updates/latest_updates.js | 43 +++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/home/page/latest_updates/latest_updates.js b/home/page/latest_updates/latest_updates.js index 42408de3b7..dbb9f21838 100644 --- a/home/page/latest_updates/latest_updates.js +++ b/home/page/latest_updates/latest_updates.js @@ -1,4 +1,8 @@ erpnext.updates = [ + ["20th February, 2013", [ + "Disable Rounded Total: If disable in 'Global Defaults', Rounding related fields \ + in sales cycle transactions and in corresponding print formats will not be visible" + ]], ["15th February, 2013", [ "Calendar: Added new FullCalendar, and Calendar Views", "Leave Application: Added email notifications on Leave Application", @@ -7,29 +11,66 @@ erpnext.updates = [ "Employee: If Employee is linked to a Profile, copy Full Name, Date of Birth, \ Image and Gender to Profile", "Leave Application: Select Leave Approver by their Full Name", + "Fixes in C-Form", ]], + ["12th February, 2013", ["Fixes in Payment Reconciliation "]], ["6th February, 2013", [ "Bookmarks: Add bookmarks via toolbar by clicking on the sign.", + "Fixes in Voucher Import Tool", ]], ["5th February, 2013", [ + "Block Negative Account Balance: If enabled, system will not allow to post entry \ + if balance goes into negative", "Leave Block List: Block users from taking leave on certain days.", + "Added project column in 'To Be Delivered/Billed' report ", + ]], + ["4th February, 2013", [ + "Make gl entry only if amount is there", + "Fixes in Stock Ledger Report" ]], ["2nd February, 2013", [ "Warehouse: Added table Warehouse User to restrict Warehouse Entry per user.", + "Fixes in Gl Entry for Purchase Invoice", + ]], + ["1st February, 2013", [ + "Removed sales order pending items report", + "Fixes in Salary Register Report, Sales Invoice and Budget Control", + ]], + ["31st January, 2013", [ + "New Report: Purchase order items pending to be received", + "GL Mapper deprecated", ]], ["28st January, 2013", [ "List Views are now configurable: To set list views, check 'In List View' in Setup > Customize Form View in the fields table.", + "Fixes in Financial Statements and Features Setup", ]], - ["24st January, 2013", [ + ["25th January, 2013", [ + "Fixes for currency in all Modern/Classic/Spartan print formats", + "Stock Ageing Report: Added show zero values option" + ]], + ["24th January, 2013", [ + "Sales Analytics based on Sales Order/Delivery Note/Sales Invoice", "Integrated Languages in Profile and via browser settings. To set your language, click on your name in the toolbar then 'My Settings...'", + "Fixes in Recurring Invoice", + "Fixes for Territory link to Sales Browser ", + "Check item/item group with same name while creating item group/item", + ]], + ["22nd January, 2013", [ + "Valuation Rate mandatory for opening Stock Reconciliation", + "Show analytics value based on valuation method defined in item master", ]], ["21st January, 2013", [ "Number Formatting: Added Number Format to Global Defaults & Currency", ]], + ["20th January, 2013", [ + "In payment matching tool only show outstanding invoices" + ]], ["18th January, 2013", [ "Buying: Added Price List to purchase cycle", + "C-Form now submittable", ]], ["16th January, 2013", [ + "Incoming rate for sales return as per delivery note outgoing rate", "Job Applicant: Track Job Applicants and extract them from a mailbox like 'jobs@example.com'. See Jobs Email Settings.", "Extract leads: Extract Leads from a mailbox like 'sales@example.com'. See Sales Email Settings.", ]], From 67160d48fd695b914fafb628eed31429ec74a004 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 20 Feb 2013 19:11:54 +0530 Subject: [PATCH 4/4] allow importing leave allocation --- hr/doctype/leave_allocation/leave_allocation.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hr/doctype/leave_allocation/leave_allocation.txt b/hr/doctype/leave_allocation/leave_allocation.txt index 027a447b72..9027c843df 100644 --- a/hr/doctype/leave_allocation/leave_allocation.txt +++ b/hr/doctype/leave_allocation/leave_allocation.txt @@ -1,12 +1,13 @@ [ { - "creation": "2013-01-10 16:34:14", + "creation": "2013-02-20 19:10:38", "docstatus": 0, - "modified": "2013-01-22 14:56:04", + "modified": "2013-02-20 19:11:03", "modified_by": "Administrator", "owner": "Administrator" }, { + "allow_import": 1, "autoname": "LAL/.#####", "doctype": "DocType", "is_submittable": 1,