[wip] GST for India. Pending reports

This commit is contained in:
Rushabh Mehta
2017-06-21 17:22:38 +05:30
parent 2cb598f644
commit b3c8f44b3e
27 changed files with 51050 additions and 105 deletions

View File

@@ -17,6 +17,8 @@ frappe.ui.form.on("Company", {
if(!frm.doc.__islocal) {
frappe.contacts.render_address_and_contact(frm);
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Company'}
frm.toggle_enable("default_currency", (frm.doc.__onload &&
!frm.doc.__onload.transactions_exist));
@@ -34,7 +36,7 @@ frappe.ui.form.on("Company", {
},
onload_post_render: function(frm) {
if(frm.get_field("delete_company_transactions").$input)
if(frm.get_field("delete_company_transactions").$input)
frm.get_field("delete_company_transactions").$input.addClass("btn-danger");
},
country: function(frm) {
@@ -144,7 +146,7 @@ erpnext.company.setup_queries = function(frm) {
["round_off_account", {"root_type": "Expense"}],
["write_off_account", {"root_type": "Expense"}],
["exchange_gain_loss_account", {"root_type": "Expense"}],
["accumulated_depreciation_account",
["accumulated_depreciation_account",
{"root_type": "Asset", "account_type": "Accumulated Depreciation"}],
["depreciation_expense_account", {"root_type": "Expense", "account_type": "Depreciation"}],
["disposal_account", {"report_type": "Profit and Loss"}],
@@ -158,11 +160,11 @@ erpnext.company.setup_queries = function(frm) {
if (frm.doc.enable_perpetual_inventory) {
$.each([
["stock_adjustment_account",
["stock_adjustment_account",
{"root_type": "Expense", "account_type": "Stock Adjustment"}],
["expenses_included_in_valuation",
["expenses_included_in_valuation",
{"root_type": "Expense", "account_type": "Expenses Included in Valuation"}],
["stock_received_but_not_billed",
["stock_received_but_not_billed",
{"root_type": "Liability", "account_type": "Stock Received But Not Billed"}]
], function(i, v) {
erpnext.company.set_custom_query(frm, v);

View File

@@ -51,10 +51,10 @@ class Company(Document):
frappe.throw(_("Abbreviation already used for another company"))
def validate_default_accounts(self):
for field in ["default_bank_account", "default_cash_account",
"default_receivable_account", "default_payable_account",
"default_expense_account", "default_income_account",
"stock_received_but_not_billed", "stock_adjustment_account",
for field in ["default_bank_account", "default_cash_account",
"default_receivable_account", "default_payable_account",
"default_expense_account", "default_income_account",
"stock_received_but_not_billed", "stock_adjustment_account",
"expenses_included_in_valuation", "default_payroll_payable_account"]:
if self.get(field):
for_company = frappe.db.get_value("Account", self.get(field), "company")
@@ -96,9 +96,9 @@ class Company(Document):
frappe.clear_cache()
def install_country_fixtures(self):
path = os.path.join(os.path.dirname(__file__), "fixtures", self.country.lower())
path = frappe.get_app_path('erpnext', 'regional', frappe.scrub(self.country))
if os.path.exists(path.encode("utf-8")):
frappe.get_attr("erpnext.setup.doctype.company.fixtures.{0}.install"
frappe.get_attr("erpnext.regional.{0}.install.install"
.format(self.country.lower()))(self)
def create_default_warehouses(self):

View File

@@ -1,24 +0,0 @@
# 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
def install(company):
docs = [
{'doctype': 'Salary Component', 'salary_component': 'Professional Tax', 'description': 'Professional Tax', 'type': 'Deduction'},
{'doctype': 'Salary Component', 'salary_component': 'Provident Fund', 'description': 'Provident fund', 'type': 'Deduction'},
{'doctype': 'Salary Component', 'salary_component': 'House Rent Allowance', 'description': 'House Rent Allowance', 'type': 'Earning'},
{'doctype': 'Salary Component', 'salary_component': 'Basic', 'description': 'Basic', 'type': 'Earning'},
{'doctype': 'Salary Component', 'salary_component': 'Arrear', 'description': 'Arrear', 'type': 'Earning'},
{'doctype': 'Salary Component', 'salary_component': 'Leave Encashment', 'description': 'Leave Encashment', 'type': 'Earning'}
]
for d in docs:
try:
doc = frappe.get_doc(d)
doc.flags.ignore_permissions = True
doc.insert()
except frappe.NameError:
pass