diff --git a/Gemfile.lock b/Gemfile.lock index 5fd0194da8..3fec248c4b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -25,35 +25,35 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.2) - actionpack (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.2) - actionview (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -61,15 +61,15 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3.2) - actionpack (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.2) - activesupport (= 7.1.3.2) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) @@ -77,24 +77,24 @@ GEM active_interaction (5.2.0) activemodel (>= 5.2, < 8) activesupport (>= 5.2, < 8) - activejob (7.1.3.2) - activesupport (= 7.1.3.2) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.1.3.2) - activesupport (= 7.1.3.2) - activerecord (7.1.3.2) - activemodel (= 7.1.3.2) - activesupport (= 7.1.3.2) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) timeout (>= 0.4.0) activerecord-import (1.4.1) activerecord (>= 4.2) - activestorage (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activesupport (= 7.1.3.2) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) marcel (~> 1.0) - activesupport (7.1.3.2) + activesupport (7.1.3.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -151,7 +151,7 @@ GEM erubi (~> 1.4) parser (>= 2.4) smart_properties - bigdecimal (3.1.7) + bigdecimal (3.1.8) bindex (0.8.1) bootsnap (1.16.0) msgpack (~> 1.2) @@ -174,7 +174,7 @@ GEM combine_pdf (1.0.22) matrix ruby-rc4 (>= 0.1.5) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.1) connection_pool (2.4.1) countries (5.3.1) unaccent (~> 0.3) @@ -300,7 +300,7 @@ GEM mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) httpclient (2.8.3) - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) @@ -353,7 +353,7 @@ GEM memoist (0.16.2) mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.22.3) + minitest (5.23.1) money (6.16.0) i18n (>= 0.6.4, <= 2) msgpack (1.6.0) @@ -418,8 +418,8 @@ GEM pundit (2.3.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.7.3) - rack (3.0.10) + racc (1.8.0) + rack (3.0.11) rack-cors (2.0.0) rack (>= 2.0.0) rack-mini-profiler (3.0.0) @@ -435,20 +435,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.2) - actioncable (= 7.1.3.2) - actionmailbox (= 7.1.3.2) - actionmailer (= 7.1.3.2) - actionpack (= 7.1.3.2) - actiontext (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activemodel (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 7.1.3.2) + railties (= 7.1.3.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -460,9 +460,9 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) irb rackup (>= 1.0.0) rake (>= 12.2) diff --git a/app/controllers/internal_api/v1/custom_leaves_controller.rb b/app/controllers/internal_api/v1/custom_leaves_controller.rb index 1a6ca7b8ad..efb600c90c 100644 --- a/app/controllers/internal_api/v1/custom_leaves_controller.rb +++ b/app/controllers/internal_api/v1/custom_leaves_controller.rb @@ -5,14 +5,14 @@ class InternalApi::V1::CustomLeavesController < InternalApi::V1::ApplicationCont def update authorize current_user, policy_class: LeaveWithLeaveTypesPolicy - CustomLeavesService.new(leave, update_params).process - render json: { notice: "Leaves updated successfully" }, status: :ok + CustomLeavesService.new(@leave, update_params).process + render json: { notice: "Custom Leaves updated successfully" }, status: :ok end private def set_leave - @_leave ||= current_company.leaves.find_or_create_by(year: params[:year]) + @leave ||= current_company.leaves.find_or_create_by(year: params[:year]) end def update_params diff --git a/app/controllers/internal_api/v1/expenses_controller.rb b/app/controllers/internal_api/v1/expenses_controller.rb index 2611fac0e2..3bde94a883 100644 --- a/app/controllers/internal_api/v1/expenses_controller.rb +++ b/app/controllers/internal_api/v1/expenses_controller.rb @@ -47,7 +47,7 @@ def destroy def expense_params params.require(:expense).permit( - :amount, :date, :description, :expense_type, :expense_category_id, :vendor_id, :receipts + :amount, :date, :description, :expense_type, :expense_category_id, :vendor_id, receipts: [] ) end diff --git a/app/controllers/internal_api/v1/invoices_controller.rb b/app/controllers/internal_api/v1/invoices_controller.rb index 459c18244d..0f6121a5b5 100644 --- a/app/controllers/internal_api/v1/invoices_controller.rb +++ b/app/controllers/internal_api/v1/invoices_controller.rb @@ -2,7 +2,6 @@ class InternalApi::V1::InvoicesController < InternalApi::V1::ApplicationController before_action :load_client, only: [:create, :update] - after_action :ensure_time_entries_billed, only: [:send_invoice] after_action :track_event, only: [:create, :update, :destroy, :send_invoice, :download] def index @@ -122,10 +121,6 @@ def invoice_email_params params.require(:invoice_email).permit(:subject, :message, recipients: []) end - def ensure_time_entries_billed - invoice.update_timesheet_entry_status! - end - def track_event Invoices::EventTrackerService.new(params[:action], @invoice || invoice, params).process end diff --git a/app/controllers/internal_api/v1/reports/client_revenues_controller.rb b/app/controllers/internal_api/v1/reports/client_revenues_controller.rb index 8caa505387..7dfe563552 100644 --- a/app/controllers/internal_api/v1/reports/client_revenues_controller.rb +++ b/app/controllers/internal_api/v1/reports/client_revenues_controller.rb @@ -9,6 +9,12 @@ def index status: :ok end + def download + authorize :report + + send_data Reports::ClientRevenues::DownloadService.new(params, current_company).process + end + def new authorize :report diff --git a/app/controllers/internal_api/v1/reports/outstanding_overdue_invoices_controller.rb b/app/controllers/internal_api/v1/reports/outstanding_overdue_invoices_controller.rb index 448ea25432..738bc58be0 100644 --- a/app/controllers/internal_api/v1/reports/outstanding_overdue_invoices_controller.rb +++ b/app/controllers/internal_api/v1/reports/outstanding_overdue_invoices_controller.rb @@ -4,21 +4,15 @@ class InternalApi::V1::Reports::OutstandingOverdueInvoicesController < InternalApi::V1::ApplicationController def index authorize :report - render :index, - locals: { - clients:, - summary: OutstandingOverdueInvoicesReportPresenter.new(clients).summary - }, - status: :ok + + report_data = Reports::OutstandingOverdueInvoices::IndexService.new(current_company).process + + render :index, locals: report_data, status: :ok end - private + def download + authorize :report - def clients - @_clients ||= current_company.clients.order("name asc").includes(:invoices).map do |client| - client - .outstanding_and_overdue_invoices - .merge({ name: client.name, logo: client.logo_url }) - end - end + send_data Reports::OutstandingOverdueInvoices::DownloadService.new(params, current_company).process + end end diff --git a/app/javascript/src/StyledComponents/Pagination/index.tsx b/app/javascript/src/StyledComponents/Pagination/index.tsx index 948d73e996..08fd9c9abe 100644 --- a/app/javascript/src/StyledComponents/Pagination/index.tsx +++ b/app/javascript/src/StyledComponents/Pagination/index.tsx @@ -105,7 +105,6 @@ const Pagination = ({