2014-03-07 11:36:02 +00:00
|
|
|
# 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 12:27:38 +00:00
|
|
|
frappe.reload_doc("setup", 'doctype', "company")
|
|
|
|
frappe.reload_doc("accounts", 'doctype', "account")
|
|
|
|
|
2014-03-21 06:45:13 +00:00
|
|
|
frappe.db.sql("""update tabAccount set account_type='Cash'
|
|
|
|
where account_type='Bank or Cash' and account_name in ('Cash', 'Cash In Hand')""")
|
|
|
|
|
|
|
|
ac_types = {"Fixed Asset Account": "Fixed Asset", "Bank or Cash": "Bank"}
|
|
|
|
for old, new in ac_types.items:
|
|
|
|
frappe.db.sql("""update tabAccount set account_type=%s
|
|
|
|
where account_type=%s""", (new, old))
|
2014-03-21 05:39:33 +00:00
|
|
|
|
|
|
|
frappe.db.sql("""update `tabAccount` set report_type =
|
|
|
|
if(is_pl_account=='Yes', 'Profit and Loss', 'Balance Sheet')""")
|
2014-03-11 12:27:38 +00:00
|
|
|
|
|
|
|
frappe.db.sql("""update `tabAccount` set balance_must_be=debit_or_credit
|
|
|
|
where ifnull(allow_negative_balance, 0) = 0""")
|