/grails-app/views/servicio/edita.gsp

http://github.com/jdmr/mateo · text · 168 lines · 168 code · 0 blank · 0 comment · 0 complexity · 6466d9a9404df3dd135c23fc0fda846f MD5 · raw file

  1. <%@ page import="contabilidad.Servicio" %>
  2. <!doctype html>
  3. <html>
  4. <head>
  5. <meta name="layout" content="main">
  6. <g:set var="entityName" value="${message(code: 'servicio.label', default: 'Servicio')}" />
  7. <title><g:message code="default.edit.label" args="[entityName]" /></title>
  8. <r:require module="tagit" />
  9. </head>
  10. <body>
  11. <a href="#edit-servicio" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></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="list" action="lista"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
  16. <li><g:link class="create" action="nuevo"><g:message code="default.new.label" args="[entityName]" /></g:link></li>
  17. </ul>
  18. </div>
  19. <div id="edit-servicio" 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="${servicio}">
  25. <ul class="errors" role="alert">
  26. <g:eachError bean="${servicio}" 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 method="post" >
  32. <g:hiddenField name="id" value="${servicio?.id}" />
  33. <g:hiddenField name="version" value="${servicio?.version}" />
  34. <fieldset class="form">
  35. <g:render template="form"/>
  36. </fieldset>
  37. <g:if test="${servicio.transacciones}">
  38. <fieldset class="form" style="margin:0;padding:0;">
  39. <ol class="property-list servicio" style="margin:0;padding:0;">
  40. <li class="fieldcontain"><span>
  41. <div id="transacciones">
  42. <table>
  43. <thead>
  44. <tr>
  45. <th><g:message code="transaccion.descripcion.label" /></th>
  46. <th><g:message code="transaccion.tags.label" /></th>
  47. <th style="text-align:right; width:150px;"></th>
  48. </tr>
  49. </thead>
  50. <tbody>
  51. <g:each var="transaccion" in="${servicio.transacciones}">
  52. <g:set var="transaccionId" value="${transaccion.id}"/>
  53. <tr>
  54. <td>${transaccion.descripcion}</td>
  55. <td>${transaccion.tags}</td>
  56. <td style="text-align:right; width:150px;"><g:link controller="servicioTransaccion" action="edita" id="${transaccion.id}"><g:message code="default.button.edit.label" /></g:link> | <g:link controller="servicioTransaccion" action="elimina" id="${transaccion.id}"><g:message code="default.button.delete.label" /></g:link></td>
  57. </tr>
  58. <tr>
  59. <td colspan="4">
  60. <table>
  61. <thead>
  62. <tr>
  63. <th style="width:100px;">${message(code:'transaccion.cuenta.label')}</th>
  64. <th style="width:100px;">${message(code:'transaccion.auxiliar.label')}</th>
  65. <th>${message(code:'transaccion.nombre.label')}</th>
  66. <th style='text-align:right;width:130px;'>${message(code:'transaccion.parcial.label')}</th>
  67. <th style='text-align:right;width:130px;'>${message(code:'transaccion.debe.label')}</th>
  68. <th style='text-align:right;width:130px;'>${message(code:'transaccion.haber.label')}</th>
  69. <th style='text-align:right;width:100px;'>${message(code:'servicioTransaccion.preguntar.label',default:'多Preguntar?')}</th>
  70. </tr>
  71. </thead>
  72. <tbody>
  73. <g:set var="counter" value="${1}" />
  74. <g:set var="counter2" value="${1}" />
  75. <g:set var="movimientos" value="${origenes[transaccion.id]}"/>
  76. <g:each var="movimiento" in="${movimientos}" status="i">
  77. <tr>
  78. <td <g:if test="${movimiento.padre}">style="text-decoration:underline;"</g:if>><g:if test="${!movimiento.auxiliar}">${movimiento.cuenta.numero}</g:if></td>
  79. <td>${movimiento.auxiliar?.numero}</td>
  80. <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>
  81. <td style='text-align:right;<g:if test="${movimiento.ultimo}">text-decoration:underline;</g:if>'>
  82. <g:if test="${movimiento.auxiliar}">
  83. <g:if test="${(counter2++) == 1}">
  84. <g:formatNumber type="currency" number="${movimiento.importe}" />
  85. </g:if>
  86. <g:else>
  87. <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" />
  88. </g:else>
  89. </g:if>
  90. </td>
  91. <td style='text-align:right;'>
  92. <g:if test="${!movimiento.auxiliar}">
  93. <g:if test="${(counter++) == 1}">
  94. <g:formatNumber type="currency" number="${movimiento.importe}" />
  95. </g:if>
  96. <g:else>
  97. <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" />
  98. </g:else>
  99. </g:if>
  100. </td>
  101. <td>&nbsp;</td>
  102. <td style="text-align:center;"><g:checkBox name="preguntar$i" value="${movimiento.preguntar}" /></td>
  103. </tr>
  104. <g:if test="${movimiento.ultimo}"><g:set var="counter2" value="${1}" /></g:if>
  105. </g:each>
  106. <g:set var="counter" value="${1}" />
  107. <g:set var="counter2" value="${1}" />
  108. <g:set var="movimientos" value="${destinos[transaccion.id]}"/>
  109. <g:each var="movimiento" in="${movimientos}" status="i">
  110. <tr>
  111. <td <g:if test="${movimiento.padre}">style="text-decoration:underline;"</g:if>><g:if test="${!movimiento.auxiliar}">${movimiento.cuenta.numero}</g:if></td>
  112. <td>${movimiento.auxiliar?.numero}</td>
  113. <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>
  114. <td style='text-align:right;<g:if test="${movimiento.ultimo}">text-decoration:underline;</g:if>'>
  115. <g:if test="${movimiento.auxiliar}">
  116. <g:if test="${(counter2++) == 1}">
  117. <g:formatNumber type="currency" number="${movimiento.importe}" />
  118. </g:if>
  119. <g:else>
  120. <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" />
  121. </g:else>
  122. </g:if>
  123. </td>
  124. <td>&nbsp;</td>
  125. <td style='text-align:right;'>
  126. <g:if test="${!movimiento.auxiliar}">
  127. <g:if test="${(counter++) == 1}">
  128. <g:formatNumber type="currency" number="${movimiento.importe}" />
  129. </g:if>
  130. <g:else>
  131. <g:formatNumber type="currency" number="${movimiento.importe}" currencySymbol="" />
  132. </g:else>
  133. </g:if>
  134. </td>
  135. <td style="text-align:center;"><g:checkBox name="preguntar$i" value="${movimiento.preguntar}" /></td>
  136. </tr>
  137. <g:if test="${movimiento.ultimo}"><g:set var="counter2" value="${1}" /></g:if>
  138. </g:each>
  139. </tbody>
  140. <tfoot>
  141. <tr>
  142. <th colspan="4" style="text-align:right;">TOTAL</th>
  143. <th style="text-align:right;"><g:formatNumber type="currency" number="${transaccion.importe}" /></th>
  144. <th style="text-align:right;"><g:formatNumber type="currency" number="${transaccion.importe}" /></th>
  145. <th>&nbsp;</th>
  146. </tr>
  147. </tfoot>
  148. </table>
  149. </td>
  150. </tr>
  151. </g:each>
  152. </tbody>
  153. </table>
  154. </div>
  155. </span>
  156. </li>
  157. </ol>
  158. </fieldset>
  159. </g:if>
  160. <fieldset class="buttons">
  161. <g:link class="create" controller="servicioTransaccion" action="nueva" id="${servicio?.id}"><g:message code="servicio.nuevaTransaccion" default="Nueva Transaccion" /></g:link>
  162. <g:actionSubmit class="save" action="actualiza" value="${message(code: 'default.button.update.label', default: 'Update')}" />
  163. <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?')}');" />
  164. </fieldset>
  165. </g:form>
  166. </div>
  167. </body>
  168. </html>