From 5463290f874cb8a99960fcae8a169df7a127c543 Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Mon, 29 Jul 2019 11:41:49 -0400 Subject: [PATCH] eventbrite: Sales report can include currency. It's a selectable column that I apparently failed to include in my last report. Keep USD around as a default for convenience. --- import2ledger/importers/eventbrite.py | 1 + tests/data/EventBrite.csv | 22 +++++++++++----------- tests/data/imports.yml | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/import2ledger/importers/eventbrite.py b/import2ledger/importers/eventbrite.py index 9958275..b1d5c4a 100644 --- a/import2ledger/importers/eventbrite.py +++ b/import2ledger/importers/eventbrite.py @@ -20,6 +20,7 @@ class SalesImporter(_csv.CSVImporterBase): OPTIONAL_FIELDS = { 'Attendee #': 'attendee_id', 'Company': 'corporation', + 'Currency': 'currency', 'Event ID': 'event_id', 'Event Name': 'event_name', 'Order #': 'order_id', diff --git a/tests/data/EventBrite.csv b/tests/data/EventBrite.csv index 83b71d8..b315869 100644 --- a/tests/data/EventBrite.csv +++ b/tests/data/EventBrite.csv @@ -1,11 +1,11 @@ -Event Name,Event ID,Order #,Order Date,First Name,Last Name,Email,Quantity,Price Tier,Ticket Type,Attendee #,Buyer Last Name,Buyer First Name,Buyer Email,Name/Company on Tax Receipt,Buyer Type,Tax Registration ID,Discount,Hold,Order Type,Total Paid,Fees Paid,Eventbrite Fees,Eventbrite Payment Processing,Tax Paid,Attendee Status,Billing Address 1,Billing Address 2,Billing City,Billing State,Billing Zip,Billing Country,Tax Address 1,Tax Address 2,Tax City,Tax State,Tax Zip,Tax Country,Company -First Event,12345678901,123432101,2018-11-27 09:24:37-05:00,Alex,Jones,aj@example.com,1,,Discount Ticket,432123401,Jones,Alex,aj@example.com,,Individual,,,,Eventbrite Completed,10,3.99,2.99,1,0,Attending,,,,,,,,,,,,, -First Event,12345678901,123432102,2018-12-06 08:35:01-05:00,Bret,Baker,bb@example.com,1,,Regular Ticket,432123402,Baker,Bret,bb@example.com,,Individual,,,,Eventbrite Completed,30,3.99,2.99,1,0,Attending,,,,,,,,,,,,, -First Event,12345678901,123432103,2019-01-07 15:09:14-05:00,Cam,Smith,cs@example.com,1,,Premium Ticket,432123403,Smith,Cam,cs@example.com,,Individual,,,,Eventbrite Completed,60,6.39,4.39,2,0,Attending,,,,,,,,,,,,,SampleCo -First Event,12345678901,123432104,2019-01-18 10:53:42-05:00,Dakota,Jones,dj@example.com,1,,Discount Ticket,432123404,Jones,Dakota,dj@example.com,,Individual,,,,Eventbrite Refunded,10,3.99,2.99,1,0,Not Attending,,,,,,,,,,,,, -First Event,12345678901,123432105,2019-01-08 12:37:25-05:00,Eir,Baker,eb@example.com,1,,Regular Ticket,432123405,Baker,Eir,eb@example.com,,Individual,,,,Eventbrite Refunded,30,3.99,2.99,1,0,Not Attending,,,,,,,,,,,,, -First Event,12345678901,123432106,2019-01-22 10:11:42-05:00,Fey,Smith,fs@example.com,1,,Premium Ticket,432123406,Smith,Fey,fs@example.com,,Individual,,,,Eventbrite Refunded,60,6.39,4.39,2,0,Not Attending,,,,,,,,,,,,, -First Event,12345678901,123432107,2019-01-15 14:32:23-05:00,Gir,Jones,gj@example.com,1,,Discount Ticket,432123407,Jones,Gir,gj@example.com,,Individual,,codeword,,Free Order,0,0,0,0,0,Attending,,,,,,,,,,,,, -First Event,12345678901,123432108,2019-02-01 12:13:48-05:00,Hal,Baker,hb@example.com,1,,Regular Ticket,432123408,Baker,Hal,hb@example.com,,Individual,,codeword,,Free Order,0,0,0,0,0,Attending,,,,,,,,,,,,, -First Event,12345678901,123432109,2019-01-11 12:55:34-05:00,Iris,Smith,is@example.com,1,,Premium Ticket,432123409,Smith,Iris,is@example.com,,Individual,,codeword,,Free Order,0,0,0,0,0,Attending,,,,,,,,,,,,, -Second Event,12345678902,123432110,2019-01-23 13:30:12-05:00,Jam,Jones,jj@example.com,1,,Discount Ticket,432123410,Jones,Jam,jj@example.com,,Individual,,,,Eventbrite Completed,25,3.99,2.99,1,0,Attending,,,,,,,,,,,,, +Event Name,Event ID,Order #,Order Date,First Name,Last Name,Email,Quantity,Price Tier,Ticket Type,Attendee #,Buyer Last Name,Buyer First Name,Buyer Email,Name/Company on Tax Receipt,Buyer Type,Tax Registration ID,Discount,Hold,Order Type,Currency,Total Paid,Fees Paid,Eventbrite Fees,Eventbrite Payment Processing,Tax Paid,Attendee Status,Billing Address 1,Billing Address 2,Billing City,Billing State,Billing Zip,Billing Country,Tax Address 1,Tax Address 2,Tax City,Tax State,Tax Zip,Tax Country,Company +First Event,12345678901,123432101,2018-11-27 09:24:37-05:00,Alex,Jones,aj@example.com,1,,Discount Ticket,432123401,Jones,Alex,aj@example.com,,Individual,,,,Eventbrite Completed,USD,10,3.99,2.99,1,0,Attending,,,,,,,,,,,,, +First Event,12345678901,123432102,2018-12-06 08:35:01-05:00,Bret,Baker,bb@example.com,1,,Regular Ticket,432123402,Baker,Bret,bb@example.com,,Individual,,,,Eventbrite Completed,USD,30,3.99,2.99,1,0,Attending,,,,,,,,,,,,, +First Event,12345678901,123432103,2019-01-07 15:09:14-05:00,Cam,Smith,cs@example.com,1,,Premium Ticket,432123403,Smith,Cam,cs@example.com,,Individual,,,,Eventbrite Completed,USD,60,6.39,4.39,2,0,Attending,,,,,,,,,,,,,SampleCo +First Event,12345678901,123432104,2019-01-18 10:53:42-05:00,Dakota,Jones,dj@example.com,1,,Discount Ticket,432123404,Jones,Dakota,dj@example.com,,Individual,,,,Eventbrite Refunded,USD,10,3.99,2.99,1,0,Not Attending,,,,,,,,,,,,, +First Event,12345678901,123432105,2019-01-08 12:37:25-05:00,Eir,Baker,eb@example.com,1,,Regular Ticket,432123405,Baker,Eir,eb@example.com,,Individual,,,,Eventbrite Refunded,USD,30,3.99,2.99,1,0,Not Attending,,,,,,,,,,,,, +First Event,12345678901,123432106,2019-01-22 10:11:42-05:00,Fey,Smith,fs@example.com,1,,Premium Ticket,432123406,Smith,Fey,fs@example.com,,Individual,,,,Eventbrite Refunded,USD,60,6.39,4.39,2,0,Not Attending,,,,,,,,,,,,, +First Event,12345678901,123432107,2019-01-15 14:32:23-05:00,Gir,Jones,gj@example.com,1,,Discount Ticket,432123407,Jones,Gir,gj@example.com,,Individual,,codeword,,Free Order,USD,0,0,0,0,0,Attending,,,,,,,,,,,,, +First Event,12345678901,123432108,2019-02-01 12:13:48-05:00,Hal,Baker,hb@example.com,1,,Regular Ticket,432123408,Baker,Hal,hb@example.com,,Individual,,codeword,,Free Order,USD,0,0,0,0,0,Attending,,,,,,,,,,,,, +First Event,12345678901,123432109,2019-01-11 12:55:34-05:00,Iris,Smith,is@example.com,1,,Premium Ticket,432123409,Smith,Iris,is@example.com,,Individual,,codeword,,Free Order,USD,0,0,0,0,0,Attending,,,,,,,,,,,,, +Second Event,12345678902,123432110,2019-01-23 13:30:12-05:00,Jam,Jones,jj@example.com,1,,Discount Ticket,432123410,Jones,Jam,jj@example.com,,Individual,,,,Eventbrite Completed,EUR,25,3.99,2.99,1,0,Attending,,,,,,,,,,,,, diff --git a/tests/data/imports.yml b/tests/data/imports.yml index fdafd4d..ce06981 100644 --- a/tests/data/imports.yml +++ b/tests/data/imports.yml @@ -728,7 +728,7 @@ payment_fees: !!python/object/apply:decimal.Decimal ["2"] tax: !!python/object/apply:decimal.Decimal [0] - date: !!python/object/apply:datetime.date [2019, 1, 23] - currency: USD + currency: EUR event_name: Second Event event_id: "12345678902" order_id: "123432110"