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