EStatement
- enum q2_sdk.hq.db.e_statement.EStatementDateColumn(value)[source]
Bases:
Enum
Valid values are as follows:
- CreateDate = <EStatementDateColumn.CreateDate: 'Create'>
- LastChange = <EStatementDateColumn.LastChange: 'Last'>
- class q2_sdk.hq.db.e_statement.AddOrUpdateParams(host_account_id, opt_in, email_address, user_id, alt_email_address=None, last_change=None)[source]
Bases:
object
- Parameters:
host_account_id (
int
) – The account id of the target accountopt_in (
bool
) – boolean representing opting in or out of e-statementsemail_address (
str
) – the target email addressuser_id (
int
) – The user ID making the creation or updatealt_email_address (
Optional
[str
]) – An alternate email for e-statements
- Params last_change:
The timestamp of the last change. Defaults to datetime.now
- class q2_sdk.hq.db.e_statement.EStatementRow(element, row_class=None, rename_fields=None)[source]
Bases:
TableRow
- class q2_sdk.hq.db.e_statement.EStatement(logger, hq_credentials=None, ret_table_obj=None)[source]
Bases:
DbObject
Queries the Q2_Customer table for rows that match the given arguments. Gathers additional details on specific customers
Programmatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.
- Parameters:
logger – Reference to calling request’s logger (self.logger in your extension)
hq_credentials (
Optional
[HqCredentials
]) – HQ Connectivity Information (Defaults to settings file)ret_table_obj (
Optional
[bool
]) – Flag to return list of LXML elements ifFalse
or TableRow objects from DB calls ifTrue
(Defaults to settings file)
- NAME = 'EStatement'
- REPRESENTATION_ROW_CLASS
alias of
EStatementRow
- async get_by_date_range(start_date, end_date, date_column, page_number=1, page_size=200)[source]
Get e-statements by date range and supports pagination
- Parameters:
start_date (
datetime
) – The start date of the date range, as a datetime objectend_date (
datetime
) – The end date of the date range, as a datetime objectdate_column (
EStatementDateColumn
) – The date column to filter the date onpage_number – the starting point for pagination. Defaults to 1
page_size – The number of transactions to get per page
- Return type:
- Returns:
A list of EStatement rows that fit the provided parameters