Fixes for AR Summary reports

This commit is contained in:
David Bomba 2023-05-20 12:04:07 +10:00
parent 402b725909
commit b1e0718a89
3 changed files with 10 additions and 9 deletions

View File

@ -44,12 +44,12 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
PDOException::class,
MaxAttemptsExceededException::class,
CommandNotFoundException::class,
ValidationException::class,
ModelNotFoundException::class,
NotFoundHttpException::class,
// PDOException::class,
// MaxAttemptsExceededException::class,
// CommandNotFoundException::class,
// ValidationException::class,
// ModelNotFoundException::class,
// NotFoundHttpException::class,
];
protected $selfHostDontReport = [

View File

@ -100,8 +100,6 @@ class ARDetailReport extends BaseExport
$query = $this->filterByClients($query);
$this->csv->insertOne($this->buildHeader());
$query->cursor()
->each(function ($invoice) {
$this->csv->insertOne($this->buildRow($invoice));

View File

@ -122,7 +122,10 @@ class ARSummaryReport extends BaseExport
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('balance', '>', 0)
->where('is_deleted', 0)
->where('due_date', '<', now()->startOfDay())
->where(function ($query){
$query->where('due_date', '<', now()->startOfDay())
->orWhereNull('due_date');
})
->sum('balance');
return Number::formatMoney($amount, $this->client);