summaryrefslogtreecommitdiff
path: root/contrib/lisp/org-invoice.el
diff options
context:
space:
mode:
authorS├ębastien Delafond <sdelafond@gmail.com>2016-11-07 10:41:54 +0100
committerS├ębastien Delafond <sdelafond@gmail.com>2016-11-07 10:41:54 +0100
commit1a7cd65ca362047cd97d4127d49108994baebc6c (patch)
treef18735f3b77120ef2e91043f2f662b03e47ccbb0 /contrib/lisp/org-invoice.el
parent55074078ca876273e3fa58ee6838cba90d2b6100 (diff)
parentec84430cf4e09ba25ec675debdf802bc28111e06 (diff)
Merge tag 'upstream/9.0'
Upstream version 9.0
Diffstat (limited to 'contrib/lisp/org-invoice.el')
-rw-r--r--contrib/lisp/org-invoice.el30
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/lisp/org-invoice.el b/contrib/lisp/org-invoice.el
index c1340a7..4c83d2e 100644
--- a/contrib/lisp/org-invoice.el
+++ b/contrib/lisp/org-invoice.el
@@ -176,8 +176,8 @@ looks like tree2, where the level is 2."
"Return a list where the car is the min level, and the cdr the max."
(let ((max 0) min level)
(dolist (info ls)
- (when (cdr (assoc 'date info))
- (setq level (cdr (assoc 'level info)))
+ (when (cdr (assq 'date info))
+ (setq level (cdr (assq 'level info)))
(when (or (not min) (< level min)) (setq min level))
(when (> level max) (setq max level))))
(cons (or min 0) max)))
@@ -186,11 +186,11 @@ looks like tree2, where the level is 2."
"Reorganize the given list by dates."
(let ((min-max (org-invoice-level-min-max ls)) new)
(dolist (info ls)
- (let* ((date (cdr (assoc 'date info)))
- (work (cdr (assoc 'work info)))
- (price (cdr (assoc 'price info)))
- (long-date (cdr (assoc 'long-date info)))
- (level (cdr (assoc 'level info)))
+ (let* ((date (cdr (assq 'date info)))
+ (work (cdr (assq 'work info)))
+ (price (cdr (assq 'price info)))
+ (long-date (cdr (assq 'long-date info)))
+ (level (cdr (assq 'level info)))
(bucket (cdr (assoc date new))))
(if (and (/= (car min-max) (cdr min-max))
(= (car min-max) level)
@@ -208,19 +208,19 @@ looks like tree2, where the level is 2."
(push (cons date bucket) new)
(setq bucket (cdr (assoc date new))))
(when (and date bucket)
- (setcdr (assoc 'total-work (car bucket))
- (+ work (cdr (assoc 'total-work (car bucket)))))
- (setcdr (assoc 'price (car bucket))
- (+ price (cdr (assoc 'price (car bucket)))))
+ (setcdr (assq 'total-work (car bucket))
+ (+ work (cdr (assq 'total-work (car bucket)))))
+ (setcdr (assq 'price (car bucket))
+ (+ price (cdr (assq 'price (car bucket)))))
(nconc bucket (list info))))))
(nreverse new)))
(defun org-invoice-info-to-table (info)
"Create a single org table row from the given info alist."
- (let ((title (cdr (assoc 'title info)))
- (total (cdr (assoc 'total-work info)))
- (work (cdr (assoc 'work info)))
- (price (cdr (assoc 'price info)))
+ (let ((title (cdr (assq 'title info)))
+ (total (cdr (assq 'total-work info)))
+ (work (cdr (assq 'work info)))
+ (price (cdr (assq 'price info)))
(with-price (plist-get org-invoice-table-params :price)))
(unless total
(setq