- <%= turbo_frame_tag "income_header_frame" do %>
-
-
Income
- <%= link_to "New Income", new_income_path, data: { turbo_frame: :incomes } %>
-
- <% end %>
-
-
- <%= turbo_frame_tag :incomes do %>
- <%= render "incomes/index" %>
- <% end %>
-
-
-
- <%= turbo_frame_tag "taxed_incomes" do %>
- <%= render partial: "shared/taxed_incomes", locals: { salary_taxed: @salary_taxed, hourly_taxed: @hourly_taxed} %>
- <% end %>
-
+
+ <%= render partial: "budget/salary_budget", locals: {totals: @totals, income: @salary_taxed} %>
diff --git a/app/views/fixed_expenses/_fixed_expense.html.erb b/app/views/fixed_expenses/_fixed_expense.html.erb
index 7e59067..0a523c5 100644
--- a/app/views/fixed_expenses/_fixed_expense.html.erb
+++ b/app/views/fixed_expenses/_fixed_expense.html.erb
@@ -1,10 +1,10 @@
<%= turbo_frame_tag dom_id(fixed_expense) do %>
-
+
<% attributes = [fixed_expense.expense_name, humanized_money_with_symbol(fixed_expense.annual_cost), humanized_money_with_symbol(fixed_expense.monthly_cost), humanized_money_with_symbol(fixed_expense.bi_weekly_cost)] %>
<% attributes.each do |attribute| %>
<%= attribute %>
<% end %>
-
<%= link_to "Edit", edit_fixed_expense_path(fixed_expense), class:"rounded-lg px-2 bg-gray-100 inline-block font-medium" %>
-
<%= button_to "Delete", fixed_expense_path(fixed_expense), method: :delete, class:"rounded-lg px-2 bg-gray-100 inline-block font-medium" %>
+
<%= link_to "Edit", edit_fixed_expense_path(fixed_expense), class:"btn btn-primary" %>
+
<%= button_to "Delete", fixed_expense_path(fixed_expense), method: :delete, class:"btn btn-danger" %>
<% end %>
diff --git a/app/views/incomes/_form.html.erb b/app/views/incomes/_form.html.erb
index 7735812..9c53ff6 100644
--- a/app/views/incomes/_form.html.erb
+++ b/app/views/incomes/_form.html.erb
@@ -14,35 +14,30 @@
<%= form.label :income_type %>
<% if @income.income_type.nil? %>
- <%= form.select :income_type, [["Salary", "SA"], ["Hourly", "HR"]], {}, {class: "block shadow rounded-md border border-gray-200 px-3 py-2 mt-2 w-full"} %>
+ <%= form.select :income_type, [["Salary", "SA"], ["Hourly", "HR"]], {}, {class: "block shadow rounded-md border border-gray-200 px-3 py-2 w-full"} %>
<% elsif @income.is_salary? %>
- <%= form.select :income_type, [["Salary", "SA"]], {}, {class: "block shadow rounded-md border border-gray-200 px-3 py-2 mt-2 w-full"} %>
+ <%= form.select :income_type, [["Salary", "SA"]], {}, {class: "block shadow rounded-md border border-gray-200 px-3 py-2 w-full"} %>
<% else %>
- <%= form.select :income_type, [["Hourly", "HR"]], {}, {class: "block shadow rounded-md border border-gray-200 px-3 py-2 mt-2 w-full"} %>
+ <%= form.select :income_type, [["Hourly", "HR"]], {}, {class: "block shadow rounded-md border border-gray-200 px-3 py-2 w-full"} %>
<% end %>
<%= form.label :rate %>
- <%= form.number_field :rate, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
+ <%= form.number_field :rate, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 w-full" %>
<%= form.label :hours %>
- <%= form.number_field :hours, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
-
-
-
- <%= form.label :weekly_income %>
- <%= form.number_field :weekly_income, readonly: true, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
+ <%= form.number_field :hours, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 w-full" %>
-
- <%= form.submit class: "rounded-lg py-1 px-4 bg-gray-100 inline-block font-medium" %>
+
+ <%= form.submit class: "rounded-lg px-2 bg-gray-100 inline-block font-medium" %>
- <%= link_to "Cancel", root_path, class: "rounded-lg py-1 px-4 bg-gray-100 inline-block font-medium" %>
+ <%= link_to "Cancel", root_path, class: "rounded-lg px-2 bg-gray-100 inline-block font-medium" %>
diff --git a/app/views/incomes/_income.html.erb b/app/views/incomes/_income.html.erb
index d2e8745..27392c3 100644
--- a/app/views/incomes/_income.html.erb
+++ b/app/views/incomes/_income.html.erb
@@ -1,9 +1,9 @@
<%= turbo_frame_tag dom_id(income) do %>
-
+
<% attributes = [income.income_type, humanized_money_with_symbol(income.rate), income.hours, humanized_money_with_symbol(income.weekly_income)] %>
<% attributes.each do |attribute| %>
<%= attribute %>
<% end %>
-
<%= link_to "Edit", edit_income_path(income), class:"rounded-lg px-2 bg-gray-100 inline-block font-medium" %>
+
<%= link_to "Edit", edit_income_path(income), class:"btn btn-primary" %>
<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 8cb25db..5823923 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -11,8 +11,8 @@
<%= javascript_importmap_tags %>
-
-
+
+
<%= yield %>
diff --git a/app/views/shared/_budget.html.erb b/app/views/shared/_budget.html.erb
index 41f6b0b..9cc30a7 100644
--- a/app/views/shared/_budget.html.erb
+++ b/app/views/shared/_budget.html.erb
@@ -4,7 +4,7 @@
0
0
- <%= humanized_money_with_symbol((income.total_net_income.fractional / 100) / 365 - totals.total_annual_cost / 365) %>
+ <%= humanized_money_with_symbol((income.daily_income.fractional / 100) - totals.total_annual_cost / 365) %>
@@ -14,7 +14,7 @@
0
0
- <%= humanized_money_with_symbol((income.bi_weekly_net_income.fractional / 100) / 2 - totals.total_bi_weekly_cost / 2) %>
+ <%= humanized_money_with_symbol((income.weekly_income.fractional / 100) - totals.total_bi_weekly_cost / 2) %>
- <%= humanized_money_with_symbol((income.total_net_income.fractional / 100) / 12 - totals.total_monthly_cost) %>
+ <%= humanized_money_with_symbol((income.monthly_income.fractional / 100) - totals.total_monthly_cost) %>