E-Invoice - API, Sales Invoice Report (update with voucherify info)

This commit is contained in:
Dillon Ngo
2025-11-04 11:55:29 +08:00
parent 28911fb00e
commit b7eeb3fcac
@@ -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);
});
});
})