Created
July 28, 2009 18:48
-
-
Save jystewart/157597 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby -w | |
# | |
# Paypal CSV to QIF | |
# By James Stewart - [email protected] | |
# | |
# A really simple script attempting to get data from my paypal account (multi currency) | |
# into Xero. More adjustment will be needed to handle the multiple currencies, but I've | |
# not found good documentation of how to bake that into the QIF file yet. | |
# | |
# (I know paypal do qif output, but it seems to only send transactions from one currency) | |
require 'rubygems' | |
require 'fastercsv' | |
puts "!Type:Cash" | |
FasterCSV.foreach(ARGV[0], :headers => true) do |row| | |
puts "D#{row['Date']}" | |
puts "T#{row['Gross']}" | |
puts "P#{row['Name']} - #{row['Type']} - #{row['Item Title']} - #{row['Currency']}" | |
puts "^" | |
if row['Fee'].to_f != 0.0 | |
puts "D#{row['Date']}" | |
puts "T-#{row['Fee']}" | |
puts "PPaypal Fee" | |
puts "^" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment