mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-18 17:57:11 +03:00
examples: stripe csv
This commit is contained in:
parent
70f95e9f2c
commit
9b536f1ae4
3
examples/csv/stripe.csv
Normal file
3
examples/csv/stripe.csv
Normal 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"
|
|
33
examples/csv/stripe.csv.rules
Normal file
33
examples/csv/stripe.csv.rules
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user