Posted: April 26, 2016 at 10:59 am
|
The topic title says it all – EE3 attendee export shows ‘date paid’ although status is pending. Why? Surely it should be blank? (using EE3 3.1.37.8.P on WP 4.5) |
Hi there, This can happen if the attendee’s Payment Record was edited. You can go to edit the attendee payment record, blank out the field for Payment Date, then click Update Payment and the date paid cell will be blank again. |
|
|
Are you saying that it is expected behaviour for a record being edited to automatically insert the current date as the payment date? How would one prevent this from happening? Surely one is not expected to save, then delete a date that has appeared, then save again? |
|
I wrote my last reply before testing blanking out the payment date field. This does not work. As soon as one saves todays date is re-inserted. It is possible to set another date in the past or future, but trying to save the record without data does not work, neither does entering ‘none’ or ‘0’ |
|
Hi – any updates on this? |
Hi there, The payment date field defaults to today’s date as it is expected if the user is editing that section that they will apply a payment and a record of the date that edit was made should be made. So its better to default to a date although I do think there should be an option to allow you to set the date back to nothing. Looking through the code we currently check if the field isset() to check if the field has been set before using it. The problem is that ‘nothing’ returns true for isset so continues on (in this case the only problem with that is that the date will always default to day, which is the default anyway) so you can not set the field in a way that would allow you to remove the date. I’ve created a ticket to allow for this but it’s a really simple change if you are comfortable working with PHP? \event-espresso\includes\admin-reports\enter_attendee_payments.php line 62 should read:
Change that to:
That will allow you to set the payment to 0 to force EE to remove the date from that field. If applied that same fix within a ticket which will be reviewed, tested and included within EE3 if no errors are found. |
|
|
Hmm… Thanks, but oddly with the change you have suggested entering 0 does not remove the date. I am pretty sure I have correctly altered line 62 of the file you identified: /wp-content/plugins/event-espresso/includes/admin-reports/enter_attendee_payments.php so cannot figure why the behaviour seems unchanged? |
Are you looking within the edit payment screen or the registration information? To confirm, when you load the page the form will always default the current date unless one has already been set. If you set the date to 0 and update, the edit payment page will still display the current date. You’ll need to reload the Registration information page to confirm if the database has been updated – http://take.ms/jUip8 |
|
|
OK thanks – I was looking at the edit payment page which as you say always shows the current date if nothing has been set even after saving with ‘0’ in the date (which is what confused me as highly unintuitive behaviour!). Going back to the registration information page after saving ‘0’ in date paid it says n/a as per your screenshot. I think that the date paid values got set in the first place by running an export on the data rather than by editing individual records like this. Not 100% certain on this however as different people use the system. |
The reason it does this is simple, its better to record the date of the payment and then amended that if needed rather than for it not to be entered at all and no record of when the payment was made. (IE the user forgot to add the date of the transaction) The edit payment section is intended to be used when your applying a payment, so the default date should be used there. If you have any suggestions on how we can improve this without losing the default date and causing more confusion I can pass those on to the developers.
Exporting the data from within EE? The export doesn’t have any code to update the records so I would be very surprised if that was the case. The edit payment screen and the payment gateways should be the only locations that edit that date. |
|
|
The invoice template php file includes the line Just trying to establish what order things are being done to see how the date paid could be getting set. |
No, that’s pulling the current payment_date set on the attendee and assigning that to a $payment_date variable. There is code to update the payment date within the invoice template, it was used to allow users to track when a user registered a pending registration and downloaded the invoice. However this proved problematic for the majority of users and was commented out. It’s a little below the line you added above:
As long as that is still commented out on your template file it’s not setting the payment_date. |
|
|
Ah – a good part of the problem is likely in this area. Before the code you mention I can see that payment status is set to ‘Pending’ if it is not already ‘Completed’. Looks like I might need the rest if I do want to keep setting ‘Pending’ so perhaps the code should just comment out the $payment_date and leave everything else? Or should I also change the $sql query to delete all reference to this variable?
|
Where is that template located? /wp-content/uploads/espresso/gateways/invoice/? That looks like an older version of the template, the latest version has all of that commented out. Compare it with /wp-content/plugins/event-espresso/gateways/invoice/template.php and you should see the difference. Have you customized the Invoice template at all? |
|
|
yes, heavily customised. In /wp-content/uploads/espresso/gateways/invoice/ |
|
The section was uncommented to reactivate payment status change on invoice download. As I asked above – “I do want to keep setting ‘Pending’ so perhaps the code should just comment out the $payment_date and leave everything else? Or should I also change the $sql query to delete all reference to this variable?” |
The easiest way to do it will be just set $payment_date to an empty string: So this:
would be:
That way you can leave the query as is and it will just set the date to nothing. Be sure to test a registration and downloading the invoice after making the above change to confirm it works as expected on your site. |
|
The support post ‘EE3 attendee export shows 'date paid' although status is pending’ 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.