<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Inventory Movement List</title>
        <nav:resources override="true"/>
    </head>
    <body>
        <div class="nav">
            <h1>List Inventory Movements</h1>
        </div>
        <div class="body">
             <g:link controller="inventoryItemDetailed" action="show" id="${inventoryItemInstance.id}">
                <h1>Inventory Item: ${inventoryItemInstance.name.encodeAsHTML()}.</h1>
            </g:link>
            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>

            <div class="paginateButtons">
                Results:${inventoryMovementListTotal}
            </div>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                   	        <g:sortableColumn action="listInventoryMovements" property="quantity" title="Quantity" />
                        
                   	        <g:sortableColumn action="listInventoryMovements"  property="inventoryMovementType" title="Movement Type" />
                        
                            <g:sortableColumn action="listInventoryMovements"  property="date" title="Date" />
                        
                   	        <g:sortableColumn action="listInventoryMovements"  property="person" title="Person" />

                            <th></th>
                   	    
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${inventoryMovementList}" status="i" var="inventoryMovementInstance">
                    <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}" onclick='window.location = "${request.getContextPath()}/inventoryMovementDetailed/show/${inventoryMovementInstance.id}"'/>

                            <td>${fieldValue(bean:inventoryMovementInstance, field:'quantity')}</td>
                        
                            <td>${fieldValue(bean:inventoryMovementInstance, field:'inventoryMovementType')}</td>
                        
                            <td><g:formatDate date="${inventoryMovementInstance.date}" format="EEE, dd-MMM-yyyy"/></td>
                        
                            <td>${fieldValue(bean:inventoryMovementInstance, field:'person')}</td>

                            <td>
                                <g:link action="show" id="${inventoryMovementInstance.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 action="listInventoryMovements" id="${inventoryItemInstance?.id}" total="${inventoryMovementListTotal}" />
            </div>
        </div>
    </body>
</html>
