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 * @var array
*/ */
protected $dontReport = [ protected $dontReport = [
PDOException::class, // PDOException::class,
MaxAttemptsExceededException::class, // MaxAttemptsExceededException::class,
CommandNotFoundException::class, // CommandNotFoundException::class,
ValidationException::class, // ValidationException::class,
ModelNotFoundException::class, // ModelNotFoundException::class,
NotFoundHttpException::class, // NotFoundHttpException::class,
]; ];
protected $selfHostDontReport = [ protected $selfHostDontReport = [

View File

@ -100,8 +100,6 @@ class ARDetailReport extends BaseExport
$query = $this->filterByClients($query); $query = $this->filterByClients($query);
$this->csv->insertOne($this->buildHeader());
$query->cursor() $query->cursor()
->each(function ($invoice) { ->each(function ($invoice) {
$this->csv->insertOne($this->buildRow($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]) ->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
->where('balance', '>', 0) ->where('balance', '>', 0)
->where('is_deleted', 0) ->where('is_deleted', 0)
->where('due_date', '<', now()->startOfDay()) ->where(function ($query){
$query->where('due_date', '<', now()->startOfDay())
->orWhereNull('due_date');
})
->sum('balance'); ->sum('balance');
return Number::formatMoney($amount, $this->client); return Number::formatMoney($amount, $this->client);