Compare commits
2 commits
4e569ed21c
...
83ae32aa70
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83ae32aa70 | ||
| abee8ac4c8 |
1 changed files with 121 additions and 0 deletions
|
|
@ -50,6 +50,7 @@ def after_migrate():
|
||||||
# create_tasks()
|
# create_tasks()
|
||||||
create_bid_meeting_note_form_templates()
|
create_bid_meeting_note_form_templates()
|
||||||
create_accounts()
|
create_accounts()
|
||||||
|
create_companies()
|
||||||
# init_stripe_accounts()
|
# init_stripe_accounts()
|
||||||
|
|
||||||
# update_address_fields()
|
# update_address_fields()
|
||||||
|
|
@ -847,6 +848,126 @@ def create_bid_meeting_note_form_templates():
|
||||||
|
|
||||||
doc.insert(ignore_permissions=True)
|
doc.insert(ignore_permissions=True)
|
||||||
|
|
||||||
|
|
||||||
|
def create_companies():
|
||||||
|
"""Create necessary companies if they do not exist."""
|
||||||
|
print("\n🔧 Checking for necessary companies...")
|
||||||
|
|
||||||
|
companies = [
|
||||||
|
{
|
||||||
|
'company_name': 'Veritas Stone',
|
||||||
|
'abbr': 'VS',
|
||||||
|
'default_currency': 'USD',
|
||||||
|
'country': 'United States',
|
||||||
|
'is_group': 0,
|
||||||
|
'parent_company': None,
|
||||||
|
'create_chart_of_accounts_based_on': 'Standard Template',
|
||||||
|
'chart_of_accounts': 'Standard',
|
||||||
|
'default_cash_account': 'Cash - VS',
|
||||||
|
'default_receivable_account': 'Debtors - VS',
|
||||||
|
'default_payable_account': 'Creditors - VS',
|
||||||
|
'default_income_account': 'Sales - VS',
|
||||||
|
'default_expense_account': 'Cost of Goods Sold - VS',
|
||||||
|
'cost_center': 'Main - VS',
|
||||||
|
'enable_perpetual_inventory': 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'company_name': 'Daniels Landscape Supplies',
|
||||||
|
'abbr': 'DL',
|
||||||
|
'default_currency': 'USD',
|
||||||
|
'country': 'United States',
|
||||||
|
'is_group': 0,
|
||||||
|
'parent_company': None,
|
||||||
|
'create_chart_of_accounts_based_on': 'Standard Template',
|
||||||
|
'chart_of_accounts': 'Standard',
|
||||||
|
'default_cash_account': 'Cash - DL',
|
||||||
|
'default_receivable_account': 'Debtors - DL',
|
||||||
|
'default_payable_account': 'Creditors - DL',
|
||||||
|
'default_income_account': 'Sales - DL',
|
||||||
|
'default_expense_account': 'Cost of Goods Sold - DL',
|
||||||
|
'cost_center': 'Main - DL',
|
||||||
|
'enable_perpetual_inventory': 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'company_name': 'sprinklersnorthwest (Demo)',
|
||||||
|
'abbr': 'SD',
|
||||||
|
'default_currency': 'USD',
|
||||||
|
'country': 'United States',
|
||||||
|
'is_group': 0,
|
||||||
|
'parent_company': None,
|
||||||
|
'create_chart_of_accounts_based_on': 'Standard Template',
|
||||||
|
'chart_of_accounts': 'Standard',
|
||||||
|
'default_cash_account': 'Cash - SD',
|
||||||
|
'default_receivable_account': 'Debtors - SD',
|
||||||
|
'default_payable_account': 'Creditors - SD',
|
||||||
|
'default_income_account': 'Sales - SD',
|
||||||
|
'default_expense_account': 'Cost of Goods Sold - SD',
|
||||||
|
'cost_center': 'Main - SD',
|
||||||
|
'enable_perpetual_inventory': 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'company_name': 'Lowe Fencing',
|
||||||
|
'abbr': 'LF',
|
||||||
|
'default_currency': 'USD',
|
||||||
|
'country': 'United States',
|
||||||
|
'is_group': 0,
|
||||||
|
'parent_company': None,
|
||||||
|
'create_chart_of_accounts_based_on': 'Standard Template',
|
||||||
|
'chart_of_accounts': 'Standard',
|
||||||
|
'default_cash_account': 'Cash - LF',
|
||||||
|
'default_receivable_account': 'Debtors - LF',
|
||||||
|
'default_payable_account': 'Creditors - LF',
|
||||||
|
'default_income_account': 'Fencing Sales - LF',
|
||||||
|
'default_expense_account': 'Cost of Goods Sold - LF',
|
||||||
|
'cost_center': 'Main - LF',
|
||||||
|
'enable_perpetual_inventory': 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'company_name': 'Nuco Yard Care',
|
||||||
|
'abbr': 'NYC',
|
||||||
|
'default_currency': 'USD',
|
||||||
|
'country': 'United States',
|
||||||
|
'is_group': 0,
|
||||||
|
'parent_company': None,
|
||||||
|
'create_chart_of_accounts_based_on': 'Standard Template',
|
||||||
|
'chart_of_accounts': 'Standard',
|
||||||
|
'default_cash_account': 'Cash - NYC',
|
||||||
|
'default_receivable_account': 'Debtors - NYC',
|
||||||
|
'default_payable_account': 'Creditors - NYC',
|
||||||
|
'default_income_account': 'Sales - NYC',
|
||||||
|
'default_expense_account': 'Cost of Goods Sold - NYC',
|
||||||
|
'cost_center': 'Main - NYC',
|
||||||
|
'enable_perpetual_inventory': 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'company_name': 'Sprinklers Northwest',
|
||||||
|
'abbr': 'S',
|
||||||
|
'default_currency': 'USD',
|
||||||
|
'country': 'United States',
|
||||||
|
'is_group': 0,
|
||||||
|
'parent_company': None,
|
||||||
|
'create_chart_of_accounts_based_on': 'Standard Template',
|
||||||
|
'chart_of_accounts': 'Standard',
|
||||||
|
'default_cash_account': 'Undeposited Funds - S',
|
||||||
|
'default_receivable_account': 'Debtors - S',
|
||||||
|
'default_payable_account': 'Creditors - S',
|
||||||
|
'default_income_account': 'Sales - S',
|
||||||
|
'default_expense_account': 'Cost of Goods Sold - S',
|
||||||
|
'cost_center': 'Main - S',
|
||||||
|
'enable_perpetual_inventory': 1
|
||||||
|
}
|
||||||
|
]
|
||||||
|
for company in companies:
|
||||||
|
if frappe.db.exists("Company", company["company_name"]):
|
||||||
|
continue
|
||||||
|
data = {
|
||||||
|
"doctype": "Company"
|
||||||
|
}
|
||||||
|
data.update(company)
|
||||||
|
doc = frappe.get_doc(data)
|
||||||
|
doc.insert(ignore_permissions=True)
|
||||||
|
|
||||||
|
|
||||||
def create_accounts():
|
def create_accounts():
|
||||||
"""Create necessary accounts if they do not exist."""
|
"""Create necessary accounts if they do not exist."""
|
||||||
print("\n🔧 Checking for necessary accounts...")
|
print("\n🔧 Checking for necessary accounts...")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue