diff --git a/resources/css/app.css b/resources/css/app.css index 3560778..3fb73c3 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -173,7 +173,7 @@ .dark { --popover: var(--color-neutral-900); --popover-foreground: hsl(0 0% 98%); --primary: var(--color-orange-300); - --primary-foreground: var(--color-orange-600); + --primary-foreground: var(--color-orange-400); --secondary: hsl(0 0% 14.9%); --secondary-foreground: hsl(0 0% 98%); --muted: var(--color-neutral-700); diff --git a/resources/js/components/ui/progress/Progress.vue b/resources/js/components/ui/progress/Progress.vue index c4f973b..005940d 100644 --- a/resources/js/components/ui/progress/Progress.vue +++ b/resources/js/components/ui/progress/Progress.vue @@ -29,7 +29,7 @@ const delegatedProps = reactiveOmit(props, "class") " > diff --git a/resources/js/lib/utils.ts b/resources/js/lib/utils.ts index 1106ca9..3881141 100644 --- a/resources/js/lib/utils.ts +++ b/resources/js/lib/utils.ts @@ -27,6 +27,18 @@ export function toCurrency(value: number | undefined) { return currencyFormatter.format(value); } +const roundedCurrencyFormatter = new Intl.NumberFormat('de-DE', { + style: 'currency', + currency: 'EUR', + minimumFractionDigits: 0, + maximumFractionDigits: 0 +}) + +export function toRoundedCurrency(value: number | undefined) { + if (!value) return roundedCurrencyFormatter.format(0); + return roundedCurrencyFormatter.format(toFixedRounded(value, 0)); +} + export function toFixedRounded(num: number, precision: number): number { return Number((Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision)).toFixed(precision)) } diff --git a/resources/js/pages/Dashboard.vue b/resources/js/pages/Dashboard.vue index becf5c8..80d2df2 100644 --- a/resources/js/pages/Dashboard.vue +++ b/resources/js/pages/Dashboard.vue @@ -1,76 +1,263 @@ diff --git a/routes/api.php b/routes/api.php index 3cd0655..5b4bbb6 100644 --- a/routes/api.php +++ b/routes/api.php @@ -26,6 +26,7 @@ Route::get('/invoices/summary', [InvoiceController::class, 'summaryAll']); Route::get('/invoices/summaryThisYear', [InvoiceController::class, 'summaryThisYear']); Route::get('/invoices/summaryBeforeThisYear', [InvoiceController::class, 'summaryBeforeThisYear']); +Route::get('/invoices/salesStatistics', [InvoiceController::class, 'salesStatistics']); Route::get('/invoices', [InvoiceController::class, 'index']); Route::post('/invoices', [InvoiceController::class, 'store']); Route::get('/invoices/{id}', [InvoiceController::class, 'single']);