Skip to content

Commit db31423

Browse files
authored
Merge branch 'main' into 5372AlignmentNudges2
2 parents 6561597 + 2f6b5ea commit db31423

File tree

13 files changed

+70
-25
lines changed

13 files changed

+70
-25
lines changed

app/controllers/kits_controller.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
class KitsController < ApplicationController
2+
def show
3+
redirect_to allocations_kit_path
4+
end
5+
26
def index
37
@kits = current_organization.kits.includes(:item, line_items: :item).class_filter(filter_params)
48
@inventory = View::Inventory.new(current_organization.id)

app/javascript/controllers/deadline_day_controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class extends Controller {
4747

4848
if (this.byDayOfMonthTarget.checked && this.dayOfMonthTarget.value) {
4949
const rule = new RRule({
50-
dtstart: today,
50+
dtstart: new Date(Date.UTC(today.getFullYear(), today.getMonth(), today.getDate(), 12)),
5151
freq: RRule.MONTHLY,
5252
interval: monthlyInterval,
5353
bymonthday: parseInt(this.dayOfMonthTarget.value),
@@ -57,7 +57,7 @@ export default class extends Controller {
5757
}
5858
if (this.byDayOfWeekTarget.checked && this.everyNthDayTarget.value && (this.dayOfWeekTarget.value)) {
5959
const rule = new RRule({
60-
dtstart: today,
60+
dtstart: new Date(Date.UTC(today.getFullYear(), today.getMonth(), today.getDate(), 12)),
6161
freq: RRule.MONTHLY,
6262
interval: monthlyInterval,
6363
byweekday: WEEKDAY_NUM_TO_OBJ[ parseInt(this.dayOfWeekTarget.value) ].nth( parseInt(this.everyNthDayTarget.value) ),

app/jobs/backup_db_rds.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ def self.run
1818
client.put_object(key: "backups/#{backup_filename}",
1919
body: File.read(backup_filename),
2020
bucket: "human-essentials-backups")
21+
22+
Rails.root.glob("*.rds.dump").each do |file|
23+
File.delete(file)
24+
end
2125
end
2226
end

app/models/storage_location.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def validate_empty_inventory
159159
end
160160

161161
def self.csv_export_headers
162-
["Name", "Address", "Square Footage", "Warehouse Type", "Total Inventory"]
162+
["Name", "Address", "Square Footage", "Warehouse Type", "Total Inventory", "Fair Market Value"]
163163
end
164164

165165
# @param storage_locations [Array<StorageLocation>]
@@ -171,7 +171,7 @@ def self.generate_csv_from_inventory(storage_locations, inventory)
171171
CSV.generate(headers: true) do |csv|
172172
csv_data = storage_locations.map do |sl|
173173
total_quantity = inventory.quantity_for(storage_location: sl.id)
174-
attributes = [sl.name, sl.address, sl.square_footage, sl.warehouse_type, total_quantity] +
174+
attributes = [sl.name, sl.address, sl.square_footage, sl.warehouse_type, total_quantity, sl.inventory_total_value_in_dollars] +
175175
all_items.map { |i| inventory.quantity_for(storage_location: sl.id, item_id: i.item_id) }
176176
attributes.map { |attr| normalize_csv_attribute(attr) }
177177
end

app/views/admin/base_items/index.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
<tr>
3434
<th>Name</th>
3535
<th class="text-right">Child Items</th>
36+
<th>Child Items</th>
3637
<th class="text-right">Actions</th>
3738
</tr>
3839
</thead>

app/views/distributions/_distribution_row.html.erb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@
44
<td class="date text-left"><%= distribution_row.created_at.strftime("%m/%d/%Y") %></td>
55
<td class="date text-left"><%= (distribution_row.issued_at.presence || distribution_row.created_at).strftime("%m/%d/%Y") %></td>
66
<td><%= distribution_row.storage_location.name %></td>
7-
87
<td class="numeric"><%= @distribution_totals[distribution_row.id].quantity %></td>
98
<td class="numeric"><%= dollar_value(@distribution_totals[distribution_row.id].value) %></td>
109
<td><%= distribution_row.delivery_method.humanize %></td>
1110
<td class="text-right"><%= distribution_shipping_cost(distribution_row.shipping_cost) %></td>
1211
<td><%= distribution_row.comment %></td>
1312
<td><%= distribution_row.state&.humanize %></td>
14-
1513
<% distribution_has_inactive_item = @distributions_with_inactive_items.include?(distribution_row.id) %>
1614
<td class="text-right">
1715
<%= view_button_to distribution_path(distribution_row) %>
16+
<% if distribution_row.request %>
17+
<%= view_button_to request_path(distribution_row.request), {icon: "eye", type: "secondary", text: "View Request"} %>
18+
<% end %>
1819
<% if (!distribution_row.complete? && !distribution_row.future?) || current_user.has_cached_role?(Role::ORG_ADMIN, current_organization) %>
1920
<%= edit_button_to edit_distribution_path(distribution_row), enabled: !distribution_has_inactive_item %>
2021
<% end %>

app/views/partner_mailer/recertification_request.text.erb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ Hi <%= @partner.name %>
22

33
It's time to update your agency information!
44

5-
Please log in to your account at <%= new_user_session_url %>
5+
Please log in to your account at <%= new_user_session_url %>, and click "My Profile"
66

7-
If no information has changed, please click Update.
8-
If any information has changed, please amend it on the form and then click Update.
7+
If no information has changed, please click 'Submit For Approval'.
98

10-
If you have any questions please contact <%= @organization.name %> at <%= @organization.email %>
9+
If any information has changed, please:
10+
11+
- Click 'Update Information'
12+
- Change the information
13+
- Click 'Save and Review'
14+
- Confirm that the information is correct
15+
- Finally, click 'Submit For Approval'
1116

12-
Thank you and have a great day!
17+
If you have any questions please contact <%= @organization.name %> at <%= @organization.email %>

app/views/storage_locations/show.html.erb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<th>Address</th>
3737
<th>Square Footage</th>
3838
<th>Warehouse Type</th>
39+
<th>Fair Market Value</th>
3940
</tr>
4041
</thead>
4142
<tbody>
@@ -44,6 +45,7 @@
4445
<td><%= @storage_location.address %></td>
4546
<td><%= @storage_location.square_footage %></td>
4647
<td><%= @storage_location.warehouse_type %></td>
48+
<td><%= number_to_currency @storage_location.inventory_total_value_in_dollars %></td>
4749
</tr>
4850
</tbody>
4951
</table>

docs/user_guide/bank/exports.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,8 @@ For each Storage Location in the filtered list:
413413
- Address,
414414
- Square Footage,
415415
- Warehouse Type,
416-
- Total Inventory, and
416+
- Total Inventory,
417+
- Fair Market Value,
417418
- Quantity for each of the organization's Items.
418419

419420
## Transfers

spec/requests/kit_requests_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
sign_in(user)
1313
end
1414

15+
describe "GET #show" do
16+
it "should redirect to the allocations page" do
17+
get kit_url(kit)
18+
expect(response).to redirect_to allocations_kit_path(kit.id)
19+
end
20+
end
21+
1522
describe "GET #index" do
1623
before do
1724
# this shouldn't be shown

0 commit comments

Comments
 (0)