Ejemplo n.º 1
0
            $items[] = $item;
        }
        return $items;
    }
    protected function findActivePeriode()
    {
        $dPeriode = \backend\models\accounting\AccPeriode::find()->active()->one();
        if ($dPeriode != null) {
            return $dPeriode->id;
        }
        throw new NotFoundHttpException('There is no active periode..');
    }
    /**
     * Execute before child save. If return false, child not saved
     * @param GoodsMovementDtl $child
     * @return boolean Description
     */
    public function beforeRSave($child)
    {
        return $child->qty != 0;
    }
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [['class' => 'mdm\\converter\\DateConverter', 'type' => 'date', 'logicalFormat' => 'php:d-m-Y', 'attributes' => ['Date' => 'date']], 'yii\\behaviors\\BlameableBehavior', 'yii\\behaviors\\TimestampBehavior', ['class' => 'dee\\tools\\StateChangeBehavior', 'states' => [[null, self::STATUS_RELEASED, 'updateStock', 1], [self::STATUS_DRAFT, self::STATUS_RELEASED, 'updateStock', 1], [self::STATUS_DRAFT, self::STATUS_RELEASED, 'postGL', 1], [self::STATUS_RELEASED, self::STATUS_DRAFT, 'updateStock', -1], [self::STATUS_RELEASED, self::STATUS_DRAFT, 'postGL', -1], [self::STATUS_RELEASED, self::STATUS_CANCELED, 'updateStock', -1], [self::STATUS_RELEASED, self::STATUS_CANCELED, 'postGL', -1], [self::STATUS_RELEASED, null, 'updateStock', -1]]]];
    }
}
GoodsMovement::$references = (require 'mv_reference.php');