PHP Classes

YII2 D3 PHP Accounting: Accounting module for YII2 based applications

Recommend this page to a friend!
  Info   View files Documentation   View files View files (68)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2021-05-28 (6 months ago) RSS 2.0 feedNot yet rated by the usersTotal: 58 This week: 1All time: 10,027 This week: 350Up
Version License PHP version Categories
yii2-d3acc 1.0.0Freeware5Libraries, Business
Description Author

This package cam accounting module for YII2 based applications.

It provides support to implement several operations necessary to perform business accounting. Currently it can:

- Perform balance accounting (bookkeeping) system based on debit and credit principles.
- Activities of the closing period and the balance period
- Dynamicly creating accounts attached one or more tables

Innovation Award
PHP Programming Innovation award nominee
May 2021
Number 5
Many companies are using Web applications to perform activities related to the accounting of their businesses.

This package provides a module to implement several types of functionality that are useful to perform activities about a company's accounting.

Manuel Lemos
Picture of Uldis Nelsons
Name: Uldis Nelsons <contact>
Classes: 14 packages by
Country: Latvia Latvia
Age: 52
All time rank: 22127 in Latvia Latvia
Week rank: 84 Up2 in Latvia Latvia Up
Innovation award
Innovation award
Nominee: 9x

Winner: 2x

Details

Latest Stable Version Total Downloads Latest Unstable Version Code Climate License

Accounting

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

Installation

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

DB structure

DB Schema

Account definition

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]);
    }    
}
 

Transaction registration


       /
        * 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);


Periods

use d3acc\models\AcPeriod;
$acPeriod = AcPeriod::getActivePeriod(acc::MONTH_PERIOD))

//close period
\d3acc\components\PeriodMonth::close(acc::MONTH_PERIOD);


Transactions

 $recAccPlayer = acc::player($person_id);
 $data = AcTran::accPeriodTran($recAccPlayer, $acPeriod);

Balance

 $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

Migrations with AccConstructor

$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 folder image Files  
File Role Description
Files folder imagecomponents (6 files)
Files folder imagedictionaries (2 files)
Files folder imagedoc (2 files)
Files folder imagegii (11 files)
Files folder imagemessages (1 directory)
Files folder imagemigrations (15 files)
Files folder imagemodels (11 files, 1 directory)
Files folder imageunit_tests (3 files)
Accessible without login Image file AccDbshema.jpg Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file messages_config.php Aux. Auxiliary script
Plain text file Module.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  components  
File Role Description
  Plain text file AccConstructor.php Class Class source
  Plain text file Dim.php Class Class source
  Plain text file DimConstructor.php Class Class source
  Plain text file PeriodBase.php Class Class source
  Plain text file PeriodHalfMonth.php Class Class source
  Plain text file PeriodMonth.php Class Class source

  Files folder image Files  /  dictionaries  
File Role Description
  Plain text file AcAccountDictionary.php Class Class source
  Plain text file AcDefDictionary.php Class Class source

  Files folder image Files  /  doc  
File Role Description
  Accessible without login Image file DbSchema.png Data Auxiliary data
  Accessible without login Plain text file DbSchema.schemaxml Data Auxiliary data

  Files folder image Files  /  gii  
File Role Description
  Accessible without login Plain text file ac_accountGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_defGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_dimGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_dim_groupGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_periodGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_period_balanceGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_period_balance_dimGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_rec_accGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_rec_refGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_tranGiiantModel.json Data Auxiliary data
  Accessible without login Plain text file ac_tran_dimGiiantModel.json Data Auxiliary data

  Files folder image Files  /  messages  
File Role Description
Files folder imageru (1 file)

  Files folder image Files  /  messages  /  ru  
File Role Description
  Accessible without login Plain text file d3acc.php Aux. Auxiliary script

  Files folder image Files  /  migrations  
File Role Description
  Plain text file m161009_181508_init.php Class Class source
  Plain text file m161018_184508_add_balance.php Class Class source
  Plain text file m161019_184508_tran_alter.php Class Class source
  Plain text file m180722_194651_tran_alter.php Class Class source
  Plain text file m180911_172355_cre...dim_group_table.php Class Class source
  Plain text file m180911_175101_create_ac_dim_table.php Class Class source
  Plain text file m180911_180201_cre..._tran_dim_table.php Class Class source
  Plain text file m181102_155620_cre...iod_balance_dim.php Class Class source
  Plain text file m181102_155720_alt...iod_balance_dim.php Class Class source
  Plain text file m190101_193802_period_balance_alter.php Class Class source
  Plain text file m190413_155446_rec_ref_add_index.php Class Class source
  Plain text file m200923_100707_add_sys_company_id.php Class Class source
  Plain text file m210119_230707_rec..._id_to_smallint.php Class Class source
  Plain text file m210427_100707_add_inex.php Class Class source
  Plain text file m210505_130707_tran_add_uniqueindex.php Class Class source

  Files folder image Files  /  models  
File Role Description
Files folder imagebase (11 files)
  Plain text file AcAccount.php Class Class source
  Plain text file AcDef.php Class Class source
  Plain text file AcDim.php Class Class source
  Plain text file AcDimGroup.php Class Class source
  Plain text file AcPeriod.php Class Class source
  Plain text file AcPeriodBalance.php Class Class source
  Plain text file AcPeriodBalanceDim.php Class Class source
  Plain text file AcRecAcc.php Class Class source
  Plain text file AcRecRef.php Class Class source
  Plain text file AcTran.php Class Class source
  Plain text file AcTranDim.php Class Class source

  Files folder image Files  /  models  /  base  
File Role Description
  Plain text file AcAccount.php Class Class source
  Plain text file AcDef.php Class Class source
  Plain text file AcDim.php Class Class source
  Plain text file AcDimGroup.php Class Class source
  Plain text file AcPeriod.php Class Class source
  Plain text file AcPeriodBalance.php Class Class source
  Plain text file AcPeriodBalanceDim.php Class Class source
  Plain text file AcRecAcc.php Class Class source
  Plain text file AcRecRef.php Class Class source
  Plain text file AcTran.php Class Class source
  Plain text file AcTranDim.php Class Class source

  Files folder image Files  /  unit_tests  
File Role Description
  Plain text file AcAccountTest.php Class Class source
  Plain text file PeriodHalfMonthTest.php Class Class source
  Plain text file PeriodMonthTest.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:58
This week:1
All time:10,027
This week:350Up
For more information send a message to info at phpclasses dot org.