diff --git a/assets/css/main.css b/assets/css/main.css index 303f754..d4193c0 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -237,7 +237,7 @@ html.dark .section-card::before { ========================= */ .dither-shadow { - @apply bg-black dark:bg-neutral-600; + @apply bg-black dark:bg-neutral-400; background-image: radial-gradient(white 1px, transparent 1px); background-size: 2px 2px; } diff --git a/components/AnnualBudget.vue b/components/AnnualBudget.vue index 3433222..16e9a24 100644 --- a/components/AnnualBudget.vue +++ b/components/AnnualBudget.vue @@ -2,114 +2,164 @@
-

Annual Budget Overview

+
+
+
+ + + + + + + + + + + + + -
-
+ Category + + Planned + + % +
+ REVENUE +
- - - - - - - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + - - - - + + + + - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - -
- Category - - Planned - %
REVENUE
+ {{ category.name }} + + {{ formatCurrency(category.planned) }} + + {{ category.percentage }}% +
- {{ category.name }} - - {{ formatCurrency(category.planned) }} - {{ category.percentage }}%
+ Total Revenue + + {{ formatCurrency(totalRevenuePlanned) }} + + 100% +
Total Revenue - {{ formatCurrency(totalRevenuePlanned) }} - 100%
+
+

+ {{ diversificationGuidance }} +

+

+ Consider developing: {{ suggestedCategories.join(", ") }} +

+

+ + Learn how to develop these revenue streams → + +

+
+
-
-

{{ diversificationGuidance }}

-

- Consider developing: {{ suggestedCategories.join(", ") }} -

-

- - Learn how to develop these revenue streams → - -

-
-
+ EXPENSES +
EXPENSES
+ {{ category.name }} + + {{ formatCurrency(category.planned) }} + + {{ category.percentage }}% +
- {{ category.name }} - - {{ formatCurrency(category.planned) }} - {{ category.percentage }}%
+ Total Expenses + + {{ formatCurrency(totalExpensesPlanned) }} + + 100% +
Total Expenses - {{ formatCurrency(totalExpensesPlanned) }} - 100%
NET TOTAL - {{ formatCurrency(netTotal) }} - -
+ + + + NET TOTAL + + + {{ formatCurrency(netTotal) }} + + + - + + + + +
@@ -242,9 +292,9 @@ const netTotal = computed( ); const netTotalClass = computed(() => { - if (netTotal.value > 0) return "bg-green-50"; - if (netTotal.value < 0) return "bg-red-50"; - return "bg-neutral-50"; + if (netTotal.value > 0) return "bg-green-50 dark:bg-green-950"; + if (netTotal.value < 0) return "bg-red-50 dark:bg-red-950"; + return "bg-neutral-50 dark:bg-neutral-800"; }); // Diversification guidance @@ -308,28 +358,6 @@ const diversificationGuidance = computed(() => { return guidance; }); -const guidanceBackgroundClass = computed(() => { - const topCategory = revenueCategories.value.reduce( - (max, cat) => (cat.percentage > max.percentage ? cat : max), - { percentage: 0 } - ); - - if (topCategory.percentage >= 70) { - return "bg-red-50"; - } else if (topCategory.percentage >= 50) { - return "bg-red-50"; - } else { - const categoriesAbove20 = revenueCategories.value.filter( - (cat) => cat.percentage >= 20 - ).length; - if (categoriesAbove20 >= 3) { - return "bg-green-50"; - } else { - return "bg-yellow-50"; - } - } -}); - // Suggested categories to develop const suggestedCategories = computed(() => { const categoriesWithRevenue = revenueCategories.value.filter( @@ -394,10 +422,11 @@ function formatCurrency(amount: number): string { } function getPercentageClass(percentage: number): string { - if (percentage > 50) return "text-red-600 font-bold"; - if (percentage > 35) return "text-yellow-600 font-semibold"; - if (percentage > 20) return "text-black font-medium"; - return "text-neutral-500"; + if (percentage > 50) return "text-red-600 dark:text-red-400 font-bold"; + if (percentage > 35) + return "text-yellow-600 dark:text-yellow-400 font-semibold"; + if (percentage > 20) return "text-black dark:text-white font-medium"; + return "text-neutral-500 dark:text-neutral-400"; } // Initialize diff --git a/components/BudgetSettingsModal.vue b/components/BudgetSettingsModal.vue new file mode 100644 index 0000000..80b08fb --- /dev/null +++ b/components/BudgetSettingsModal.vue @@ -0,0 +1,208 @@ + + + \ No newline at end of file diff --git a/components/PayrollOncostModal.vue b/components/PayrollOncostModal.vue deleted file mode 100644 index de0acaf..0000000 --- a/components/PayrollOncostModal.vue +++ /dev/null @@ -1,323 +0,0 @@ - - - - - diff --git a/composables/useCoopBuilder.ts b/composables/useCoopBuilder.ts index 2c75fe9..fb3f163 100644 --- a/composables/useCoopBuilder.ts +++ b/composables/useCoopBuilder.ts @@ -102,7 +102,7 @@ export function useCoopBuilder() { streams: baseStreams.map(s => { // Reduce service revenue by 30% if (s.category?.toLowerCase().includes('service') || s.label.toLowerCase().includes('service')) { - return { ...s, monthly: (s.monthly || 0) * 0.7 } + return { ...s, monthly: Math.round((s.monthly || 0) * 0.7) } } return s }) @@ -128,7 +128,7 @@ export function useCoopBuilder() { if (revenueDelay > 0) { adjustedStreams = adjustedStreams.map(s => ({ ...s, - monthly: (s.monthly || 0) * Math.max(0, 1 - (revenueDelay / 12)) + monthly: Math.round((s.monthly || 0) * Math.max(0, 1 - (revenueDelay / 12))) })) } @@ -251,7 +251,7 @@ export function useCoopBuilder() { // Calculate monthly payroll const payrollCost = monthlyPayroll(scenarioMembers || [], currentMode) || 0 const oncostPct = store.payrollOncostPct || 0 - const totalPayroll = payrollCost * (1 + Math.max(0, oncostPct) / 100) + const totalPayroll = Math.round(payrollCost * (1 + Math.max(0, oncostPct) / 100)) // Calculate revenue and costs const totalRevenue = (scenarioStreams || []).reduce((sum, s) => sum + (s.monthly || 0), 0) diff --git a/composables/useCushionForecast.ts b/composables/useCushionForecast.ts index 5d70cc4..1c190d5 100644 --- a/composables/useCushionForecast.ts +++ b/composables/useCushionForecast.ts @@ -63,7 +63,7 @@ export function useCushionForecast() { const operatingMode = policiesStore.operatingMode || 'minimum' const payrollCost = monthlyPayroll(membersStore.members, operatingMode) const oncostPct = policiesStore.payrollOncostPct || 0 - const totalPayroll = payrollCost * (1 + oncostPct / 100) + const totalPayroll = Math.round(payrollCost * (1 + oncostPct / 100)) const overheadCost = budgetStore.overheadCosts.reduce((sum, cost) => sum + (cost.amount || 0), 0) return totalPayroll + overheadCost diff --git a/composables/useDeferredMetrics.ts b/composables/useDeferredMetrics.ts index 43d74d9..630816f 100644 --- a/composables/useDeferredMetrics.ts +++ b/composables/useDeferredMetrics.ts @@ -18,7 +18,7 @@ export const useDeferredMetrics = () => { ): number => { const totalTargetHours = members.reduce((sum, member) => sum + (member.targetHours || 0), 0) const grossPayroll = totalTargetHours * hourlyWage - return grossPayroll * (1 + oncostPct / 100) + return Math.round(grossPayroll * (1 + oncostPct / 100)) } const calculateDeferredRatio = ( diff --git a/composables/usePayrollAllocation.ts b/composables/usePayrollAllocation.ts index 1562e1b..f66916a 100644 --- a/composables/usePayrollAllocation.ts +++ b/composables/usePayrollAllocation.ts @@ -33,7 +33,7 @@ export function usePayrollAllocation() { // Total payroll with oncosts const totalPayrollWithOncosts = computed(() => { - return basePayrollBudget.value * (1 + payrollOncostPct.value / 100) + return Math.round(basePayrollBudget.value * (1 + payrollOncostPct.value / 100)) }) // Update member planned pay when allocation changes diff --git a/composables/useRunway.ts b/composables/useRunway.ts index da9cd46..c57d6cd 100644 --- a/composables/useRunway.ts +++ b/composables/useRunway.ts @@ -23,7 +23,7 @@ export const useRunway = () => { // Add oncosts const oncostPct = policiesStore.payrollOncostPct || 0 - const totalPayroll = payrollCost * (1 + oncostPct / 100) + const totalPayroll = Math.round(payrollCost * (1 + oncostPct / 100)) // Add overhead costs const overheadCost = budgetStore.overheadCosts.reduce((sum, cost) => sum + (cost.amount || 0), 0) diff --git a/composables/useStorSync.ts b/composables/useStorSync.ts index fdea813..d69cab6 100644 --- a/composables/useStorSync.ts +++ b/composables/useStorSync.ts @@ -106,7 +106,7 @@ export const useStoreSync = () => { id: member.id, name: member.displayName, role: member.role, - hoursPerMonth: Number(((member.hoursPerWeek || 0) * 4.33).toFixed(2)), + hoursPerMonth: Math.round((member.hoursPerWeek || 0) * 4.33), minMonthlyNeeds: member.minMonthlyNeeds, monthlyPayPlanned: member.monthlyPayPlanned, targetMonthlyPay: member.targetMonthlyPay, diff --git a/pages/budget.vue b/pages/budget.vue index 3f46b2f..2104cba 100644 --- a/pages/budget.vue +++ b/pages/budget.vue @@ -4,34 +4,20 @@

Budget Worksheet

-
- - -
+
- - How are these calculated? + + Settings - + Export
@@ -63,280 +49,358 @@
-
+
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - -
- Item - - {{ month.label }} -
-
- REVENUE - - + Add - -
-
- TOTAL REVENUE - - {{ formatCurrency(monthlyTotals[month.key]?.revenue || 0) }} -
-
- EXPENSES - - + Add - -
-
- TOTAL EXPENSES - - {{ formatCurrency(monthlyTotals[month.key]?.expenses || 0) }} -
+ NET INCOME + + {{ + formatCurrency(monthlyTotals[month.key]?.net || 0) + }} +
- NET INCOME - - {{ formatCurrency(monthlyTotals[month.key]?.net || 0) }} -
- CUMULATIVE BALANCE - - {{ formatCurrency(cumulativeBalances[month.key] || 0) }} -
+ + + + CUMULATIVE BALANCE + + + {{ + formatCurrency(cumulativeBalances[month.key] || 0) + }} + + + +
@@ -403,7 +467,9 @@ placeholder="Enter annual amount (e.g., 12000)" size="lg"> @@ -415,11 +481,11 @@

This will divide - ${{ newRevenue.annualAmount || 0 }} equally across all 12 months (${{ newRevenue.annualAmount ? Math.round(newRevenue.annualAmount / 12) @@ -440,7 +506,9 @@ placeholder="Enter monthly amount (e.g., 1000)" size="lg"> @@ -452,7 +520,7 @@

This will set - ${{ newRevenue.monthlyAmount || 0 }} for all 12 months @@ -545,7 +613,9 @@ size="lg" class="text-sm font-medium w-full"> @@ -557,11 +627,11 @@

This will divide - ${{ newExpense.annualAmount || 0 }} equally across all 12 months (${{ newExpense.annualAmount ? Math.round(newExpense.annualAmount / 12) @@ -583,7 +653,9 @@ size="lg" class="text-sm font-medium w-full"> @@ -595,7 +667,7 @@

This will set - ${{ newExpense.monthlyAmount || 0 }} for all 12 months @@ -638,76 +710,419 @@ - - + + + + + + + + + + + + + + + + - +