|
@@ -113,10 +113,10 @@
|
|
|
"-"))
|
|
"-"))
|
|
|
|
|
|
|
|
(defun get-op-description (op)
|
|
(defun get-op-description (op)
|
|
|
- (let ((cat (parse-integer (aget op "category" "id"))))
|
|
|
|
|
|
|
+ (let ((cat (parse-integer (aget op "category" "id") :junk-allowed t)))
|
|
|
(cond
|
|
(cond
|
|
|
- ((= cat 16) (if (> (aget op "accountAmount" "value")
|
|
|
|
|
- 1500)
|
|
|
|
|
|
|
+ ((equal cat 16) (if (> (aget op "accountAmount" "value")
|
|
|
|
|
+ 1500)
|
|
|
"project: Volvo" "project: Smart"))
|
|
"project: Volvo" "project: Smart"))
|
|
|
(:otherwise
|
|
(:otherwise
|
|
|
(or
|
|
(or
|
|
@@ -132,7 +132,7 @@
|
|
|
(t (concatenate 'string "assets:Tinkoff:" (aget op "account")))))
|
|
(t (concatenate 'string "assets:Tinkoff:" (aget op "account")))))
|
|
|
|
|
|
|
|
(defun get-op-account2 (op)
|
|
(defun get-op-account2 (op)
|
|
|
- (let ((cat (parse-integer (aget op "category" "id"))))
|
|
|
|
|
|
|
+ (let ((cat (parse-integer (aget op "category" "id") :junk-allowed t)))
|
|
|
(case cat
|
|
(case cat
|
|
|
(60 "expenses:Food:Fast-food")
|
|
(60 "expenses:Food:Fast-food")
|
|
|
(36 "expenses:Transport")
|
|
(36 "expenses:Transport")
|
|
@@ -157,11 +157,12 @@
|
|
|
for account1 = (get-op-account1 op)
|
|
for account1 = (get-op-account1 op)
|
|
|
for account2 = (get-op-account2 op)
|
|
for account2 = (get-op-account2 op)
|
|
|
for expense = (equal "Debit" (aget op "type"))
|
|
for expense = (equal "Debit" (aget op "type"))
|
|
|
- collect (format nil "~A ~A~@[ ; ~A~]~% ~38A ~A~,2F ~A~% ~38A ~A~,2F ~A~[ @@ ~A~,2F ~A~]"
|
|
|
|
|
|
|
+ collect (format nil "~A ~A~@[ ; ~A~]~% ~38A ~A~,2F ~A~@[ @@ ~{~A~,2F ~A~}~]~% ~38A ~A~,2F ~A"
|
|
|
date payee (unless (equal payee description) description)
|
|
date payee (unless (equal payee description) description)
|
|
|
- account1 (if expense "-" " ") account-amount account-currency
|
|
|
|
|
account2 (if expense " " "-") account-amount account-currency
|
|
account2 (if expense " " "-") account-amount account-currency
|
|
|
- (not (equal currency account-currency)) (if expense " " "-") amount currency)))
|
|
|
|
|
|
|
+ (unless (equal currency account-currency)
|
|
|
|
|
+ (list (if expense " " "-") amount currency))
|
|
|
|
|
+ account1 (if expense "-" " ") account-amount account-currency)))
|
|
|
|
|
|
|
|
(defparameter +day+ (* 24 60 60) "Seconds in day")
|
|
(defparameter +day+ (* 24 60 60) "Seconds in day")
|
|
|
|
|
|