@@ -39,12 +39,9 @@ const datePostedRegex = new RegExp(`^${dateRange}`, "g");
39
39
const transactions = db
40
40
. getByTerms ( reportCategory , reportSubCategory )
41
41
. filter ( ( transaction : string [ ] ) : boolean => {
42
- const matchedDateRange = ! ! ( transaction [ 2 ] . match ( datePostedRegex ) || [ ] )
43
- . length ;
42
+ const matchedDateRange = ! ! ( transaction [ 2 ] . match ( datePostedRegex ) || [ ] ) . length ;
44
43
return (
45
- transaction [ 9 ] !== "omit" &&
46
- transaction [ 9 ] !== "split" &&
47
- matchedDateRange
44
+ transaction [ 9 ] !== "omit" && transaction [ 9 ] !== "split" && matchedDateRange
48
45
) ;
49
46
} ) ;
50
47
@@ -59,19 +56,15 @@ console.log(
59
56
console . log ( "================" ) ;
60
57
61
58
let runningTotal = 0 ;
62
- transactions
63
- . sort ( sortTransactionsByDate )
64
- . forEach ( ( transaction : string [ ] ) : void => {
65
- const [ , , date , amount , description , , , , , , , , notes ] = transaction ;
66
- const parsedAmount = parseFloat ( amount ) ;
67
- const displayNotes = notes || "<No notes>" ;
68
- console . log (
69
- `${ date } , ${ formatCurrency (
70
- parsedAmount
71
- ) } , ${ description } , ${ displayNotes } `
72
- ) ;
73
- runningTotal += parsedAmount ;
74
- } ) ;
59
+ transactions . sort ( sortTransactionsByDate ) . forEach ( ( transaction : string [ ] ) : void => {
60
+ const [ , , date , amount , description , , , , , , , , notes ] = transaction ;
61
+ const parsedAmount = parseFloat ( amount ) ;
62
+ const displayNotes = notes || "<No notes>" ;
63
+ console . log (
64
+ `${ date } , ${ formatCurrency ( parsedAmount ) } , ${ description } , ${ displayNotes } `
65
+ ) ;
66
+ runningTotal += parsedAmount ;
67
+ } ) ;
75
68
76
69
console . log ( "----------------" ) ;
77
70
console . log ( formatCurrency ( runningTotal ) ) ;
0 commit comments