Skip to content

Commit

Permalink
Merge pull request #893 from GratefulGarmentProject/donation-journal-…
Browse files Browse the repository at this point in the history
…exports

Add more external ids to tables and some small rubocop fixes (more to come)
  • Loading branch information
smellsblue authored Aug 20, 2024
2 parents 9c03f42 + ce4c1bc commit ac862fe
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Documentation:
Enabled: false

Layout/LineLength:
Max: 120
Max: 150
Exclude:
- spec/**/*

Expand Down
2 changes: 1 addition & 1 deletion app/models/net_suite_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def self.host
"#{NetSuite::Configuration.account}.app.netsuite.com"
end

def self.path(object, prefix: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
def self.path(object, prefix: nil) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity, Metrics/AbcSize
case object
when Order
if prefix == :journal
Expand Down
8 changes: 5 additions & 3 deletions app/views/donations/_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<th class="col-xs-2">Items</th>
<th class="col-xs-2">Value</th>

<% if local_assigns[:for_closed] %>
<th class="col-xs-1">External Id</th>
<% if current_user.can_sync_donations? && local_assigns[:for_closed] %>
<th class="col-xs-1">Ext Id</th>
<th class="col-xs-1">Journal Ext Id</th>
<% end %>

<th class="col-xs-1">Date Received</th>
Expand All @@ -28,8 +29,9 @@
<td><%= donation.item_count %></td>
<td><%= number_to_currency(donation.value, unit: "$", precision: 2) %></td>

<% if local_assigns[:for_closed] %>
<% if current_user.can_sync_donations? && local_assigns[:for_closed] %>
<td><%= external_id_or_status(donation, link: true) %></td>
<td><%= external_id_or_status(donation, link: true, prefix: :journal) %></td>
<% end %>

<td><%= donation.formatted_donation_date %></td>
Expand Down
8 changes: 5 additions & 3 deletions app/views/orders/_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
<th>Date Received</th>
<th>Status</th>

<% if local_assigns[:for_closed] %>
<th>External Id</th>
<% if current_user.can_sync_orders? && local_assigns[:for_closed] %>
<th>Ext Id</th>
<th>Journal Ext Id</th>
<% end %>

<th>Tracking Number</th>
Expand All @@ -25,8 +26,9 @@
<td><%= order.formatted_order_date %></td>
<td><%= order.status.titleize %></td>

<% if local_assigns[:for_closed] %>
<% if current_user.can_sync_orders? && local_assigns[:for_closed] %>
<td><%= external_id_or_status(order, link: true) %></td>
<td><%= external_id_or_status(order, link: true, prefix: :journal) %></td>
<% end %>

<td>
Expand Down
4 changes: 2 additions & 2 deletions app/views/purchases/_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<th>Date Entered</th>
<th>Status</th>

<% if local_assigns[:for_closed] %>
<% if current_user.can_sync_purchases? && local_assigns[:for_closed] %>
<th>External Id</th>
<th>Journal External Id</th>
<% end %>
Expand All @@ -24,7 +24,7 @@
<td><%= purchase.formatted_purchase_date %></td>
<td><%= purchase.status.titleize %></td>

<% if local_assigns[:for_closed] %>
<% if current_user.can_sync_purchases? && local_assigns[:for_closed] %>
<td><%= external_id_or_status(purchase, link: true) %></td>
<td><%= external_id_or_status(purchase, link: true, prefix: :variance) %></td>
<% end %>
Expand Down

0 comments on commit ac862fe

Please sign in to comment.