Beispiel #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPurchaseDtls()
 {
     return $this->hasMany(PurchaseDtl::className(), ['id_purchase' => 'id_purchase']);
 }
Beispiel #2
0
?>
            <div class="pull-right">
                Item Discount:
                <?php 
echo Html::activeTextInput($model, 'item_discount', ['style' => 'width:60px;', 'id' => 'item-discount']);
?>
            </div>
        </div>
        <div class="box-body" style="text-align: right;">
            <?php 
echo Html::activeHiddenInput($model, 'purchase_value', ['id' => 'purchase-value']);
?>
            <h4 id="bfore" style="display: none;">Rp <span id="purchase-val">0</span>-<span id="disc-val">0</span></h4>
            <h2>Rp <span id="total-price"></span></h2>
        </div>
        <table class="table table-striped">
            <?php 
echo TabularInput::widget(['id' => 'detail-grid', 'allModels' => $details, 'modelClass' => PurchaseDtl::className(), 'options' => ['tag' => 'tbody'], 'itemOptions' => ['tag' => 'tr'], 'itemView' => '_item_detail', 'clientOptions' => []]);
?>
        </table>
    </div>
</div>
<?php 
$js = $this->render('_script', [], $this->context);
$this->registerJs($js, \yii\web\View::POS_END);
BizDataAsset::register($this, ['master' => MasterHelper::getMasters('product, barcode, supplier, product_supplier')]);
$js = <<<JS
yii.purchase.onReady();

JS;
$this->registerJs($js);