examples: stripe csv

This commit is contained in:
Simon Michael 2020-11-11 10:25:15 -08:00
parent 70f95e9f2c
commit 9b536f1ae4
2 changed files with 36 additions and 0 deletions

3
examples/csv/stripe.csv Normal file
View File

@ -0,0 +1,3 @@
"balance_transaction_id","created_utc","available_on_utc","currency","gross","fee","net","reporting_category","description"
"txn_14G11HjubSIHf9IKrvJdwN","2020-01-23 08:26:29","2020-01-27 00:00:00","usd","12.00","0.00","12.00","charge",
"txn_14G11HjHgubIH9ZvbPgYO7","2020-01-23 08:26:31","2020-01-27 00:00:00","usd","-0.77","0.00","-0.77","refund","REFUND FOR PAYMENT"
1 balance_transaction_id created_utc available_on_utc currency gross fee net reporting_category description
2 txn_14G11HjubSIHf9IKrvJdwN 2020-01-23 08:26:29 2020-01-27 00:00:00 usd 12.00 0.00 12.00 charge
3 txn_14G11HjHgubIH9ZvbPgYO7 2020-01-23 08:26:31 2020-01-27 00:00:00 usd -0.77 0.00 -0.77 refund REFUND FOR PAYMENT

View File

@ -0,0 +1,33 @@
# example: https://paste.tomsmeding.com/fOTKscYN
# Stripe "Balance change from activity" CSV, default fields:
fields balance_transaction_id, created_utc, available_on_utc, currency, gross, fee, net, reporting_category, description
skip 1
date %created_utc
date-format %Y-%m-%d %H:%M:%S
code %balance_transaction_id
# use currency field as currency symbol, with a space
currency %currency
# but show usd as $
if ,usd,
currency $
# the first posting is money leaving/entering my balance
# (negative means leaving my account, in all amount fields)
account1 assets:online:stripe
amount1 %net
# the second posting is money sent to/received from other party
# we'll set generic account names based on sign and reporting_category
amount2 -%gross
if %gross ^-
account2 expenses:%reporting_category
if %gross ^[^-]
account2 revenues:%reporting_category
# if there's a non-zero fee, add a third posting
if %fee [1-9]
account3 expenses:banking:stripe
amount3 -%fee