-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #280 from zhang-accounting/277-support-multiple-op…
…erating-currency 277 support multiple operating currency
- Loading branch information
Showing
9 changed files
with
134 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,32 @@ | ||
{ | ||
"Modify": "Modify", | ||
"ASSET_BLANACE": "Asset Balance", | ||
"LIABILITY": "Liability", | ||
"CURRENT_MONTH_INCOME":"Montly Income", | ||
"CURRENT_MONTH_EXPENSE":"Monthly Expenses", | ||
"RESET": "Reset", | ||
"REFRESH": "Refresh", | ||
|
||
"NEW_TRANSACTION_PAYEE_CREATE": "Create", | ||
|
||
"NAV_HOME": "Home", | ||
"NAV_JOURNALS": "Journals", | ||
"NAV_ACCOUNTS": "Accounts", | ||
"NAV_COMMDOITIES": "Commodities", | ||
"NAV_DOCUMENTS": "Documents", | ||
"NAV_REPORT": "Report", | ||
"NAV_LIABILITY": "Liability", | ||
"NAV_RAW_EDITING": "Raw Editing", | ||
"NAV_TOOLS": "Tools", | ||
"NAV_SETTING": "Setting", | ||
"NAV_BUDGETS": "Budget", | ||
|
||
"AccountDoesNotExist": "Account does not exist", | ||
"AccountBalanceCheckError": " Account does not pass the balance check", | ||
"AccountClosed": "Try to operate a closed account", | ||
"TransactionDoesNotBalance": "Transaction does not balance", | ||
"CommodityDoesNotDefine": "Try to use a undefined commodity", | ||
"TransactionHasMultipleImplicitPosting": "Transaction has more than one implicit posting unit", | ||
"CloseNonZeroAccount": "Trying to close an account with non zero balance", | ||
|
||
"ACCOUNT_FILTER_PLACEHOLDER": "filter by keyword...", | ||
"ACCOUNT_FILTER_CLOSE_BUTTON_ARIA": "clean account filter keyword" | ||
"Modify": "Modify", | ||
"ASSET_BLANACE": "Asset Balance", | ||
"LIABILITY": "Liability", | ||
"CURRENT_MONTH_INCOME": "Montly Income", | ||
"CURRENT_MONTH_EXPENSE": "Monthly Expenses", | ||
"RESET": "Reset", | ||
"SAVE": "Save", | ||
"REFRESH": "Refresh", | ||
"NEW_TRANSACTION_PAYEE_CREATE": "Create", | ||
"NAV_HOME": "Home", | ||
"NAV_JOURNALS": "Journals", | ||
"NAV_ACCOUNTS": "Accounts", | ||
"NAV_COMMDOITIES": "Commodities", | ||
"NAV_DOCUMENTS": "Documents", | ||
"NAV_REPORT": "Report", | ||
"NAV_LIABILITY": "Liability", | ||
"NAV_RAW_EDITING": "Raw Editing", | ||
"NAV_TOOLS": "Tools", | ||
"NAV_SETTING": "Setting", | ||
"NAV_BUDGETS": "Budget", | ||
"ERROR.AccountDoesNotExist": "Account does not exist", | ||
"ERROR.AccountBalanceCheckError": " Account does not pass the balance check", | ||
"ERROR.AccountClosed": "Try to operate a closed account", | ||
"ERROR.TransactionDoesNotBalance": "Transaction does not balance", | ||
"ERROR.CommodityDoesNotDefine": "Try to use a undefined commodity", | ||
"ERROR.TransactionHasMultipleImplicitPosting": "Transaction has more than one implicit posting unit", | ||
"ERROR.CloseNonZeroAccount": "Trying to close an account with non zero balance", | ||
"ERROR.MultipleOperatingCurrencyDetect": "Ledger contains multiple operating currency options, which is not recommended in zhang", | ||
"ACCOUNT_FILTER_PLACEHOLDER": "filter by keyword...", | ||
"ACCOUNT_FILTER_CLOSE_BUTTON_ARIA": "clean account filter keyword" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,32 @@ | ||
{ | ||
"Modify": "修改", | ||
"ASSET_BLANACE": "账户余额", | ||
"LIABILITY": "负债", | ||
"CURRENT_MONTH_INCOME":"本月收入", | ||
"CURRENT_MONTH_EXPENSE":"本月支出", | ||
"RESET": "还原", | ||
"REFRESH": "刷新", | ||
|
||
"NEW_TRANSACTION_PAYEE_CREATE": "新增", | ||
|
||
"NAV_HOME": "仪表台", | ||
"NAV_JOURNALS": "流水", | ||
"NAV_ACCOUNTS": "账户", | ||
"NAV_COMMDOITIES": "货币", | ||
"NAV_DOCUMENTS": "文档", | ||
"NAV_REPORT": "报表", | ||
"NAV_LIABILITY": "负债", | ||
"NAV_RAW_EDITING": "编辑", | ||
"NAV_TOOLS": "工具", | ||
"NAV_SETTING": "设置", | ||
"NAV_BUDGETS": "预算", | ||
"ACCOUNT_FILTER_PLACEHOLDER": "按关键字过滤...", | ||
"ACCOUNT_FILTER_CLOSE_BUTTON_ARIA": "清空过滤关键字" | ||
"Modify": "修改", | ||
"ASSET_BLANACE": "账户余额", | ||
"LIABILITY": "负债", | ||
"CURRENT_MONTH_INCOME": "本月收入", | ||
"CURRENT_MONTH_EXPENSE": "本月支出", | ||
"RESET": "还原", | ||
"SAVE": "保存", | ||
"REFRESH": "刷新", | ||
"NEW_TRANSACTION_PAYEE_CREATE": "新增", | ||
"NAV_HOME": "仪表台", | ||
"NAV_JOURNALS": "流水", | ||
"NAV_ACCOUNTS": "账户", | ||
"NAV_COMMDOITIES": "货币", | ||
"NAV_DOCUMENTS": "文档", | ||
"NAV_REPORT": "报表", | ||
"NAV_LIABILITY": "负债", | ||
"NAV_RAW_EDITING": "编辑", | ||
"NAV_TOOLS": "工具", | ||
"NAV_SETTING": "设置", | ||
"NAV_BUDGETS": "预算", | ||
"ACCOUNT_FILTER_PLACEHOLDER": "按关键字过滤...", | ||
"ACCOUNT_FILTER_CLOSE_BUTTON_ARIA": "清空过滤关键字", | ||
"ERROR.AccountDoesNotExist": "对应账户不存在", | ||
"ERROR.AccountBalanceCheckError": "账户定期对账不通过", | ||
"ERROR.AccountClosed": "尝试使用一个已经关闭的账户", | ||
"ERROR.TransactionDoesNotBalance": "该交易行间金额不平衡", | ||
"ERROR.CommodityDoesNotDefine": "尝试使用一个未定义的货币", | ||
"ERROR.TransactionHasMultipleImplicitPosting": "该交易存在多条隐形/需推倒金额的行", | ||
"ERROR.CloseNonZeroAccount": "尝试关闭一个余额非零的账户", | ||
"ERROR.MultipleOperatingCurrencyDetect": "账本中存在多项 operating currency 的配置,这是 zhang 中不推荐的用法" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
integration-tests/multiple-operating-currency-support/main.zhang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
option "title" "My Accounting" | ||
option "operating_currency" "CNY" | ||
option "operating_currency" "USD" | ||
option "operating_currency" "EUR" | ||
|
||
1970-01-01 open Assets:BankCard CNY,USD |
35 changes: 35 additions & 0 deletions
35
integration-tests/multiple-operating-currency-support/validations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
[ | ||
{ | ||
"uri": "/api/store", | ||
"validations": [ | ||
[ | ||
"$.data.errors.length()", | ||
2 | ||
], | ||
[ | ||
"$.data.errors[0].error_type", | ||
"MultipleOperatingCurrencyDetect" | ||
], | ||
[ | ||
"$.data.errors[1].error_type", | ||
"MultipleOperatingCurrencyDetect" | ||
], | ||
[ | ||
"$.data.options.operating_currency", | ||
"EUR" | ||
], | ||
[ | ||
"$.data.commodities.CNY.name", | ||
"CNY" | ||
], | ||
[ | ||
"$.data.commodities.USD.name", | ||
"USD" | ||
], | ||
[ | ||
"$.data.commodities.EUR.name", | ||
"EUR" | ||
] | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,6 @@ pub enum ErrorKind { | |
CloseNonZeroAccount, | ||
|
||
BudgetDoesNotExist, | ||
|
||
MultipleOperatingCurrencyDetect, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters