Prepare data.
This commit is contained in:
		
							parent
							
								
									b018da2c61
								
							
						
					
					
						commit
						a6f307d230
					
				
					 1 changed files with 15 additions and 4 deletions
				
			
		|  | @ -246,10 +246,10 @@ | |||
|    (map (lambda (mce) | ||||
| 	  (let ((fee (member-calendar-entry->fee mce))) | ||||
| 	    (list (cal-ensure-day (car mce)) | ||||
| 		  fee | ||||
| 		  (- fee) | ||||
| 		  'CZK | ||||
| 		  (cadr mce) | ||||
| 		  fee))) | ||||
| 		  (- fee)))) | ||||
| 	mc)) | ||||
| 
 | ||||
|  ;; Converts bank transactions to transactions usable in balance | ||||
|  | @ -277,7 +277,18 @@ | |||
| 	  (all (sort all-unsorted | ||||
| 		     (lambda (a b) | ||||
| 		       (cal-day<? (car a) (car b)))))) | ||||
|      (print all) | ||||
|      '())) | ||||
|      (let loop ((trs all) | ||||
| 		(rbls '()) | ||||
| 		(bal 0)) | ||||
|        (if (null? trs) | ||||
| 	   (let ((res (reverse rbls))) | ||||
| 	     (print res) | ||||
| 	     res) | ||||
| 	   (let* ((amt (list-ref (car trs) 4)) | ||||
| 		  (nbal (+ bal amt))) | ||||
| 	     (loop (cdr trs) | ||||
| 		   (cons (cons nbal (car trs)) | ||||
| 			 rbls) | ||||
| 		   nbal)))))) | ||||
| 
 | ||||
|  ) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue