Jump to content
  • 0

[Resolved] invoice paid, client still recieve overdue emails notice


Blesta Addons

Question

a client has paid his invoice in 28-7-2017. the invoice due is 6-8-2017 . now is closed and transaction well recorded .

the client still receive a notice about the invoice due (2  times), when we have checked blesta email logs we didn't find any trace for those email . the client has forwarded the emails to us, and it appear sent from blesta with date/time of cron run . i have make a deep look in the server mail log and i found that the email sent from our server .

How this can happen, payment notice email sent from blesta for closed invoice and is not recorded in the email log in blesta !!!

this can lead to a suspension service?

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

We have found the issue .

12 hours ago, Tyson said:

or maybe a separate Blesta installation altogether that is using the same database?

another instance of the VM was running in our cloud servers, it was a stuff mistake , he cloned our VM instead of a client VM , for this reason the cloned VM send email from our server (as smtp) so it exist entry in the mail log and no entry in blesta .

for the suspension, as the invoice is paid and closed in our server, but not in the cloned one they was suspended in the cloned one .

SO Sorry for this trouble, it has takes from me about 4 days of searching and searching until i found a client claim that he was not received any info about his cloned VM, when i have checked i have found that the VM has the same hostname as our server, so we finally get the issue, it was stressed days.

Link to comment
Share on other sites

  • 0

The invoice would have to be unpaid for the service to be considered for suspension in the future, so it depends. Does the invoice have a non-null `date_closed`? If there is no `date_closed` date set, the invoice is considered Open and would receive the payment notices.

If the email was sent by Blesta it should appear in the email logs. Do other payment notice emails appear in the email logs?

Link to comment
Share on other sites

  • 0
5 hours ago, Tyson said:

The invoice would have to be unpaid for the service to be considered for suspension in the future, so it depends. Does the invoice have a non-null `date_closed`? If there is no `date_closed` date set, the invoice is considered Open and would receive the payment notices.

If the email was sent by Blesta it should appear in the email logs. Do other payment notice emails appear in the email logs?

This case is a strange case, all the other emails are in the logs , also i found the payment email with the final invoice in the logs in blesta, what is not normal how blesta send emails and is not stored in the logs , that who will make me crazy !!!! i never expeienced like this case, i have the fallowing point :

- The invoice is paid totally and in closed status.
- Blesta sent payment due notice email for this closed invoice, but is not recorded in blesta logs, in the mail server log exist a entry for them.

we have Proforma enabled, is there any query sql to run to make diagnostics or any other think i should do ?

Link to comment
Share on other sites

  • 0

The email logs can be deleted over time based on your rotation policy under System -> General -> Basic Setup. Are you sure those payment notice emails are not just so old that they were deleted from the logs?

Are you sure the invoice has a `date_closed` set in the `invoices` table?

Payment notices can go out for open invoices, e.g., invoices in this list (where the date is the current timestamp UTC):

SELECT
`invoices`.*,
REPLACE(`invoices`.`id_format`, '{num}', `invoices`.`id_value`) AS `id_code`,
`invoice_delivery`.`date_sent` AS `delivery_date_sent`,
REPLACE(`clients`.`id_format`, '{num}', `clients`.`id_value`) AS `client_id_code`,
`contacts`.`first_name` AS `client_first_name`,
`contacts`.`last_name` AS `client_last_name`,
`contacts`.`company` AS `client_company`,
`contacts`.`address1` AS `client_address1`,
`contacts`.`email` AS `client_email`,
invoices.total-IFNULL(invoices.paid,0) AS `due`
FROM `invoices`
INNER JOIN `clients` ON `clients`.`id`=`invoices`.`client_id`
INNER JOIN `client_groups` ON `client_groups`.`id`=`clients`.`client_group_id`
INNER JOIN `contacts` ON `contacts`.`contact_type`='primary' AND `contacts`.`client_id`=`clients`.`id`
LEFT JOIN `invoice_delivery` ON `invoice_delivery`.`date_sent` IS NOT NULL AND `invoice_delivery`.`invoice_id`=`invoices`.`id`
WHERE `invoices`.`date_closed` IS NULL
AND `invoices`.`status` IN ('active','proforma')
AND `invoices`.`date_billed`<='2017-08-07 21:38:49'
AND `client_groups`.`company_id`=1
GROUP BY `invoices`.`id`

If you run that query, does the invoice you're referring to appear in the list?

Link to comment
Share on other sites

  • 0
15 hours ago, Tyson said:

The email logs can be deleted over time based on your rotation policy under System -> General -> Basic Setup. Are you sure those payment notice emails are not just so old that they were deleted from the logs?

Are you sure the invoice has a `date_closed` set in the `invoices` table?

Payment notices can go out for open invoices, e.g., invoices in this list (where the date is the current timestamp UTC):


SELECT
`invoices`.*,
REPLACE(`invoices`.`id_format`, '{num}', `invoices`.`id_value`) AS `id_code`,
`invoice_delivery`.`date_sent` AS `delivery_date_sent`,
REPLACE(`clients`.`id_format`, '{num}', `clients`.`id_value`) AS `client_id_code`,
`contacts`.`first_name` AS `client_first_name`,
`contacts`.`last_name` AS `client_last_name`,
`contacts`.`company` AS `client_company`,
`contacts`.`address1` AS `client_address1`,
`contacts`.`email` AS `client_email`,
invoices.total-IFNULL(invoices.paid,0) AS `due`
FROM `invoices`
INNER JOIN `clients` ON `clients`.`id`=`invoices`.`client_id`
INNER JOIN `client_groups` ON `client_groups`.`id`=`clients`.`client_group_id`
INNER JOIN `contacts` ON `contacts`.`contact_type`='primary' AND `contacts`.`client_id`=`clients`.`id`
LEFT JOIN `invoice_delivery` ON `invoice_delivery`.`date_sent` IS NOT NULL AND `invoice_delivery`.`invoice_id`=`invoices`.`id`
WHERE `invoices`.`date_closed` IS NULL
AND `invoices`.`status` IN ('active','proforma')
AND `invoices`.`date_billed`<='2017-08-07 21:38:49'
AND `client_groups`.`company_id`=1
GROUP BY `invoices`.`id`

If you run that query, does the invoice you're referring to appear in the list?

Hell tyson,

about the logs is not deleted by the rotation policy, as exist entry older than them .

date_closed is not empty , and is filled with the same date of payment 2017-07-28 08:26:59 .

your query has returned a lot of invoices in the result, but the concerned invoice is not in the list.

i found that date_billed is the same as date_closed 2017-07-28 08:26:59, but i think this is related to pro-forma setting.

date_due is 2017-08-06 00:00:00, status is 'active', so from the database i think is all thing is fine.

if i'm not wrong today it should send the suspension notice, i will be tunned to see what will come .

 

Link to comment
Share on other sites

  • 0

We have another case, not sure if this related to this issue, i have another website that was suspended yesterday by blesta, the invoice was paid already on Aug 04, 2017 . the payment was done after the third notice , so i can't say the emails sent even if the invoice was paid, but the question here why it was suspended if the invoice is paid and closed ? this time the blesta mail log show the suspension email are logged.

 

 

Link to comment
Share on other sites

  • 0
8 hours ago, Blesta Addons said:

We have another case, not sure if this related to this issue, i have another website that was suspended yesterday by blesta, the invoice was paid already on Aug 04, 2017 . the payment was done after the third notice , so i can't say the emails sent even if the invoice was paid, but the question here why it was suspended if the invoice is paid and closed ? this time the blesta mail log show the suspension email are logged.

Are there any invoices that have a line item associated with the service where:

  • the invoice has not been closed (i.e. has a null `date_closed` value)
  • the invoice status is active or proforma
  • the invoice has a due date in the past

If all those criteria are met, then the service could be suspended.

9 hours ago, Blesta Addons said:

i found that date_billed is the same as date_closed 2017-07-28 08:26:59, but i think this is related to pro-forma setting.

date_due is 2017-08-06 00:00:00, status is 'active', so from the database i think is all thing is fine.

if i'm not wrong today it should send the suspension notice, i will be tunned to see what will come .

It sounds like the data in the database is fine, yes. Did the service get suspended? If the invoice `date_closed` is set to 2017-07-28 08:26:59, then it should not be suspended --unless-- there is a different invoice for the service that is past due.

9 hours ago, Blesta Addons said:

Hell tyson,

about the logs is not deleted by the rotation policy, as exist entry older than them .

date_closed is not empty , and is filled with the same date of payment 2017-07-28 08:26:59 .

your query has returned a lot of invoices in the result, but the concerned invoice is not in the list.

If the invoice is not in the list, a payment notice email would not be sent for it. If some are still being sent, it is very peculiar and I wonder if something strange is going on.. do those payment notice emails ever get sent from custom code or a custom plugin, or maybe a separate Blesta installation altogether that is using the same database?

Link to comment
Share on other sites

  • 0
30 minutes ago, Tyson said:

If the invoice is not in the list, a payment notice email would not be sent for it. If some are still being sent, it is very peculiar and I wonder if something strange is going on.. do those payment notice emails ever get sent from custom code or a custom plugin, or maybe a separate Blesta installation altogether that is using the same database?

we have only this in our production server, so no replicate of it.  we don't have any other plugin that send notice email, the only plugins that send emails has nothing for notices or suspension notices .

other question i will search tomorrow and back to you,  is really strange this cases .

Link to comment
Share on other sites

  • 0

Something is totally strange, blesta suspend website that are already paid, today we have received another case, we have now 5 service suspended but they are paid !!!

we have not added any new plugin or any new modification . the only thing we have do is upgrading the last month to v4.0.1 .

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...