Example #1
0
    </div>

	<?php 
ActiveForm::end();
?>

</div>

<div class="receipt-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

	<?php 
$columns = [['attribute' => 'bukmark_code', 'label' => 'Código', 'value' => 'product.bukmark_code', 'options' => ['style' => 'width: 100px;']], ['attribute' => 'product_id', 'value' => 'product.title', 'filter' => Html::activeDropDownList($searchModel, 'product_id', Product::getDropdownData(), ['class' => 'form-control', 'prompt' => 'Elegir producto']), 'enableSorting' => false], ['label' => 'Cliente', 'value' => 'estimate.client.name', 'filter' => Html::activeDropDownList($searchModel, 'client_id', Client::getIdNameArray(), ['class' => 'form-control', 'prompt' => 'Nombre'])], ['attribute' => 'estimate.receipt.created_date', 'format' => 'date', 'filter' => false], ['attribute' => 'quantity'], ['label' => 'Total', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->quantitySubtotal, Currency::CURRENCY_ARS);
}, 'options' => ['style' => 'width: 150px;']]];
?>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $columns]);
?>

	<?php 
echo ExportMenu::widget(['dataProvider' => $exportDataProvider, 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'filename' => 'resumen', 'columns' => $columns]);
?>

</div>
Example #2
0
/* @var $model app\models\EstimateEntry */
/* @var $form yii\widgets\ActiveForm */
$currencies = Currency::labels();
$this->registerJs('var productImagesUrl = "' . Url::to(['product/get-images', 'id' => 'placeholder']) . '";', View::POS_HEAD);
$this->registerJs('var productSupplierUrl = "' . Url::to(['product/get-supplier', 'id' => 'placeholder']) . '";', View::POS_HEAD);
EstimateEntryAsset::register($this);
?>

<div class="estimate-entry-form">

	<?php 
$form = ActiveForm::begin(['enableClientValidation' => false]);
?>

	<?php 
echo $form->field($model, 'product_id')->dropDownList(Product::getDropdownData(), ['prompt' => 'Elegir producto', 'id' => 'product_id']);
?>
	<?php 
if ($model->isNewRecord) {
    ?>
		<div class="form-group">
			<?php 
    echo Html::submitButton('Crear producto', ['class' => 'btn btn-primary', 'name' => 'action', 'value' => 'add-product']);
    ?>
		</div>
	<?php 
}
?>
	
	<?php 
echo $form->field($model, 'product_image_id')->hiddenInput(['id' => 'product_image_id']);