Changeset 605 for trunk/grails-app
- Timestamp:
- Jun 21, 2010, 12:23:21 PM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/InventoryItemPurchaseDetailedController.groovy
r597 r605 148 148 response.contentType = ConfigurationHolder.config.grails.mime.types[params.format] 149 149 response.setHeader("Content-disposition", "attachment; filename=Purchases.${params.extension}") 150 List fields = ["purchaseOrderNumber", "date Entered", "costCode", "quantity", "orderValueAmount", "invoiceNumber",150 List fields = ["purchaseOrderNumber", "date", "costCode", "quantity", "orderValueAmount", "invoiceNumber", 151 151 "inventoryItemPurchaseType"] 152 Map labels = ["purchaseOrderNumber": "Order Number", "date Entered": "Date", "costCode": "Cost Code",152 Map labels = ["purchaseOrderNumber": "Order Number", "date": "Date", "costCode": "Cost Code", 153 153 "quantity": "Quantity", "orderValueAmount": "Order \$", "invoiceNumber": "Invoice Number", 154 154 "inventoryItemPurchaseType": "Type"] 155 Map formatters = [ date Entered: dateFmt]155 Map formatters = [ date: dateFmt] 156 156 Map parameters = [title: title, separator: ","] 157 157 … … 165 165 filterParams.order = params.order ?: "desc" 166 166 167 // Get some associatedProperty values for filterpane. 168 def associatedPropertyValues = [:] 169 def startOfYearRange = dateUtilService.getYearFromDate(dateUtilService.plusYear(new Date(), -10)) 170 def endOfYearRange = dateUtilService.getYearFromDate(dateUtilService.plusYear(new Date(), 10)) 171 associatedPropertyValues.yearRange = startOfYearRange..endOfYearRange 172 167 173 return[ inventoryItemPurchaseList: inventoryItemPurchaseList, 168 inventoryItemPurchaseTotal: inventoryItemPurchaseTotal, 169 filterParams: filterParams ] 174 inventoryItemPurchaseTotal: inventoryItemPurchaseTotal, 175 filterParams: filterParams, 176 associatedPropertyValues: associatedPropertyValues ] 170 177 171 178 } // end search() -
trunk/grails-app/domain/InventoryItemPurchase.groovy
r599 r605 2 2 3 3 Person enteredBy 4 Person lastUpdatedBy 4 5 InventoryItem inventoryItem 5 6 CostCode costCode 6 7 InventoryItemPurchaseType inventoryItemPurchaseType 8 Supplier supplier 7 9 8 Date dateEntered = new Date() 10 Date date = new Date() 11 Date lastUpdated // autoTimestamp 12 Date dateCreated // autoTimestamp 13 9 14 Integer quantity 10 15 String purchaseOrderNumber = '' … … 12 17 Currency orderValueCurrency 13 18 String invoiceNumber = '' 19 String comment = "" 14 20 15 21 Boolean receivedComplete = false … … 41 47 orderValueAmount(max: new BigDecimal(1000000000000)) 42 48 orderValueCurrency() 49 comment(maxSize:255) 50 lastUpdatedBy(nullable: true) 43 51 } 44 52 -
trunk/grails-app/services/InventoryPurchaseService.groovy
r600 r605 150 150 return fail(code:"inventoryItemPurchase.delete.failure.payment.approved") 151 151 152 def startOfDay = dateUtilService.getMidnight(result.inventoryItemPurchaseInstance.date Entered)152 def startOfDay = dateUtilService.getMidnight(result.inventoryItemPurchaseInstance.date) 153 153 def inventoryMovements = InventoryMovement.withCriteria { 154 154 eq("inventoryItem", result.inventoryItemPurchaseInstance.inventoryItem ) … … 234 234 result.inventoryItemPurchaseInstance.properties = params 235 235 result.inventoryItemPurchaseInstance.purchaseOrderNumber = result.inventoryItemPurchaseInstance.purchaseOrderNumber.trim() 236 result.inventoryItemPurchaseInstance.lastUpdatedBy = authService.currentUser 236 237 237 238 if(result.inventoryItemPurchaseInstance.hasErrors() || !result.inventoryItemPurchaseInstance.save()) … … 315 316 // Fetch to prevent lazy initialization error. 316 317 result.inventoryItemPurchaseInstance.inventoryItem.unitOfMeasure 318 result.inventoryItemPurchaseInstance.inventoryItem.inventoryLocation 317 319 318 320 if(order.hasErrors() || !order.save()) … … 339 341 340 342 } // end withTransaction 341 } // save()343 } // receiveSave() 342 344 343 345 def approveInvoicePaymentSave(params) { -
trunk/grails-app/views/inventoryItemDetailed/show.gsp
r595 r605 448 448 <g:sortableColumn action="show" property="purchaseOrderNumber" 449 449 title="Order #" params="[paginate: 'purchases']" /> 450 <g:sortableColumn action="show" property="date Entered"450 <g:sortableColumn action="show" property="date" 451 451 title="Date" params="[paginate: 'purchases']" /> 452 452 <g:sortableColumn action="show" property="costCode" … … 479 479 </td> 480 480 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'> 481 <g:formatDate date="${purchase.date Entered}" format="EEE, dd-MMM-yyyy"/>481 <g:formatDate date="${purchase.date}" format="EEE, dd-MMM-yyyy"/> 482 482 </td> 483 483 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/approveInvoicePayment.gsp
r597 r605 21 21 <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance.inventoryItem?.id}" /> 22 22 <g:hiddenField name="receivedId" value="${receivedId}" /> 23 <g:hiddenField name="supplier.id" value="${inventoryItemPurchaseInstance.supplier?.id}" /> 23 24 <g:hiddenField name="returnTo" value="${params.returnTo}" /> 24 25 <div class="dialog"> … … 88 89 </tr> 89 90 91 <tr class="prop"> 92 <td valign="top" class="name"> 93 <label for="comment">Comment:</label> 94 </td> 95 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'comment','errors')}"> 96 <textarea rows="5" cols="40" name="comment">${fieldValue(bean:inventoryItemPurchaseInstance, field:'comment')}</textarea> 97 </td> 98 </tr> 99 90 100 </tbody> 91 101 </table> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/create.gsp
r595 r605 7 7 <title>Create InventoryItemPurchase</title> 8 8 <nav:resources override="true"/> 9 <resource:dateChooser /> 9 10 </head> 10 11 <body> … … 50 51 <tr class="prop"> 51 52 <td valign="top" class="name"> 53 <label for="date">Date:</label> 54 </td> 55 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'date','errors')}"> 56 <richui:dateChooser name="date" format="dd-MM-yyyy" value="${inventoryItemPurchaseInstance.date}" /> 57 </td> 58 </tr> 59 60 <tr class="prop"> 61 <td valign="top" class="name"> 52 62 <label for="costCode">Cost Code:</label> 53 63 </td> … … 57 67 name="costCode.id" 58 68 value="${inventoryItemPurchaseInstance?.costCode?.id}" 59 noSelection="['null': '']"></g:select>69 noSelection="['null':/${g.message(code:'default.please.select.text')}/]"></g:select> 60 70 </td> 61 </tr> 71 </tr> 72 73 <tr class="prop"> 74 <td valign="top" class="name"> 75 <label for="supplier">Supplier:</label> 76 </td> 77 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'supplier','errors')}"> 78 <g:select optionKey="id" 79 from="${ Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 80 name="supplier.id" 81 value="${inventoryItemPurchaseInstance?.supplier?.id}" 82 noSelection="['null':/${g.message(code:'default.please.select.text')}/]"> 83 </g:select> 84 <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p> 85 </td> 86 </tr> 62 87 63 88 <tr class="prop"> … … 73 98 <tr class="prop"> 74 99 <td valign="top" class="name"> 75 <label for="orderValue"> Purchase Order $:</label>100 <label for="orderValue">Order Value:</label> 76 101 </td> 77 102 <td valign="top" class="value"> … … 80 105 value="${inventoryItemPurchaseInstance.orderValueAmount}" /> 81 106 <g:currencySelect name="orderValueCurrency" 82 value="${inventoryItemPurchaseInstance.orderValueCurrency}" /> 107 value="${inventoryItemPurchaseInstance?.orderValueCurrency}" 108 from="${grailsApplication.config.currencyList}"> 109 </g:currencySelect> 83 110 </td> 84 </tr> 111 </tr> 112 113 <tr class="prop"> 114 <td valign="top" class="name"> 115 <label for="comment">Comment:</label> 116 </td> 117 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'comment','errors')}"> 118 <textarea rows="5" cols="40" name="comment">${fieldValue(bean:inventoryItemPurchaseInstance, field:'comment')}</textarea> 119 </td> 120 </tr> 85 121 86 122 </tbody> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/edit.gsp
r600 r605 33 33 34 34 <tr class="prop"> 35 <td valign="top" class="name"> Inventory ItemPurchase Type:</td>35 <td valign="top" class="name">Purchase Type:</td> 36 36 37 37 <td valign="top" class="value">${inventoryItemPurchaseInstance?.inventoryItemPurchaseType?.encodeAsHTML()}</td> … … 41 41 <tr class="prop"> 42 42 <td valign="top" class="name"> 43 <label for="invoiceNumber">Purchase Order Number:</label>43 <label for="invoiceNumber">Purchase Order #:</label> 44 44 </td> 45 45 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'purchaseOrderNumber','errors')}"> … … 47 47 </td> 48 48 </tr> 49 50 <tr class="prop"> 51 <td valign="top" class="name"> 52 <label for="date">Date:</label> 53 </td> 54 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'date','errors')}"> 55 <richui:dateChooser name="date" format="dd-MM-yyyy" value="${inventoryItemPurchaseInstance.date}" /> 56 </td> 57 </tr> 49 58 50 59 <tr class="prop"> … … 57 66 name="costCode.id" 58 67 value="${inventoryItemPurchaseInstance?.costCode?.id}" ></g:select> 68 </td> 69 </tr> 70 71 <tr class="prop"> 72 <td valign="top" class="name"> 73 <label for="supplier">Supplier:</label> 74 </td> 75 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'supplier','errors')}"> 76 <g:select optionKey="id" 77 from="${ Supplier.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }" 78 name="supplier.id" 79 value="${inventoryItemPurchaseInstance?.supplier?.id}" 80 noSelection="['null':/${g.message(code:'default.please.select.text')}/]"> 81 </g:select> 82 <p><g:link controller="supplierDetailed" action="create">+Add Supplier</g:link></p> 59 83 </td> 60 84 </tr> … … 73 97 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'orderValueAmount','errors')}"> 74 98 <input type="text" id="orderValueAmount" name="orderValueAmount" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'orderValueAmount')}" /> 75 <g:currencySelect name="orderValueCurrency" value="${inventoryItemPurchaseInstance?.orderValueCurrency}" ></g:currencySelect> 99 <g:currencySelect name="orderValueCurrency" 100 value="${inventoryItemPurchaseInstance?.orderValueCurrency}" 101 from="${grailsApplication.config.currencyList}"> 102 </g:currencySelect> 76 103 </td> 77 104 </tr> 78 79 <tr class="prop"> 80 <td valign="top" class="name"> 81 <label for="invoiceNumber">Invoice Number:</label> 82 </td> 83 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'invoiceNumber','errors')}"> 84 <input type="text" maxlength="50" id="invoiceNumber" name="invoiceNumber" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'invoiceNumber')}"/> 85 </td> 86 </tr> 105 106 <g:if test="${inventoryItemPurchaseInstance.inventoryItemPurchaseType?.id == 4}"> 107 <tr class="prop"> 108 <td valign="top" class="name"> 109 <label for="invoiceNumber">Invoice Number:</label> 110 </td> 111 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'invoiceNumber','errors')}"> 112 <input type="text" maxlength="50" id="invoiceNumber" name="invoiceNumber" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'invoiceNumber')}"/> 113 </td> 114 </tr> 115 </g:if> 87 116 88 117 <g:if test="${inventoryItemPurchaseInstance?.inventoryItemPurchaseType?.id > 0}"> … … 126 155 127 156 <tr class="prop"> 128 <td valign="top" class="name">Date Entered:</td> 129 130 <td valign="top" class="value"> 131 <g:formatDate date="${inventoryItemPurchaseInstance?.dateEntered}" format="EEE, dd-MMM-yyyy @ HH:mm"/> 157 <td valign="top" class="name"> 158 <label for="comment">Comment:</label> 132 159 </td> 133 160 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'comment','errors')}"> 161 <textarea rows="5" cols="40" name="comment">${fieldValue(bean:inventoryItemPurchaseInstance, field:'comment')}</textarea> 162 </td> 134 163 </tr> 135 164 165 <tr class="prop"> 166 <td valign="top" class="name">Entered By:</td> 167 <td valign="top" class="value"> 168 <g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.enteredBy?.id}"> 169 ${inventoryItemPurchaseInstance?.enteredBy?.encodeAsHTML()} 170 </g:link> 171 on <g:formatDate date="${inventoryItemPurchaseInstance?.dateCreated}" format="EEE, dd-MMM-yyyy @ HH:mm"/> 172 </td> 173 </tr> 174 175 <g:if test="${inventoryItemPurchaseInstance.lastUpdatedBy}"> 136 176 <tr class="prop"> 137 <td valign="top" class="name">Entered By:</td> 138 139 <td valign="top" class="value"><g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.enteredBy?.id}">${inventoryItemPurchaseInstance?.enteredBy?.encodeAsHTML()}</g:link></td> 140 177 <td valign="top" class="name">Last Updated By:</td> 178 <td valign="top" class="value"> 179 <g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.lastUpdatedBy?.id}"> 180 ${inventoryItemPurchaseInstance?.lastUpdatedBy.encodeAsHTML()} 181 </g:link> 182 on <g:formatDate date="${inventoryItemPurchaseInstance?.lastUpdated}" format="EEE, dd-MMM-yyyy @ HH:mm"/> 183 </td> 141 184 </tr> 185 </g:if > 142 186 143 187 </tbody> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/receive.gsp
r600 r605 22 22 <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance.inventoryItem?.id}" /> 23 23 <g:hiddenField name="orderId" value="${orderId}" /> 24 <g:hiddenField name="supplier.id" value="${inventoryItemPurchaseInstance.supplier?.id}" /> 24 25 <g:hiddenField name="returnTo" value="${params.returnTo}" /> 25 26 <div class="dialog"> … … 64 65 </tr> 65 66 67 <tr class="prop"> 68 <td valign="top" class="name"> 69 <label for="supplier">Supplier:</label> 70 </td> 71 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'supplier','errors')}"> 72 ${inventoryItemPurchaseInstance.supplier} 73 </td> 74 </tr> 75 66 76 <tr class="prop"> 67 77 <td valign="top" class="name"> … … 84 94 ${inventoryItemPurchaseInstance.orderValueCurrency?.encodeAsHTML()} 85 95 </td> 96 </tr> 97 98 <tr class="prop"> 99 <td valign="top" class="name"> 100 <label for="comment">Comment:</label> 101 </td> 102 <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'comment','errors')}"> 103 <textarea rows="5" cols="40" name="comment">${fieldValue(bean:inventoryItemPurchaseInstance, field:'comment')}</textarea> 104 </td> 86 105 </tr> 87 </tr>88 106 89 107 </tbody> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/search.gsp
r595 r605 83 83 <g:sortableColumn property="purchaseOrderNumber" 84 84 title="Order #" params="${filterParams}" /> 85 <g:sortableColumn property="date Entered"85 <g:sortableColumn property="date" 86 86 title="Date" params="${filterParams}" /> 87 87 <g:sortableColumn property="costCode" … … 114 114 </td> 115 115 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> 116 <g:formatDate date="${purchase.date Entered}" format="EEE, dd-MMM-yyyy"/>116 <g:formatDate date="${purchase.date}" format="EEE, dd-MMM-yyyy"/> 117 117 </td> 118 118 <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}?returnTo=search"'> … … 193 193 action="search" 194 194 class="overlayPane" 195 excludeProperties="orderValueCurrency "195 excludeProperties="orderValueCurrency, dateCreated" 196 196 associatedProperties="inventoryItemPurchaseType.name" 197 197 filterPropertyValues="${['inventoryItemPurchaseType.name':[values:InventoryItemPurchaseType.findAllByIsActive(true)], 198 date Entered:[years:2020..2000,precision:'day']198 date:[years: associatedPropertyValues.yearRange,precision:'day'] 199 199 ]}"/> 200 200 </div> <!-- end body --> -
trunk/grails-app/views/inventoryItemPurchaseDetailed/show.gsp
r595 r605 26 26 27 27 <tr class="prop"> 28 <td valign="top" class="name"> Inventory ItemPurchase Type:</td>28 <td valign="top" class="name">Purchase Type:</td> 29 29 30 30 <td valign="top" class="value">${inventoryItemPurchaseInstance?.inventoryItemPurchaseType?.encodeAsHTML()}</td> … … 33 33 34 34 <tr class="prop"> 35 <td valign="top" class="name">Purchase Order Number:</td>35 <td valign="top" class="name">Purchase Order #:</td> 36 36 37 37 <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'purchaseOrderNumber')}</td> … … 40 40 41 41 <tr class="prop"> 42 <td valign="top" class="name">Date:</td> 43 <td valign="top" class="value"> 44 <g:formatDate date="${inventoryItemPurchaseInstance?.date}" format="EEE, dd-MMM-yyyy"/> 45 </td> 46 </tr> 47 48 <tr class="prop"> 42 49 <td valign="top" class="name">Cost Code:</td> 43 50 44 51 <td valign="top" class="value"><g:link controller="costCodeDetailed" action="show" id="${inventoryItemPurchaseInstance?.costCode?.id}">${inventoryItemPurchaseInstance?.costCode?.encodeAsHTML()}</g:link></td> 52 53 </tr> 54 55 <tr class="prop"> 56 <td valign="top" class="name">Supplier:</td> 57 58 <td valign="top" class="value"><g:link controller="supplierDetailed" action="show" id="${inventoryItemPurchaseInstance?.supplier?.id}">${inventoryItemPurchaseInstance?.supplier?.encodeAsHTML()}</g:link></td> 45 59 46 60 </tr> … … 62 76 63 77 </tr> 64 65 < tr class="prop">66 <t d valign="top" class="name">Invoice Number:</td>67 68 <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'invoiceNumber')}</td>69 70 </ tr>78 79 <g:if test="${inventoryItemPurchaseInstance.inventoryItemPurchaseType?.id == 4}"> 80 <tr class="prop"> 81 <td valign="top" class="name">Invoice Number:</td> 82 <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'invoiceNumber')}</td> 83 </tr> 84 </g:if> 71 85 72 86 <tr class="prop"> … … 87 101 </td> 88 102 </tr> 89 103 90 104 <tr class="prop"> 91 <td valign="top" class="name">Date Entered:</td> 92 93 <td valign="top" class="value"> 94 <g:formatDate date="${inventoryItemPurchaseInstance?.dateEntered}" format="EEE, dd-MMM-yyyy @ HH:mm"/> 95 </td> 96 105 <td valign="top" class="name">Comment:</td> 106 <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'comment')}</td> 97 107 </tr> 98 108 99 109 <tr class="prop"> 100 110 <td valign="top" class="name">Entered By:</td> 101 102 <td valign="top" class="value"><g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.enteredBy?.id}">${inventoryItemPurchaseInstance?.enteredBy?.encodeAsHTML()}</g:link></td> 103 111 <td valign="top" class="value"> 112 <g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.enteredBy?.id}"> 113 ${inventoryItemPurchaseInstance?.enteredBy?.encodeAsHTML()} 114 </g:link> 115 on <g:formatDate date="${inventoryItemPurchaseInstance?.dateCreated}" format="EEE, dd-MMM-yyyy @ HH:mm"/> 116 </td> 104 117 </tr> 118 119 <g:if test="${inventoryItemPurchaseInstance.lastUpdatedBy}"> 120 <tr class="prop"> 121 <td valign="top" class="name">Last Updated By:</td> 122 <td valign="top" class="value"> 123 <g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.lastUpdatedBy?.id}"> 124 ${inventoryItemPurchaseInstance?.lastUpdatedBy.encodeAsHTML()} 125 </g:link> 126 on <g:formatDate date="${inventoryItemPurchaseInstance?.lastUpdated}" format="EEE, dd-MMM-yyyy @ HH:mm"/> 127 </td> 128 </tr> 129 </g:if > 105 130 106 131 </tbody>
Note: See TracChangeset
for help on using the changeset viewer.