Your cart is currently empty!
Fatal error while creating PayPal CSV file
—
by
Hello,
if we try to create the PayPal CSV there is a fatal error. Any thoughts?
Newest WP / PHP 7.2.15 / Affiliates Enterprise Version 4.0.3
[27-Mar-2019 17:23:28 UTC] PHP Fatal error: Uncaught Error: Class ‘Affiliates_Settings_Registration’ not found in /absolute/path/public_html/wp-content/plugins/affiliates-enterprise/lib/ext/abstract/class-affiliates-totals.php:37
Stack trace:
#0 /absolute/path/public_html/wp-content/plugins/affiliates-enterprise/lib/ext/includes/generate-mass-payment-file.php(51): Affiliates_Totals::get_mass_payment_file(‘paypal’, Array, ‘UTF-8’)
#1 {main}
thrown in /absolute/path/public_html/wp-content/plugins/affiliates-enterprise/lib/ext/abstract/class-affiliates-totals.php on line 37
Posted in Affiliates Enterprise
Comments
11 responses to “Fatal error while creating PayPal CSV file”
Hello, Bruno,
My sincere apologies for the slow reply, we have been quite busy through the past month and this thread got buried down the queue without a proper response.
I have conveyed your suggestion to add a filter hook when creating the mass payment file for consideration to our lead developer and though we can’t promise on an ETA yet, we’re looking into the matter. I have also marked this theme as a feature request, so that it stays on our development list.
Cheers,
Denitsa
Hey there, Bruno!
That’s weird, when I check the file affiliates-enterprise/lib/ext/abstract/class-affiliates-totals.php, the last closing bracket is curly (that’s on line 69), as is the one for the last function (the render_results, line 68). How did you learn about this error – did you get a message again when exporting a mass payment file?
About adding VAT, I’d need a bit more detail to understand the scenario clearly, e.g. do you add/subtract additional VAT after the referral amount is calculated, or is it something else you’re referring to?
Cheers,
Denitsa
Hey Denitsa,
I have installed the new update again and now the closing brackets are included. I learned about this error while studying the files to find solutions for my questions. Since you use minifying, this tool is helpful: http://www.phpformatter.com/
VAT: At the moment the affiliate system calculates all amounts ´without VAT and that’s fine. We can communicate this to our partners. But if we generate the PayPal payment file we need to add 19% VAT on all amounts. Is there a filter where we can change the calculations?
Cheers
Hello, Bruno,
Thank you for your suggestion.
As for the VAT, would it work for you if you used a formula-based rate, e.g. you add/subtract 19% to the base commission rate?
To create a formula-based rate, go to Affiliates > Rates > New Rate – under Type choose Formula and input the desired formula under Value.
These are the default variables, that come with the WooCommerce Integration, for example:
s : the net order subtotal
t : product line subtotal
p : unit product price as product subtotal divided by the quantity (the number of units for the order line)
q : quantity, the number of line units
For example, if you’d type s*1.19, that’d give you 119% of the net transaction amount and then you could set your current rate to it – if you give a 10% commission, then the whole sum of the rate would be 1.19*s*0.1 (or just 0.119*s). You can check the available options on this page -> http://docs.itthinx.com/document/affiliates-enterprise/rates/, specifically under the Formula-based Rates section.
You can also use the filter affiliates_formula_computer_variables provided by the plugin’s API.
Documentation is found on this page (http://docs.itthinx.com/document/affiliates-enterprise/api/filters/), under the affiliates_formula_computer_variables section.
Let me know how it goes!
Cheers,
Denitsa
Hello Denitsa,
it is a little bit more complicated.Unfortunately, this will not help, because here in Germany you have to differentiate between different types of entrepreneurs. Some get with VAT, others don’t and you have to pay it to the tax office directly.
Most helpful (and most useful) would be simply a filter hook in which the value is passed which is used for the payout file and as 2nd parameter the user_id of the affiliate. Then you can see in the metadata of the user what has to be used for this sum.
Cheers
Hey Bruno,
Thanks for clarifying! What you might try, is using a spreadsheet template in which to import the data.
Just to make sure if I got this right, in some cases VAT needs to be included, and in some it doesn’t, but is it up to the affiliate to pay and invoice VAT, or do you need to cover VAT payments for them?
We have it in the road map for the plugin to include a similar functionality (I can’t provide you with an ETA on that though), which would allow including custom registration fields when exporting (but not with the Mass Payment file option). Then it’d be possible to have an extra field for each user, that concerns the VAT/no VAT calculation.
Cheers,
Denitsa
We don’t need an extra field. It is only a matter of being able to influence the sum when creating the Mass Payment File with the help of an action filter. As first value the sum is used, as second value the user_id of the affiliate. That is all. Just a simple action filter.
FYI The latest release (4.1.0) has these filters added which should provide convenient for your purposes:
* Added the affiliates_totals_payment_file_line filter.
* Added the affiliates_totals_payment_file_line_output filter.
* Added the affiliates_totals_export_file_headings filter.
* Added the affiliates_totals_export_file_line filter.
* Added the affiliates_totals_export_file_line_output filter.
The filters are documented here and are pretty straight-forward to use:
http://docs.itthinx.com/document/affiliates-enterprise/api/filters/
Cheers
And I have a question for the mass payment file. How can I add the VAT to the the individual totals ?
Hello Denitsa,
It seems that there is still an error inside the file:
affiliates-enterprise/lib/ext/abstract/class-affiliates-totals.php
The last function ends with a bracket instead of a curly bracket.
Cheers
Hello, Bruno!
Thanks for letting us know about that error, we confirmed it on our end and fixed it in the latest release – Affiliates 4.0.4. Please give it a try 🙂
Hope this helps!
Cheers,
Denitsa