Add fis_wdg_* table functions for dashboard widgets and wire them into FuchsDatabase.sqlproj; update the invoice list procs accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- =============================================
|
||||
-- Description: Dashboard widget 'wdg_invoices_overdue' (Unbezahlte Rechungen Überfällig).
|
||||
-- Called from [dbo].[fis_widgets].[sql] as: SELECT * FROM [dbo].[fis_wdg_invoices_overdue]()
|
||||
-- =============================================
|
||||
CREATE FUNCTION [dbo].[fis_wdg_invoices_overdue]()
|
||||
RETURNS TABLE
|
||||
AS
|
||||
RETURN
|
||||
(
|
||||
SELECT [label] = N'überfällige Rechnungen (10wd)', [value] = COUNT(*)
|
||||
FROM [dbo].[fds__fn_unpaidInvoices]()
|
||||
WHERE [dbo].[fds__fn_invoiceDate]([DateFinalized], NULL) >= DATEFROMPARTS(2026, 1, 1)
|
||||
AND [dbo].[date_addcustom]([dbo].[fds__fn_invoiceDate]([DateFinalized], NULL), '10wd') < CAST(GETDATE() as date)
|
||||
);
|
||||
Reference in New Issue
Block a user