From 56f08786add0539462141243a8fd9c890b1a583d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Tue, 25 Aug 2020 13:40:24 +0800 Subject: [PATCH] Revised the data order of the add_accounts() method in DataFiller to put English first in the accounting application. --- .../management/commands/accounting_sample.py | 90 +++++++++---------- accounting/utils.py | 6 +- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/accounting/management/commands/accounting_sample.py b/accounting/management/commands/accounting_sample.py index 11c9243..ef394c8 100644 --- a/accounting/management/commands/accounting_sample.py +++ b/accounting/management/commands/accounting_sample.py @@ -70,67 +70,67 @@ class Command(BaseCommand): self._filler = DataFiller(user) self._filler.add_accounts([ - (1, "資產", "assets", "资产"), - (2, "負債", "liabilities", "负债"), - (3, "業主權益", "owners’ equity", "业主权益"), - (4, "營業收入", "operating revenue", "营业收入"), - (5, "營業成本", "operating costs", "营业成本"), - (6, "營業費用", "operating expenses", "营业费用"), - (7, "營業外收入及費用", + (1, "assets", "資產", "资产"), + (2, "liabilities", "負債", "负债"), + (3, "owners’ equity", "業主權益", "业主权益"), + (4, "operating revenue", "營業收入", "营业收入"), + (5, "operating costs", "營業成本", "营业成本"), + (6, "operating expenses", "營業費用", "营业费用"), + (7, "non-operating revenue and expenses, other income (expense)", - "营业外收入及费用"), - (8, "所得稅費用(或利益)", "income tax expense (or benefit)", + "營業外收入及費用", "营业外收入及费用"), + (8, "income tax expense (or benefit)", "所得稅費用(或利益)", "所得税费用(或利益)"), - (9, "非經常營業損益", "nonrecurring gain or loss", + (9, "nonrecurring gain or loss", "非經常營業損益", "非经常营业损益"), - (11, "流動資產", "current assets", "流动资产"), - (111, "現金及約當現金", "cash and cash equivalents", + (11, "current assets", "流動資產", "流动资产"), + (111, "cash and cash equivalents", "現金及約當現金", "现金及约当现金"), - (1111, "庫存現金", "petty cash/revolving funds", "库存现金"), - (1112, "零用金/週轉金", "cash on hand", "零用金/周转金"), - (1113, "銀行存款", "cash in banks", "银行存款"), - (12, "流動資產", "current assets", "流动资产"), - (125, "預付費用", "prepaid expenses", "预付费用"), - (1255, "預付所得稅", "prepaid income tax", "预付所得税"), - (13, "基金及長期投資", "funds and long-term investments", + (1111, "petty cash/revolving funds", "庫存現金", "库存现金"), + (1112, "cash on hand", "零用金/週轉金", "零用金/周转金"), + (1113, "cash in banks", "銀行存款", "银行存款"), + (12, "current assets", "流動資產", "流动资产"), + (125, "prepaid expenses", "預付費用", "预付费用"), + (1255, "prepaid income tax", "預付所得稅", "预付所得税"), + (13, "funds and long-term investments", "基金及長期投資", "基金及长期投资"), - (131, "基金", "funds", "基金"), - (1314, "退休基金", "pension fund", "退休基金"), - (14, "固定資產", "property , plant, and equipment", "固定资产"), - (144, "機(器)具及設備", "machinery and equipment", "机(器)具及设备"), - (1441, "機(器)具", "machinery", "机(器)具"), + (131, "funds", "基金", "基金"), + (1314, "pension fund", "退休基金", "退休基金"), + (14, "property , plant, and equipment", "固定資產", "固定资产"), + (144, "machinery and equipment", "機(器)具及設備", + "机(器)具及设备"), + (1441, "machinery", "機(器)具", "机(器)具"), - (21, "流動負債", "current liabilities", "流动负债"), - (214, "應付帳款", "accounts payable", "应付帐款"), - (2141, "應付帳款", "accounts payable", "应付帐款"), + (21, "current liabilities", "流動負債", "流动负债"), + (214, "accounts payable", "應付帳款", "应付帐款"), + (2141, "accounts payable", "應付帳款", "应付帐款"), - (33, "保留盈餘(或累積虧損)", - "retained earnings (accumulated deficit)", - "保留盈余(或累积亏损)"), - (335, "未分配盈餘(或累積虧損)", + (33, "retained earnings (accumulated deficit)", + "保留盈餘(或累積虧損)", "保留盈余(或累积亏损)"), + (335, "retained earnings-unappropriated (or accumulated deficit)", - "未分配盈余(或累积亏损)"), - (3351, "累積盈虧", "accumulated profit or loss", "累积盈亏"), - (3353, "本期損益", "net income or loss for current period", + "未分配盈餘(或累積虧損)", "未分配盈余(或累积亏损)"), + (3351, "accumulated profit or loss", "累積盈虧", "累积盈亏"), + (3353, "net income or loss for current period", "本期損益", "本期损益"), - (46, "勞務收入", "service revenue", "劳务收入"), - (461, "勞務收入", "service revenue", "劳务收入"), - (4611, "勞務收入", "service revenue", "劳务收入"), + (46, "service revenue", "勞務收入", "劳务收入"), + (461, "service revenue", "勞務收入", "劳务收入"), + (4611, "service revenue", "勞務收入", "劳务收入"), - (62, "管理及總務費用", "general & administrative expenses", + (62, "general & administrative expenses", "管理及總務費用", "管理及总务费用"), - (625, "管理及總務費用", "general & administrative expenses", + (625, "general & administrative expenses", "管理及總務費用", "管理及总务费用"), - (6254, "旅費", "travelling expense, travel", "旅费"), - (626, "管理及總務費用", "general & administrative expenses", + (6254, "travelling expense, travel", "旅費", "旅费"), + (626, "general & administrative expenses", "管理及總務費用", "管理及总务费用"), - (6262, "保險費", "insurance (expense)", "保险费"), - (627, "管理及總務費用", "general & administrative expenses", + (6262, "insurance (expense)", "保險費", "保险费"), + (627, "general & administrative expenses", "管理及總務費用", "管理及总务费用"), - (6272, "伙食費", "meal (expenses)", "伙食费"), - (6273, "職工福利", "employee benefits/welfare", "职工福利"), + (6272, "meal (expenses)", "伙食費", "伙食费"), + (6273, "employee benefits/welfare", "職工福利", "职工福利"), ]) self.add_payrolls(5) diff --git a/accounting/utils.py b/accounting/utils.py index 5090b5c..d32aa7d 100644 --- a/accounting/utils.py +++ b/accounting/utils.py @@ -146,7 +146,7 @@ class DataFiller: Args: accounts (tuple[tuple[any]]): Tuples of - (code, Traditional Chinese, English, Simplified Chinese) + (code, English, Traditional Chinese, Simplified Chinese) of the accounts. """ for data in accounts: @@ -156,8 +156,8 @@ class DataFiller: parent = None if len(code) == 1\ else Account.objects.get(code=code[:-1]) account = Account(parent=parent, code=code, current_user=self.user) - account.set_l10n_in("title", "zh-hant", data[1]) - account.set_l10n_in("title", "en", data[2]) + account.set_l10n_in("title", "en", data[1]) + account.set_l10n_in("title", "zh-hant", data[2]) account.set_l10n_in("title", "zh-hans", data[3]) account.save()