From b1c5738a677fc982bbc700d2464b02e3a75aa55c Mon Sep 17 00:00:00 2001 From: nabinhait Date: Sat, 19 Jul 2014 16:53:45 +0530 Subject: [PATCH 1/3] Fixes overflow tolerance --- erpnext/controllers/status_updater.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 3c6355488f..7a4a30004b 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -152,7 +152,7 @@ class StatusUpdater(Document): overflow_percent = ((item[args['target_field']] - item[args['target_ref_field']]) / item[args['target_ref_field']]) * 100 - + print overflow_percent - tolerance if overflow_percent - tolerance > 0.01: item['max_allowed'] = flt(item[args['target_ref_field']] * (100+tolerance)/100) item['reduce_by'] = item[args['target_field']] - item['max_allowed'] @@ -266,8 +266,7 @@ def get_tolerance_for(item_code, item_tolerance={}, global_tolerance=None): if not tolerance: if global_tolerance == None: - global_tolerance = flt(frappe.db.get_value('Global Defaults', None, - 'tolerance')) + global_tolerance = flt(frappe.db.get_value('Stock Settings', None, 'tolerance')) tolerance = global_tolerance item_tolerance[item_code] = tolerance From 711e8bec3df43c2893fb2ba4f88d621ea2475fb1 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Sat, 19 Jul 2014 17:00:15 +0530 Subject: [PATCH 2/3] Fixes overflow tolerance --- erpnext/controllers/status_updater.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 7a4a30004b..6a2dce00fc 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -152,7 +152,7 @@ class StatusUpdater(Document): overflow_percent = ((item[args['target_field']] - item[args['target_ref_field']]) / item[args['target_ref_field']]) * 100 - print overflow_percent - tolerance + if overflow_percent - tolerance > 0.01: item['max_allowed'] = flt(item[args['target_ref_field']] * (100+tolerance)/100) item['reduce_by'] = item[args['target_field']] - item['max_allowed'] From b1e7bf16bab7811fd82e718c28f2ff371e880986 Mon Sep 17 00:00:00 2001 From: nabinhait Date: Sat, 19 Jul 2014 17:56:43 +0530 Subject: [PATCH 3/3] Translate while creating India specific accounts --- .../company/fixtures/india/__init__.py | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/erpnext/setup/doctype/company/fixtures/india/__init__.py b/erpnext/setup/doctype/company/fixtures/india/__init__.py index fa45ab0364..d52b30402e 100644 --- a/erpnext/setup/doctype/company/fixtures/india/__init__.py +++ b/erpnext/setup/doctype/company/fixtures/india/__init__.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe +from frappe import _ def install(company): docs = [ @@ -27,44 +28,45 @@ def install(company): 'group_or_ledger': 2, 'account_type': 3, 'report_type': 4, - 'tax_rate': 5 + 'tax_rate': 5, + 'root_type': 6 } acc_list_india = [ - ['CENVAT Capital Goods','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Service Tax','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Service Tax Cess 1','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Service Tax Cess 2','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT Edu Cess','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['CENVAT SHE Cess','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['Excise Duty 4','Tax Assets','Ledger','Tax','Balance Sheet','4.00'], - ['Excise Duty 8','Tax Assets','Ledger','Tax','Balance Sheet','8.00'], - ['Excise Duty 10','Tax Assets','Ledger','Tax','Balance Sheet','10.00'], - ['Excise Duty 14','Tax Assets','Ledger','Tax','Balance Sheet','14.00'], - ['Excise Duty Edu Cess 2','Tax Assets','Ledger','Tax','Balance Sheet','2.00'], - ['Excise Duty SHE Cess 1','Tax Assets','Ledger','Tax','Balance Sheet','1.00'], - ['P L A','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['P L A - Cess Portion','Tax Assets','Ledger','Chargeable','Balance Sheet', None], - ['Edu. Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'], - ['Edu. Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'], - ['Edu. Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet','2.00'], - ['Excise Duty @ 4','Duties and Taxes','Ledger','Tax','Balance Sheet','4.00'], - ['Excise Duty @ 8','Duties and Taxes','Ledger','Tax','Balance Sheet','8.00'], - ['Excise Duty @ 10','Duties and Taxes','Ledger','Tax','Balance Sheet','10.00'], - ['Excise Duty @ 14','Duties and Taxes','Ledger','Tax','Balance Sheet','14.00'], - ['Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','10.3'], - ['SHE Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'], - ['SHE Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'], - ['SHE Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet','1.00'], - ['Professional Tax','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['VAT','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Advertisement)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Commission)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Contractor)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Interest)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Rent)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None], - ['TDS (Salary)','Duties and Taxes','Ledger','Chargeable','Balance Sheet', None] + [_('CENVAT Capital Goods'),_(_('Tax Assets')),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Service Tax'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Service Tax Cess 1'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Service Tax Cess 2'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT Edu Cess'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('CENVAT SHE Cess'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('Excise Duty 4'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','4.00', 'Asset'], + [_('Excise Duty 8'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','8.00', 'Asset'], + [_('Excise Duty 10'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','10.00', 'Asset'], + [_('Excise Duty 14'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','14.00', 'Asset'], + [_('Excise Duty Edu Cess 2'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','2.00', 'Asset'], + [_('Excise Duty SHE Cess 1'),_('Tax Assets'),'Ledger','Tax','Balance Sheet','1.00', 'Asset'], + [_('P L A'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('P L A - Cess Portion'),_('Tax Assets'),'Ledger','Chargeable','Balance Sheet', None, 'Asset'], + [_('Edu. Cess on Excise'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'], + [_('Edu. Cess on Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'], + [_('Edu. Cess on TDS'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','2.00', 'Liability'], + [_('Excise Duty @ 4'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','4.00', 'Liability'], + [_('Excise Duty @ 8'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','8.00', 'Liability'], + [_('Excise Duty @ 10'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','10.00', 'Liability'], + [_('Excise Duty @ 14'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','14.00', 'Liability'], + [_('Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','10.3', 'Liability'], + [_('SHE Cess on Excise'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'], + [_('SHE Cess on Service Tax'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'], + [_('SHE Cess on TDS'),_('Duties and Taxes'),'Ledger','Tax','Balance Sheet','1.00', 'Liability'], + [_('Professional Tax'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('VAT'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Advertisement)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Commission)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Contractor)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Interest)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Rent)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'], + [_('TDS (Salary)'),_('Duties and Taxes'),'Ledger','Chargeable','Balance Sheet', None, 'Liability'] ] for lst in acc_list_india: