mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
not map to parent accounts, hidden accounts, and hidden categories when importing transactions
This commit is contained in:
@@ -774,12 +774,21 @@ func (s *AccountService) GetAccountMapByList(accounts []*models.Account) map[int
|
||||
return accountMap
|
||||
}
|
||||
|
||||
// GetAccountNameMapByList returns an account map by a list
|
||||
func (s *AccountService) GetAccountNameMapByList(accounts []*models.Account) map[string]*models.Account {
|
||||
// GetVisibleAccountNameMapByList returns visible account map by a list
|
||||
func (s *AccountService) GetVisibleAccountNameMapByList(accounts []*models.Account) map[string]*models.Account {
|
||||
accountMap := make(map[string]*models.Account)
|
||||
|
||||
for i := 0; i < len(accounts); i++ {
|
||||
account := accounts[i]
|
||||
|
||||
if account.Hidden {
|
||||
continue
|
||||
}
|
||||
|
||||
if account.Type == models.ACCOUNT_TYPE_MULTI_SUB_ACCOUNTS {
|
||||
continue
|
||||
}
|
||||
|
||||
accountMap[account.Name] = account
|
||||
}
|
||||
return accountMap
|
||||
|
||||
Reference in New Issue
Block a user