Merge branch 'dillon/90-e-invoice-f-2' into vapor/development

This commit is contained in:
Dillon Ngo
2025-11-04 11:55:43 +08:00
@@ -92,14 +92,14 @@ class DateRangeNoData implements Filter
$q->where('created_at', '<', '2025-07-01 00:00:00');
});
})
->whereHas('transactions', function ($query) {
$query->where('type', TransactionType::INVOICE)
->whereDoesntHave('attributesKVP', function ($invoiceQuery) {
$invoiceQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
->where(function ($query){
$query
->whereDoesntHave('transactions.attributesKVP', function ($subQuery) {
$subQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
})
->whereDoesntHave('attributesKVP', function ($subQuery) {
$subQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
});
})
->whereDoesntHave('attributesKVP', function ($invoiceQuery) {
$invoiceQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
});
})
// OR bookings with refunds
@@ -119,14 +119,15 @@ class DateRangeNoData implements Filter
$q->where('created_at', '<', '2025-07-01 00:00:00');
});
})
->whereHas('transactions', function ($query) {
$query->where('type', TransactionType::INVOICE)
->whereDoesntHave('attributesKVP', function ($invoiceQuery) {
$invoiceQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
->where(function ($query){
$query
->whereDoesntHave('transactions.attributesKVP', function ($subQuery) {
$subQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
})
->whereDoesntHave('attributesKVP', function ($subQuery) {
$subQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
});
})
->whereDoesntHave('attributesKVP', function ($invoiceQuery) {
$invoiceQuery->where('key', KVPKey::AUTOCOUNT_DOCNO_INVOICE);
});
});
})