Details
-
Type:
New Feature
-
Status: Done
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
Description
I have found we have some invoices where the invoices are wrong and contain items that should have been billed to other customers.
These items are easy to find by running this query
select * FROM `astpp`.`invoices` LEFT JOIN `astpp`.`invoice_details` ON `astpp`.`invoices`.`id` = `astpp`.`invoice_details`.`invoiceid` LEFT JOIN `astpp`.`accounts` ON `astpp`.`invoice_details`.`accountid` = `astpp`.`accounts`.`id` WHERE astpp.invoices.accountid != astpp.invoice_details.accountid
If any rows are returned, those are rows that have been added to the wrong invoice & customer.
See attached image.

I have confirmed that the invoice_details.accountid is correct and both invoice.accountid and invoice_details.invoiceid are incorrect. Note that some of the invoices.ids are not only wrong between the tables, but are also used for multiple invoice_details.accountids
The invoice_details.created_date on these items looks strange because the date is vaguely believable, but the times see odd.
I have the astpp-invoice.log for the generation of some of these invoices, but there's not enough detail to be helpful.
This looks like it may be related to ASTPPCOM-179 which appears to have been closed without a clear resolution.
My code is up to date to v3.6 I think to commit bee34d1d4bf82d61561a570be65ec3cf5eda166b
Please can others using monthly post-pay please run query above and add their results?
I'm continuing to investigate.