Changeset 595
- Timestamp:
- Jun 11, 2010, 11:44:49 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r579 r595 375 375 [order:91, controller:'unitOfMeasureDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }] 376 376 ] 377 ], 378 [order:220, controller:'inventoryItemPurchaseDetailed', title:'inventoryItemPurchase', action:'search', 379 subItems: [ 380 [order:10, controller:'inventoryItemPurchaseDetailed', title:'Purchase Search', action:'search', isVisible: { true }], 381 [order:20, controller:'inventoryItemPurchaseDetailed', title:'Order', action:'create', isVisible: { true }], 382 [order:90, controller:'inventoryItemPurchaseDetailed', title:'Show', action:'show', isVisible: { params.action == 'show' }], 383 [order:91, controller:'inventoryItemPurchaseDetailed', title:'Edit', action:'edit', isVisible: { params.action == 'edit' }] 384 ] 377 385 ] 378 386 ] -
trunk/grails-app/controllers/InventoryItemPurchaseDetailedController.groovy
r594 r595 75 75 } 76 76 else { 77 params.sort = " purchaseOrderNumber"78 params.order = " desc"77 params.sort = "id" 78 params.order = "asc" 79 79 } 80 80 81 81 if(isFilterApplied) { 82 82 // filterPane: 83 params.sort = params.sort ?: "id"84 params.order = params.order ?: "desc"85 83 //if(params.sort == "attentionFlag") // See ticket #64 in Trac. 86 84 //params.sort = "id" … … 175 173 def show = { 176 174 def inventoryItemPurchaseInstance = InventoryItemPurchase.read( params.id ) 175 params.returnTo = params.returnTo ?: 'inventoryItem' 177 176 178 177 if(!inventoryItemPurchaseInstance) { … … 188 187 if(!result.error) { 189 188 flash.message = g.message(code: "default.delete.success", args: ["InventoryItemPurchase", params.id]) 190 redirect(controller: 'inventoryItemDetailed', 191 action: 'show', 192 id: result.inventoryItemId, 193 params: [showTab: "showPurchasingTab"]) 189 if(params.returnTo == 'inventoryItem') { 190 redirect(controller: 'inventoryItemDetailed', 191 action: 'show', 192 id: result.inventoryItemId, 193 params: [showTab: "showPurchasingTab"]) 194 } 195 else { 196 redirect(action: 'search') 197 } 194 198 return 195 199 } … … 207 211 def edit = { 208 212 def result = inventoryPurchaseService.edit(params) 213 params.returnTo = params.returnTo ?: 'inventoryItem' 209 214 210 215 if(!result.error) … … 236 241 def inventoryItemPurchaseInstance = new InventoryItemPurchase() 237 242 inventoryItemPurchaseInstance.properties = params 243 params.returnTo = params.returnTo ?: 'inventoryItem' 238 244 239 245 if(!inventoryItemPurchaseInstance.inventoryItem) { … … 251 257 if(!result.error) { 252 258 flash.message = g.message(code: "default.create.success", args: ["Inventory Purchase", '']) 253 redirect(controller: 'inventoryItemDetailed', 254 action: 'show', 255 id: result.inventoryItemId, 256 params: [showTab: "showPurchasingTab"]) 259 if(params.returnTo == 'inventoryItem') { 260 redirect(controller: 'inventoryItemDetailed', 261 action: 'show', 262 id: result.inventoryItemId, 263 params: [showTab: "showPurchasingTab"]) 264 } 265 else { 266 redirect(action: 'search') 267 } 257 268 return 258 269 } … … 271 282 272 283 inventoryItemPurchaseInstance.properties = params 284 params.returnTo = params.returnTo ?: 'inventoryItem' 273 285 def calcQuantities = inventoryPurchaseService.calcQuantities(inventoryItemPurchaseInstance) 274 286 inventoryItemPurchaseInstance.quantity = calcQuantities.thisOrderRemaining … … 282 294 if(!result.error) { 283 295 flash.message = g.message(code: "default.create.success", args: ["Inventory Purchase", '']) 284 redirect(controller: 'inventoryItemDetailed', 285 action: 'show', 286 id: result.inventoryItemId, 287 params: [showTab: "showPurchasingTab"]) 296 if(params.returnTo == 'inventoryItem') { 297 redirect(controller: 'inventoryItemDetailed', 298 action: 'show', 299 id: result.inventoryItemId, 300 params: [showTab: "showPurchasingTab"]) 301 } 302 else { 303 redirect(action: 'search') 304 } 288 305 return 289 306 } … … 311 328 312 329 inventoryItemPurchaseInstance.properties = params 330 params.returnTo = params.returnTo ?: 'inventoryItem' 313 331 return ['inventoryItemPurchaseInstance':inventoryItemPurchaseInstance, 314 332 'orderId': inventoryItemPurchaseInstance.id] … … 320 338 if(!result.error) { 321 339 flash.message = g.message(code: "default.create.success", args: ["Inventory Purchase", '']) 322 redirect(controller: 'inventoryItemDetailed', 323 action: 'show', 324 id: result.inventoryItemId, 325 params: [showTab: "showPurchasingTab"]) 340 if(params.returnTo == 'inventoryItem') { 341 redirect(controller: 'inventoryItemDetailed', 342 action: 'show', 343 id: result.inventoryItemId, 344 params: [showTab: "showPurchasingTab"]) 345 } 346 else { 347 redirect(action: 'search') 348 } 326 349 return 327 350 } -
trunk/grails-app/views/inventoryItemDetailed/show.gsp
r584 r595 502 502 </g:link> 503 503 </td> 504 504 505 <g:if test="${purchase.inventoryItemPurchaseType.id == 1}"> 505 506 <g:if test="${!purchase.receivedComplete}"> 506 507 <td class="notClickable"> 507 <g:link controller="inventoryItemPurchaseDetailed" action="receive" id="${purchase.id}">508 <g:link controller="inventoryItemPurchaseDetailed" action="receive" params="[id: purchase.id, returnTo: 'inventoryItem']"> 508 509 <img src="${resource(dir:'images/skin',file:'basket_put.png')}" alt="Receive" title="Receive" /> 509 510 </g:link> 510 511 </td> 512 <td class="notClickable"> 513 </td> 511 514 </g:if> 512 515 <g:else> 513 516 <td class="notClickable"> 514 517 </td> 518 <td class="notClickable"> 519 </td> 515 520 </g:else> 521 </g:if> 522 <g:elseif test="${(purchase.inventoryItemPurchaseType.id == 2)||(purchase.inventoryItemPurchaseType.id == 3)}"> 516 523 <g:if test="${!purchase.invoicePaymentApproved}"> 517 524 <td class="notClickable"> 518 <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" id="${purchase.id}"> 525 </td> 526 <td class="notClickable"> 527 <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" params="[id: purchase.id, returnTo: 'inventoryItem']"> 519 528 <img src="${resource(dir:'images/skin',file:'tick.png')}" alt="Approve" title="Approve Payment" /> 520 529 </g:link> … … 524 533 <td class="notClickable"> 525 534 </td> 535 <td class="notClickable"> 536 </td> 526 537 </g:else> 527 </g: if>538 </g:elseif> 528 539 <g:else> 529 540 <td class="notClickable"> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/approveInvoicePayment.gsp
r441 r595 21 21 <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance.inventoryItem?.id}" /> 22 22 <g:hiddenField name="orderId" value="${orderId}" /> 23 <g:hiddenField name="returnTo" value="${params.returnTo}" /> 23 24 <div class="dialog"> 24 25 <table> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/create.gsp
r441 r595 6 6 <meta name="layout" content="main" /> 7 7 <title>Create InventoryItemPurchase</title> 8 <nav:resources override="true"/> 8 9 </head> 9 10 <body> … … 20 21 <g:form action="save" method="post" > 21 22 <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance?.inventoryItem?.id}" /> 23 <g:hiddenField name="returnTo" value="${params.returnTo}" /> 22 24 <div class="dialog"> 23 25 <table> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/receive.gsp
r441 r595 6 6 <meta name="layout" content="main" /> 7 7 <title>Receive InventoryItemPurchase</title> 8 <nav:resources override="true"/> 8 9 </head> 9 10 <body> … … 21 22 <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance.inventoryItem?.id}" /> 22 23 <g:hiddenField name="orderId" value="${orderId}" /> 24 <g:hiddenField name="returnTo" value="${params.returnTo}" /> 23 25 <div class="dialog"> 24 26 <table> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/search.gsp
r570 r595 10 10 <body> 11 11 <div class="nav"> 12 < h1>Inventory Purchases</h1>12 <nav:renderSubItems group="navAlt"/> 13 13 </div> 14 14 … … 110 110 <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"/> 111 111 112 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id} "'>112 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 113 113 ${fieldValue(bean:purchase, field:'purchaseOrderNumber')} 114 114 </td> 115 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id} "'>115 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 116 116 <g:formatDate date="${purchase.dateEntered}" format="EEE, dd-MMM-yyyy"/> 117 117 </td> 118 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id} "'>118 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 119 119 ${fieldValue(bean:purchase, field:'costCode')} 120 120 </td> 121 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id} "'>121 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 122 122 ${fieldValue(bean:purchase, field:'quantity')} 123 123 </td> 124 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id} "'>124 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 125 125 ${fieldValue(bean:purchase, field:'orderValueAmount')} 126 126 ${fieldValue(bean:purchase, field:'orderValueCurrency')} 127 127 </td> 128 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id} "'>128 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 129 129 ${fieldValue(bean:purchase, field:'invoiceNumber')} 130 130 </td> 131 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id} "'>131 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 132 132 ${fieldValue(bean:purchase, field:'inventoryItemPurchaseType')} 133 133 </td> 134 134 <td class="notClickable"> 135 <g:link controller="inventoryItemPurchaseDetailed" action="show" id="${purchase.id}">135 <g:link controller="inventoryItemPurchaseDetailed" action="show" params="[id: purchase.id, returnTo: 'search']"> 136 136 <img src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" title="Show" /> 137 137 </g:link> 138 138 </td> 139 139 140 <g:if test="${purchase.inventoryItemPurchaseType.id == 1}"> 140 141 <g:if test="${!purchase.receivedComplete}"> 141 142 <td class="notClickable"> 142 <g:link controller="inventoryItemPurchaseDetailed" action="receive" id="${purchase.id}">143 <g:link controller="inventoryItemPurchaseDetailed" action="receive" params="[id: purchase.id, returnTo: 'search']"> 143 144 <img src="${resource(dir:'images/skin',file:'basket_put.png')}" alt="Receive" title="Receive" /> 144 145 </g:link> 145 146 </td> 147 <td class="notClickable"> 148 </td> 146 149 </g:if> 147 150 <g:else> 148 151 <td class="notClickable"> 149 152 </td> 153 <td class="notClickable"> 154 </td> 150 155 </g:else> 156 </g:if> 157 <g:elseif test="${(purchase.inventoryItemPurchaseType.id == 2)||(purchase.inventoryItemPurchaseType.id == 3)}"> 151 158 <g:if test="${!purchase.invoicePaymentApproved}"> 152 159 <td class="notClickable"> 153 <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" id="${purchase.id}"> 160 </td> 161 <td class="notClickable"> 162 <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" params="[id: purchase.id, returnTo: 'search']"> 154 163 <img src="${resource(dir:'images/skin',file:'tick.png')}" alt="Approve" title="Approve Payment" /> 155 164 </g:link> … … 159 168 <td class="notClickable"> 160 169 </td> 170 <td class="notClickable"> 171 </td> 161 172 </g:else> 162 </g: if>173 </g:elseif> 163 174 <g:else> 164 175 <td class="notClickable"> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/show.gsp
r441 r595 6 6 <meta name="layout" content="main" /> 7 7 <title>Show InventoryItemPurchase</title> 8 <nav:resources override="true"/> 8 9 </head> 9 10 <body> 10 11 <div class="nav"> 11 < h1>Show InventoryItemPurchase</h1>12 <nav:renderSubItems group="navAlt"/> 12 13 </div> 13 14 <div class="body"> … … 108 109 <div class="buttons"> 109 110 <g:form> 110 <input type="hidden" name="id" value="${inventoryItemPurchaseInstance?.id}" /> 111 <g:hiddenField name="id" value="${inventoryItemPurchaseInstance?.id}" /> 112 <g:hiddenField name="returnTo" value="${params.returnTo}" /> 111 113 <span class="button"><g:actionSubmit class="edit" value="Edit" /></span> 112 114 <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
Note: See TracChangeset
for help on using the changeset viewer.