db59d2fc8c
If there's a 'ledger entry' key in the entry data, use that value as the name of the template to load. Thanks to this, nbpy2017 could collapse multiple importers into one. Otherwise, build a default template name based on the importer source, and try to use that. All the configuration names now end with "ledger entry" instead of starting with "template". This makes it clearer what they're for, in case we support other kinds of output templates in the future. I ended up changing the names of some of the importers so the default template name was nice, rather than specifying template names for all of them, to reduce the amount of name discrepancies across the codebase.
249 lines
9.6 KiB
YAML
249 lines
9.6 KiB
YAML
- source: PatreonPatronReport_2017-09-01.csv
|
|
importer: patreon.IncomeImporter
|
|
expect:
|
|
- payee: Alex Jones
|
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["1500.00"]
|
|
currency: USD
|
|
- payee: Dakota Doe
|
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["12.00"]
|
|
currency: USD
|
|
|
|
- source: PatreonEarnings.csv
|
|
importer: patreon.ServiceFeesImporter
|
|
expect:
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["61.73"]
|
|
currency: USD
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 10, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["117.03"]
|
|
currency: USD
|
|
|
|
- source: PatreonEarnings.csv
|
|
importer: patreon.CardFeesImporter
|
|
expect:
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["52.47"]
|
|
currency: USD
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 10, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["99.47"]
|
|
currency: USD
|
|
|
|
- source: PatreonVat.csv
|
|
importer: patreon.VATImporter
|
|
expect:
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["2.00"]
|
|
currency: USD
|
|
country_code: AT
|
|
country_name: Austria
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 9, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["3.30"]
|
|
currency: USD
|
|
country_code: BE
|
|
country_name: Belgium
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 10, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["0.40"]
|
|
currency: USD
|
|
country_code: BG
|
|
country_name: Bulgaria
|
|
- payee: Patreon
|
|
date: !!python/object/apply:datetime.date [2017, 10, 1]
|
|
amount: !!python/object/apply:decimal.Decimal ["6.05"]
|
|
currency: USD
|
|
country_code: CZ
|
|
country_name: Czech Republic
|
|
|
|
- source: StripePayments.csv
|
|
importer: stripe.PaymentImporter
|
|
expect:
|
|
- payee: Dakota Smith
|
|
date: !!python/object/apply:datetime.date [2017, 11, 8]
|
|
amount: !!python/object/apply:decimal.Decimal ["100.00"]
|
|
fee: !!python/object/apply:decimal.Decimal ["3"]
|
|
tax: !!python/object/apply:decimal.Decimal ["0"]
|
|
currency: USD
|
|
payment_id: ch_oxuish6phae2Raighooghi3U
|
|
description: "Payment for invoice #102"
|
|
- payee: Dakota Jones
|
|
date: !!python/object/apply:datetime.date [2017, 10, 28]
|
|
amount: !!python/object/apply:decimal.Decimal ["50.00"]
|
|
fee: !!python/object/apply:decimal.Decimal ["1.4"]
|
|
tax: !!python/object/apply:decimal.Decimal ["0"]
|
|
currency: USD
|
|
payment_id: ch_hHee9ef1aeyee1ruo7ochee9
|
|
description: "Payment for invoice #100"
|
|
|
|
- source: nbpy2017a.html
|
|
importer: nbpy2017.InvoiceImporter
|
|
expect:
|
|
- payee: Python Person A
|
|
ledger entry: nbpy2017 invoice ledger entry
|
|
date: !!python/object/apply:datetime.date [2017, 10, 19]
|
|
amount: !!python/object/apply:decimal.Decimal ["80.00"]
|
|
tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"]
|
|
shirts_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
|
|
currency: USD
|
|
status: Invoice
|
|
invoice_id: "83"
|
|
invoice_date: !!python/object/apply:datetime.date [2017, 10, 19]
|
|
- payee: Python Person A
|
|
ledger entry: nbpy2017 payment ledger entry
|
|
date: !!python/object/apply:datetime.date [2017, 10, 19]
|
|
amount: !!python/object/apply:decimal.Decimal ["80.00"]
|
|
tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"]
|
|
shirts_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
|
|
currency: USD
|
|
status: Payment
|
|
invoice_id: "83"
|
|
invoice_date: !!python/object/apply:datetime.date [2017, 10, 19]
|
|
payment_id: ch_ahr0ue8lai1ohqu4Gei4Biem
|
|
stripe_id: ch_ahr0ue8lai1ohqu4Gei4Biem
|
|
|
|
- source: nbpy2017b.html
|
|
importer: nbpy2017.InvoiceImporter
|
|
expect:
|
|
- payee: Python Person B
|
|
ledger entry: nbpy2017 invoice ledger entry
|
|
date: !!python/object/apply:datetime.date [2017, 12, 3]
|
|
amount: !!python/object/apply:decimal.Decimal ["50.00"]
|
|
tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
ticket_rate: !!python/object/apply:decimal.Decimal ["42.50"]
|
|
shirts_sold: !!python/object/apply:decimal.Decimal ["0"]
|
|
shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
|
|
status: Invoice
|
|
currency: USD
|
|
invoice_date: !!python/object/apply:datetime.date [2017, 12, 3]
|
|
invoice_id: "304"
|
|
- payee: Python Person B
|
|
ledger entry: nbpy2017 payment ledger entry
|
|
date: !!python/object/apply:datetime.date [2017, 12, 3]
|
|
amount: !!python/object/apply:decimal.Decimal ["50.00"]
|
|
tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
ticket_rate: !!python/object/apply:decimal.Decimal ["42.50"]
|
|
shirts_sold: !!python/object/apply:decimal.Decimal ["0"]
|
|
shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
|
|
status: Payment
|
|
currency: USD
|
|
invoice_date: !!python/object/apply:datetime.date [2017, 12, 3]
|
|
payment_id: ch_eishei9aiY8aiqu4lieYiu9i
|
|
stripe_id: ch_eishei9aiY8aiqu4lieYiu9i
|
|
invoice_id: "304"
|
|
|
|
- source: nbpy2017c.html
|
|
importer: nbpy2017.InvoiceImporter
|
|
expect:
|
|
- payee: Python Person C
|
|
ledger entry: nbpy2017 invoice ledger entry
|
|
date: !!python/object/apply:datetime.date [2017, 10, 5]
|
|
amount: !!python/object/apply:decimal.Decimal ["55.00"]
|
|
tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"]
|
|
shirts_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
|
|
status: Invoice
|
|
currency: USD
|
|
invoice_date: !!python/object/apply:datetime.date [2017, 10, 5]
|
|
invoice_id: "11"
|
|
- payee: Python Person C
|
|
ledger entry: nbpy2017 payment ledger entry
|
|
date: !!python/object/apply:datetime.date [2017, 10, 5]
|
|
amount: !!python/object/apply:decimal.Decimal ["55.00"]
|
|
tickets_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
ticket_rate: !!python/object/apply:decimal.Decimal ["21.25"]
|
|
shirts_sold: !!python/object/apply:decimal.Decimal ["1"]
|
|
shirt_rate: !!python/object/apply:decimal.Decimal ["25.50"]
|
|
status: Payment
|
|
currency: USD
|
|
invoice_date: !!python/object/apply:datetime.date [2017, 10, 5]
|
|
payment_id: ch_daer0ahwoh9oDeiqu2eimoD7
|
|
stripe_id: ch_daer0ahwoh9oDeiqu2eimoD7
|
|
invoice_id: "11"
|
|
|
|
- source: AmazonAffiliateEarnings.csv
|
|
importer: amazon.EarningsImporter
|
|
expect:
|
|
- payee: Amazon
|
|
date: !!python/object/apply:datetime.date [2016, 12, 20]
|
|
amount: !!python/object/apply:decimal.Decimal ["4.24"]
|
|
currency: USD
|
|
- payee: Amazon
|
|
date: !!python/object/apply:datetime.date [2017, 1, 7]
|
|
amount: !!python/object/apply:decimal.Decimal ["-.08"]
|
|
currency: USD
|
|
|
|
- source: Benevity.csv
|
|
importer: benevity.DonationsImporter
|
|
expect:
|
|
- date: !!python/object/apply:datetime.date [2017, 10, 28]
|
|
currency: USD
|
|
disbursement_id: ABCDE12345
|
|
amount: !!python/object/apply:decimal.Decimal [20]
|
|
donation_amount: !!python/object/apply:decimal.Decimal [20]
|
|
match_amount: !!python/object/apply:decimal.Decimal [0]
|
|
payee: Dakota Smith
|
|
corporation: Company A
|
|
project: ""
|
|
comment: ""
|
|
frequency: One-time
|
|
transaction_id: 67890QWERT
|
|
- date: !!python/object/apply:datetime.date [2017, 10, 30]
|
|
currency: USD
|
|
disbursement_id: ABCDE12345
|
|
amount: !!python/object/apply:decimal.Decimal [25]
|
|
donation_amount: !!python/object/apply:decimal.Decimal [25]
|
|
match_amount: !!python/object/apply:decimal.Decimal [0]
|
|
payee: Dakota Smith
|
|
corporation: Company A
|
|
project: ""
|
|
comment: ""
|
|
frequency: One-time
|
|
transaction_id: 67890WERTY
|
|
- date: !!python/object/apply:datetime.date [2017, 10, 19]
|
|
currency: USD
|
|
disbursement_id: ABCDE12345
|
|
amount: !!python/object/apply:decimal.Decimal [10]
|
|
donation_amount: !!python/object/apply:decimal.Decimal [0]
|
|
match_amount: !!python/object/apply:decimal.Decimal [10]
|
|
payee: Anonymous
|
|
corporation: Company B
|
|
project: ""
|
|
comment: ""
|
|
frequency: Unknown
|
|
transaction_id: 67890ERTYU
|
|
- date: !!python/object/apply:datetime.date [2017, 10, 19]
|
|
currency: USD
|
|
disbursement_id: ABCDE12345
|
|
amount: !!python/object/apply:decimal.Decimal [20]
|
|
donation_amount: !!python/object/apply:decimal.Decimal [0]
|
|
match_amount: !!python/object/apply:decimal.Decimal [20]
|
|
payee: Anonymous
|
|
corporation: Company B
|
|
project: ""
|
|
comment: ""
|
|
frequency: Unknown
|
|
transaction_id: 67890RTYUI
|
|
- date: !!python/object/apply:datetime.date [2017, 10, 19]
|
|
currency: USD
|
|
disbursement_id: ABCDE12345
|
|
amount: !!python/object/apply:decimal.Decimal [30]
|
|
donation_amount: !!python/object/apply:decimal.Decimal [30]
|
|
match_amount: !!python/object/apply:decimal.Decimal [0]
|
|
payee: Anonymous
|
|
corporation: Company B
|
|
project: ""
|
|
comment: ""
|
|
frequency: Recurring
|
|
transaction_id: 67890TYUIO
|