\FundsFlow
Financial data preprocessing and rendering class
Synopsis
class FundsFlow
{
- // constants
- const OFFSET_DATE = 0;
- const OFFSET_TIME = 1;
- const OFFSET_LOGIN = 7;
- const OFFSET_FROM = 12;
- const OFFSET_TO = 14;
- const MASK_FEE = 'fee charge';
- const TABLE_FEES = 'fees';
- const TABLE_PAYS = 'payments';
- const TABLE_CORR = 'paymentscorr';
- // members
- protected array $alterConf = ;
- protected array $billingConf = ;
- protected array $allUserData = ;
- protected array $allTariffsData = ;
- protected array $fundsTmp = ;
- protected array $userTags = ;
- public bool $avoidDTKeysDuplicates = false;
- protected bool $feesHarvesterFlag = false;
- protected $feesDb = '';
- protected $paymentsDb = '';
- protected $corrDb = '';
- protected string $dateFilter = '';
- protected $cemetery = '';
- protected array $allBuriedUsers = ;
- protected string $colorPayment = '005304';
- protected string $colorFee = 'a90000';
- protected string $colorBonus = '007706';
- protected string $colorAdditionalFee = 'd50000';
- protected string $colorCorrecting = 'ff6600';
- protected string $colorMock = '006699';
- protected string $colorSet = '000000';
- protected string $colorCreditViolet = '552c82';
- // methods
- public void __construct()
- protected void loadConfigs()
- protected void initTmp()
- protected void initFinanceDb()
- protected void initFeesDb()
- protected void loadAllUserData()
- protected void loadCemetery()
- protected void loadAllTariffsData()
- protected void loadUserTags()
- public void setDateFilter()
- public array getLogFees()
- public array getDbFees()
- public array getFees()
- public array getAllCashFlows()
- public int harvestFees()
- public array getPayments()
- public array getPaymentsCorr()
- public array getCashTypeNames()
- public void renderArray()
- public array transformArray()
- public array filterByDate()
- protected string renderUserTags()
- public string renderCorpsFlows()
- public string renderCorpsFlowsTotal()
- public string renderCorpsFlowsHeaders()
- public string renderCorpsFlowsDateForm()
- public string getOnlineLeftCount()
- public void runDataLoders()
- public int getOnlineLeftCountFast()
- public void makeFreezeMonthFee()
- public mixed concatAvoidDuplicateKeys()
Constants
Name | Value |
---|---|
OFFSET_DATE | 0 |
OFFSET_TIME | 1 |
OFFSET_LOGIN | 7 |
OFFSET_FROM | 12 |
OFFSET_TO | 14 |
MASK_FEE | 'fee charge' |
TABLE_FEES | 'fees' |
TABLE_PAYS | 'payments' |
TABLE_CORR | 'paymentscorr' |
Members
protected
- $allBuriedUsers
—
array
Contains buried users - $allTariffsData
—
array
Contains available tariffs data as tariffname=>data - $allUserData
—
array
Contains all of available user data as login=>userdata - $alterConf
—
array
Contains system alter config as key=>value - $billingConf
—
array
Contains main billing config as key=>value - $cemetery
—
Contains cemetery instance for further usage - $colorAdditionalFee
- $colorBonus
- $colorCorrecting
- $colorCreditViolet
- $colorFee
- $colorMock
-
$colorPayment
Rendering coloring settings - $colorSet
- $corrDb
—
Balance corrections database abstraction layer - $dateFilter
—
string
Contains date filter for massive queries - $feesDb
—
Harvested fees database abstraction layer - $feesHarvesterFlag
—
bool
Is fees harvester enabled flag. - $fundsTmp
—
array
Storage os some temporary data - $paymentsDb
—
Payments database abstraction layer - $userTags
—
array
Contains assigned user tags
public
- $avoidDTKeysDuplicates
—
bool
Placeholder for FF_REP_AVOID_DUPLICATE_DT_KEYS alter.ini option
Methods
protected
- initFeesDb() — Inits fees database abstraction layer
- initFinanceDb() — Inits fees database abstraction layer
- initTmp() — Inits tmp data with empty values
- loadAllTariffsData() — Loads tariffs data from database into protected property
- loadAllUserData() — Loads all of available users data as login=>array
- loadCemetery() — Inits cemetery and preloads all buried users
- loadConfigs() — Preloads system configs
- loadUserTags() — Loads existing tagtypes and usertags into protected props for further usage
- renderUserTags() — Renders user tags if available
public
- __construct() — Creates new FundsFlow instance
- concatAvoidDuplicateKeys() — Process possible duplicates and concatenates $fees, $payments and $corrections arrays
- filterByDate() — Extracts funds only with some date pattern
- getAllCashFlows() — Returns all payments/fees/corrections with optional date filter as login=>counter=>flows
- getCashTypeNames() — Returns array of cashtype names
- getDbFees() — Returns array of fees by some login from harvested fees database
- getFees() — Returns array of fees by some login with parsing it from stargazer log
- getLogFees() — Returns array of fees by some login with parsing it from stargazer log
- getOnlineLeftCount() — Returns user online left days
- getOnlineLeftCountFast() — Returns user online left days without additional DB queries runDataLoaders() must be run once, before usage
- getPayments() — Returns array of all payments by some user
- getPaymentsCorr() — Returns array of all payments of user by some login
- harvestFees() — Harvests some fees from stargazer log to database
- makeFreezeMonthFee() — Charges month freezing fee (i dont know why this is here)
- renderArray() — Renders result of default fundsflow module
- renderCorpsFlows() — Renders table for corps users payments/fees stats
- renderCorpsFlowsDateForm() — Returns year/month selectors form
- renderCorpsFlowsHeaders() — Returns corpsacts table headers
- renderCorpsFlowsTotal() — Returns totals data from previous renderCorpsFlows runs
- runDataLoders() — Loads all user and tariffs data
- setDateFilter() — Datetime mask for filtering payments/fees on massive queries
- transformArray() — Transforms array for normal output