?> <div class="col-lg-9" style="padding-left: 0px;"> <div class="panel panel-info"> <div class="panel-heading"> Product : <?php echo AutoComplete::widget(['name' => 'product', 'id' => 'product', 'clientOptions' => ['source' => new JsExpression('yii.global.sourceProduct'), 'select' => new JsExpression('yii.standart.onProductSelect'), 'delay' => 100]]); ?> </div> <div class="panel-body" style="text-align: right;"> <h2>Rp<span id="total-price"></h2></span> <?php echo Html::activeHiddenInput($model, 'sales_value', ['id' => 'total-price-inp']); ?> </div> <table class="table table-striped"> <?php echo TabularInput::widget(['id' => 'detail-grid', 'allModels' => $model->salesDtls, 'modelClass' => SalesDtl::className(), 'options' => ['tag' => 'tbody'], 'itemOptions' => ['tag' => 'tr'], 'itemView' => '_item_detail', 'clientOptions' => ['initRow' => new JsExpression('yii.standart.initRow')]]); ?> </table> </div> </div> <?php $js = $this->render('_script', ['price' => $price], $this->context); $this->registerJs($js, \yii\web\View::POS_END); AppHelper::bizConfig($this, ['masters' => ['products', 'barcodes', 'prices', 'customers'], 'price_ct' => $price]); $js_ready = <<<JS yii.standart.onReady(); JS; $this->registerJs($js_ready);
/** * @return \yii\db\ActiveQuery */ public function getSalesDtls() { return $this->hasMany(SalesDtl::className(), ['id_sales' => 'id_sales'])->with('idCogs'); }