Index: trunk/grails-app/views/costCodeDetailed/create.gsp
===================================================================
--- trunk/grails-app/views/costCodeDetailed/create.gsp	(revision 441)
+++ trunk/grails-app/views/costCodeDetailed/create.gsp	(revision 441)
@@ -0,0 +1,62 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Create CostCode</title>
+        <nav:resources override="true"/>
+    </head>
+    <body>
+        <div class="nav">
+            <nav:renderSubItems group="navAlt"/>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:hasErrors bean="${costCodeInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${costCodeInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form action="save" method="post" >
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="name">Name:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:costCodeInstance,field:'name','errors')}">
+                                    <input type="text" maxlength="50" id="name" name="name" value="${fieldValue(bean:costCodeInstance,field:'name')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="description">Description:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:costCodeInstance,field:'description','errors')}">
+                                    <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:costCodeInstance,field:'description')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="isActive">Is Active:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:costCodeInstance,field:'isActive','errors')}">
+                                    <g:checkBox name="isActive" value="${costCodeInstance?.isActive}" ></g:checkBox>
+                                </td>
+                            </tr> 
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><input class="save" type="submit" value="Create" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/costCodeDetailed/edit.gsp
===================================================================
--- trunk/grails-app/views/costCodeDetailed/edit.gsp	(revision 441)
+++ trunk/grails-app/views/costCodeDetailed/edit.gsp	(revision 441)
@@ -0,0 +1,66 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Edit CostCode</title>
+        <nav:resources override="true"/>
+    </head>
+    <body>
+        <div class="nav">
+            <nav:renderSubItems group="navAlt"/>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:hasErrors bean="${costCodeInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${costCodeInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form method="post" >
+                <input type="hidden" name="id" value="${costCodeInstance?.id}" />
+                <input type="hidden" name="version" value="${costCodeInstance?.version}" />
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="name">Name:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:costCodeInstance,field:'name','errors')}">
+                                    <input type="text" maxlength="50" id="name" name="name" value="${fieldValue(bean:costCodeInstance,field:'name')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="description">Description:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:costCodeInstance,field:'description','errors')}">
+                                    <input type="text" maxlength="100" id="description" name="description" value="${fieldValue(bean:costCodeInstance,field:'description')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="isActive">Is Active:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:costCodeInstance,field:'isActive','errors')}">
+                                    <g:checkBox name="isActive" value="${costCodeInstance?.isActive}" ></g:checkBox>
+                                </td>
+                            </tr> 
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
+                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
+                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/costCodeDetailed/list.gsp
===================================================================
--- trunk/grails-app/views/costCodeDetailed/list.gsp	(revision 441)
+++ trunk/grails-app/views/costCodeDetailed/list.gsp	(revision 441)
@@ -0,0 +1,61 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>CostCode List</title>
+        <nav:resources override="true"/>
+    </head>
+    <body>
+        <div class="nav">
+            <nav:renderSubItems group="navAlt"/>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <div class="list">
+                <table>
+                    <thead>
+                        <tr>
+                        
+                   	        <g:sortableColumn property="id" title="Id" />
+                        
+                   	        <g:sortableColumn property="name" title="Name" />
+                        
+                   	        <g:sortableColumn property="description" title="Description" />
+                        
+                   	        <g:sortableColumn property="isActive" title="Is Active" />
+
+                            <th></th>
+                        
+                        </tr>
+                    </thead>
+                    <tbody>
+                    <g:each in="${costCodeInstanceList}" status="i" var="costCodeInstance">
+                        <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'/>
+                        
+                            <td>${fieldValue(bean:costCodeInstance, field:'id')}</td>
+                        
+                            <td>${fieldValue(bean:costCodeInstance, field:'name')}</td>
+                        
+                            <td>${fieldValue(bean:costCodeInstance, field:'description')}</td>
+                        
+                            <td>${fieldValue(bean:costCodeInstance, field:'isActive')}</td>
+
+                            <td>
+                                <g:link action="show" id="${costCodeInstance.id}">
+                                    <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
+                                </g:link>
+                            </td>
+                        
+                        </tr>
+                    </g:each>
+                    </tbody>
+                </table>
+            </div>
+            <div class="paginateButtons">
+                <g:paginate total="${costCodeInstanceTotal}" />
+            </div>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/costCodeDetailed/show.gsp
===================================================================
--- trunk/grails-app/views/costCodeDetailed/show.gsp	(revision 441)
+++ trunk/grails-app/views/costCodeDetailed/show.gsp	(revision 441)
@@ -0,0 +1,74 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Show CostCode</title>
+        <nav:resources override="true"/>
+    </head>
+    <body>
+        <div class="nav">
+            <nav:renderSubItems group="navAlt"/>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <div class="dialog">
+                <table>
+                    <tbody>
+
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Id:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:costCodeInstance, field:'id')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Name:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:costCodeInstance, field:'name')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Description:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:costCodeInstance, field:'description')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Is Active:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:costCodeInstance, field:'isActive')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Inventory Item Purchases:</td>
+                            
+                            <td  valign="top" style="text-align:left;" class="value">
+                                <ul>
+                                <g:each var="i" in="${costCodeInstance.inventoryItemPurchases}">
+                                    <li><g:link controller="inventoryItemPurchaseDetailed" action="show" id="${i.id}">${i?.encodeAsHTML()}</g:link></li>
+                                </g:each>
+                                </ul>
+                            </td>
+                            
+                        </tr>
+                    
+                    </tbody>
+                </table>
+            </div>
+            <div class="buttons">
+                <g:form>
+                    <input type="hidden" name="id" value="${costCodeInstance?.id}" />
+                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
+                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
+                </g:form>
+            </div>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/inventoryItemDetailed/edit.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/edit.gsp	(revision 440)
+++ trunk/grails-app/views/inventoryItemDetailed/edit.gsp	(revision 441)
@@ -164,5 +164,5 @@
                                     <label for="averageDeliveryTime">Estimated Unit Price:</label>
                                 </td>
-                                <td valign="top">
+                                <td valign="top" class="value">
                                     <input  class="medium ${hasErrors(bean:inventoryItemInstance,field:'estimatedUnitPriceAmount','errors')}"
                                                     type="text" id="estimatedUnitPriceAmount" name="estimatedUnitPriceAmount"
Index: trunk/grails-app/views/inventoryItemDetailed/importInventoryItemPurchases.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/importInventoryItemPurchases.gsp	(revision 441)
+++ trunk/grails-app/views/inventoryItemDetailed/importInventoryItemPurchases.gsp	(revision 441)
@@ -0,0 +1,35 @@
+<html>
+    <head>
+        <meta name="layout" content="main" />
+        <title>Import Inventory Item Purchases</title>
+        <nav:resources override="true"/>
+        <g:render template="/shared/pictureHead" />
+    </head>
+    <body>
+        <div class="nav">
+            <h1>Import Inventory Purchases</h1>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:uploadForm action="importInventoryItemPurchasesSave" onsubmit="return Lightbox.loading();">
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="file">File:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    <input type="file" id="file" name="file" size="40"/>
+                                </td>
+                            </tr>
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><input class="save" type="submit" value="Create" /></span>
+                </div>
+            </g:uploadForm>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/inventoryItemDetailed/search.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/search.gsp	(revision 440)
+++ trunk/grails-app/views/inventoryItemDetailed/search.gsp	(revision 441)
@@ -76,5 +76,9 @@
                                         /
                                         <g:link action="importInventory">
-                                            Import
+                                            Import Inventory
+                                        </g:link>
+                                        /
+                                        <g:link action="importInventoryItemPurchases">
+                                            Import Purchases
                                         </g:link>
                                     </td>
Index: trunk/grails-app/views/inventoryItemDetailed/show.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemDetailed/show.gsp	(revision 440)
+++ trunk/grails-app/views/inventoryItemDetailed/show.gsp	(revision 441)
@@ -43,4 +43,5 @@
                     <richui:tabLabel selected="${showTab.detail}" title="Detail" />
                     <richui:tabLabel selected="${showTab.movement}" title="Movement" />
+                    <richui:tabLabel selected="${showTab.purchasing}" title="Purchasing" />
                 </richui:tabLabels>
 
@@ -384,7 +385,142 @@
 <!-- End Movement tab -->
 
+<!-- Start Purchases tab -->
+                    <richui:tabContent>
+
+                        <g:if test="${inventoryItemPurchases.isEmpty()}">
+                            <br />
+                            No Inventory Purchases.
+                            <br />
+                            <br />
+
+                            <div class="buttons">
+                                <g:form controller="inventoryItemPurchaseDetailed">
+                                    <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
+                                    <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span>
+                                </g:form>
+                            </div>
+
+                        </g:if>
+                        <g:else>
+
+                            <div class="list">
+                                <table>
+                                    <thead>
+                                        <tr>
+                                            <g:sortableColumn action="show" property="purchaseOrderNumber"
+                                                                                title="Order #" params="[paginate: 'purchases']"  />
+                                            <g:sortableColumn action="show"  property="dateEntered"
+                                                                                title="Date" params="[paginate: 'purchases']" />
+                                            <g:sortableColumn action="show"  property="costCode"
+                                                                                title="Cost Code" params="[paginate: 'purchases']" />
+                                            <g:sortableColumn action="show"  property="quantity"
+                                                                                title="Quantity" params="[paginate: 'purchases']" />
+                                            <g:sortableColumn action="show"  property="orderValueAmount"
+                                                                                title="Order \$" params="[paginate: 'purchases']" />
+                                            <g:sortableColumn action="show"  property="invoiceNumber"
+                                                                                title="Invoice Number" params="[paginate: 'purchases']" />
+                                            <g:sortableColumn action="show"  property="inventoryItemPurchaseType"
+                                                                                title="Type" params="[paginate: 'purchases']" />
+                                            <th>
+                                                <img  src="${resource(dir:'images/skin',file:'database_go_grey.png')}" alt="Show" title="Show" />
+                                            </th>
+                                            <th>
+                                                <img  src="${resource(dir:'images/skin',file:'basket_put_grey.png')}" alt="Receive" title="Receive" />
+                                            </th>
+                                            <th>
+                                                <img  src="${resource(dir:'images/skin',file:'tick_grey.png')}" alt="Approve" title="Approve Payment" />
+                                            </th>
+                                        </tr>
+                                    </thead>
+                                    <tbody>
+                                        <g:each in="${inventoryItemPurchases}" status="i" var="purchase">
+                                            <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"/>
+
+                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
+                                                    ${fieldValue(bean:purchase, field:'purchaseOrderNumber')}
+                                                </td>
+                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
+                                                    <g:formatDate date="${purchase.dateEntered}" format="EEE, dd-MMM-yyyy"/>
+                                                </td>
+                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
+                                                    ${fieldValue(bean:purchase, field:'costCode')}
+                                                </td>
+                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
+                                                    ${fieldValue(bean:purchase, field:'quantity')}
+                                                </td>
+                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
+                                                    ${fieldValue(bean:purchase, field:'orderValueAmount')}
+                                                    ${fieldValue(bean:purchase, field:'orderValueCurrency')}
+                                                </td>
+                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
+                                                    ${fieldValue(bean:purchase, field:'invoiceNumber')}
+                                                </td>
+                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
+                                                    ${fieldValue(bean:purchase, field:'inventoryItemPurchaseType')}
+                                                </td>
+                                                <td>
+                                                    <g:link controller="inventoryItemPurchaseDetailed" action="show" id="${purchase.id}">
+                                                        <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" title="Show" />
+                                                    </g:link>
+                                                </td>
+                                                <g:if test="${purchase.inventoryItemPurchaseType.id == 1}">
+                                                    <g:if test="${!purchase.receivedComplete}">
+                                                        <td>
+                                                            <g:link controller="inventoryItemPurchaseDetailed" action="receive" id="${purchase.id}">
+                                                                <img  src="${resource(dir:'images/skin',file:'basket_put.png')}" alt="Receive" title="Receive" />
+                                                            </g:link>
+                                                        </td>
+                                                    </g:if>
+                                                    <g:else>
+                                                        <td>
+                                                        </td>
+                                                    </g:else>
+                                                    <g:if test="${!purchase.invoicePaymentApproved}">
+                                                        <td>
+                                                            <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" id="${purchase.id}">
+                                                                <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Approve" title="Approve Payment" />
+                                                            </g:link>
+                                                        </td>
+                                                    </g:if>
+                                                    <g:else>
+                                                        <td>
+                                                        </td>
+                                                    </g:else>
+                                                </g:if>
+                                                <g:else>
+                                                    <td>
+                                                    </td>
+                                                    <td>
+                                                    </td>
+                                                </g:else>
+
+                                            </tr>
+                                        </g:each>
+                                    </tbody>
+                                </table>
+                            </div>
+
+                            <div class="buttons">
+                                <g:form controller="inventoryItemPurchaseDetailed">
+                                    <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
+                                    Results: ${inventoryItemPurchases.size()} / ${inventoryItemPurchasesTotal}
+                                    <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span>
+                                </g:form>
+                            </div>
+
+                            <div class="paginateButtons">
+                                <g:paginate action="show"
+                                                        id="${inventoryItemInstance?.id}"
+                                                        total="${inventoryItemPurchasesTotal}"
+                                                        params="[paginate: 'purchases']" />
+                            </div>
+
+                        </g:else>
+
+                    </richui:tabContent>
+<!-- End Movement tab -->
+
                 </richui:tabContents>
             </richui:tabView>
-
 
         </div>
Index: trunk/grails-app/views/inventoryItemPurchaseDetailed/approveInvoicePayment.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemPurchaseDetailed/approveInvoicePayment.gsp	(revision 441)
+++ trunk/grails-app/views/inventoryItemPurchaseDetailed/approveInvoicePayment.gsp	(revision 441)
@@ -0,0 +1,98 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Approve Payment InventoryItemPurchase</title>
+    </head>
+    <body>
+        <div class="nav">
+            <h1>Approve Payment</h1>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:hasErrors bean="${inventoryItemPurchaseInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${inventoryItemPurchaseInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form action="approveInvoicePaymentSave" method="post" >
+                <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance.inventoryItem?.id}" />
+                <g:hiddenField name="orderId" value="${orderId}" />
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="inventoryItem">Inventory Item:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    <g:link controller="inventoryItemDetailed"
+                                                    action="show"
+                                                    id="${inventoryItemPurchaseInstance.inventoryItem.id}">
+                                        ${inventoryItemPurchaseInstance.inventoryItem.encodeAsHTML()}
+                                    </g:link>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="purchaseOrderNumber">Purchase Order #:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    ${inventoryItemPurchaseInstance.purchaseOrderNumber.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'costCode','errors')}">
+                                    ${inventoryItemPurchaseInstance.costCode.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="quantity">Invoice #:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'invoiceNumber','errors')}">
+                                    <input type="text" id="invoiceNumber" name="invoiceNumber" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'invoiceNumber')}" />
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="quantity">Quantity:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'quantity','errors')}">
+                                    <input type="text" id="quantity" name="quantity" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'quantity')}" />
+                                    ${inventoryItemPurchaseInstance.inventoryItem.unitOfMeasure.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="orderValue">Purchase Order $:</label>
+                                </td>
+                                <td valign="top">
+                                    <input  class="medium ${hasErrors(bean:inventoryItemPurchaseInstance,field:'orderValueAmount','errors')}"
+                                                    type="text" id="orderValueAmount" name="orderValueAmount"
+                                                    value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'orderValueAmount')}" />
+                                    ${inventoryItemPurchaseInstance.orderValueCurrency?.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><input class="save" type="submit" value="Create" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/inventoryItemPurchaseDetailed/create.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemPurchaseDetailed/create.gsp	(revision 441)
+++ trunk/grails-app/views/inventoryItemPurchaseDetailed/create.gsp	(revision 441)
@@ -0,0 +1,93 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Create InventoryItemPurchase</title>
+    </head>
+    <body>
+        <div class="nav">
+            <h1>Order Inventory</h1>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:hasErrors bean="${inventoryItemPurchaseInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${inventoryItemPurchaseInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form action="save" method="post" >
+                <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance?.inventoryItem?.id}" />
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="inventoryItem">Inventory Item:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    <g:link controller="inventoryItemDetailed"
+                                                    action="show"
+                                                    id="${inventoryItemPurchaseInstance.inventoryItem.id}">
+                                        ${inventoryItemPurchaseInstance.inventoryItem.encodeAsHTML()}
+                                    </g:link>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="purchaseOrderNumber">Purchase Order #:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'purchaseOrderNumber','errors')}">
+                                    <input type="text" maxlength="50" id="purchaseOrderNumber" name="purchaseOrderNumber" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'purchaseOrderNumber')}"/>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'costCode','errors')}">
+                                    <g:select optionKey="id"
+                                                        from="${ CostCode.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
+                                                        name="costCode.id"
+                                                        value="${inventoryItemPurchaseInstance?.costCode?.id}"
+                                                        noSelection="['null':'']"></g:select>
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="quantity">Quantity:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'quantity','errors')}">
+                                    <input type="text" id="quantity" name="quantity" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'quantity')}" />
+                                    ${inventoryItemPurchaseInstance.inventoryItem.unitOfMeasure.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="orderValue">Purchase Order $:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    <input  class="medium ${hasErrors(bean:inventoryItemPurchaseInstance,field:'orderValueAmount','errors')}"
+                                                    type="text" id="orderValueAmount" name="orderValueAmount"
+                                                    value="${inventoryItemPurchaseInstance.orderValueAmount}" />
+                                    <g:currencySelect name="orderValueCurrency"
+                                                                        value="${inventoryItemPurchaseInstance.orderValueCurrency}" />
+                                </td>
+                            </tr> 
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><input class="save" type="submit" value="Create" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/inventoryItemPurchaseDetailed/edit.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemPurchaseDetailed/edit.gsp	(revision 441)
+++ trunk/grails-app/views/inventoryItemPurchaseDetailed/edit.gsp	(revision 441)
@@ -0,0 +1,131 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Edit InventoryItemPurchase</title>
+    </head>
+    <body>
+        <div class="nav">
+            <h1>Edit InventoryItemPurchase</h1>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:hasErrors bean="${inventoryItemPurchaseInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${inventoryItemPurchaseInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form method="post" >
+                <input type="hidden" name="id" value="${inventoryItemPurchaseInstance?.id}" />
+                <input type="hidden" name="version" value="${inventoryItemPurchaseInstance?.version}" />
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                    
+                            <tr class="prop">
+                                <td valign="top" class="name">Inventory Item:</td>
+                                
+                                <td valign="top" class="value"><g:link controller="inventoryItemDetailed" action="show" id="${inventoryItemPurchaseInstance?.inventoryItem?.id}">${inventoryItemPurchaseInstance?.inventoryItem?.encodeAsHTML()}</g:link></td>
+                                
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">Inventory Item Purchase Type:</td>
+                                
+                                <td valign="top" class="value">${inventoryItemPurchaseInstance?.inventoryItemPurchaseType?.encodeAsHTML()}</td>
+                                
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">Purchase Order Number:</td>
+                                
+                                <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'purchaseOrderNumber')}</td>
+                                
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'costCode','errors')}">
+                                    <g:select optionKey="id"
+                                                        from="${ CostCode.findAllByIsActive(true).sort { p1, p2 -> p1.name.compareToIgnoreCase(p2.name) } }"
+                                                        name="costCode.id"
+                                                        value="${inventoryItemPurchaseInstance?.costCode?.id}" ></g:select>
+                                </td>
+                            </tr>
+                    
+                            <tr class="prop">
+                                <td valign="top" class="name">Quantity:</td>
+                                
+                                <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'quantity')}</td>
+                                
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="orderValueAmount">Order Value:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'orderValueAmount','errors')}">
+                                    <input type="text" id="orderValueAmount" name="orderValueAmount" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'orderValueAmount')}" />
+                                    <g:currencySelect name="orderValueCurrency" value="${inventoryItemPurchaseInstance?.orderValueCurrency}" ></g:currencySelect>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="invoiceNumber">Invoice Number:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'invoiceNumber','errors')}">
+                                    <input type="text" maxlength="50" id="invoiceNumber" name="invoiceNumber" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'invoiceNumber')}"/>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="receivedComplete">Received Complete:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    ${inventoryItemPurchaseInstance?.receivedComplete}
+                                </td>
+                            </tr>
+                            
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="invoicePaymentApproved">Invoice Payment Approved:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    ${inventoryItemPurchaseInstance?.invoicePaymentApproved}
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">Date Entered:</td>
+                                
+                                <td valign="top" class="value">
+                                    <g:formatDate date="${inventoryItemPurchaseInstance?.dateEntered}" format="EEE, dd-MMM-yyyy @ HH:mm"/>
+                                </td>
+                                
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">Entered By:</td>
+                                
+                                <td valign="top" class="value"><g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.enteredBy?.id}">${inventoryItemPurchaseInstance?.enteredBy?.encodeAsHTML()}</g:link></td>
+                                
+                            </tr>
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><g:actionSubmit class="save" value="Update" /></span>
+                    <span class="button"><g:actionSubmit class="cancel" value="Cancel" action="Show"/></span>
+                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/inventoryItemPurchaseDetailed/receive.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemPurchaseDetailed/receive.gsp	(revision 441)
+++ trunk/grails-app/views/inventoryItemPurchaseDetailed/receive.gsp	(revision 441)
@@ -0,0 +1,90 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Receive InventoryItemPurchase</title>
+    </head>
+    <body>
+        <div class="nav">
+            <h1>Receive Inventory</h1>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <g:hasErrors bean="${inventoryItemPurchaseInstance}">
+            <div class="errors">
+                <g:renderErrors bean="${inventoryItemPurchaseInstance}" as="list" />
+            </div>
+            </g:hasErrors>
+            <g:form action="receiveSave" method="post" >
+                <g:hiddenField name="inventoryItem.id" value="${inventoryItemPurchaseInstance.inventoryItem?.id}" />
+                <g:hiddenField name="orderId" value="${orderId}" />
+                <div class="dialog">
+                    <table>
+                        <tbody>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="inventoryItem">Inventory Item:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    <g:link controller="inventoryItemDetailed"
+                                                    action="show"
+                                                    id="${inventoryItemPurchaseInstance.inventoryItem.id}">
+                                        ${inventoryItemPurchaseInstance.inventoryItem.encodeAsHTML()}
+                                    </g:link>
+                                </td>
+                            </tr>
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="purchaseOrderNumber">Purchase Order #:</label>
+                                </td>
+                                <td valign="top" class="value">
+                                    ${inventoryItemPurchaseInstance.purchaseOrderNumber.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="costCode">Cost Code:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'costCode','errors')}">
+                                    ${inventoryItemPurchaseInstance.costCode.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="quantity">Quantity:</label>
+                                </td>
+                                <td valign="top" class="value ${hasErrors(bean:inventoryItemPurchaseInstance,field:'quantity','errors')}">
+                                    <input type="text" id="quantity" name="quantity" value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'quantity')}" />
+                                    ${inventoryItemPurchaseInstance.inventoryItem.unitOfMeasure.encodeAsHTML()}
+                                </td>
+                            </tr> 
+                        
+                            <tr class="prop">
+                                <td valign="top" class="name">
+                                    <label for="orderValueAmount">Purchase Order $:</label>
+                                </td>
+                                <td valign="top">
+                                    <input  class="medium ${hasErrors(bean:inventoryItemPurchaseInstance,field:'orderValueAmount','errors')}"
+                                                    type="text" id="orderValueAmount" name="orderValueAmount"
+                                                    value="${fieldValue(bean:inventoryItemPurchaseInstance,field:'orderValueAmount')}" />
+                                    ${inventoryItemPurchaseInstance.orderValueCurrency?.encodeAsHTML()}
+                                </td>
+                            </tr>
+                            </tr> 
+                        
+                        </tbody>
+                    </table>
+                </div>
+                <div class="buttons">
+                    <span class="button"><input class="save" type="submit" value="Create" /></span>
+                </div>
+            </g:form>
+        </div>
+    </body>
+</html>
Index: trunk/grails-app/views/inventoryItemPurchaseDetailed/show.gsp
===================================================================
--- trunk/grails-app/views/inventoryItemPurchaseDetailed/show.gsp	(revision 441)
+++ trunk/grails-app/views/inventoryItemPurchaseDetailed/show.gsp	(revision 441)
@@ -0,0 +1,117 @@
+
+
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+        <meta name="layout" content="main" />
+        <title>Show InventoryItemPurchase</title>
+    </head>
+    <body>
+        <div class="nav">
+            <h1>Show InventoryItemPurchase</h1>
+        </div>
+        <div class="body">
+            <g:render template="/shared/messages" />
+            <div class="dialog">
+                <table>
+                    <tbody>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Inventory Item:</td>
+                            
+                            <td valign="top" class="value"><g:link controller="inventoryItemDetailed" action="show" id="${inventoryItemPurchaseInstance?.inventoryItem?.id}">${inventoryItemPurchaseInstance?.inventoryItem?.encodeAsHTML()}</g:link></td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Inventory Item Purchase Type:</td>
+                            
+                            <td valign="top" class="value">${inventoryItemPurchaseInstance?.inventoryItemPurchaseType?.encodeAsHTML()}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Purchase Order Number:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'purchaseOrderNumber')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Cost Code:</td>
+                            
+                            <td valign="top" class="value"><g:link controller="costCodeDetailed" action="show" id="${inventoryItemPurchaseInstance?.costCode?.id}">${inventoryItemPurchaseInstance?.costCode?.encodeAsHTML()}</g:link></td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Quantity:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'quantity')}</td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Order Value:</td>
+                            
+                            <td valign="top" class="value">
+                                ${fieldValue(bean:inventoryItemPurchaseInstance, field:'orderValueAmount')}
+                                ${inventoryItemPurchaseInstance.orderValueCurrency?.encodeAsHTML()}
+                            </td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Invoice Number:</td>
+                            
+                            <td valign="top" class="value">${fieldValue(bean:inventoryItemPurchaseInstance, field:'invoiceNumber')}</td>
+                            
+                        </tr>
+                        
+                        <tr class="prop">
+                            <td valign="top" class="name">
+                                <label for="receivedComplete">Received Complete:</label>
+                            </td>
+                            <td valign="top" class="value">
+                                ${inventoryItemPurchaseInstance?.receivedComplete}
+                            </td>
+                        </tr>
+                        
+                        <tr class="prop">
+                            <td valign="top" class="name">
+                                <label for="invoicePaymentApproved">Invoice Payment Approved:</label>
+                            </td>
+                            <td valign="top" class="value">
+                                ${inventoryItemPurchaseInstance?.invoicePaymentApproved}
+                            </td>
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Date Entered:</td>
+                            
+                            <td valign="top" class="value">
+                                <g:formatDate date="${inventoryItemPurchaseInstance?.dateEntered}" format="EEE, dd-MMM-yyyy @ HH:mm"/>
+                            </td>
+                            
+                        </tr>
+                    
+                        <tr class="prop">
+                            <td valign="top" class="name">Entered By:</td>
+                            
+                            <td valign="top" class="value"><g:link controller="person" action="show" id="${inventoryItemPurchaseInstance?.enteredBy?.id}">${inventoryItemPurchaseInstance?.enteredBy?.encodeAsHTML()}</g:link></td>
+                            
+                        </tr>
+                    
+                    </tbody>
+                </table>
+            </div>
+            <div class="buttons">
+                <g:form>
+                    <input type="hidden" name="id" value="${inventoryItemPurchaseInstance?.id}" />
+                    <span class="button"><g:actionSubmit class="edit" value="Edit" /></span>
+                    <span class="button"><g:actionSubmit class="delete" onclick="return confirm('Are you sure?');" value="Delete" /></span>
+                </g:form>
+            </div>
+        </div>
+    </body>
+</html>
