예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Producto::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['idproducto' => $this->idproducto, 'idunidadmedida' => $this->idunidadmedida, 'idtipoproducto' => $this->idtipoproducto, 'exento' => $this->exento, 'almacen' => $this->almacen, 'stockminimo' => $this->stockminimo, 'servicio' => $this->servicio]);
     $query->andFilterWhere(['like', 'descripcion', $this->descripcion]);
     return $dataProvider;
 }
예제 #2
0
                                                        </div>

                                                        <div class="md-modal md-effect-18 colored-header danger" id="agregar-producto" style="max-height: 90%;">
                                                            <div class="md-content">
                                                                <div class="modal-header">
                                                                    <h3>Agregar Producto</h3>
                                                                    <button type="button" class="close md-close" data-dismiss="modal" aria-hidden="true">&times;</button>
                                                                </div>
                                                                <div class="modal-body">
                                                                    <div class="nano nscroller has-scrollbar">
                                                                        <div style="right: -15px;" tabindex="0" class="content">


                                                                            <?php 
$ordenCompraDetalle = new app\modules\siap\models\OrdenCompraDetalle();
$productos = \app\modules\siap\models\Producto::find()->all();
$data = [];
foreach ($productos as $producto) {
    $data[trim($producto->idproducto)] = trim($producto->descripcion);
}
$form2 = ActiveForm::begin();
echo $form2->field($ordenCompraDetalle, 'idproducto')->widget(kartik\select2\Select2::classname(), ['data' => array_merge(['' => ''], $data), 'options' => ['placeholder' => 'Seleccone un producto ...', 'onchange' => 'informacionProducto()'], 'pluginOptions' => ['allowClear' => true]])->label("Producto");
?>

                                                                            <?php 
echo $form2->field($ordenCompraDetalle, 'cantidad', [])->input('number', ['onformchange' => 'actualizarTotalProductoAgregar()', 'class' => 'form-control', 'min' => '0', 'value' => '0', 'onkeyup' => 'actualizarTotalProductoAgregar()']);
?>

                                                                            <?php 
echo $form2->field($ordenCompraDetalle, 'punitario', [])->input('number', ['onformchange' => 'actualizarTotalProductoAgregar()', 'onkeyup' => 'actualizarTotalProductoAgregar()', 'class' => 'form-control sin-spinner', 'min' => '0', 'value' => '0']);
?>