crater
crater copied to clipboard
All invoices showing "OVERDUE" after migration
I recently migrated from 4.x to 6.x and all my invoices now show the "OVERDUE" badge, even if I set overdue flag to 0 in the database, or set the due date to a distant date in the future. Please help! Thank you :)
This is quite a jump. Are you sure that all of the DB migrations have been applied?
Yes
@profiteroles1 I think it's the same issue as I've described here for the currency model. Essentially, "0" boolean false values in the db (that aren't casted by the model) are evaluating as true
in client-side JS.
Try adding 'overdue' => 'boolean'
to the $casts
property in app/Models/Invoice.php
Were these invoices unpaid (no payments) and has the due date already passed?
In that case, these invoices will be considered as overdue.
Also, try the solution mentioned by @southan to see if that's the issue.
Also, try the solution mentioned by @southan to see if that's the issue.
This fixes the issue. Thank you
Try adding
'overdue' => 'boolean'
to the$casts
property inapp/Models/Invoice.php
I tried this, and it does remove the "overdue" flag from invoices. However, invoices which are overdue aren't marked as such, either. So it's not really a complete fix.