예제 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDetalleNotaVentas()
 {
     return $this->hasMany(DetalleNotaVenta::className(), ['id_nota_venta' => 'id']);
 }
예제 #2
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\data\ActiveDataProvider;
/* @var $this yii\web\View */
/* @var $model app\models\NotaVenta */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="nota-venta-form">

    <?php 
$form = ActiveForm::begin();
$dataProvider = new ActiveDataProvider(['query' => \app\models\DetalleNotaVenta::find()->where(['id' => 0])]);
?>
        <?php 
echo $form->field($model, 'fecha')->textInput();
?>

        <?php 
echo $form->field($model, 'id_empleado')->textInput();
?>

    <div class="form-group">
        <?php 
echo Html::submitButton($model->isNewRecord ? 'Create' : 'Update', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
    </div>

    <?php