Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Fix date filtering and order of transactions |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
9332fb989fc0ad8cd034a0d843276720 |
User & Date: | atomicules 2016-10-16 21:46:18 |
Context
2025-03-10
| ||
16:28 |
Finally handle UTF-8 BOM
Keep pre-processing in Vim which is dumb/lazy. check-in: ed7740affc user: atomicules tags: trunk | |
2016-10-16
| ||
21:46 | Fix date filtering and order of transactions check-in: 9332fb989f user: atomicules tags: trunk | |
2016-10-02
| ||
12:30 |
Convert to csv parsing only
Really I don't need all that class stuff in there anymore, but I thought I | |
Changes
Changes to smile.rb.
︙ | ︙ | |||
34 35 36 37 38 39 40 | #Need to skip first/last line unless line[0] == "Date" @balance = line[5] date = Date.parse(line[0]) name = line[1] credit = line[3] debit = line[4] | | | | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | #Need to skip first/last line unless line[0] == "Date" @balance = line[5] date = Date.parse(line[0]) name = line[1] credit = line[3] debit = line[4] unless date < @date_back @transactions << { :date => date, :name => name, :credit => credit, :debit => debit} end end #No need to sort any more end csv.close end def write_ledger balance_assertion = "" File.open("smile.dat", "w") do |file| #Reverse for writing out #@transactions.reverse! @transactions.each.with_index do |transaction, idx| file << transaction[:date].strftime("%Y/%m/%d")+"\t*\t"+transaction[:name]+"\n" if transaction[:debit] #Quote all commodities because having ledger utf-8 trouble amount = "\"£\"-"+transaction[:debit] type = "Expenses:" else |
︙ | ︙ |