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
	<?php 
ActiveForm::end();
?>

</div>

<div class="receipt-index">

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

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'id', 'options' => ['style' => 'width: 100px;']], ['label' => 'Cliente', 'value' => 'estimate.client.name', 'filter' => Html::activeDropDownList($searchModel, 'client_id', Client::getIdNameArray(), ['class' => 'form-control', 'prompt' => 'Nombre'])], ['label' => 'Presupuesto', 'value' => 'estimate.title'], 'number', ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'status', 'label' => 'Estado', 'value' => 'statusLabel', 'filter' => Html::activeDropDownList($searchModel, 'status', Receipt::statusLabels(), ['class' => 'form-control', 'prompt' => 'Estado']), 'editableOptions' => ['inputType' => Editable::INPUT_DROPDOWN_LIST, 'data' => Receipt::statusLabels()]], ['attribute' => 'created_date', 'format' => 'date', 'filter' => false], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

	<?php 
echo ExportMenu::widget(['dataProvider' => $exportDataProvider, 'target' => ExportMenu::TARGET_SELF, 'showConfirmAlert' => false, 'filename' => 'facturas', 'columns' => [['attribute' => 'created_date', 'format' => 'date', 'filter' => false], ['attribute' => 'type', 'value' => 'typeLabel'], ['attribute' => 'number', 'label' => 'Factura Nro'], ['label' => 'Cliente', 'value' => 'estimate.client.name'], ['label' => 'CUIT', 'value' => 'estimate.client.cuit'], ['label' => 'Facturación Neta', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->estimate->total_checked, Currency::CURRENCY_ARS);
}], ['label' => 'IVA', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->IVATotal, Currency::CURRENCY_ARS);
}], ['label' => 'Facturación Bruta', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->gross, Currency::CURRENCY_ARS);
}], ['label' => 'Utilidad', 'value' => function ($model, $key, $index, $column) {
    return Currency::format($model->estimate->total_checked - $model->estimate->cost_checked, Currency::CURRENCY_ARS);
}], ['label' => 'Porcentaje', 'value' => null], ['label' => 'Productos', 'value' => 'products'], ['label' => 'Estado', 'value' => 'statusLabel'], ['label' => 'Recibo Nro', 'value' => null]]]);
?>

</div>