E-Invoice - API, Sales Invoice Report (update to exclude data that is marked not to be imported)

This commit is contained in:
Dillon Ngo
2025-11-15 12:19:53 +08:00
parent b7eeb3fcac
commit f0f6822b7e
3 changed files with 18 additions and 3 deletions
@@ -61,8 +61,13 @@ class DateRange implements Filter
ApprovalStatus::SUSPENDED,
])
->where(function ($q) use ($startDate, $endDate) {
$q->where(function ($q) {
$q->whereDoesntHave('company', function ($query) {
$query->where('debtor', 'N/A NO NEED TO IMPORT');
});
})
// Bookings without refunds
$q->where(function ($q1) use ($startDate, $endDate) {
->where(function ($q1) use ($startDate, $endDate) {
$q1->where('status', ApprovalStatus::COMPLETED)
->whereHas('transactions', function ($query) use ($startDate, $endDate){
$query->payments()
@@ -77,8 +77,13 @@ class DateRangeNoData implements Filter
ApprovalStatus::SUSPENDED,
])
->where(function ($q) use ($startDate, $endDate) {
$q->where(function ($q) {
$q->whereDoesntHave('company', function ($query) {
$query->where('debtor', 'N/A NO NEED TO IMPORT');
});
})
// Bookings without refunds
$q->where(function ($q1) use ($startDate, $endDate) {
->where(function ($q1) use ($startDate, $endDate) {
$q1->where('status', ApprovalStatus::COMPLETED)
->whereHas('transactions', function ($query) use ($startDate, $endDate){
$query->payments()
@@ -78,8 +78,13 @@ class DateRangeWithData implements Filter
ApprovalStatus::SUSPENDED,
])
->where(function ($q) use ($startDate, $endDate) {
$q->where(function ($q) {
$q->whereDoesntHave('company', function ($query) {
$query->where('debtor', 'N/A NO NEED TO IMPORT');
});
})
// Bookings without refunds
$q->where(function ($q1) use ($startDate, $endDate) {
->where(function ($q1) use ($startDate, $endDate) {
$q1->where('status', ApprovalStatus::COMPLETED)
->whereHas('transactions', function ($query) use ($startDate, $endDate){
$query->payments()