/** * * @param \biz\base\Event $event */ public function purchaseReceiveEnd($event) { /* @var $model \biz\accounting\models\Purchase */ $model = $event->params[0]; // GL ************* $glHdr = ['date' => date('Y-m-d'), 'type_reff' => GlHeader::TYPE_PURCHASE, 'memo' => null, 'id_reff' => $model->id_purchase, 'id_branch' => $model->id_branch, 'description' => 'Pembelian barang kredit ' . $model->purchase_num]; $dtls = ['PERSEDIAAN' => $model->purchase_value * (1 - $model->item_discount * 0.01), 'HUTANG' => $model->purchase_value * (1 - $model->item_discount * 0.01)]; $glDtls = AccHelper::entriSheetToGlMaps('PEMBELIAN_KREDIT', $dtls); AccHelper::createGL($glHdr, $glDtls); }
yii\jui\AutoCompleteAsset::register($this); yii\jui\ThemeAsset::register($this); biz\app\assets\BizAsset::register($this); $jsFunc = <<<JS function (\$row) { \$row.find('.nm_account').autocomplete({ source: biz.master.coas, select: function (event, ui) { var \$row = \$(event.target).closest('tr'); \$row.find('.id_account').val(ui.item.id); \$row.find('.cd_account').text(ui.item.cd_coa); \$row.find('.nm_account').val(ui.item.value); return false; } }); } JS; biz\app\assets\BizDataAsset::register($this, ['master' => AccHelper::getMasters('coa'), 'config' => ['glAfterAddRow' => new \yii\web\JsExpression($jsFunc)]]); $js = <<<JS \$('#tbl-glheader a[data-action="append"]').click(function () { \$('#tbl-gldetail').mdmTabularInput('addRow'); return false; }); yii.numeric.input(\$('#tbl-glheader'),'input.amount'); yii.numeric.format(\$('#tbl-glheader'),'input.amount'); JS; $this->registerJs($js);
/** * * @param Coa $model */ protected function fillAttributes($model) { $model->coa_type = $model->cd_account[0] . '00000'; $model->normal_balance = Helper::getNormalBalanceOfType($model->coa_type); return true; }
/** * @var yii\web\View $this * @var biz\models\\Coa $model * @var yii\widgets\ActiveForm $form */ $form = ActiveForm::begin(); ?> <div class="box box-primary"> <div class="box-header"> </div> <div class="box-body"> <?php // $form->field($model, 'coa_type')->dropDownList(Coa::getCoaType(), ['style' => 'width:180px;']) ?> <?php echo $form->field($model, 'id_parent')->dropDownList(Helper::getGroupedCoaList(true)); ?> <?php echo $form->field($model, 'cd_account')->textInput(['maxlength' => 16, 'style' => 'width:160px;']); ?> <?php echo $form->field($model, 'nm_account')->textInput(['maxlength' => 64, 'style' => 'width:240px;']); ?> <?php // $el_id = Html::getInputId($model, 'id_parent'); // $field = $form->field($model, "id_parent", ['template' => "{label}\n{input}{text}\n{hint}\n{error}"]); // $field->labelOptions['for'] = $el_id; // $field->hiddenInput(['id' => 'id_parent']);
/** * @inheritdoc */ public function rules() { return [[['id_periode'], 'default', 'value' => Helper::getCurrentIdAccPeriode()], [['status'], 'default', 'value' => self::STATUS_ACTIVE], [['glDate', 'id_branch', 'id_periode', 'description', 'status'], 'required'], [['description'], 'string'], [['gl_date'], 'safe'], [['id_branch', 'id_periode', 'type_reff', 'id_reff', 'status'], 'integer']]; }
use biz\accounting\components\Helper; /* @var $this yii\web\View */ /* @var $model biz\accounting\models\Coa */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="coa-form col-lg-6"> <?php $form = ActiveForm::begin(); ?> <div class="panel panel-primary"> <div class="panel-heading">Chart of Account</div> <div class="panel-body"> <?php echo $form->field($model, 'id_parent')->dropDownList(Helper::getGroupedCoaList(true), ['encodeSpaces' => true]); ?> <?php echo $form->field($model, 'cd_account')->textInput(['maxlength' => 16, 'style' => 'width:180px;']); ?> <?php echo $form->field($model, 'nm_account')->textInput(['maxlength' => 64]); ?> </div> </div> <div class="form-group">