<?php $this->breadcrumbs = array($model->label(2) => array('index'), GxHtml::valueEx($model) => array('view', 'id' => GxActiveRecord::extractPkValue($model, true)), Yii::t('app', 'Editar')); $this->menu = array(array('label' => Yii::t('app', 'Listar') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Agregar') . ' ' . $model->label(), 'url' => array('create')), array('label' => Yii::t('app', 'Ver') . ' ' . $model->label(), 'url' => array('view', 'id' => GxActiveRecord::extractPkValue($model, true))), array('label' => Yii::t('app', 'Administrar') . ' ' . $model->label(2), 'url' => array('admin'))); ?> <h1><?php echo Yii::t('app', 'Editar') . ' ' . GxHtml::encode($model->label()) . ' Patente N°: ' . '<font color="yellow">' . OrdenTrabajo::formatearPatente(GxHtml::encode(GxHtml::valueEx($model))) . '</font>'; ?> </h1> <?php $this->renderPartial('_form', array('model' => $model));
<?php $this->breadcrumbs = array($model->label(2) => array('index'), GxHtml::valueEx($model)); $this->menu = array(array('label' => Yii::t('app', 'Listar') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Agregar') . ' ' . $model->label(), 'url' => array('create')), array('label' => Yii::t('app', 'Editar') . ' ' . $model->label(), 'url' => array('update', 'id' => $model->id)), array('label' => Yii::t('app', 'Borrar') . ' ' . $model->label(), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => Yii::t('app', 'Administrar') . ' ' . $model->label(2), 'url' => array('admin'))); ?> <h1><?php echo GxHtml::encode($model->label()) . ' ' . GxHtml::encode(GxHtml::valueEx($model)); ?> </h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array('ano', array('name' => 'Total Neto', 'value' => OrdenTrabajo::formatearPeso($model->ppto_anual)), array('name' => 'Total Neto', 'value' => OrdenTrabajo::formatearPeso($model->ppto_mensual)), 'creado', 'modificado'))); ?>
<?php echo CHtml::endForm(); ?> </div><!-- form --> <div chart> <?php if (isset($dataProvider) && ($data = $dataProvider->getData()) != null) { for ($i = 0; $i < 12; $i++) { $dataHc[$i] = 0; } foreach ($data as $da) { $dataHc[$da['mes'] - 1] = (int) $da['gastoMensual']; } if (isset($_GET['cv']) && $_GET['cv'] == true) { $texto = ' del vehiculo patente ' . OrdenTrabajo::formatearPatente($_GET['patente']); } else { $texto = ''; } $this->Widget('ext.highcharts.HighchartsWidget', array('options' => array('title' => array('text' => 'Progreso Gastos Reparaciones Año ' . $anio . $texto), 'tooltip' => array('formatter' => 'js:function(){ return "<b>Gastos de "+ this.x +":</b>"+ formatCurrency(this.y); }'), 'xAxis' => array('categories' => array('Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre')), 'yAxis' => array('title' => array('text' => 'Gasto Reparacion')), 'series' => array(array('name' => 'Gasto' . ' Año ' . $anio . $texto, 'data' => $dataHc)), 'credits' => array('enabled' => false)))); } else { echo 'No hay resultados'; } ?> </div> <script type="text/javascript"> function formatCurrency(num) { num = num.toString().replace(/\$|\,/g,'');
public function actionAdmin() { $model = new OrdenTrabajo('search'); $model->unsetAttributes(); if (isset($_GET['OrdenTrabajo'])) { $model->setAttributes($_GET['OrdenTrabajo']); } $this->render('admin', array('model' => $model)); }
<?php $this->breadcrumbs = array($model->label(2) => array('index'), GxHtml::valueEx($model)); $this->menu = array(array('label' => Yii::t('app', 'Agregar') . ' ' . $model->label(), 'url' => array('create?factura=' . $model->idRf . '&id=' . $model->id_rf)), array('label' => Yii::t('app', 'Listar') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Editar') . ' ' . $model->label(), 'url' => array('update', 'id' => $model->id)), array('label' => Yii::t('app', 'Borrar') . ' ' . $model->label(), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => Yii::t('app', 'Administrar') . ' ' . $model->label(2), 'url' => array('admin'))); ?> <h1><?php echo GxHtml::encode($model->label()) . ' Nro.° ' . "<font color='yellow'>" . GxHtml::encode(GxHtml::valueEx($model)) . "</font>"; ?> </h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'idVehiculo', 'type' => 'raw', 'value' => $model->idVehiculo !== null ? GxHtml::link(OrdenTrabajo::formatearPatente($model->idVehiculo), array('vehiculos/view', 'id' => GxActiveRecord::extractPkValue($model->idVehiculo, true))) : null), array('name' => 'idRf', 'type' => 'raw', 'value' => $model->idRf !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idRf)), array('registroFactura/view', 'id' => GxActiveRecord::extractPkValue($model->idRf, true))) : null), array('name' => 'kilometraje', 'type' => 'raw', 'value' => OrdenTrabajo::formatearKm($model->kilometraje)), 'fecha', 'creado', 'modificado'))); $mazo = 1; $this->widget('zii.widgets.grid.CGridView', array('id' => 'detallesOt-grid', 'summaryText' => '', 'dataProvider' => $detOt, 'columns' => array(array('name' => 'id_detalle_reparacion', 'value' => '$data->idDetalleReparacion == null ? null : $data->idDetalleReparacion->nombre'), array('name' => 'id_marca', 'value' => '$data->idMarca == null ? null : $data->idMarca->nombre'), array('name' => 'cantidad', 'value' => '$data->cantidad', 'htmlOptions' => array('style' => 'text-align: right;')), array('name' => 'precio_unitario', 'value' => 'OrdenTrabajo::formatearPeso($data->precio_unitario)', 'htmlOptions' => array('style' => 'text-align: right;')), array('name' => 'subtotal', 'value' => 'OrdenTrabajo::formatearPeso($data->subtotal)', 'htmlOptions' => array('style' => 'text-align: right;')), array('name' => 'observacion', 'value' => '$data->observacion'))));
public function eliminar($id) { DB::beginTransaction(); try { $OT = OrdenTrabajo::findOrFail($id); $items = $OT->items()->get(); foreach ($items as $i) { $a = $i->delete(); } $OT->delete(); DB::commit(); return Response::json(array('error' => false, 'mensaje' => 'Orden de trabajo ' . $id . ' eliminada correctamente', 'listado' => $OT->toArray()), 200); } catch (Exception $e) { DB::rollback(); return Response::json(array('error' => true, 'mensaje' => $e->getMessage()), 200); } }
<?php echo isset($data3[0]['ppto_anual']) ? OrdenTrabajo::formatearPeso($data3[0]['ppto_anual']) : '$ 0'; ?> <br /> <b><?php echo 'Presupuesto Mensual'; ?> :</b> <?php echo isset($data3[0]['ppto_mensual']) ? OrdenTrabajo::formatearPeso($data3[0]['ppto_mensual']) : '$ 0'; ?> <br /> <b><?php echo 'Presupuesto Anual Disponible'; ?> :</b> <?php echo isset($data4[0]['total']) && isset($data3[0]['ppto_mensual']) ? OrdenTrabajo::formatearPeso($data3[0]['ppto_anual'] - $data4[0]['total']) : '$ 0'; ?> <br /> <b><?php echo 'Presupuesto Mensual Disponible'; ?> :</b> <?php echo isset($data3[0]['ppto_mensual']) ? OrdenTrabajo::formatearPeso($data3[0]['ppto_mensual'] - $data2[0]['total']) : '$ 0'; ?> <br />
<?php $this->breadcrumbs = array(OrdenTrabajo::label(2), Yii::t('app', 'Index')); $this->menu = array(array('label' => Yii::t('app', 'Agregar') . ' ' . OrdenTrabajo::label(), 'url' => array('create')), array('label' => Yii::t('app', 'Administrar') . ' ' . OrdenTrabajo::label(2), 'url' => array('admin'))); ?> <h1><?php echo GxHtml::encode(OrdenTrabajo::label(2)); ?> </h1> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'emptyText' => 'No hay resultados', 'summaryText' => 'Mostrando del {start} al {end} de {count} resultado(s).', 'pager' => array('header' => '', 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente'), 'itemView' => '_view'));
<?php $this->breadcrumbs = array($model->label(2) => array('index'), GxHtml::valueEx($model)); $this->menu = array(array('label' => Yii::t('app', 'Agregar') . ' ' . $model->getRelationLabel('ordenTrabajos', 1), 'url' => array('ordentrabajo/create?factura=' . $model->nro_factura . '&id=' . $model->id)), array('label' => Yii::t('app', 'Administrar') . ' ' . $model->label(2), 'url' => array('admin')), array('label' => Yii::t('app', 'Listar') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Agregar') . ' ' . $model->label(), 'url' => array('create')), array('label' => Yii::t('app', 'Editar') . ' ' . $model->label(), 'url' => array('update', 'id' => $model->id)), array('label' => Yii::t('app', 'Borrar') . ' ' . $model->label(), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?'))); ?> <h1><?php echo GxHtml::encode($model->label()) . ' N° ' . "<font color='yellow'>" . GxHtml::encode(GxHtml::valueEx($model)) . "</font>"; ?> </h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'idProveedor', 'type' => 'raw', 'value' => $model->idProveedor !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idProveedor)), array('proveedores/view', 'id' => GxActiveRecord::extractPkValue($model->idProveedor, true))) : null), 'fecha', 'creado', 'modificado'))); $this->widget('zii.widgets.grid.CGridView', array('id' => 'ordenes-grid', 'summaryText' => '', 'dataProvider' => $OrdenTrabajo, 'columns' => array(array('name' => 'nro_guia', 'value' => '$data->nro_guia', 'htmlOptions' => array('style' => 'text-align: right;')), array('header' => 'Patente', 'value' => 'OrdenTrabajo::formatearPatente($data->idVehiculo->patente)', 'htmlOptions' => array('style' => 'text-align: center;')), array('name' => 'fecha', 'value' => '$data->fecha', 'htmlOptions' => array('style' => 'text-align: center;')), array('header' => 'Kilometraje', 'value' => 'OrdenTrabajo::formatearKm($data->kilometraje)', 'htmlOptions' => array('style' => 'text-align: right;')), array('header' => 'Subtotal', 'value' => 'OrdenTrabajo::formatearPeso($data->sumita)', 'htmlOptions' => array('style' => 'text-align: right;')), array('class' => 'CButtonColumn', 'header' => 'Opciones', 'htmlOptions' => array('width' => 120), 'template' => '{view}{update}{delete}', 'buttons' => array('view' => array('label' => 'Ver', 'url' => 'Yii::app()->createUrl("ordentrabajo/view", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/ver.png'), 'update' => array('label' => 'Editar', 'url' => 'Yii::app()->createUrl("ordentrabajo/update", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/editar.png'), 'delete' => array('label' => 'Borrar', 'url' => 'Yii::app()->createUrl("ordentrabajo/delete", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/delete.png')))))); $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'Total Neto', 'value' => OrdenTrabajo::formatearPeso($model->total_neto)), array('name' => 'Total Bruto', 'value' => OrdenTrabajo::formatearPeso($model->total_bruto)))));
?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('ppto_anual')); ?> : <?php echo GxHtml::encode(OrdenTrabajo::formatearPeso($data->ppto_anual)); ?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('ppto_mensual')); ?> : <?php echo GxHtml::encode(OrdenTrabajo::formatearPeso($data->ppto_mensual)); ?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('creado')); ?> : <?php echo GxHtml::encode($data->creado); ?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('modificado')); ?> : <?php
<?php echo $form->error($model, 'kilometraje'); ?> </div><!-- row --> <div class="row"> <?php echo CHtml::label('Valores con :', 'valores'); ?> <?php echo CHtml::radioButtonList('valores', '', array('1' => 'Con Iva', '2' => 'Sin Iva'), array('onChange' => 'subtotal()')); ?> </div> <?php $this->widget('ext.multimodelform.MultiModelForm', array('id' => 'id_member', 'formConfig' => OrdenTrabajo::model()->getMultiModelForm(), 'model' => $detalle, 'tableView' => true, 'validatedItems' => $detallesValidados, 'data' => $detalle->findAll('id_ot=:id_Ot', array(':id_Ot' => $model->id)))); ?> <?php echo GxHtml::submitButton(Yii::t('app', 'Guardar'), array('class' => 'boton')); $this->endWidget(); ?> </div><!-- form --> <script type="text/javascript"> function subtotal(){ existe = true; existe2 = true; existe3 = true; pu = '_precio_unitario';
<?php $this->breadcrumbs = array($model->label(2) => array('index'), GxHtml::valueEx($model)); $this->menu = array(array('label' => Yii::t('app', 'Listar') . ' ' . $model->label(2), 'url' => array('index')), array('label' => Yii::t('app', 'Agregar') . ' ' . $model->label(), 'url' => array('create')), array('label' => Yii::t('app', 'Editar') . ' ' . $model->label(), 'url' => array('update', 'id' => $model->id)), array('label' => Yii::t('app', 'Borrar') . ' ' . $model->label(), 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->id), 'confirm' => 'Are you sure you want to delete this item?')), array('label' => Yii::t('app', 'Administrar') . ' ' . $model->label(2), 'url' => array('admin'))); ?> <h1><?php echo GxHtml::encode($model->label()) . ' Patente N°: ' . '<font color="yellow">' . OrdenTrabajo::formatearPatente(GxHtml::encode(GxHtml::valueEx($model))) . '</font>'; ?> </h1> <?php $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'idCombustible0', 'type' => 'raw', 'value' => $model->idCombustible0 !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idCombustible0)), array('combustibles/view', 'id' => GxActiveRecord::extractPkValue($model->idCombustible0, true))) : null), array('name' => 'idTipoVehiculo0', 'type' => 'raw', 'value' => $model->idTipoVehiculo0 !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idTipoVehiculo0)), array('tiposVehiculos/view', 'id' => GxActiveRecord::extractPkValue($model->idTipoVehiculo0, true))) : null), array('name' => 'idProveedor0', 'type' => 'raw', 'value' => $model->idProveedor0 !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idProveedor0)), array('proveedores/view', 'id' => GxActiveRecord::extractPkValue($model->idProveedor0, true))) : null), array('name' => 'idMarca0', 'type' => 'raw', 'value' => $model->idMarca0 !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idMarca0)), array('marcasVehiculos/view', 'id' => GxActiveRecord::extractPkValue($model->idMarca0, true))) : null), array('name' => 'idModelo0', 'type' => 'raw', 'value' => $model->idModelo0 !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idModelo0)), array('modelosVehiculos/view', 'id' => GxActiveRecord::extractPkValue($model->idModelo0, true))) : null), array('name' => 'idColor0', 'type' => 'raw', 'value' => $model->idColor0 !== null ? GxHtml::link(GxHtml::encode(GxHtml::valueEx($model->idColor0)), array('coloresVehiculos/view', 'id' => GxActiveRecord::extractPkValue($model->idColor0, true))) : null), array('name' => 'precioCompra', 'type' => 'raw', 'value' => OrdenTrabajo::formatearPeso($model->precioCompra)), array('name' => 'Año', 'type' => 'raw', 'value' => $model->ano), array('name' => 'estado', 'type' => 'raw', 'value' => $model->saberEstado($model->estado)), 'creado', 'modificado'))); $this->widget('zii.widgets.grid.CGridView', array('id' => 'ordenesvh-grid', 'summaryText' => 'Mostrando del {start} al {end} de {count} resultado(s).', 'pager' => array('header' => '', 'prevPageLabel' => 'Anterior', 'nextPageLabel' => 'Siguiente'), 'dataProvider' => $dataProvider, 'columns' => array(array('name' => 'nro_factura', 'value' => '$data->idRf->nro_factura', 'htmlOptions' => array('style' => 'text-align: right;')), array('name' => 'Fecha Factura', 'value' => '$data->idRf->fecha', 'htmlOptions' => array('style' => 'text-align: center;')), array('name' => 'nro_guia', 'value' => '$data->nro_guia', 'htmlOptions' => array('style' => 'text-align: right;')), array('name' => 'Fecha Guia', 'value' => '$data->fecha', 'htmlOptions' => array('style' => 'text-align: center;')), array('header' => 'Kilometraje', 'value' => 'OrdenTrabajo::formatearKm($data->kilometraje)', 'htmlOptions' => array('style' => 'text-align: right;')), array('header' => 'Subtotal', 'value' => 'OrdenTrabajo::formatearPeso($data->sumita)', 'htmlOptions' => array('style' => 'text-align: right;')), array('class' => 'CButtonColumn', 'header' => 'Opciones', 'htmlOptions' => array('width' => 120), 'template' => '{view}{update}{delete}', 'buttons' => array('view' => array('label' => 'Ver', 'url' => 'Yii::app()->createUrl("ordentrabajo/view", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/ver.png'), 'update' => array('label' => 'Editar', 'url' => 'Yii::app()->createUrl("ordentrabajo/update", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/editar.png'), 'delete' => array('label' => 'Borrar', 'url' => 'Yii::app()->createUrl("ordentrabajo/delete", array("id"=>$data->id))', 'imageUrl' => Yii::app()->baseUrl . '/images/delete.png')))))); $this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => array(array('name' => 'Gasto Acumulado', 'value' => $model->sumarGasto())))); ?>
?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('total_neto')); ?> : <?php echo "<font color='blue'>" . GxHtml::encode(OrdenTrabajo::formatearPeso($data->total_neto)) . "</font>"; ?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('total_bruto')); ?> : <?php echo "<font color='blue'>" . GxHtml::encode(OrdenTrabajo::formatearPeso($data->total_bruto)) . "</font>"; ?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('id_proveedor')); ?> : <?php echo "<font color='green'>" . GxHtml::encode(GxHtml::valueEx($data->idProveedor)) . "</font>"; ?> <br /> <?php echo GxHtml::encode($data->getAttributeLabel('fecha')); ?> : <?php