|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -# Copyright (c) 2006-2017, Puzzle ITC GmbH. This file is part of |
| 3 | +# Copyright (c) 2006-2025, Puzzle ITC GmbH. This file is part of |
4 | 4 | # PuzzleTime and licensed under the Affero General Public License version 3 |
5 | 5 | # or later. See the COPYING file at the top-level directory or at |
6 | 6 | # https://github.com/puzzle/puzzletime. |
|
9 | 9 | # |
10 | 10 | # Table name: accounting_posts |
11 | 11 | # |
12 | | -# id :integer not null, primary key |
13 | | -# work_item_id :integer not null |
14 | | -# portfolio_item_id :integer |
15 | | -# offered_hours :float |
16 | | -# offered_rate :decimal(12, 2) |
17 | | -# offered_total :decimal(12, 2) |
18 | | -# remaining_hours :integer |
19 | | -# billable :boolean default(TRUE), not null |
20 | | -# description_required :boolean default(FALSE), not null |
21 | | -# ticket_required :boolean default(FALSE), not null |
22 | | -# closed :boolean default(FALSE), not null |
23 | | -# from_to_times_required :boolean default(FALSE), not null |
24 | | -# service_id :integer |
| 12 | +# id :integer not null, primary key |
| 13 | +# work_item_id :integer not null |
| 14 | +# portfolio_item_id :integer |
| 15 | +# offered_hours :float |
| 16 | +# offered_rate :decimal(12, 2) |
| 17 | +# offered_total :decimal(12, 2) |
| 18 | +# remaining_hours :integer |
| 19 | +# billable :boolean default(TRUE), not null |
| 20 | +# description_required :boolean default(FALSE), not null |
| 21 | +# ticket_required :boolean default(FALSE), not null |
| 22 | +# closed :boolean default(FALSE), not null |
| 23 | +# from_to_times_required :boolean default(FALSE), not null |
| 24 | +# service_id :integer |
| 25 | +# billing_reminder_active :boolean default(TRUE), not null |
25 | 26 | # |
26 | 27 |
|
27 | 28 | class AccountingPost < ApplicationRecord |
@@ -100,14 +101,6 @@ def propagate_closed! |
100 | 101 | work_item.propagate_closed!(order.status.closed? || closed?) |
101 | 102 | end |
102 | 103 |
|
103 | | - def unbilled_billable_times_exist_in_past_month? |
104 | | - work_item.worktimes |
105 | | - .in_period(Period.parse('-1m')) |
106 | | - .where(billable: true) |
107 | | - .where(invoice_id: nil) |
108 | | - .present? |
109 | | - end |
110 | | - |
111 | 104 | private |
112 | 105 |
|
113 | 106 | def derive_offered_fields |
|
0 commit comments