Open geekelo opened 3 months ago
This file configures an ActiveAdmin interface to manage reports related to card requests. The interface provides options to filter, view, and download reports for Card::Request
records within a specified date range. Here’s a breakdown of the key elements:
card_request_report.rb
Card::Request
report under the "Reports" menu with the label "Card Request Reports" in the ActiveAdmin interface.index title: "Card Request Reports by Date Range" do
panel "Filter Card Request Reports" do
transactions_by_date_form
) that allows users to filter reports by date range and possibly other criteria.panel "Report Downloads" do
controller do
before_action :set_date_range, only: [:index]
set_date_range
method before the index action to ensure the date range is set based on the user’s input or defaults to the current date.def set_date_range
def index
Card::Request
records within the specified date range and optionally filters them by status.def generate_csv(transactions)
User ID
, External Id
, Status
, Name
, Email
, Card Type
, Total Amount
, Provider Amount
, and Bananacrystal Amount
.def generate_pdf(transactions)
This configuration is particularly useful for administrators who need to monitor, analyze, and export data related to card requests over specific time periods.
FILE