REFACTOR: combine 2 key-choice-list into 1

Previously key-choice-list was selected from 2 lists depending
on use-split-action setting. This commit combines to 1 list
with suitable (if) clause in the middle.
This commit is contained in:
Christopher Lam 2017-12-22 17:40:11 +08:00
parent ee01038ee5
commit 02905fe38f

View File

@ -589,106 +589,60 @@ tags within description, notes or memo. ")
;; Sorting options
(let ((key-choice-list
(if (qof-book-use-split-action-for-num-field (gnc-get-current-book))
(list (vector 'none
(N_ "None")
(N_ "Do not sort."))
(append
(list (vector 'none
(N_ "None")
(N_ "Do not sort."))
(vector 'account-name
(N_ "Account Name")
(N_ "Sort & subtotal by account name."))
(vector 'account-name
(N_ "Account Name")
(N_ "Sort & subtotal by account name."))
(vector 'account-code
(N_ "Account Code")
(N_ "Sort & subtotal by account code."))
(vector 'account-code
(N_ "Account Code")
(N_ "Sort & subtotal by account code."))
(vector 'date
(N_ "Date")
(N_ "Sort by date."))
(vector 'date
(N_ "Date")
(N_ "Sort by date."))
(vector 'reconciled-date
(N_ "Reconciled Date")
(N_ "Sort by the Reconciled Date."))
(vector 'reconciled-date
(N_ "Reconciled Date")
(N_ "Sort by the Reconciled Date."))
(vector 'register-order
(N_ "Register Order")
(N_ "Sort as in the register."))
(vector 'register-order
(N_ "Register Order")
(N_ "Sort as in the register."))
(vector 'corresponding-acc-name
(N_ "Other Account Name")
(N_ "Sort by account transferred from/to's name."))
(vector 'corresponding-acc-name
(N_ "Other Account Name")
(N_ "Sort by account transferred from/to's name."))
(vector 'corresponding-acc-code
(N_ "Other Account Code")
(N_ "Sort by account transferred from/to's code."))
(vector 'corresponding-acc-code
(N_ "Other Account Code")
(N_ "Sort by account transferred from/to's code."))
(vector 'amount
(N_ "Amount")
(N_ "Sort by amount."))
(vector 'amount
(N_ "Amount")
(N_ "Sort by amount."))
(vector 'description
(N_ "Description")
(N_ "Sort by description."))
(vector 'description
(N_ "Description")
(N_ "Sort by description."))
(vector 'number
(N_ "Number/Action")
(N_ "Sort by check number/action."))
(vector 't-number
(N_ "Transaction Number")
(N_ "Sort by transaction number."))
(vector 'memo
(N_ "Memo")
(N_ "Sort by memo.")))
(list (vector 'none
(N_ "None")
(N_ "Do not sort."))
(vector 'account-name
(N_ "Account Name")
(N_ "Sort & subtotal by account name."))
(vector 'account-code
(N_ "Account Code")
(N_ "Sort & subtotal by account code."))
(vector 'date
(N_ "Date")
(N_ "Sort by date."))
(vector 'reconciled-date
(N_ "Reconciled Date")
(N_ "Sort by the Reconciled Date."))
(vector 'register-order
(N_ "Register Order")
(N_ "Sort as in the register."))
(vector 'corresponding-acc-name
(N_ "Other Account Name")
(N_ "Sort by account transferred from/to's name."))
(vector 'corresponding-acc-code
(N_ "Other Account Code")
(N_ "Sort by account transferred from/to's code."))
(vector 'amount
(N_ "Amount")
(N_ "Sort by amount."))
(vector 'description
(N_ "Description")
(N_ "Sort by description."))
(vector 'number
(N_ "Number")
(N_ "Sort by check/transaction number."))
(vector 'memo
(N_ "Memo")
(N_ "Sort by memo.")))))
(vector 'number
(N_ "Number/Action")
(N_ "Sort by check number/action.")))
(if (qof-book-use-split-action-for-num-field (gnc-get-current-book))
(list
(vector 't-number
(N_ "Transaction Number")
(N_ "Sort by transaction number.")))
'())
(list
(vector 'memo
(N_ "Memo")
(N_ "Sort by memo.")))))
(ascending-choice-list
(list