FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Attributes | Protected Member Functions | List of all members
Txt_Tatra_Banka_Statement_File_Importer Class Reference

Parser for Tatra banka E-mail statements. More...

Inheritance diagram for Txt_Tatra_Banka_Statement_File_Importer:
Tatra_Banka_Statement_File_Importer Bank_Statement_File_Importer

Public Attributes

const REGEX_DATA = "@(\d{1,2}\.\d{1,2}\.\d{4} \d{1,2}:\d{2}).+(\w{2}\d{2}(\d{4})(\d{16})).* (\d+,\d{2}) (.+)\.@"
const REGEX_CA = "@ (\d{4})/([\d-]+)@"
const REGEX_NO_CA = "@Popis transakcie: ()(.*)@"
const REGEX_VS = "@VS ?(\d*)@"
const REGEX_SS = "@SS ?(\d*)@"
const REGEX_CS = "@KS ?(\d*)@"
const REGEX_BALANCE = "@aktualny zostatok:[^0-9]*((\d+[ ]?)\d+,\d{2}) (.+)@"
const REGEX_MSG = "@Informacia pre prijemcu: (.*)@"
- Public Attributes inherited from Tatra_Banka_Statement_File_Importer
const LAST_DOWNLOAD_SETTINGS_KEY = 'last_download'
- Public Attributes inherited from Bank_Statement_File_Importer
const DIR = 'importers'
 Dir with driver classes.

Protected Member Functions

 check_file_data_format ()
 Checks whether the file content that is stored into a fileData property has valid format.
 get_header_data ()
 Gets header data of file data format.
 parse_file_data ()
 Parses a file data into a semantic interpretation of its content.
 do_download (Bank_account_Model $bank_account, Bank_Account_Settings $settings, $url)
 This method enables to download a bank statement.
 decode_body ($body, $struct)
- Protected Member Functions inherited from Tatra_Banka_Statement_File_Importer
 store (&$stats=array())
 Stores data that are obtain via parse_file_data method (stored internally.
- Protected Member Functions inherited from Bank_Statement_File_Importer
 __construct (Bank_account_Model $bam)
 Creates new instance od bank statement import.
 get_user_id ()
 User ID of caller of this importer.
 get_bank_account ()
 Gets bank account for which the importer is evaulating imports.
 set_file_data ($fd)
 Sets bank statement file data (content of a file)
 get_file_data ()
 Gets bank statement file data (content of a file)
 add_error ($error, $translate=TRUE)
 Adds given error to the start of the error stack.
 add_exception_error (Exception $e, $translate=TRUE)
 Add given exception as error to the start of the error stack.
 add_affected_member ($member_id)
 Adds member as affected by this parsed statement.
 get_errors ()
 Gets error trace.
 find_member_by_vs ($variable_symbol, $error_correction=TRUE)
 Finds member ID by variable method.
 before_download (Bank_account_Model $bank_account, Bank_Account_Settings $settings)
 This method may be implemented in order to do some action before downloading of a bank statement.
 notify_affected_members ()
 Informs affected members by email or SMS according to setting variables inform_affected_member_by_email and inform_affected_member_by_sms.

Additional Inherited Members

- Public Member Functions inherited from Bank_Statement_File_Importer
 get_importer_name ()
 Get importer name.
- Static Public Member Functions inherited from Bank_Statement_File_Importer
static get_drivers ()
 Gets available drivers.
static download (Bank_account_Model $bank_account, Bank_Account_Settings $settings, $send_emails, $send_sms)
 Tries to download statement and then import it.
static import (Bank_account_Model $bank_account, $filename, $ext, $send_emails=TRUE, $send_sms=FALSE)
 Imports a bank statement placed in a file that is given by the filename to bank account that is given by its database model.
- Static Protected Member Functions inherited from Tatra_Banka_Statement_File_Importer
static remove_zeros ($value)
 Removes zeros on beginning of string (symbols or account)
- Protected Attributes inherited from Tatra_Banka_Statement_File_Importer
 $data = array()
 $last_download_datetime

Detailed Description

Parser for Tatra banka E-mail statements.

Author
David Raška

Member Function Documentation

Txt_Tatra_Banka_Statement_File_Importer::check_file_data_format ( )
protected

Checks whether the file content that is stored into a fileData property has valid format.

This method checks only a format (syntax), semantic meaning of content is examined later.

An error in the format may be add into error stack (addError) that is later displayed to user if this function returns FALSE.

Returns
boolean TRUE if format is corrrent, FALSE otherwise

Reimplemented from Bank_Statement_File_Importer.

Txt_Tatra_Banka_Statement_File_Importer::do_download ( Bank_account_Model  $bank_account,
Bank_Account_Settings  $settings,
  $url 
)
protected

This method enables to download a bank statement.

By default it simply download file from the specified URL. If other type of download is needed that this method should be overriden.

Parameters
Bank_account_Model$bank_account
Bank_Account_Settings$settings
string$urlPrepare download URL
Returns
string Content of downloaded file or FALSE on error

Reimplemented from Bank_Statement_File_Importer.

Txt_Tatra_Banka_Statement_File_Importer::get_header_data ( )
protected

Gets header data of file data format.

This method is used for checking if the bank statement correspondes to bank account in the database.

Data must be available in any time after calling of check_file_data_format method.

An error in the format may be add into error stack (addError) that is later displayed to user if this function returns FALSE.

If bank statement file not providing any header information NULL can be returned to skip assert for bank account match.

Returns
Header_Data|boolean|null

Reimplemented from Bank_Statement_File_Importer.

Txt_Tatra_Banka_Statement_File_Importer::parse_file_data ( )
protected

Parses a file data into a semantic interpretation of its content.

This interpretation must be defined by implementing class.

An error in the format may be add into error stack (addError) that is later displayed to user if this function returns FALSE.

Returns
boolean TRUE if file data were succesfully parsed, FALSE otherwise

Reimplemented from Bank_Statement_File_Importer.


The documentation for this class was generated from the following file: