Esempio n. 1
0
use yii\jui\AutoComplete;
use biz\inventory\models\TransferDtl;
use mdm\widgets\TabularInput;
use biz\app\assets\BizDataAsset;
use biz\master\components\Helper as MasterHelper;
?>
<div class="box box-info">
    <div class="box-header" style="padding: 10px;">
        Product :
        <?php 
echo AutoComplete::widget(['name' => 'product', 'id' => 'product', 'clientOptions' => ['source' => new JsExpression('yii.global.sourceProduct'), 'select' => new JsExpression('yii.transfer.onProductSelect'), 'delay' => 100], 'options' => ['class' => 'form-control']]);
?>
    </div>
    <div class="box-body no-padding">
        <table class="table table-striped">
            <?php 
echo TabularInput::widget(['id' => 'detail-grid', 'allModels' => $model->transferDtls, 'modelClass' => TransferDtl::className(), 'itemView' => '_item_detail', 'options' => ['tag' => 'tbody'], 'itemOptions' => ['tag' => 'tr'], 'clientOptions' => ['initRow' => new JsExpression('yii.transfer.initRow')]]);
?>
        </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, product_stock')]);
$js_ready = <<<JS
\$("#product").data("ui-autocomplete")._renderItem = yii.global.renderItem;
yii.transfer.onReady();
JS;
$this->registerJs($js_ready);
Esempio n. 2
0
 */
?>
<div class="col-lg-9" style="padding-left: 0px;">
    <div class="panel panel-info">
        <table class="table table-striped">
            <tfoot>
                <tr>
                    <td colspan="4">
                        Product :
                        <?php 
echo AutoComplete::widget(['name' => 'product', 'id' => 'product', 'clientOptions' => ['source' => new JsExpression('yii.global.sourceProduct'), 'select' => new JsExpression('yii.receive.onProductSelect'), 'delay' => 100]]);
?>
                    </td>
                </tr>
            </tfoot>
            <?php 
echo TabularInput::widget(['id' => 'detail-grid', 'allModels' => $details, 'modelClass' => TransferDtl::className(), 'itemView' => '_item_detail', 'options' => ['tag' => 'tbody'], 'itemOptions' => ['tag' => 'tr']]);
?>
        </table>
    </div>
</div>

<?php 
$js = $this->render('_script', [], $this->context);
$this->registerJs($js, yii\web\View::POS_END);
AppHelper::bizConfig($this, ['masters' => ['products', 'barcodes', 'product_stock']]);
$js_ready = <<<JS
\$("#product").data("ui-autocomplete")._renderItem = yii.global.renderItem;
yii.receive.onReady();
JS;
$this->registerJs($js_ready);
Esempio n. 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransferDtls()
 {
     return $this->hasMany(TransferDtl::className(), ['id_transfer' => 'id_transfer'])->orderBy([new \yii\db\Expression('transfer_qty_send=0 ASC')]);
 }
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTransferDtl()
 {
     return $this->hasOne(TransferDtl::className(), ['id_transfer' => 'id_transfer', 'id_product' => 'id_product']);
 }