Support

Home Forums Event Espresso Premium Adding fields to the CSV report EE4

Adding fields to the CSV report EE4

Posted: April 20, 2017 at 9:13 am


Robin Brandenburg

April 20, 2017 at 9:13 am

The CSV report does not include the price breakdown as required by our State Sales Tax commission. I am trying to get it up to their requirements.
To be compliant the CSV report must show Ticket Price, Sales Tax, Processing Fees (Non-Taxable),
It is important to note that Processing Fees are not taxable and should not be included in the Sales Tax Computation.
If you select an item to be taxable in the ticket creation area then all surcharges are taxed.
If you edit the Pricing area so Sales taxes is not charged to processing fees then the invoice becomes problematic.
I have added a custom plugin that customizes the Price breakdown described in support thread:
https://eventespresso.com/topic/adding-in-new-fields-into-registrations-reports-export/
This reports;
Event, Ticket Price + Surcharge in one column.
(I.E.)
Mothers Day Brunch 12:00 pm 25.00+Processing Fee 1.00
It does not report the Sales Tax.
I need some code that reports all three.
The instructions on setting up a custom plugin were excellent and easy to follow. Thanks!
A general note; The CSV does not comply with the State’s reporting requirements. I would suspect that this is true for all or most states. I do not know about other Countries and provinces but I would suspect that VAT taxes are also problematic and must be reported separately.


Josh

  • Support Staff

April 21, 2017 at 4:51 pm

Hi Robin,

The following should work for you as long as it’s going to be okay to show the Sales Tax total of the transaction for each registration row:

https://gist.github.com/joshfeck/4b38327cd36756c8233d345ffd170376

You can add the above to a functions plugin.


Robin Brandenburg

April 22, 2017 at 3:20 pm

Thanks Josh. Almost there. The Column has a title “Total Taxes” which is fine, but before each item in the column is the Word Taxes, ie. “Taxes 2.37”
How would I take the word taxes out. Not a PHP coder but looked at the code for the obvious and could not find it.
Thanks


Tony

  • Support Staff

April 24, 2017 at 7:22 am

It’s line 23 of that function:

https://gist.github.com/joshfeck/4b38327cd36756c8233d345ffd170376#file-csv_transaction-php-L23

I’m assuming your sub line item name is ‘Taxes’?

Try changing the above line to:

$sub_line_item_details[] = $sub_line_item->get_pretty( 'LIN_total', 'localized_float' );

Is that what you are looking for?


Robin Brandenburg

April 24, 2017 at 7:08 pm

Thanks Tony, Josh and whoever else worked on this. That is indeed what I needed.

Thanks Again.


Robin Brandenburg

May 1, 2017 at 7:37 am

Didn’t read Josh’s reply close enough.
The following should work for you as long as it’s going to be okay to show the Sales Tax total of the transaction for each registration row:

Further testing revealed that the Sales Tax total is shown in each registration row as Josh Stated but for 3 tickets it show the total for all 3 tickets 3 times.
So the report is Over reporting sales tax. Can we show just the sales tax for the each sale.
Sorry I should have read closer.


Tony

  • Support Staff

May 2, 2017 at 5:54 am

You could wrap the above within a check for the primary registrant.

I forked Joshes example here: https://gist.github.com/Pebblo/76d0e1c7cb851a56636b09ef62156059

That just checks if the registrant is the primary registrant before adding the column (there is only 1 primary registrant per group).

Would that work?


Robin Brandenburg

May 2, 2017 at 6:14 am

Tony and Josh, Thanks
I took tony’s code and added the edit from Josh to remove the words in the report column and now it is reporting the way the state tax commission wants it to be reported.

Thanks for your help.


Tony

  • Support Staff

May 2, 2017 at 6:27 am

You’re most welcome, I’m glad that worked for you.

The support post ‘Adding fields to the CSV report EE4’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso