diff --git a/app/assets/javascripts/plutus/application.js b/app/assets/javascripts/plutus/application.js index 8913b40f..9da3dcbd 100644 --- a/app/assets/javascripts/plutus/application.js +++ b/app/assets/javascripts/plutus/application.js @@ -10,4 +10,7 @@ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details // about supported directives. // +//= require jquery +//= require jquery_ujs +//= require jquery.ui.datepicker //= require_tree . diff --git a/app/assets/javascripts/plutus/reports.js.coffee b/app/assets/javascripts/plutus/reports.js.coffee new file mode 100644 index 00000000..fab24e21 --- /dev/null +++ b/app/assets/javascripts/plutus/reports.js.coffee @@ -0,0 +1,2 @@ +jQuery -> + $('.datepicker').datepicker dateFormat: "yy-mm-dd" diff --git a/app/assets/stylesheets/plutus/application.css b/app/assets/stylesheets/plutus/application.css index 160b5510..ac26e950 100644 --- a/app/assets/stylesheets/plutus/application.css +++ b/app/assets/stylesheets/plutus/application.css @@ -13,6 +13,7 @@ *= require_tree . *= require bootstrap.min *= require bootstrap-theme.min + *= require jquery.ui.datepicker *= require_self */ body { padding-top: 60px; } diff --git a/app/controllers/plutus/reports_controller.rb b/app/controllers/plutus/reports_controller.rb new file mode 100644 index 00000000..c919fb7d --- /dev/null +++ b/app/controllers/plutus/reports_controller.rb @@ -0,0 +1,25 @@ +module Plutus + # == Security: + # Only GET requests are supported. You should ensure that your application + # controller enforces its own authentication and authorization, which this + # controller will inherit. + # + # @author Michael Bulat + class ReportsController < Plutus::ApplicationController + unloadable + + # @example + # GET /reports/balance_sheet + def balance_sheet + @date = params[:date] ? Date.parse(params[:date]) : Date.today + @assets = Plutus::Asset.all + @liabilities = Plutus::Liability.all + @equity = Plutus::Equity.all + + respond_to do |format| + format.html # index.html.erb + end + end + + end +end diff --git a/app/views/plutus/reports/_account.html.erb b/app/views/plutus/reports/_account.html.erb new file mode 100644 index 00000000..c0e222d1 --- /dev/null +++ b/app/views/plutus/reports/_account.html.erb @@ -0,0 +1,19 @@ +<% if accounts.count > 0%> +
+ | + |
---|---|
<%=h account.name %> | +<%=h account.balance %> | +