Perl API for report.cgi

Unless indicated, all parameters are name => 'value' style. If [Order Specific] is used, then the parameters must come in that order and are old style. Ex. ValidateParameter($name, $value) instead of get_ledger_color(dbh => $dbh, ledger_code => $ledger_code).

$ = get_ledger_name(dbh, ledger_db)

$ = get_ledger_code(dbh, ledger_name)

$ = get_ledger_color(dbh, ledger_code)

%ref, $ = get_report_attributes(dbh) - returns the hash reference to the attributes and the error_string

void display_for_running(dbh, error_string, status_string)

void display_for_edit(dbh, error_string, status_string)

void create_report_frames(cookie_name, cookie_value, dbh)

void edit_report_frames(dbh, cookie_name, cookie_value)

% = get_default_data()

1 or 0 = validateParameter(name, value) [Order specific]

@ = get_all_account_types(dbh)

@ = get_all_accounts(dbh)

@ = get_all_sub_accounts(dbh)

@ = get_all_detailed_reports(dbh)

1 or 0 = find_account_type(array, num)

1 or 0 = find_account(array, num)

1 or 0 = find_sub_account(array, num)

1 or 0 = find_detailed_report(array, num)

-1, ..., n = find_level(array, level)

"" or Report Name = DoesReportExist(dbh, id)

1 or 0 = DoesMemorizedReportExist(dbh, id, report_name, ledger_code)

1 or 0 = IsReportEditable(dbh, id) - Assumes report does exist, doesn't do a validity check.

-1 or id = FindReportByName(dbh, name)

$ = TypeOfReport(dbh, id)

@ = parse_rows(rows, dbh)

1 or 0 = validate_row_item(name, value) [Order specific]

$ = FindSubAccount(number, array_ref) [Order specific]

$ = FindSubAccountType(number, array_ref) [Order specific]

@ = GetReportData(dbh, id)

@of@'s = GetReportRows(dbh, id)

@ = GetAccountTypes(dbh) - returns an array of all account types in the system.

@ = GetAccountTypeNames(dbh, @account_types) - returns the names of every account type in the array.

$ = GetAccountType(dbh, acct_number) - returns the account type of the specified account.

$ = GetAccountName(dbh, acct_number) - returns the name of the specified account.

$ = GetSubAccountName(dbh, sub_acct_number)

@ = GetLocalAccounts(dbh, @account_types, taxable(optional), ledger_code)

@ = AccountActivity(dbh, @accounts, search_type(optional), ledger_code, begin_date, end_date, @sub_account(optional), @sub_entity(optional))

@ = AccountBalanceActivity(dbh, @accounts, ledger_code, end_date, search_type(optional), @sub_account(optional), @sub_entity(optional))

$ = AddMoneyByDebitCredit(balance, debit_increases, dorc, amount)

@ = AccountActivitySplit(dbh, @accounts, search_type(optional), ledger_code, begin_date, end_date)

$ = GetSubAccountTypeName(dbh, sub_account_type)

@ = GetSubAccountTypes(dbh, account_type)

@ = GetSubAccounts(dbh, account_type, order(optional))

@ = GetSubAccountsForSubAccountType(dbh, sub_account_type, order(optional))

$ = GetTypeForSubAccount(dbh, sub_account)

@ = GetAccountsForSubAccount(dbh, sub_account, ledger_code, account_type, taxable(optional))

@ = AccountTypeActivity(dbh, @account_types, search_type(optional), ledger_code, begin_date(optional if balance), end_date, taxable(optional), balance(optional), @sub_entity(optional), @sub_account(optional))

@ = RetrieveSubArray(array, index) - returns the array at array[index].

@ = SubAccountActivity(dbh, @sub_accounts, @accounts, search_type(optional), ledger_code, begin_date, end_date)

@ = GetSubEntities(dbh, ledger_code)

@ = SubEntityAccountActivity(dbh, @sub_entities, @accounts, search_type(optional), ledger_code, begin_date, end_date, @sub_account(optional))

@ = SubEntitySubAccountActivity(dbh, @sub_entities, @accounts, search_type(optional), ledger_code, begin_date, end_date, @sub_accounts)

@ = GetActivityData(dbh, ledger_code, sql_statement)

@ = getKnownYearsInfo(dbh, ledger_code)

@ = GetAccountBalance(dbh, @account, ledger_code, end_date, @sub_account(optional), @sub_entity(optional))

void log_temp_file(dbh, file_name)

void display_regular_report_top(dbh, file_name)

void display_regular_report(dbh, file_name, report_type)

void display_detailed_report_top(dbh, file_name)

void display_detailed_report(dbh, file_name, report_type)

void report_first_screen_edit_create(mode, name, id, report_class, report_type, column_variable, column_variable_data, date_range, display_dates, max_columns, min_columns, text_size, data_size, text_font, data_font, total_column, fg_color, bg_color, underline_length, dbh, error_string)

void report_second_screen_edit_create(mode, id, dbh)

void customize_report_display(dbh, error_string, memorized, id, report_name, ledger, ledger_name, ledger_code, ledger_color, report_class, report_type, column_variable, column_variable_data, date_range, display_dates, max_columns, min_columns, text_font, text_size, data_font, data_size, total_column, underline_length, fg_color, bg_color, account_format, data_precision, negative_format, dates_entered, column_data, column_type, column_data) - if memorized is true, then the id must contain the id of the report along with the report name separated by a | character.

void memorized_report_display(dbh, report_type, error_string(optional), question_string(optional), id, ledger, ledger_code, ledger_color, report_name, fg_color, bg_color, negative_format, text_size, text_font, data_size, data_font, account_format, data_precision, {dates_entered, underline_length, total_column, column_data, column_type, column_variable, column_variable_data}(if regular), {sql_statement, headers, sorted_by, sorted_order, subtotal, subtotal_type}(if detailed))

void gather_regular_report_data("dbh", "id", "ledger", "ledger_color", "report_name", "date_range", "fg_color", "bg_color", "underline_length", "data_precision", "negative_format", "text_size", "text_font", "data_size", "data_font", "account_format", "column_variable", "column_variable_data", "total_column", "column_data", "column_type", "dates_entered")

void run_report("dbh", "id", "ledger", "ledger_color", "report_name", "date_range", "dates_entered", "max_columns", "min_columns", "fg_color", "bg_color", "underline_length", "data_precision", "negative_format", "text_size", "text_font", "data_size", "data_font", "account_format", "column_variable", "column_variable_data", "total_column", "display_dates", "column_data", "column_type")

$ = convert_data(precision, value) - converts value to precision.

$ = massage_data(precision, value) - prints value in precision.

$ = get_account_type_data(%args, temp_hash, %temp_row) - returns max_display_level

$ = get_account_data(%args, temp_hash, %temp_row) - returns max_display_level

$ = get_sub_account_type_data(%args, temp_hash, %temp_row) - returns max_display_level

$ = get_sub_account_data(%args, temp_hash, %temp_row) - returns max_display_level

$ = get_total_data(%args, temp_hash, %temp_row) - returns max_display_level

void get_detail_data(%args, temp_hash, %temp_row)

($,@) = parse_formula(formula) - returns error_string and array of tokens.

void my_die(title, code, message) [Order specific]

void my_db_die(title, code, message) [Order specific]




Copyright (c) 2001 HLR
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1; A copy of the license is available at http://www.gnu.org/licenses/licenses.html#FDL.

Updated: $Id: report.cgi_api.html,v 1.1.1.1 2001/08/09 19:02:57 moreejt Exp $