1541 lines
56 KiB
Python
1541 lines
56 KiB
Python
from django_ledger.io import roles
|
|
from django.core.management.base import BaseCommand
|
|
from django.utils.translation import gettext_lazy as _
|
|
from django_ledger.models import ChartOfAccountModel, AccountModel, EntityModel
|
|
|
|
|
|
class Command(BaseCommand):
|
|
help = "Creates Chart of Accounts for Deepseek entity"
|
|
|
|
def handle(self, *args, **options):
|
|
"""
|
|
Create chart of accounts for automotive dealership business
|
|
"""
|
|
|
|
# Create Chart of Accounts
|
|
entity_model = EntityModel.objects.get(name="Claude")
|
|
coa_model = entity_model.get_default_coa()
|
|
# entity_model.get_all_accounts().delete()
|
|
# coa_model, created = ChartOfAccountModel.objects.get_or_create(
|
|
# entity=entity_model,
|
|
# name='Automotive Dealership Chart of Accounts',
|
|
# )
|
|
|
|
# accounts_data = [
|
|
# # Current Assets
|
|
# {
|
|
# 'code': '1010',
|
|
# 'name': 'Cash on Hand',
|
|
# 'name_arabic': 'الصندوق',
|
|
# 'role': roles.ASSET_CA_CASH,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1020',
|
|
# 'name': 'Bank',
|
|
# 'name_arabic': 'البنك',
|
|
# 'role': roles.ASSET_CA_CASH,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1030',
|
|
# 'name': 'Accounts Receivable',
|
|
# 'name_arabic': 'العملاء',
|
|
# 'role': roles.ASSET_CA_RECEIVABLES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1040',
|
|
# 'name': 'Inventory (Cars)',
|
|
# 'name_arabic': 'مخزون السيارات',
|
|
# 'role': roles.ASSET_CA_INVENTORY,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1045',
|
|
# 'name': 'Spare Parts Inventory',
|
|
# 'name_arabic': 'مخزون قطع الغيار',
|
|
# 'role': roles.ASSET_CA_INVENTORY,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1050',
|
|
# 'name': 'Employee Advances',
|
|
# 'name_arabic': 'سُلف وأمانات الموظفين',
|
|
# 'role': roles.ASSET_CA_RECEIVABLES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1060',
|
|
# 'name': 'Prepaid Expenses',
|
|
# 'name_arabic': 'مصروفات مدفوعة مقدماً',
|
|
# 'role': roles.ASSET_CA_PREPAID,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1070',
|
|
# 'name': 'Notes Receivable',
|
|
# 'name_arabic': 'أوراق القبض',
|
|
# 'role': roles.ASSET_LTI_NOTES_RECEIVABLE,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Fixed Assets (2000-2999)
|
|
# {
|
|
# 'code': '2010',
|
|
# 'name': 'Lands',
|
|
# 'name_arabic': 'أراضي',
|
|
# 'role': roles.ASSET_LTI_LAND,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2011',
|
|
# 'name': 'Buildings',
|
|
# 'name_arabic': 'مباني',
|
|
# 'role': roles.ASSET_PPE_BUILDINGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2012',
|
|
# 'name': 'Company Vehicles',
|
|
# 'name_arabic': 'سيارات الشركة',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2013',
|
|
# 'name': 'Equipment & Tools',
|
|
# 'name_arabic': 'أجهزة ومعدات',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2014',
|
|
# 'name': 'Furniture & Fixtures',
|
|
# 'name_arabic': 'أثاث وديكور',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2015',
|
|
# 'name': 'Other Fixed Assets',
|
|
# 'name_arabic': 'أصول ثابتة أخرى',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2020',
|
|
# 'name': 'Long-term Investments',
|
|
# 'name_arabic': 'استثمارات طويلة الأجل',
|
|
# 'role': roles.ASSET_LTI_SECURITIES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2030',
|
|
# 'name': 'Intangible Assets',
|
|
# 'name_arabic': 'أصول غير ملموسة',
|
|
# 'role': roles.ASSET_INTANGIBLE_ASSETS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Current Liabilities (3000-3999)
|
|
# {
|
|
# 'code': '3010',
|
|
# 'name': 'Accounts Payable',
|
|
# 'name_arabic': 'الموردين',
|
|
# 'role': roles.LIABILITY_CL_ACC_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '3020',
|
|
# 'name': 'Notes Payable',
|
|
# 'name_arabic': 'أوراق الدفع',
|
|
# 'role': roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '3030',
|
|
# 'name': 'Short-term Loans',
|
|
# 'name_arabic': 'قروض قصيرة الأجل',
|
|
# 'role': roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '3040',
|
|
# 'name': 'Employee Payables',
|
|
# 'name_arabic': 'السلف المستحقة',
|
|
# 'role': roles.LIABILITY_CL_WAGES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '3050',
|
|
# 'name': 'Accrued Expenses',
|
|
# 'name_arabic': 'مصروفات مستحقة',
|
|
# 'role': roles.LIABILITY_CL_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '3060',
|
|
# 'name': 'Accrued Taxes',
|
|
# 'name_arabic': 'ضرائب مستحقة',
|
|
# 'role': roles.LIABILITY_CL_TAXES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '3070',
|
|
# 'name': 'Provisions',
|
|
# 'name_arabic': 'مخصصات',
|
|
# 'role': roles.LIABILITY_CL_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Long-term Liabilities (4000-4999)
|
|
# {
|
|
# 'code': '4010',
|
|
# 'name': 'Long-term Bank Loans',
|
|
# 'name_arabic': 'قروض طويلة الأجل',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '4020',
|
|
# 'name': 'Lease Liabilities',
|
|
# 'name_arabic': 'التزامات تمويلية',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '4030',
|
|
# 'name': 'Other Long-term Liabilities',
|
|
# 'name_arabic': 'التزامات أخرى طويلة الأجل',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Equity (5000-5999)
|
|
# {
|
|
# 'code': '5010',
|
|
# 'name': 'Capital',
|
|
# 'name_arabic': 'رأس المال',
|
|
# 'role': roles.EQUITY_CAPITAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '5020',
|
|
# 'name': 'Statutory Reserve',
|
|
# 'name_arabic': 'الاحتياطي القانوني',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '5030',
|
|
# 'name': 'Retained Earnings',
|
|
# 'name_arabic': 'احتياطي الأرباح',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '5040',
|
|
# 'name': 'Profit & Loss for the Period',
|
|
# 'name_arabic': 'أرباح وخسائر الفترة',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Revenue (6000-6999)
|
|
# {
|
|
# 'code': '6010',
|
|
# 'name': 'Car Sales',
|
|
# 'name_arabic': 'مبيعات السيارات',
|
|
# 'role': roles.INCOME_OPERATIONAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '6020',
|
|
# 'name': 'After-Sales Services',
|
|
# 'name_arabic': 'إيرادات خدمات ما بعد البيع',
|
|
# 'role': roles.INCOME_OPERATIONAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6030',
|
|
# 'name': 'Car Rental Income',
|
|
# 'name_arabic': 'إيرادات تأجير سيارات',
|
|
# 'role': roles.INCOME_PASSIVE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6040',
|
|
# 'name': 'Other Income',
|
|
# 'name_arabic': 'إيرادات أخرى',
|
|
# 'role': roles.INCOME_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Expenses (7000-7999)
|
|
# {
|
|
# 'code': '7010',
|
|
# 'name': 'Cost of Goods Sold',
|
|
# 'name_arabic': 'تكلفة البضاعة المباعة',
|
|
# 'role': roles.COGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '7015',
|
|
# 'name': 'Spare Parts Cost Consumed',
|
|
# 'name_arabic': 'تكلفة قطع الغيار المستهلكة',
|
|
# 'role': roles.COGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7020',
|
|
# 'name': 'Salaries & Wages',
|
|
# 'name_arabic': 'رواتب وأجور',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7030',
|
|
# 'name': 'Rent',
|
|
# 'name_arabic': 'إيجار',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7040',
|
|
# 'name': 'Utilities',
|
|
# 'name_arabic': 'كهرباء ومياه',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7050',
|
|
# 'name': 'Advertising & Marketing',
|
|
# 'name_arabic': 'دعاية وإعلان',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7060',
|
|
# 'name': 'Maintenance',
|
|
# 'name_arabic': 'صيانة',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7070',
|
|
# 'name': 'Operating Expenses',
|
|
# 'name_arabic': 'مصاريف تشغيلية',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7080',
|
|
# 'name': 'Depreciation',
|
|
# 'name_arabic': 'استهلاك أصول ثابتة',
|
|
# 'role': roles.EXPENSE_DEPRECIATION,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7090',
|
|
# 'name': 'Fees & Taxes',
|
|
# 'name_arabic': 'رسوم وضرائب',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7100',
|
|
# 'name': 'Bank Charges',
|
|
# 'name_arabic': 'مصاريف بنكية',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '7110',
|
|
# 'name': 'Other Expenses',
|
|
# 'name_arabic': 'مصاريف أخرى',
|
|
# 'role': roles.EXPENSE_OTHER,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# }
|
|
# ]
|
|
# # Create accounts
|
|
|
|
# accounts_data = [
|
|
# # Current Assets (1XXXX)
|
|
# {
|
|
# 'code': '10100',
|
|
# 'name': 'Cash on Hand',
|
|
# 'name_arabic': 'الصندوق',
|
|
# 'role': roles.ASSET_CA_CASH,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '10200',
|
|
# 'name': 'Bank',
|
|
# 'name_arabic': 'البنك',
|
|
# 'role': roles.ASSET_CA_CASH,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '10300',
|
|
# 'name': 'Accounts Receivable',
|
|
# 'name_arabic': 'العملاء',
|
|
# 'role': roles.ASSET_CA_RECEIVABLES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '10400',
|
|
# 'name': 'Inventory (Cars)',
|
|
# 'name_arabic': 'مخزون السيارات',
|
|
# 'role': roles.ASSET_CA_INVENTORY,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '10450',
|
|
# 'name': 'Spare Parts Inventory',
|
|
# 'name_arabic': 'مخزون قطع الغيار',
|
|
# 'role': roles.ASSET_CA_INVENTORY,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '10500',
|
|
# 'name': 'Employee Advances',
|
|
# 'name_arabic': 'سُلف وأمانات الموظفين',
|
|
# 'role': roles.ASSET_CA_RECEIVABLES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '10600',
|
|
# 'name': 'Prepaid Expenses',
|
|
# 'name_arabic': 'مصروفات مدفوعة مقدماً',
|
|
# 'role': roles.ASSET_CA_PREPAID,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '10700',
|
|
# 'name': 'Notes Receivable',
|
|
# 'name_arabic': 'أوراق القبض',
|
|
# 'role': roles.ASSET_LTI_NOTES_RECEIVABLE,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Fixed Assets (2XXXX)
|
|
# {
|
|
# 'code': '20100',
|
|
# 'name': 'Lands',
|
|
# 'name_arabic': 'أراضي',
|
|
# 'role': roles.ASSET_LTI_LAND,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '20110',
|
|
# 'name': 'Buildings',
|
|
# 'name_arabic': 'مباني',
|
|
# 'role': roles.ASSET_PPE_BUILDINGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '20120',
|
|
# 'name': 'Company Vehicles',
|
|
# 'name_arabic': 'سيارات الشركة',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '20130',
|
|
# 'name': 'Equipment & Tools',
|
|
# 'name_arabic': 'أجهزة ومعدات',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '20140',
|
|
# 'name': 'Furniture & Fixtures',
|
|
# 'name_arabic': 'أثاث وديكور',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '20150',
|
|
# 'name': 'Other Fixed Assets',
|
|
# 'name_arabic': 'أصول ثابتة أخرى',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '20200',
|
|
# 'name': 'Long-term Investments',
|
|
# 'name_arabic': 'استثمارات طويلة الأجل',
|
|
# 'role': roles.ASSET_LTI_SECURITIES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '20300',
|
|
# 'name': 'Intangible Assets',
|
|
# 'name_arabic': 'أصول غير ملموسة',
|
|
# 'role': roles.ASSET_INTANGIBLE_ASSETS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Current Liabilities (3XXXX)
|
|
# {
|
|
# 'code': '30100',
|
|
# 'name': 'Accounts Payable',
|
|
# 'name_arabic': 'الموردين',
|
|
# 'role': roles.LIABILITY_CL_ACC_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '30200',
|
|
# 'name': 'Notes Payable',
|
|
# 'name_arabic': 'أوراق الدفع',
|
|
# 'role': roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '30300',
|
|
# 'name': 'Short-term Loans',
|
|
# 'name_arabic': 'قروض قصيرة الأجل',
|
|
# 'role': roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '30400',
|
|
# 'name': 'Employee Payables',
|
|
# 'name_arabic': 'السلف المستحقة',
|
|
# 'role': roles.LIABILITY_CL_WAGES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '30500',
|
|
# 'name': 'Accrued Expenses',
|
|
# 'name_arabic': 'مصروفات مستحقة',
|
|
# 'role': roles.LIABILITY_CL_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '30600',
|
|
# 'name': 'Accrued Taxes',
|
|
# 'name_arabic': 'ضرائب مستحقة',
|
|
# 'role': roles.LIABILITY_CL_TAXES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '30700',
|
|
# 'name': 'Provisions',
|
|
# 'name_arabic': 'مخصصات',
|
|
# 'role': roles.LIABILITY_CL_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Long-term Liabilities (4XXXX)
|
|
# {
|
|
# 'code': '40100',
|
|
# 'name': 'Long-term Bank Loans',
|
|
# 'name_arabic': 'قروض طويلة الأجل',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '40200',
|
|
# 'name': 'Lease Liabilities',
|
|
# 'name_arabic': 'التزامات تمويلية',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '40300',
|
|
# 'name': 'Other Long-term Liabilities',
|
|
# 'name_arabic': 'التزامات أخرى طويلة الأجل',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Equity (5XXXX)
|
|
# {
|
|
# 'code': '50100',
|
|
# 'name': 'Capital',
|
|
# 'name_arabic': 'رأس المال',
|
|
# 'role': roles.EQUITY_CAPITAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '50200',
|
|
# 'name': 'Statutory Reserve',
|
|
# 'name_arabic': 'الاحتياطي القانوني',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '50300',
|
|
# 'name': 'Retained Earnings',
|
|
# 'name_arabic': 'احتياطي الأرباح',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '50400',
|
|
# 'name': 'Profit & Loss for the Period',
|
|
# 'name_arabic': 'أرباح وخسائر الفترة',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Revenue (6XXXX)
|
|
# {
|
|
# 'code': '60100',
|
|
# 'name': 'Car Sales',
|
|
# 'name_arabic': 'مبيعات السيارات',
|
|
# 'role': roles.INCOME_OPERATIONAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '60200',
|
|
# 'name': 'After-Sales Services',
|
|
# 'name_arabic': 'إيرادات خدمات ما بعد البيع',
|
|
# 'role': roles.INCOME_OPERATIONAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '60300',
|
|
# 'name': 'Car Rental Income',
|
|
# 'name_arabic': 'إيرادات تأجير سيارات',
|
|
# 'role': roles.INCOME_PASSIVE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '60400',
|
|
# 'name': 'Other Income',
|
|
# 'name_arabic': 'إيرادات أخرى',
|
|
# 'role': roles.INCOME_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Expenses (7XXXX)
|
|
# {
|
|
# 'code': '70100',
|
|
# 'name': 'Cost of Goods Sold',
|
|
# 'name_arabic': 'تكلفة البضاعة المباعة',
|
|
# 'role': roles.COGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '70150',
|
|
# 'name': 'Spare Parts Cost Consumed',
|
|
# 'name_arabic': 'تكلفة قطع الغيار المستهلكة',
|
|
# 'role': roles.COGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70200',
|
|
# 'name': 'Salaries & Wages',
|
|
# 'name_arabic': 'رواتب وأجور',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70300',
|
|
# 'name': 'Rent',
|
|
# 'name_arabic': 'إيجار',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70400',
|
|
# 'name': 'Utilities',
|
|
# 'name_arabic': 'كهرباء ومياه',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70500',
|
|
# 'name': 'Advertising & Marketing',
|
|
# 'name_arabic': 'دعاية وإعلان',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70600',
|
|
# 'name': 'Maintenance',
|
|
# 'name_arabic': 'صيانة',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70700',
|
|
# 'name': 'Operating Expenses',
|
|
# 'name_arabic': 'مصاريف تشغيلية',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70800',
|
|
# 'name': 'Depreciation',
|
|
# 'name_arabic': 'استهلاك أصول ثابتة',
|
|
# 'role': roles.EXPENSE_DEPRECIATION,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '70900',
|
|
# 'name': 'Fees & Taxes',
|
|
# 'name_arabic': 'رسوم وضرائب',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '71000',
|
|
# 'name': 'Bank Charges',
|
|
# 'name_arabic': 'مصاريف بنكية',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '71100',
|
|
# 'name': 'Other Expenses',
|
|
# 'name_arabic': 'مصاريف أخرى',
|
|
# 'role': roles.EXPENSE_OTHER,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# }
|
|
# ]
|
|
|
|
# accounts_data = [
|
|
# # Current Assets (must start with 1)
|
|
# {
|
|
# 'code': '1010',
|
|
# 'name': 'Cash on Hand',
|
|
# 'role': roles.ASSET_CA_CASH,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1020',
|
|
# 'name': 'Bank',
|
|
# 'role': roles.ASSET_CA_CASH,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1030',
|
|
# 'name': 'Accounts Receivable',
|
|
# 'role': roles.ASSET_CA_RECEIVABLES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1040',
|
|
# 'name': 'Inventory (Cars)',
|
|
# 'role': roles.ASSET_CA_INVENTORY,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '1045',
|
|
# 'name': 'Spare Parts Inventory',
|
|
# 'role': roles.ASSET_CA_INVENTORY,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1050',
|
|
# 'name': 'Employee Advances',
|
|
# 'role': roles.ASSET_CA_RECEIVABLES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1060',
|
|
# 'name': 'Prepaid Expenses',
|
|
# 'role': roles.ASSET_CA_PREPAID,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1070',
|
|
# 'name': 'Notes Receivable',
|
|
# 'role': roles.ASSET_LTI_NOTES_RECEIVABLE,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Fixed Assets (must also start with 1)
|
|
# {
|
|
# 'code': '1110',
|
|
# 'name': 'Lands',
|
|
# 'role': roles.ASSET_LTI_LAND,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1111',
|
|
# 'name': 'Buildings',
|
|
# 'role': roles.ASSET_PPE_BUILDINGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1112',
|
|
# 'name': 'Company Vehicles',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1113',
|
|
# 'name': 'Equipment & Tools',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1114',
|
|
# 'name': 'Furniture & Fixtures',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1115',
|
|
# 'name': 'Other Fixed Assets',
|
|
# 'role': roles.ASSET_PPE_EQUIPMENT,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1120',
|
|
# 'name': 'Long-term Investments',
|
|
# 'role': roles.ASSET_LTI_SECURITIES,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '1130',
|
|
# 'name': 'Intangible Assets',
|
|
# 'role': roles.ASSET_INTANGIBLE_ASSETS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Current Liabilities (must start with 2)
|
|
# {
|
|
# 'code': '2010',
|
|
# 'name': 'Accounts Payable',
|
|
# 'role': roles.LIABILITY_CL_ACC_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '2020',
|
|
# 'name': 'Notes Payable',
|
|
# 'role': roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2030',
|
|
# 'name': 'Short-term Loans',
|
|
# 'role': roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2040',
|
|
# 'name': 'Employee Payables',
|
|
# 'role': roles.LIABILITY_CL_WAGES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2050',
|
|
# 'name': 'Accrued Expenses',
|
|
# 'role': roles.LIABILITY_CL_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2060',
|
|
# 'name': 'Accrued Taxes',
|
|
# 'role': roles.LIABILITY_CL_TAXES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2070',
|
|
# 'name': 'Provisions',
|
|
# 'role': roles.LIABILITY_CL_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Long-term Liabilities (must also start with 2)
|
|
# {
|
|
# 'code': '2210',
|
|
# 'name': 'Long-term Bank Loans',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2220',
|
|
# 'name': 'Lease Liabilities',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '2230',
|
|
# 'name': 'Other Long-term Liabilities',
|
|
# 'role': roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Equity (must start with 3)
|
|
# {
|
|
# 'code': '3010',
|
|
# 'name': 'Capital',
|
|
# 'role': roles.EQUITY_CAPITAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '3020',
|
|
# 'name': 'Statutory Reserve',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '3030',
|
|
# 'name': 'Retained Earnings',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '3040',
|
|
# 'name': 'Profit & Loss for the Period',
|
|
# 'role': roles.EQUITY_ADJUSTMENT,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Revenue (must start with 4)
|
|
# {
|
|
# 'code': '4010',
|
|
# 'name': 'Car Sales',
|
|
# 'role': roles.INCOME_OPERATIONAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '4020',
|
|
# 'name': 'After-Sales Services',
|
|
# 'role': roles.INCOME_OPERATIONAL,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '4030',
|
|
# 'name': 'Car Rental Income',
|
|
# 'role': roles.INCOME_PASSIVE,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '4040',
|
|
# 'name': 'Other Income',
|
|
# 'role': roles.INCOME_OTHER,
|
|
# 'balance_type': roles.CREDIT,
|
|
# 'locked': False
|
|
# },
|
|
|
|
# # Expenses (must start with 5 for COGS, 6 for others)
|
|
# {
|
|
# 'code': '5010',
|
|
# 'name': 'Cost of Goods Sold',
|
|
# 'role': roles.COGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': True
|
|
# },
|
|
# {
|
|
# 'code': '5015',
|
|
# 'name': 'Spare Parts Cost Consumed',
|
|
# 'role': roles.COGS,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6010',
|
|
# 'name': 'Salaries & Wages',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6020',
|
|
# 'name': 'Rent',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6030',
|
|
# 'name': 'Utilities',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6040',
|
|
# 'name': 'Advertising & Marketing',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6050',
|
|
# 'name': 'Maintenance',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6060',
|
|
# 'name': 'Operating Expenses',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6070',
|
|
# 'name': 'Depreciation',
|
|
# 'role': roles.EXPENSE_DEPRECIATION,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6080',
|
|
# 'name': 'Fees & Taxes',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6090',
|
|
# 'name': 'Bank Charges',
|
|
# 'role': roles.EXPENSE_OPERATIONAL,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# },
|
|
# {
|
|
# 'code': '6100',
|
|
# 'name': 'Other Expenses',
|
|
# 'role': roles.EXPENSE_OTHER,
|
|
# 'balance_type': roles.DEBIT,
|
|
# 'locked': False
|
|
# }
|
|
# ]
|
|
|
|
accounts_data = [
|
|
# Current Assets (must start with 1)
|
|
{
|
|
"code": "1010",
|
|
"name": "Cash on Hand",
|
|
"role": roles.ASSET_CA_CASH,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": True,
|
|
"default": True, # Default for ASSET_CA_CASH
|
|
},
|
|
{
|
|
"code": "1020",
|
|
"name": "Bank",
|
|
"role": roles.ASSET_CA_CASH,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": True,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "1030",
|
|
"name": "Accounts Receivable",
|
|
"role": roles.ASSET_CA_RECEIVABLES,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": True,
|
|
"default": True, # Default for ASSET_CA_RECEIVABLES
|
|
},
|
|
{
|
|
"code": "1040",
|
|
"name": "Inventory (Cars)",
|
|
"role": roles.ASSET_CA_INVENTORY,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": True,
|
|
"default": True, # Default for ASSET_CA_INVENTORY
|
|
},
|
|
{
|
|
"code": "1045",
|
|
"name": "Spare Parts Inventory",
|
|
"role": roles.ASSET_CA_INVENTORY,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "1050",
|
|
"name": "Employee Advances",
|
|
"role": roles.ASSET_CA_RECEIVABLES,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "1060",
|
|
"name": "Prepaid Expenses",
|
|
"role": roles.ASSET_CA_PREPAID,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for ASSET_CA_PREPAID
|
|
},
|
|
{
|
|
"code": "1070",
|
|
"name": "Notes Receivable",
|
|
"role": roles.ASSET_LTI_NOTES_RECEIVABLE,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for ASSET_LTI_NOTES_RECEIVABLE
|
|
},
|
|
# Fixed Assets (must also start with 1)
|
|
{
|
|
"code": "1110",
|
|
"name": "Lands",
|
|
"role": roles.ASSET_LTI_LAND,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for ASSET_LTI_LAND
|
|
},
|
|
{
|
|
"code": "1111",
|
|
"name": "Buildings",
|
|
"role": roles.ASSET_PPE_BUILDINGS,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for ASSET_PPE_BUILDINGS
|
|
},
|
|
{
|
|
"code": "1112",
|
|
"name": "Company Vehicles",
|
|
"role": roles.ASSET_PPE_EQUIPMENT,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for ASSET_PPE_EQUIPMENT
|
|
},
|
|
{
|
|
"code": "1113",
|
|
"name": "Equipment & Tools",
|
|
"role": roles.ASSET_PPE_EQUIPMENT,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "1114",
|
|
"name": "Furniture & Fixtures",
|
|
"role": roles.ASSET_PPE_EQUIPMENT,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "1115",
|
|
"name": "Other Fixed Assets",
|
|
"role": roles.ASSET_PPE_EQUIPMENT,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "1120",
|
|
"name": "Long-term Investments",
|
|
"role": roles.ASSET_LTI_SECURITIES,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for ASSET_LTI_SECURITIES
|
|
},
|
|
{
|
|
"code": "1130",
|
|
"name": "Intangible Assets",
|
|
"role": roles.ASSET_INTANGIBLE_ASSETS,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for ASSET_INTANGIBLE_ASSETS
|
|
},
|
|
# Current Liabilities (must start with 2)
|
|
{
|
|
"code": "2010",
|
|
"name": "Accounts Payable",
|
|
"role": roles.LIABILITY_CL_ACC_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": True,
|
|
"default": True, # Default for LIABILITY_CL_ACC_PAYABLE
|
|
},
|
|
{
|
|
"code": "2020",
|
|
"name": "Notes Payable",
|
|
"role": roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for LIABILITY_CL_ST_NOTES_PAYABLE
|
|
},
|
|
{
|
|
"code": "2030",
|
|
"name": "Short-term Loans",
|
|
"role": roles.LIABILITY_CL_ST_NOTES_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "2040",
|
|
"name": "Employee Payables",
|
|
"role": roles.LIABILITY_CL_WAGES_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for LIABILITY_CL_WAGES_PAYABLE
|
|
},
|
|
{
|
|
"code": "2050",
|
|
"name": "Accrued Expenses",
|
|
"role": roles.LIABILITY_CL_OTHER,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for LIABILITY_CL_OTHER
|
|
},
|
|
{
|
|
"code": "2060",
|
|
"name": "Accrued Taxes",
|
|
"role": roles.LIABILITY_CL_TAXES_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for LIABILITY_CL_TAXES_PAYABLE
|
|
},
|
|
{
|
|
"code": "2070",
|
|
"name": "Provisions",
|
|
"role": roles.LIABILITY_CL_OTHER,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
# Long-term Liabilities (must also start with 2)
|
|
{
|
|
"code": "2210",
|
|
"name": "Long-term Bank Loans",
|
|
"role": roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for LIABILITY_LTL_NOTES_PAYABLE
|
|
},
|
|
{
|
|
"code": "2220",
|
|
"name": "Lease Liabilities",
|
|
"role": roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "2230",
|
|
"name": "Other Long-term Liabilities",
|
|
"role": roles.LIABILITY_LTL_NOTES_PAYABLE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
# Equity (must start with 3)
|
|
{
|
|
"code": "3010",
|
|
"name": "Capital",
|
|
"role": roles.EQUITY_CAPITAL,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": True,
|
|
"default": True, # Default for EQUITY_CAPITAL
|
|
},
|
|
{
|
|
"code": "3020",
|
|
"name": "Statutory Reserve",
|
|
"role": roles.EQUITY_ADJUSTMENT,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for EQUITY_ADJUSTMENT
|
|
},
|
|
{
|
|
"code": "3030",
|
|
"name": "Retained Earnings",
|
|
"role": roles.EQUITY_ADJUSTMENT,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "3040",
|
|
"name": "Profit & Loss for the Period",
|
|
"role": roles.EQUITY_ADJUSTMENT,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
# Revenue (must start with 4)
|
|
{
|
|
"code": "4010",
|
|
"name": "Car Sales",
|
|
"role": roles.INCOME_OPERATIONAL,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": True,
|
|
"default": True, # Default for INCOME_OPERATIONAL
|
|
},
|
|
{
|
|
"code": "4020",
|
|
"name": "After-Sales Services",
|
|
"role": roles.INCOME_OPERATIONAL,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "4030",
|
|
"name": "Car Rental Income",
|
|
"role": roles.INCOME_PASSIVE,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for INCOME_PASSIVE
|
|
},
|
|
{
|
|
"code": "4040",
|
|
"name": "Other Income",
|
|
"role": roles.INCOME_OTHER,
|
|
"balance_type": roles.CREDIT,
|
|
"locked": False,
|
|
"default": True, # Default for INCOME_OTHER
|
|
},
|
|
# Expenses (must start with 5 for COGS, 6 for others)
|
|
{
|
|
"code": "5010",
|
|
"name": "Cost of Goods Sold",
|
|
"role": roles.COGS,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": True,
|
|
"default": True, # Default for COGS
|
|
},
|
|
{
|
|
"code": "5015",
|
|
"name": "Spare Parts Cost Consumed",
|
|
"role": roles.COGS,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6010",
|
|
"name": "Salaries & Wages",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for EXPENSE_OPERATIONAL
|
|
},
|
|
{
|
|
"code": "6020",
|
|
"name": "Rent",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6030",
|
|
"name": "Utilities",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6040",
|
|
"name": "Advertising & Marketing",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6050",
|
|
"name": "Maintenance",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6060",
|
|
"name": "Operating Expenses",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6070",
|
|
"name": "Depreciation",
|
|
"role": roles.EXPENSE_DEPRECIATION,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for EXPENSE_DEPRECIATION
|
|
},
|
|
{
|
|
"code": "6080",
|
|
"name": "Fees & Taxes",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6090",
|
|
"name": "Bank Charges",
|
|
"role": roles.EXPENSE_OPERATIONAL,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": False,
|
|
},
|
|
{
|
|
"code": "6100",
|
|
"name": "Other Expenses",
|
|
"role": roles.EXPENSE_OTHER,
|
|
"balance_type": roles.DEBIT,
|
|
"locked": False,
|
|
"default": True, # Default for EXPENSE_OTHER
|
|
},
|
|
]
|
|
|
|
created_accounts = []
|
|
|
|
for account_data in accounts_data:
|
|
try:
|
|
account = entity_model.create_account(
|
|
coa_model=coa_model,
|
|
code=account_data["code"],
|
|
name=_(account_data["name"]),
|
|
role=_(account_data["role"]),
|
|
balance_type=_(account_data["balance_type"]),
|
|
active=True,
|
|
)
|
|
account.role_default = account_data["default"]
|
|
account.save()
|
|
created_accounts.append(account)
|
|
self.stdout.write(
|
|
self.style.SUCCESS(
|
|
f"Created account: {account.code} - {account.name}"
|
|
)
|
|
)
|
|
except Exception as e:
|
|
self.stdout.write(
|
|
self.style.ERROR(
|
|
f"Error creating account {account_data['code']}: {str(e)}"
|
|
)
|
|
)
|
|
|
|
self.stdout.write(
|
|
self.style.SUCCESS(
|
|
f"\nSuccessfully created {len(created_accounts)} accounts in Chart of Accounts"
|
|
)
|
|
)
|