2014-03-07 17:06:02 +05:30
|
|
|
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
|
|
|
# License: GNU General Public License v3. See license.txt
|
|
|
|
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import frappe
|
|
|
|
|
|
|
|
def execute():
|
2014-03-11 17:57:38 +05:30
|
|
|
frappe.reload_doc("setup", 'doctype', "company")
|
|
|
|
frappe.reload_doc("accounts", 'doctype', "account")
|
2014-04-28 17:08:28 +05:30
|
|
|
|
|
|
|
frappe.db.sql("""update tabAccount set account_type='Cash'
|
2014-03-21 12:15:13 +05:30
|
|
|
where account_type='Bank or Cash' and account_name in ('Cash', 'Cash In Hand')""")
|
2014-04-28 17:08:28 +05:30
|
|
|
|
|
|
|
frappe.db.sql("""update tabAccount set account_type='Stock'
|
2014-03-25 18:28:49 +05:30
|
|
|
where account_name = 'Stock Assets'""")
|
2014-04-28 17:08:28 +05:30
|
|
|
|
2014-03-21 12:15:13 +05:30
|
|
|
ac_types = {"Fixed Asset Account": "Fixed Asset", "Bank or Cash": "Bank"}
|
2014-03-23 17:35:24 +05:30
|
|
|
for old, new in ac_types.items():
|
2014-04-28 17:08:28 +05:30
|
|
|
frappe.db.sql("""update tabAccount set account_type=%s
|
|
|
|
where account_type=%s""", (new, old))
|
2014-03-21 11:09:33 +05:30
|
|
|
|
2014-03-23 17:35:24 +05:30
|
|
|
try:
|
2014-04-28 17:08:28 +05:30
|
|
|
frappe.db.sql("""update `tabAccount` set report_type =
|
2014-03-23 17:35:24 +05:30
|
|
|
if(is_pl_account='Yes', 'Profit and Loss', 'Balance Sheet')""")
|
2014-04-28 17:08:28 +05:30
|
|
|
|
|
|
|
frappe.db.sql("""update `tabAccount` set balance_must_be=debit_or_credit
|
2014-03-23 17:35:24 +05:30
|
|
|
where ifnull(allow_negative_balance, 0) = 0""")
|
|
|
|
except:
|
2014-03-25 16:53:50 +05:30
|
|
|
pass
|