mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 19:51:09 -04:00
refactor sales reports
This commit is contained in:
@ -26,8 +26,7 @@ class ReportController extends Controller
|
|||||||
$query->whereBetween(
|
$query->whereBetween(
|
||||||
'invoice_date',
|
'invoice_date',
|
||||||
[$start->format('Y-m-d'), $end->format('Y-m-d')]
|
[$start->format('Y-m-d'), $end->format('Y-m-d')]
|
||||||
)
|
);
|
||||||
->where('paid_status', Invoice::STATUS_PAID);
|
|
||||||
}])
|
}])
|
||||||
->customer()
|
->customer()
|
||||||
->whereCompany($company->id)
|
->whereCompany($company->id)
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class InvoiceItem extends Model
|
|||||||
$query->whereBetween(
|
$query->whereBetween(
|
||||||
'invoice_date',
|
'invoice_date',
|
||||||
[$start->format('Y-m-d'), $end->format('Y-m-d')]
|
[$start->format('Y-m-d'), $end->format('Y-m-d')]
|
||||||
)->where('paid_status', Invoice::STATUS_PAID);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -216,7 +216,7 @@ class User extends Authenticatable implements HasMedia
|
|||||||
$query->whereBetween(
|
$query->whereBetween(
|
||||||
'invoice_date',
|
'invoice_date',
|
||||||
[$start->format('Y-m-d'), $end->format('Y-m-d')]
|
[$start->format('Y-m-d'), $end->format('Y-m-d')]
|
||||||
)->where('paid_status', Invoice::STATUS_PAID);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user