Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 67 | All time: 10,346 This week: 102 |
Version | License | PHP version | Categories | |||
yii2-d3acc 1.0.0 | Freeware | 5 | Libraries, Business |
Description | Author | |||||||||||||||||||||||
This package cam accounting module for YII2 based applications. Innovation Award
|
|
This Yii2 module provides support for balance accounting (bookkeeping) system based on debit and credit principles. Provide additinal functionality: * periods (closing period and period balance) * dynamicly creating accounts attached one or more tables
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist d3yii2/yii2-d3acc "*"
or add
"d3yii2/yii2-d3acc": "*"
to the require section of your composer.json
file.
push migration
Create object acc
use \d3acc\models\AcRecAcc;
use Yii;
/
* Description of acc
*
* @author Dealer
*/
class acc
{
const MONTH_PERIOD = 1;
const PLAYER_ACC = 4;
const EXPENSES = 10;
const FOND_PLAYGROUND = 7;
acc::CODE_CRD_PLAYGROUND = 'CreditPlaygound';
/
* get player account
* @param int $personId
* @return AcRecAcc
*/
public static function player($personId)
{
return AcRecAcc::getAcc(self::PLAYER_ACC, ['person' => $personId]);
}
/
* get expenses account
* @return AcRecAcc
*/
public static function expenses()
{
return AcRecAcc::getAcc(self::EXPENSES);
}
/
* get for player playground account
* @param int $personId
* @param int $playgroundId
* @return AcRecAcc
*/
public static function fondPlayground($personId, $playgroundId)
{
return AcRecAcc::getAcc(self::FOND_PLAYGROUND,
['person' => $personId, 'playground' => $playgroundId]);
}
}
/
* player accounts
*/
$recAccPPG = acc::playerPlayground($person_id, $playground_id);
$recAccPlayer = acc::player($person_id);
$day = date('Y-m-d');
$tran = AcTran::registre($recAccPlayer, $recAccPPG, $personAmt,
$day, acc::MONTH_PERIOD, acc::CODE_CRD_PLAYGROUND);
use d3acc\models\AcPeriod;
$acPeriod = AcPeriod::getActivePeriod(acc::MONTH_PERIOD))
//close period
\d3acc\components\PeriodMonth::close(acc::MONTH_PERIOD);
$recAccPlayer = acc::player($person_id);
$data = AcTran::accPeriodTran($recAccPlayer, $acPeriod);
$filter = ['playground' => $playgroundId]
$playgroundAllPersonBalance = AcTran::accBalanceFilter(acc::FOND_PLAYGROUND, $acPeriod,$filter);
$filter = ['person' => $personId]
$personAllPlaygroundsBalance = AcTran::accBalanceFilter(acc::FOND_PLAYGROUND, $acPeriod,$filter);
$allPlaygroundsAllPersonBalance = AcTran::accBalanceFilter(acc::FOND_PLAYGROUND, $acPeriod,[]);
Define account plan by creating acc class
Add definition record in tables
$constructor = new AccConstructor();
Load existind or create new account (ac_account table) for session
$constructor->load($accId);
$constructor->create($code, $name);
Add new account dimension (ac_def table) for loaded/created account
$definition = $constructor->addDimension($table, $pkField);
Add new extended-account (ac_rec_acc table) for loaded/created account
$extAccount = $constructor->addExtendedAccount();
Add new dimension value (ac_rec_ref table) and recalculate label for given extended-account (ac_rec_acc table)
$constructor->addDimensionRecAcc($extAccount->id, $definition->id, $pk_value);
Files (68) |
File | Role | Description | ||
---|---|---|---|---|
components (6 files) | ||||
dictionaries (2 files) | ||||
doc (2 files) | ||||
gii (11 files) | ||||
messages (1 directory) | ||||
migrations (15 files) | ||||
models (11 files, 1 directory) | ||||
unit_tests (3 files) | ||||
AccDbshema.jpg | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
messages_config.php | Aux. | Auxiliary script | ||
Module.php | Class | Class source | ||
README.md | Doc. | Documentation |
Files (68) | / | components |
File | Role | Description |
---|---|---|
AccConstructor.php | Class | Class source |
Dim.php | Class | Class source |
DimConstructor.php | Class | Class source |
PeriodBase.php | Class | Class source |
PeriodHalfMonth.php | Class | Class source |
PeriodMonth.php | Class | Class source |
Files (68) | / | dictionaries |
File | Role | Description |
---|---|---|
AcAccountDictionary.php | Class | Class source |
AcDefDictionary.php | Class | Class source |
Files (68) | / | doc |
File | Role | Description |
---|---|---|
DbSchema.png | Data | Auxiliary data |
DbSchema.schemaxml | Data | Auxiliary data |
Files (68) | / | gii |
File | Role | Description |
---|---|---|
ac_accountGiiantModel.json | Data | Auxiliary data |
ac_defGiiantModel.json | Data | Auxiliary data |
ac_dimGiiantModel.json | Data | Auxiliary data |
ac_dim_groupGiiantModel.json | Data | Auxiliary data |
ac_periodGiiantModel.json | Data | Auxiliary data |
ac_period_balanceGiiantModel.json | Data | Auxiliary data |
ac_period_balance_dimGiiantModel.json | Data | Auxiliary data |
ac_rec_accGiiantModel.json | Data | Auxiliary data |
ac_rec_refGiiantModel.json | Data | Auxiliary data |
ac_tranGiiantModel.json | Data | Auxiliary data |
ac_tran_dimGiiantModel.json | Data | Auxiliary data |
Files (68) | / | migrations |
File | Role | Description |
---|---|---|
m161009_181508_init.php | Class | Class source |
m161018_184508_add_balance.php | Class | Class source |
m161019_184508_tran_alter.php | Class | Class source |
m180722_194651_tran_alter.php | Class | Class source |
m180911_172355_cre...dim_group_table.php | Class | Class source |
m180911_175101_create_ac_dim_table.php | Class | Class source |
m180911_180201_cre..._tran_dim_table.php | Class | Class source |
m181102_155620_cre...iod_balance_dim.php | Class | Class source |
m181102_155720_alt...iod_balance_dim.php | Class | Class source |
m190101_193802_period_balance_alter.php | Class | Class source |
m190413_155446_rec_ref_add_index.php | Class | Class source |
m200923_100707_add_sys_company_id.php | Class | Class source |
m210119_230707_rec..._id_to_smallint.php | Class | Class source |
m210427_100707_add_inex.php | Class | Class source |
m210505_130707_tran_add_uniqueindex.php | Class | Class source |
Files (68) | / | models |
File | Role | Description | ||
---|---|---|---|---|
base (11 files) | ||||
AcAccount.php | Class | Class source | ||
AcDef.php | Class | Class source | ||
AcDim.php | Class | Class source | ||
AcDimGroup.php | Class | Class source | ||
AcPeriod.php | Class | Class source | ||
AcPeriodBalance.php | Class | Class source | ||
AcPeriodBalanceDim.php | Class | Class source | ||
AcRecAcc.php | Class | Class source | ||
AcRecRef.php | Class | Class source | ||
AcTran.php | Class | Class source | ||
AcTranDim.php | Class | Class source |
Files (68) | / | models | / | base |
File | Role | Description |
---|---|---|
AcAccount.php | Class | Class source |
AcDef.php | Class | Class source |
AcDim.php | Class | Class source |
AcDimGroup.php | Class | Class source |
AcPeriod.php | Class | Class source |
AcPeriodBalance.php | Class | Class source |
AcPeriodBalanceDim.php | Class | Class source |
AcRecAcc.php | Class | Class source |
AcRecRef.php | Class | Class source |
AcTran.php | Class | Class source |
AcTranDim.php | Class | Class source |
Files (68) | / | unit_tests |
File | Role | Description |
---|---|---|
AcAccountTest.php | Class | Class source |
PeriodHalfMonthTest.php | Class | Class source |
PeriodMonthTest.php | Class | Class source |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.