Jonathan Posted June 16, 2015 Report Posted June 16, 2015 Upon invoice generation (verified over days now) date_autodebit isn't filled in the "invoices" table, thus all email tell customers they need to enable auto-debit causing a pretty good bit of confusion with them. Is it supposed to always be null? If so, how is "invoice.autodebit_date_formatted" in email template supposed to work?
Jonathan Posted June 16, 2015 Author Report Posted June 16, 2015 Verified in 3.4.4 with default email templates that regardless of a client's auto-debit settings, date_autodebit in the DB isn't set and the customer is prompted to setup auto-debit (when it should tell them the auto-debit date).
Paul Posted June 16, 2015 Report Posted June 16, 2015 I'm not sure that field is for that purpose, hopefully Cody or Tyson can clarify. Auto debit is determined by other factors, such as whether they have auto debit enabled, and a payment account selected for auto debit. I *think*, maybe, that field is used when auto debit fails and will be re-attempted at a later time. Will need clarification, but that's my suspicion.
Tyson Posted June 18, 2015 Report Posted June 18, 2015 The invoice autodebit date is an override date. If an override date is not set, the auto debit date is determined from the invoice due date and the setting Auto Debit Days Before Due Date. How are customers prompted to setup auto-debit? Is this in an email template?
Jonathan Posted June 18, 2015 Author Report Posted June 18, 2015 It's the default "invoice created (unpaid)" email template. Nothing has been changed there. This is the "if" statement generating it: Hi {contact.first_name}, An invoice has been created for your account and is attached to this email in PDF format. {% for invoice in invoices %} Invoice #: {invoice.id_code} {% if autodebit %}{% if invoice.autodebit_date_formatted %}Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted} unless payment has been applied sooner. {% else %} If you would like us to automatically charge your card, login to your account at https://{client_url} to set up auto debit.{% endif %}{% else %}If you would like us to automatically charge your card, login to your account at https://{client_url} to set up auto debit.{% endif %} Pay Now, visit https://{invoice.payment_url} (No login required) {% endfor %} If you have any questions about your invoice, please let us know!
Tyson Posted June 18, 2015 Report Posted June 18, 2015 Does the client that received that email have autodebit enabled? Under their profile, the "Auto Debit" section in the sidebar would say "ENABLED". Does the client have a payment account setup? If so, is a payment account set for autodebit? Under the client's payment accounts page, a radio button exists in the table next to each row. Auto debit is enabled for the payment account that is selected. Is the invoice an active or proforma invoice? If autodebit is enabled, the invoice is active, and a payment account exists for autodebit, then they should see this in the email: Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted} unless payment has been applied sooner. Otherwise: If you would like us to automatically charge your card, login to your account at https://{client_url} to set up auto debit.
Jonathan Posted June 18, 2015 Author Report Posted June 18, 2015 All criteria is met so that the customer should get: Auto debit is enabled for your account, so we'll automatically process the card you have on file on {invoice.autodebit_date_formatted} unless payment has been applied sooner. Auto-debit is enabled, a payment account is setup - the payment account works. It's standard invoicing - not proforma or pro-rata. This is happening on a 3.4.x install as well.
Tyson Posted June 18, 2015 Report Posted June 18, 2015 I'm not able to duplicate that behavior. Are you sure the payment account is set for autodebit? If the client profile shows Auto Debit as "ENABLED" with a strike-through, then a payment account is not set for auto debit.
Jonathan Posted June 19, 2015 Author Report Posted June 19, 2015 I'm not able to duplicate that behavior. Are you sure the payment account is set for autodebit? If the client profile shows Auto Debit as "ENABLED" with a strike-through, then a payment account is not set for auto debit. 10000% positive. It's happening across the board on two different installs. It's not hit or miss for certain customers, it's happening to everyone with auto-debit enabled.
Jonathan Posted July 9, 2015 Author Report Posted July 9, 2015 The date in auto-debit email reminder is also not getting filled. This is a reminder that a payment is scheduled to be charged to your account on in the amount of $60.00 for invoice #468755. Guess the two things are related. Verified this happens in two different systems, each on 3.5 stable. One system runs PHP 5.6, the other PHP 5.4.
Jonathan Posted July 9, 2015 Author Report Posted July 9, 2015 I think I found the issue. Will update this post with more info once confirmed. Blesta Addons and activa 2
Tyson Posted July 9, 2015 Report Posted July 9, 2015 I think I found the issue. Will update this post with more info once confirmed. Sounds good. Curious what you've found.
Jonathan Posted July 9, 2015 Author Report Posted July 9, 2015 Looks like it was due to a missing autodebit setting in client_settings table. On one install I know how this happened. On the second I have no idea how it wasn't there for some records. It was a WHMCS import FWIW.
Tyson Posted July 10, 2015 Report Posted July 10, 2015 So the client did not have a specific autodebit setting, and was inheriting from the client group or company, which was set to disabled? Did a company/system setting for autodebit even exist? Did clicking the Autodebit link on the client profile not toggle enabling/disabling autodebit by adding the field to the client settings? And did it say "ENABLED" when it was not? I'm not sure I would classify this issue as a bug unless one of those answers is yes, however, I tested this myself to find them working properly.
Recommended Posts