halumein/yii2-spending

Spending module

Installs: 169

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2017-03-01 06:09 UTC

This package is not auto-updated.

Last update: 2024-11-09 20:28:25 UTC


README

Модуль учта затрат

php composer require halumein/yii2-spending "*"

миграция:

php yii migrate --migrationPath=vendor/halumein/yii2-spending/migrations

В конфигурационный файл приложения добавить модуль test

    'modules' => [
        'spending' => [
            'class' => 'halumein\spending\Module',
            'userModel' => 'app\models\User',
            'adminRoles' => ['superadmin', 'administrator'],
            'on create' => function($event) {
                \Yii::$app->cashbox->addTransaction('outcome', $event->model->cost, $event->model->cashbox_id);
            },
        ],
        //...
    ]