S(
Asked
I am getting 500 Errors on the "Add Purchase" submission, please see the attached file
Attachments
- MSAnsweredHello,
Can you please share the errors in the latest log file `storage/logs/`
Thank you - S(AnsweredPlease see the attached log fileAttachments
- MSAnsweredHello,
I see the error for undefined key. Please run `php artisan migrate --force` to update the database and then try to add sale again.
Thank you - S(AnsweredStill I am getting the error while adding the "Add Purchase"
- MSAnsweredPlease check the error log again.
- S(AnsweredPlease see the attached filesAttachments
- MSAnsweredHello,
I can see the error for `Undefined array key "discount_method"` If you see the line this error generated from that should be
```
$v['discount_amount'] = 'order' == ($v['discount_method'] ?? null) ? (new DiscountAction())->calculate($v['discount'] ?? false, $v['total']) : 0;
```
Means if not key for `discount_method` then it should fallback to `null`. I suspect that is old error. Please delete the log file and then try add purchase again. If still get error, please attach the new log file.
Thank you - S(Answerednow it is working fine,
it was $v['discount_amount'] = 'order' == $v['discount_method'] ? (new DiscountAction())->calculate($v['discount'] ?? false, $v['total']) : 0; - MSAnsweredThat's strange it should be in the latest update. When did you download the file?
- Login to Reply