/grails-app/views/transaccion/ingresos.gsp
text | 225 lines | 214 code | 11 blank | 0 comment | 0 complexity | 5d470cbe075a75996885c2abe5f15f42 MD5 | raw file
1<!doctype html> 2<html> 3 <head> 4 <meta name="layout" content="main"> 5 <g:set var="entityName" value="${message(code: 'transaccion.label', default: 'Transacciè´¸n')}" /> 6 <g:set var="polizaName" value="${message(code: 'poliza.label', default: 'Poliza')}" /> 7 <title><g:message code="default.edit.label" args="[entityName]" /></title> 8 <r:require module="tagit" /> 9 </head> 10 <body> 11 <a href="#edit-cuenta" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content…"/></a> 12 <div class="nav" role="navigation"> 13 <ul> 14 <li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li> 15 <li><g:link class="edit" controller="poliza" action="edita" id="${transaccion.poliza.id}"><g:message code="default.edit.label" args="[polizaName]" /></g:link></li> 16 <li><g:link class="create" action="nueva"><g:message code="default.new.label" args="[entityName]" /></g:link></li> 17 </ul> 18 </div> 19 <div id="edit-transaccion" class="content scaffold-edit" role="main"> 20 <h1><g:message code="default.edit.label" args="[entityName]" /></h1> 21 <g:if test="${flash.message}"> 22 <div class="message" role="status">${flash.message}</div> 23 </g:if> 24 <g:hasErrors bean="${transaccion}"> 25 <ul class="errors" role="alert"> 26 <g:eachError bean="${transaccion}" var="error"> 27 <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li> 28 </g:eachError> 29 </ul> 30 </g:hasErrors> 31 <g:form action="actualizaIngreso" method="post" > 32 <g:hiddenField name="id" value="${transaccion?.id}" /> 33 <g:hiddenField name="version" value="${transaccion?.version}" /> 34 <g:hiddenField name="cuentaId" value="" /> 35 <g:hiddenField name="auxiliarId" value="" /> 36 37 <g:if test="${origenes}"> 38 <fieldset class="form" style="margin:0;padding:0;"> 39 <div id="movimientosDiv"> 40 <table style="margin:0;"> 41 <thead> 42 <tr> 43 <th style="width:100px;">${message(code:'transaccion.cuenta.label')}</th> 44 <th style="width:100px;">${message(code:'transaccion.auxiliar.label')}</th> 45 <th>${message(code:'transaccion.nombre.label')}</th> 46 <th style='text-align:right;width:130px;'>${message(code:'transaccion.parcial.label')}</th> 47 <th style='text-align:right;width:130px;'>${message(code:'transaccion.debe.label')}</th> 48 <th style='text-align:right;width:130px;'>${message(code:'transaccion.haber.label')}</th> 49 </tr> 50 </thead> 51 <tbody> 52 <g:set var="counter" value="${1}" /> 53 <g:set var="counter2" value="${1}" /> 54 <g:each var="movimiento" in="${origenes}"> 55 <tr> 56 <td <g:if test="${movimiento.padre}">style="text-decoration:underline;"</g:if>><g:if test="${!movimiento.auxiliar}">${movimiento.cuenta.numero}</g:if></td> 57 <td>${movimiento.auxiliar?.numero}</td> 58 <td <g:if test="${movimiento.padre}">style="text-decoration:underline;"</g:if>><g:if test="${!movimiento.auxiliar}">${movimiento.cuenta.descripcion}</g:if><g:else>${movimiento.auxiliar.descripcion}</g:else></td> 59 <td style='text-align:right;<g:if test="${movimiento.ultimo}">text-decoration:underline;</g:if>'> 60 <g:if test="${movimiento.auxiliar}"> 61 <g:if test="${(counter2++) == 1}"> 62 <g:formatNumber type="currency" number="${movimiento.importe}" /> 63 </g:if> 64 <g:else> 65 <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" /> 66 </g:else> 67 </g:if> 68 </td> 69 <td style='text-align:right;'> 70 <g:if test="${!movimiento.auxiliar}"> 71 <g:if test="${(counter++) == 1}"> 72 <g:formatNumber type="currency" number="${movimiento.importe}" /> 73 </g:if> 74 <g:else> 75 <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" /> 76 </g:else> 77 </g:if> 78 </td> 79 <td> </td> 80 </tr> 81 </g:each> 82 <g:set var="counter" value="${1}" /> 83 <g:set var="counter2" value="${1}" /> 84 <g:each var="movimiento" in="${destinos}"> 85 <tr> 86 <td <g:if test="${movimiento.padre}">style="text-decoration:underline;"</g:if>><g:if test="${!movimiento.auxiliar}">${movimiento.cuenta.numero}</g:if></td> 87 <td>${movimiento.auxiliar?.numero}</td> 88 <td style='padding-left:30px;<g:if test="${movimiento.padre}">text-decoration:underline;</g:if>'><g:if test="${!movimiento.auxiliar}">${movimiento.cuenta.descripcion}</g:if><g:else>${movimiento.auxiliar.descripcion}</g:else></td> 89 <td style='text-align:right;<g:if test="${movimiento.ultimo}">text-decoration:underline;</g:if>'> 90 <g:if test="${movimiento.auxiliar}"> 91 <g:if test="${(counter2++) == 1}"> 92 <g:formatNumber type="currency" number="${movimiento.importe}" /> 93 </g:if> 94 <g:else> 95 <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" /> 96 </g:else> 97 </g:if> 98 </td> 99 <td> </td> 100 <td style='text-align:right;'> 101 <g:if test="${!movimiento.auxiliar}"> 102 <g:if test="${(counter++) == 1}"> 103 <g:formatNumber type="currency" number="${movimiento.importe}" /> 104 </g:if> 105 <g:else> 106 <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" /> 107 </g:else> 108 </g:if> 109 </td> 110 </tr> 111 </g:each> 112 </tbody> 113 <tfoot> 114 <tr> 115 <th colspan="4" style="text-align:right;">TOTAL</th> 116 <th style="text-align:right;"><g:formatNumber type="currency" number="${transaccion.importe}" /></th> 117 <th style="text-align:right;"><g:formatNumber type="currency" number="${transaccion.importe}" /></th> 118 </tr> 119 </tfoot> 120 </table> 121 </div> 122 123 </fieldset> 124 </g:if> 125 126 <fieldset class="form"> 127 <div class="fieldcontain"> 128 <h3> 129 <g:message code="transaccion.tags.label" default="tags" /> 130 </h3> 131 <ul name="tags"> 132 <g:each in="${transaccion?.tags?.tokenize(',')}"> 133 <li>${it}</li> 134 </g:each> 135 </ul> 136 </div> 137 138 <div class="fieldcontain ${hasErrors(bean: transaccion, field: 'descripcion', 'error')} required"> 139 <label for="descripcion"> 140 <g:message code="transaccion.descripcion.label" default="descripcion" /> 141 <span class="required-indicator">*</span> 142 </label> 143 <g:textArea name="descripcion" maxlength="200" required="" value="${transaccion?.descripcion}"/> 144 </div> 145 146 <div class="fieldcontain ${hasErrors(bean: transaccion, field: 'importe', 'error')} required"> 147 <label for="importe"> 148 <g:message code="transaccion.importe.label" default="importe" /> 149 </label> 150 <g:textField name="importe" maxlength="200" value="" style="width:400px;"/> 151 </div> 152 153 <div class="fieldcontain ${hasErrors(bean: transaccion, field: 'cuenta', 'error')} required"> 154 <label for="cuenta"> 155 <g:message code="transaccion.cuenta.label" default="cuenta" /> 156 </label> 157 <g:textField name="cuenta" maxlength="200" value="" style="width:400px;"/> 158 </div> 159 160 <div id="auxiliarDiv" class="fieldcontain ${hasErrors(bean: transaccion, field: 'auxiliar', 'error')} required" style="display:none;"> 161 <label for="auxiliar"> 162 <g:message code="transaccion.auxiliar.label" default="auxiliar" /> 163 </label> 164 <g:textField name="auxiliar" maxlength="200" value="" style="width:400px;"/> 165 </div> 166 167 <div class="fieldcontain"> 168 <label for="esDebe"> 169 <g:message code="transaccion.esDebe.label" default="esDebe" /> 170 </label> 171 <input type="checkbox" name="esDebe" value="" id="esDebe" /> 172 </div> 173 174 <div class="fieldcontain"> 175 <label for="agrega"><g:message code="transaccion.agrega.label" /></label> 176 <g:submitButton name="agrega" class="save" value="${message(code: 'transaccion.nuevoMovimiento.button')}"/> 177 </div> 178 179 </fieldset> 180 <fieldset class="buttons"> 181 <g:actionSubmit class="save" action="actualizaIngreso" value="${message(code: 'default.button.update.label', default: 'Update')}" /> 182 <g:actionSubmit class="delete" action="elimina" value="${message(code: 'default.button.delete.label', default: 'Delete')}" formnovalidate="" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /> 183 <g:link class="edit" controller="poliza" action="edita" id="${transaccion.poliza.id}"><g:message code="default.edit.label" args="[polizaName]" /></g:link> 184 </fieldset> 185 </g:form> 186 </div> 187 <r:script> 188 $(document).ready(function() { 189 $('#cuenta').autocomplete({ 190 source:"${createLink(action:'cuentas')}" 191 , select: function(event, ui) { 192 $('#cuentaId').val(ui.item.id); 193 if (ui.item.auxiliar) { 194 $("#auxiliarId").val(ui.item.auxiliarId); 195 $("#auxiliarDiv").toggle('blind',{},500, function() { 196 $("#auxiliar").val($("#cuenta").val()); 197 $("#cuenta").val(ui.item.cuenta); 198 $("#esDebe").focus(); 199 }); 200 } else if (ui.item.tieneAuxiliares) { 201 $("#auxiliarDiv").toggle('blind',{},500, function() { 202 $("#auxiliar").focus(); 203 }); 204 } else { 205 $("#esDebe").focus(); 206 } 207 } 208 }); 209 $('#auxiliar').autocomplete({ 210 source:"${createLink(action:'auxiliares')}/"+$('#cuentaId').val() 211 ,select: function(event,ui) { 212 $('#auxiliarId').val(ui.item.id); 213 $('#cuentaId').val(ui.item.cuentaId); 214 $('#cuenta').val(ui.item.cuenta); 215 $("#esDebe").focus(); 216 } 217 }); 218 219 $("ul[name='tags']").tagit({select:true, tagSource: "${g.createLink(action: 'tags')}"}); 220 $('#descripcion').select(); 221 $('#descripcion').focus(); 222 }); 223 </r:script> 224 </body> 225</html>