Class: ReportsClient

Inherits:
Object
  • Object
show all
Defined in:
lib/lockstep_sdk/clients/reports_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ ReportsClient

Initialize the ReportsClient class with an API client instance.



22
23
24
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 22

def initialize(connection)
    @connection = connection
end

Instance Method Details

#accounts_payable_aging_headerObject

Retrieves AP Aging Header information report broken down by aging bucket.

The AP Aging Header report contains aggregated information about the TotalBillsPastDue, TotalVendors, and their respective PercentageOfTotalAp grouped by their aging ReportBucket.



173
174
175
176
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 173

def accounts_payable_aging_header()
    path = "/api/v1/Reports/ap-aging-header"
    @connection.request(:get, path, nil, nil)
end

#accounts_payable_header(report_date:, company_id:) ⇒ Object

Retrieves AP header information up to the date specified.



131
132
133
134
135
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 131

def accounts_payable_header(report_date:, company_id:)
    path = "/api/v1/Reports/ap-header"
    params = {:reportDate => report_date, :companyId => company_id}
    @connection.request(:get, path, nil, params)
end

#accounts_receivable_aging_headerObject

Retrieves AR Aging Header information report broken down by aging bucket.

The AR Aging Header report contains aggregated information about the TotalInvoicesPastDue, TotalCustomers, and their respective PercentageOfTotalAr grouped by their aging ReportBucket.



163
164
165
166
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 163

def accounts_receivable_aging_header()
    path = "/api/v1/Reports/ar-aging-header"
    @connection.request(:get, path, nil, nil)
end

#accounts_receivable_header(report_date:, company_id:) ⇒ Object

Retrieves AR header information up to the date specified.



120
121
122
123
124
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 120

def accounts_receivable_header(report_date:, company_id:)
    path = "/api/v1/Reports/ar-header"
    params = {:reportDate => report_date, :companyId => company_id}
    @connection.request(:get, path, nil, params)
end

#attachments_header_information(company_id:) ⇒ Object

Retrieves Attachment Header information for the requested companyId.

The Attachment Header report contains aggregated information about the TotalAttachments, TotalArchived, and TotalActive attachment classifications.



184
185
186
187
188
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 184

def attachments_header_information(company_id:)
    path = "/api/v1/Reports/attachments-header"
    params = {:companyId => company_id}
    @connection.request(:get, path, nil, params)
end

#balance_sheet_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:) ⇒ Object

Generates a balance sheet for the given time range.



230
231
232
233
234
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 230

def balance_sheet_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:)
    path = "/api/v1/Reports/balance-sheet"
    params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id, :columnOption => column_option, :displayDepth => display_depth, :comparisonPeriod => comparison_period, :showCurrencyDifference => show_currency_difference, :showPercentageDifference => show_percentage_difference}
    @connection.request(:get, path, nil, params)
end

#cash_flow(timeframe:) ⇒ Object

Retrieves a current Cash Flow report for this account.

The Cash Flow report indicates the amount of payments retrieved and invoices billed within a given timeframe. You can use this report to determine the overall balance of money coming into and out of your accounts receivable and accounts payable businesses.



33
34
35
36
37
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 33

def cash_flow(timeframe:)
    path = "/api/v1/Reports/cashflow"
    params = {:timeframe => timeframe}
    @connection.request(:get, path, nil, params)
end

#cash_flow_statement_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:) ⇒ Object

Generates a cash flow statement for the given time range.



244
245
246
247
248
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 244

def cash_flow_statement_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:)
    path = "/api/v1/Reports/cash-flow-statement"
    params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id, :columnOption => column_option, :displayDepth => display_depth}
    @connection.request(:get, path, nil, params)
end

#daily_sales_outstanding(report_date:) ⇒ Object

Retrieves a current Daily Sales Outstanding (DSO) report for this account.

Daily Sales Outstanding, or DSO, is a metric that indicates the average number of days that it takes for an invoice to be fully paid. You can use this report to identify whether a company is improving on its ability to collect on invoices.



57
58
59
60
61
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 57

def daily_sales_outstanding(report_date:)
    path = "/api/v1/Reports/daily-sales-outstanding"
    params = {:reportDate => report_date}
    @connection.request(:get, path, nil, params)
end

#days_payable_outstandingObject

Retrieves a current Days Payable Outstanding (DPO) report for this account.

Days payable outstanding (DPO) is a financial ratio that indicates the average time (in days) that a company takes to pay its bills to its trade creditors, which may include suppliers, vendors, or financiers.



68
69
70
71
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 68

def days_payable_outstanding()
    path = "/api/v1/Reports/daily-payable-outstanding"
    @connection.request(:get, path, nil, nil)
end

#days_payable_outstanding_summary(report_date:, filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Retrieves a summary for each vendor that includes a count of their outstanding bills, the total amount outstanding, and their daily payable outstanding value.

Days payable outstanding (DPO) is a financial ratio that indicates the average time (in days) that a company takes to pay its bills to its trade creditors, which may include suppliers, vendors, or financiers.

More information on querying can be found on the [Searchlight Query Language](developer.lockstep.io/docs/querying-with-searchlight) page on the Lockstep Developer website.



263
264
265
266
267
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 263

def days_payable_outstanding_summary(report_date:, filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Reports/daily-payable-outstanding-summary"
    params = {:reportDate => report_date, :filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @connection.request(:get, path, nil, params)
end

#days_payable_outstanding_summary_total(report_date:) ⇒ Object

Retrieves total number of vendors, bills, the total amount outstanding, and the daily payable outstanding value for a group.

Days payable outstanding (DPO) is a financial ratio that indicates the average time (in days) that a company takes to pay its bills to its trade creditors, which may include suppliers, vendors, or financiers.



275
276
277
278
279
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 275

def days_payable_outstanding_summary_total(report_date:)
    path = "/api/v1/Reports/daily-payable-outstanding-summary-total"
    params = {:reportDate => report_date}
    @connection.request(:get, path, nil, params)
end

#income_statement_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:) ⇒ Object

Generates an Income Statement for the given time range.



213
214
215
216
217
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 213

def income_statement_report(start_date:, end_date:, app_enrollment_id:, column_option:, display_depth:, comparison_period:, show_currency_difference:, show_percentage_difference:)
    path = "/api/v1/Reports/income-statement"
    params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id, :columnOption => column_option, :displayDepth => display_depth, :comparisonPeriod => comparison_period, :showCurrencyDifference => show_currency_difference, :showPercentageDifference => show_percentage_difference}
    @connection.request(:get, path, nil, params)
end

#invoice_aging_report(company_id:, recalculate:, currency_code:, currency_provider:, buckets:, ap_report:) ⇒ Object

The Aging Report contains information about the total dollar value of invoices broken down by their age. Last default or specified bucket treated as a catch all bucket for values that fit in that bucket or beyond.

You can specify viewing parameters for the aging report such as currency code and date bucket configuration. You can also view aging data for an entire account or a specific company.

This information is recalculated when invoice data changes. After each invoice data change occurs, Lockstep queues up a calculation based on the current invoice data at that time. This information is calculated and persisted for each customer so that the report will be available quickly.

To force a recalculation of aging data, specify the recalculate option. Note that forcing a recalculation will slow your API response time.



152
153
154
155
156
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 152

def invoice_aging_report(company_id:, recalculate:, currency_code:, currency_provider:, buckets:, ap_report:)
    path = "/api/v1/Reports/aging"
    params = {:CompanyId => company_id, :Recalculate => recalculate, :CurrencyCode => currency_code, :CurrencyProvider => currency_provider, :Buckets => buckets, :ApReport => ap_report}
    @connection.request(:get, path, nil, params)
end

#payables_coming_dueObject

Retrieves payable amount due for 4 time buckets (Today, 7 Days from Today, 14 Days from Today, and 30 Days from Today).



76
77
78
79
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 76

def payables_coming_due()
    path = "/api/v1/Reports/payables-coming-due"
    @connection.request(:get, path, nil, nil)
end

#payables_coming_due_header(report_date:) ⇒ Object

Retrieves total number of vendors, bills, the total amount outstanding, for a group.



99
100
101
102
103
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 99

def payables_coming_due_header(report_date:)
    path = "/api/v1/Reports/payables-coming-due-header"
    params = {:reportDate => report_date}
    @connection.request(:get, path, nil, params)
end

#payables_coming_due_summary(filter:, include_param:, order:, page_size:, page_number:) ⇒ Object

Payables coming due represents the amount of cash required to pay vendor bills based on the due dates of the bills. Each bucket represents total amount due within the time period based on open Payables as of today.



89
90
91
92
93
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 89

def payables_coming_due_summary(filter:, include_param:, order:, page_size:, page_number:)
    path = "/api/v1/Reports/payables-coming-due-summary"
    params = {:filter => filter, :include => include_param, :order => order, :pageSize => page_size, :pageNumber => page_number}
    @connection.request(:get, path, nil, params)
end

#payables_summary_report(timeframe:) ⇒ Object

Retrieves a current Payables Summary report for this account.

The Payables Summary report indicates the amount of payments sent and bills received within a given timeframe. You can use this report to determine the overall balance of money coming into and out of your accounts receivable and accounts payable businesses.



45
46
47
48
49
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 45

def payables_summary_report(timeframe:)
    path = "/api/v1/Reports/payables-summary"
    params = {:timeframe => timeframe}
    @connection.request(:get, path, nil, params)
end

#risk_ratesObject

Retrieves a current Risk Rate report for this account.

Risk Rate is a metric that indicates the percentage of total AR balance left unpaid after 90 days. You can use this report to identify the percentage of invoice value that is not being collected in a timely manner.



110
111
112
113
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 110

def risk_rates()
    path = "/api/v1/Reports/risk-rates"
    @connection.request(:get, path, nil, nil)
end

#trial_balance_report(start_date:, end_date:, app_enrollment_id:) ⇒ Object

Generates a Trial Balance Report for the given time range.



196
197
198
199
200
# File 'lib/lockstep_sdk/clients/reports_client.rb', line 196

def trial_balance_report(start_date:, end_date:, app_enrollment_id:)
    path = "/api/v1/Reports/trial-balance"
    params = {:startDate => start_date, :endDate => end_date, :appEnrollmentId => app_enrollment_id}
    @connection.request(:get, path, nil, params)
end