reg: include txn's code field in register CSV output (#746)
This commit is contained in:
		
							parent
							
								
									41a8122ae1
								
							
						
					
					
						commit
						abb2e6bfc2
					
				| @ -68,15 +68,16 @@ register opts@CliOpts{reportopts_=ropts} j = do | |||||||
| 
 | 
 | ||||||
| postingsReportAsCsv :: PostingsReport -> CSV | postingsReportAsCsv :: PostingsReport -> CSV | ||||||
| postingsReportAsCsv (_,is) = | postingsReportAsCsv (_,is) = | ||||||
|   ["txnidx","date","description","account","amount","total"] |   ["txnidx","date","code","description","account","amount","total"] | ||||||
|   : |   : | ||||||
|   map postingsReportItemAsCsvRecord is |   map postingsReportItemAsCsvRecord is | ||||||
| 
 | 
 | ||||||
| postingsReportItemAsCsvRecord :: PostingsReportItem -> Record | postingsReportItemAsCsvRecord :: PostingsReportItem -> Record | ||||||
| postingsReportItemAsCsvRecord (_, _, _, p, b) = [idx,date,desc,acct,amt,bal] | postingsReportItemAsCsvRecord (_, _, _, p, b) = [idx,date,code,desc,acct,amt,bal] | ||||||
|   where |   where | ||||||
|     idx  = show $ maybe 0 tindex $ ptransaction p |     idx  = show $ maybe 0 tindex $ ptransaction p | ||||||
|     date = showDate $ postingDate p -- XXX csv should show date2 with --date2 |     date = showDate $ postingDate p -- XXX csv should show date2 with --date2 | ||||||
|  |     code = maybe "" (T.unpack . tcode) $ ptransaction p | ||||||
|     desc = T.unpack $ maybe "" tdescription $ ptransaction p |     desc = T.unpack $ maybe "" tdescription $ ptransaction p | ||||||
|     acct = bracket $ T.unpack $ paccount p |     acct = bracket $ T.unpack $ paccount p | ||||||
|       where |       where | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user