From ec84430cf4e09ba25ec675debdf802bc28111e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= Date: Mon, 7 Nov 2016 10:41:54 +0100 Subject: Imported Upstream version 9.0 --- contrib/lisp/org-invoice.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'contrib/lisp/org-invoice.el') 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 -- cgit v1.2.3