Skip to content

Commit 4925022

Browse files
committed
Merge branch 'release/1.6.5'
2 parents 04ca222 + c5c3f99 commit 4925022

File tree

60 files changed

+1524
-429
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1524
-429
lines changed

Gemfile.lock

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -25,76 +25,76 @@ GIT
2525
GEM
2626
remote: https://rubygems.org/
2727
specs:
28-
actioncable (7.1.3.2)
29-
actionpack (= 7.1.3.2)
30-
activesupport (= 7.1.3.2)
28+
actioncable (7.1.3.4)
29+
actionpack (= 7.1.3.4)
30+
activesupport (= 7.1.3.4)
3131
nio4r (~> 2.0)
3232
websocket-driver (>= 0.6.1)
3333
zeitwerk (~> 2.6)
34-
actionmailbox (7.1.3.2)
35-
actionpack (= 7.1.3.2)
36-
activejob (= 7.1.3.2)
37-
activerecord (= 7.1.3.2)
38-
activestorage (= 7.1.3.2)
39-
activesupport (= 7.1.3.2)
34+
actionmailbox (7.1.3.4)
35+
actionpack (= 7.1.3.4)
36+
activejob (= 7.1.3.4)
37+
activerecord (= 7.1.3.4)
38+
activestorage (= 7.1.3.4)
39+
activesupport (= 7.1.3.4)
4040
mail (>= 2.7.1)
4141
net-imap
4242
net-pop
4343
net-smtp
44-
actionmailer (7.1.3.2)
45-
actionpack (= 7.1.3.2)
46-
actionview (= 7.1.3.2)
47-
activejob (= 7.1.3.2)
48-
activesupport (= 7.1.3.2)
44+
actionmailer (7.1.3.4)
45+
actionpack (= 7.1.3.4)
46+
actionview (= 7.1.3.4)
47+
activejob (= 7.1.3.4)
48+
activesupport (= 7.1.3.4)
4949
mail (~> 2.5, >= 2.5.4)
5050
net-imap
5151
net-pop
5252
net-smtp
5353
rails-dom-testing (~> 2.2)
54-
actionpack (7.1.3.2)
55-
actionview (= 7.1.3.2)
56-
activesupport (= 7.1.3.2)
54+
actionpack (7.1.3.4)
55+
actionview (= 7.1.3.4)
56+
activesupport (= 7.1.3.4)
5757
nokogiri (>= 1.8.5)
5858
racc
5959
rack (>= 2.2.4)
6060
rack-session (>= 1.0.1)
6161
rack-test (>= 0.6.3)
6262
rails-dom-testing (~> 2.2)
6363
rails-html-sanitizer (~> 1.6)
64-
actiontext (7.1.3.2)
65-
actionpack (= 7.1.3.2)
66-
activerecord (= 7.1.3.2)
67-
activestorage (= 7.1.3.2)
68-
activesupport (= 7.1.3.2)
64+
actiontext (7.1.3.4)
65+
actionpack (= 7.1.3.4)
66+
activerecord (= 7.1.3.4)
67+
activestorage (= 7.1.3.4)
68+
activesupport (= 7.1.3.4)
6969
globalid (>= 0.6.0)
7070
nokogiri (>= 1.8.5)
71-
actionview (7.1.3.2)
72-
activesupport (= 7.1.3.2)
71+
actionview (7.1.3.4)
72+
activesupport (= 7.1.3.4)
7373
builder (~> 3.1)
7474
erubi (~> 1.11)
7575
rails-dom-testing (~> 2.2)
7676
rails-html-sanitizer (~> 1.6)
7777
active_interaction (5.2.0)
7878
activemodel (>= 5.2, < 8)
7979
activesupport (>= 5.2, < 8)
80-
activejob (7.1.3.2)
81-
activesupport (= 7.1.3.2)
80+
activejob (7.1.3.4)
81+
activesupport (= 7.1.3.4)
8282
globalid (>= 0.3.6)
83-
activemodel (7.1.3.2)
84-
activesupport (= 7.1.3.2)
85-
activerecord (7.1.3.2)
86-
activemodel (= 7.1.3.2)
87-
activesupport (= 7.1.3.2)
83+
activemodel (7.1.3.4)
84+
activesupport (= 7.1.3.4)
85+
activerecord (7.1.3.4)
86+
activemodel (= 7.1.3.4)
87+
activesupport (= 7.1.3.4)
8888
timeout (>= 0.4.0)
8989
activerecord-import (1.4.1)
9090
activerecord (>= 4.2)
91-
activestorage (7.1.3.2)
92-
actionpack (= 7.1.3.2)
93-
activejob (= 7.1.3.2)
94-
activerecord (= 7.1.3.2)
95-
activesupport (= 7.1.3.2)
91+
activestorage (7.1.3.4)
92+
actionpack (= 7.1.3.4)
93+
activejob (= 7.1.3.4)
94+
activerecord (= 7.1.3.4)
95+
activesupport (= 7.1.3.4)
9696
marcel (~> 1.0)
97-
activesupport (7.1.3.2)
97+
activesupport (7.1.3.4)
9898
base64
9999
bigdecimal
100100
concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -151,7 +151,7 @@ GEM
151151
erubi (~> 1.4)
152152
parser (>= 2.4)
153153
smart_properties
154-
bigdecimal (3.1.7)
154+
bigdecimal (3.1.8)
155155
bindex (0.8.1)
156156
bootsnap (1.16.0)
157157
msgpack (~> 1.2)
@@ -174,7 +174,7 @@ GEM
174174
combine_pdf (1.0.22)
175175
matrix
176176
ruby-rc4 (>= 0.1.5)
177-
concurrent-ruby (1.2.3)
177+
concurrent-ruby (1.3.1)
178178
connection_pool (2.4.1)
179179
countries (5.3.1)
180180
unaccent (~> 0.3)
@@ -300,7 +300,7 @@ GEM
300300
mini_mime (>= 1.0.0)
301301
multi_xml (>= 0.5.2)
302302
httpclient (2.8.3)
303-
i18n (1.14.4)
303+
i18n (1.14.5)
304304
concurrent-ruby (~> 1.0)
305305
image_processing (1.12.2)
306306
mini_magick (>= 4.9.5, < 5)
@@ -353,7 +353,7 @@ GEM
353353
memoist (0.16.2)
354354
mini_magick (4.12.0)
355355
mini_mime (1.1.5)
356-
minitest (5.22.3)
356+
minitest (5.23.1)
357357
money (6.16.0)
358358
i18n (>= 0.6.4, <= 2)
359359
msgpack (1.6.0)
@@ -418,8 +418,8 @@ GEM
418418
pundit (2.3.0)
419419
activesupport (>= 3.0.0)
420420
raabro (1.4.0)
421-
racc (1.7.3)
422-
rack (3.0.10)
421+
racc (1.8.0)
422+
rack (3.0.11)
423423
rack-cors (2.0.0)
424424
rack (>= 2.0.0)
425425
rack-mini-profiler (3.0.0)
@@ -435,20 +435,20 @@ GEM
435435
rackup (2.1.0)
436436
rack (>= 3)
437437
webrick (~> 1.8)
438-
rails (7.1.3.2)
439-
actioncable (= 7.1.3.2)
440-
actionmailbox (= 7.1.3.2)
441-
actionmailer (= 7.1.3.2)
442-
actionpack (= 7.1.3.2)
443-
actiontext (= 7.1.3.2)
444-
actionview (= 7.1.3.2)
445-
activejob (= 7.1.3.2)
446-
activemodel (= 7.1.3.2)
447-
activerecord (= 7.1.3.2)
448-
activestorage (= 7.1.3.2)
449-
activesupport (= 7.1.3.2)
438+
rails (7.1.3.4)
439+
actioncable (= 7.1.3.4)
440+
actionmailbox (= 7.1.3.4)
441+
actionmailer (= 7.1.3.4)
442+
actionpack (= 7.1.3.4)
443+
actiontext (= 7.1.3.4)
444+
actionview (= 7.1.3.4)
445+
activejob (= 7.1.3.4)
446+
activemodel (= 7.1.3.4)
447+
activerecord (= 7.1.3.4)
448+
activestorage (= 7.1.3.4)
449+
activesupport (= 7.1.3.4)
450450
bundler (>= 1.15.0)
451-
railties (= 7.1.3.2)
451+
railties (= 7.1.3.4)
452452
rails-controller-testing (1.0.5)
453453
actionpack (>= 5.0.1.rc1)
454454
actionview (>= 5.0.1.rc1)
@@ -460,9 +460,9 @@ GEM
460460
rails-html-sanitizer (1.6.0)
461461
loofah (~> 2.21)
462462
nokogiri (~> 1.14)
463-
railties (7.1.3.2)
464-
actionpack (= 7.1.3.2)
465-
activesupport (= 7.1.3.2)
463+
railties (7.1.3.4)
464+
actionpack (= 7.1.3.4)
465+
activesupport (= 7.1.3.4)
466466
irb
467467
rackup (>= 1.0.0)
468468
rake (>= 12.2)

app/controllers/internal_api/v1/custom_leaves_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ class InternalApi::V1::CustomLeavesController < InternalApi::V1::ApplicationCont
55

66
def update
77
authorize current_user, policy_class: LeaveWithLeaveTypesPolicy
8-
CustomLeavesService.new(leave, update_params).process
9-
render json: { notice: "Leaves updated successfully" }, status: :ok
8+
CustomLeavesService.new(@leave, update_params).process
9+
render json: { notice: "Custom Leaves updated successfully" }, status: :ok
1010
end
1111

1212
private
1313

1414
def set_leave
15-
@_leave ||= current_company.leaves.find_or_create_by(year: params[:year])
15+
@leave ||= current_company.leaves.find_or_create_by(year: params[:year])
1616
end
1717

1818
def update_params

app/controllers/internal_api/v1/expenses_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def destroy
4747

4848
def expense_params
4949
params.require(:expense).permit(
50-
:amount, :date, :description, :expense_type, :expense_category_id, :vendor_id, :receipts
50+
:amount, :date, :description, :expense_type, :expense_category_id, :vendor_id, receipts: []
5151
)
5252
end
5353

app/controllers/internal_api/v1/invoices_controller.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
class InternalApi::V1::InvoicesController < InternalApi::V1::ApplicationController
44
before_action :load_client, only: [:create, :update]
5-
after_action :ensure_time_entries_billed, only: [:send_invoice]
65
after_action :track_event, only: [:create, :update, :destroy, :send_invoice, :download]
76

87
def index
@@ -122,10 +121,6 @@ def invoice_email_params
122121
params.require(:invoice_email).permit(:subject, :message, recipients: [])
123122
end
124123

125-
def ensure_time_entries_billed
126-
invoice.update_timesheet_entry_status!
127-
end
128-
129124
def track_event
130125
Invoices::EventTrackerService.new(params[:action], @invoice || invoice, params).process
131126
end

app/controllers/internal_api/v1/reports/client_revenues_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ def index
99
status: :ok
1010
end
1111

12+
def download
13+
authorize :report
14+
15+
send_data Reports::ClientRevenues::DownloadService.new(params, current_company).process
16+
end
17+
1218
def new
1319
authorize :report
1420

app/controllers/internal_api/v1/reports/outstanding_overdue_invoices_controller.rb

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@
44
class InternalApi::V1::Reports::OutstandingOverdueInvoicesController < InternalApi::V1::ApplicationController
55
def index
66
authorize :report
7-
render :index,
8-
locals: {
9-
clients:,
10-
summary: OutstandingOverdueInvoicesReportPresenter.new(clients).summary
11-
},
12-
status: :ok
7+
8+
report_data = Reports::OutstandingOverdueInvoices::IndexService.new(current_company).process
9+
10+
render :index, locals: report_data, status: :ok
1311
end
1412

15-
private
13+
def download
14+
authorize :report
1615

17-
def clients
18-
@_clients ||= current_company.clients.order("name asc").includes(:invoices).map do |client|
19-
client
20-
.outstanding_and_overdue_invoices
21-
.merge({ name: client.name, logo: client.logo_url })
22-
end
23-
end
16+
send_data Reports::OutstandingOverdueInvoices::DownloadService.new(params, current_company).process
17+
end
2418
end

app/javascript/src/StyledComponents/Pagination/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ const Pagination = ({
105105
<div className="flex items-center justify-end">
106106
<select
107107
className="p-2 text-xs font-bold text-miru-han-purple-1000"
108-
defaultValue={itemsPerPage}
109108
value={itemsPerPage}
110109
onChange={handleClickOnPerPage}
111110
>

app/javascript/src/apis/expenses.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@ import axios from "./api";
22

33
const path = "/expenses";
44

5-
const index = async () => await axios.get(path);
5+
const index = (query = "") => axios.get(query ? `${path}?${query}` : path);
66

7-
const create = async payload => await axios.post(path, payload);
7+
const create = payload =>
8+
axios.post(path, payload, {
9+
headers: {
10+
"Content-Type": "multipart/form-data",
11+
},
12+
});
813

9-
const show = async id => await axios.get(`${path}/${id}`);
14+
const show = id => axios.get(`${path}/${id}`);
1015

11-
const update = async (id, payload) => axios.patch(`${path}/${id}`, payload);
16+
const update = (id, payload, config) =>
17+
axios.patch(`${path}/${id}`, payload, config);
1218

13-
const destroy = async id => axios.delete(`${path}/${id}`);
19+
const destroy = id => axios.delete(`${path}/${id}`);
1420

15-
const createCategory = async payload =>
16-
axios.post("/expense_categories", payload);
21+
const createCategory = payload => axios.post("/expense_categories", payload);
22+
23+
const createVendors = payload => axios.post("/vendors", payload);
1724

1825
const expensesApi = {
1926
index,
@@ -22,6 +29,7 @@ const expensesApi = {
2229
update,
2330
destroy,
2431
createCategory,
32+
createVendors,
2533
};
2634

2735
export default expensesApi;

app/javascript/src/apis/leaves.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import axios from "./api";
22

33
const allLeaves = () => axios.get("/leaves");
44

5+
const customLeaves = (year, payload) =>
6+
axios.patch(`/custom_leaves/${year}`, payload);
7+
58
const updateLeaveWithLeaveTypes = (year, payload) =>
69
axios.patch(`/leave_with_leave_type/${year}`, payload);
710

811
const leavesApi = {
912
allLeaves,
13+
customLeaves,
1014
updateLeaveWithLeaveTypes,
1115
};
1216

app/javascript/src/apis/reports/clientRevenue.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ const get = (from, to, clientIds) =>
99

1010
const newReport = async () => axios.get(`${path}new`);
1111

12-
const clientRevenueApi = { get, newReport };
12+
const download = (type, queryParams) =>
13+
axios({
14+
method: "GET",
15+
url: `${path}/download.${type}${queryParams}`,
16+
responseType: "blob",
17+
});
18+
19+
const clientRevenueApi = { get, newReport, download };
1320

1421
export default clientRevenueApi;

0 commit comments

Comments
 (0)