Ignore:
Timestamp:
Mar 16, 2010, 12:00:04 PM (14 years ago)
Author:
gav
Message:

Add CostCode and InventoryItemPurchase domain classes with import features.
Includes some fixes to inventory imports, where manufacturer and supplier were crossed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/inventoryItemDetailed/show.gsp

    r435 r441  
    4343                    <richui:tabLabel selected="${showTab.detail}" title="Detail" />
    4444                    <richui:tabLabel selected="${showTab.movement}" title="Movement" />
     45                    <richui:tabLabel selected="${showTab.purchasing}" title="Purchasing" />
    4546                </richui:tabLabels>
    4647
     
    384385<!-- End Movement tab -->
    385386
     387<!-- Start Purchases tab -->
     388                    <richui:tabContent>
     389
     390                        <g:if test="${inventoryItemPurchases.isEmpty()}">
     391                            <br />
     392                            No Inventory Purchases.
     393                            <br />
     394                            <br />
     395
     396                            <div class="buttons">
     397                                <g:form controller="inventoryItemPurchaseDetailed">
     398                                    <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
     399                                    <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span>
     400                                </g:form>
     401                            </div>
     402
     403                        </g:if>
     404                        <g:else>
     405
     406                            <div class="list">
     407                                <table>
     408                                    <thead>
     409                                        <tr>
     410                                            <g:sortableColumn action="show" property="purchaseOrderNumber"
     411                                                                                title="Order #" params="[paginate: 'purchases']"  />
     412                                            <g:sortableColumn action="show"  property="dateEntered"
     413                                                                                title="Date" params="[paginate: 'purchases']" />
     414                                            <g:sortableColumn action="show"  property="costCode"
     415                                                                                title="Cost Code" params="[paginate: 'purchases']" />
     416                                            <g:sortableColumn action="show"  property="quantity"
     417                                                                                title="Quantity" params="[paginate: 'purchases']" />
     418                                            <g:sortableColumn action="show"  property="orderValueAmount"
     419                                                                                title="Order \$" params="[paginate: 'purchases']" />
     420                                            <g:sortableColumn action="show"  property="invoiceNumber"
     421                                                                                title="Invoice Number" params="[paginate: 'purchases']" />
     422                                            <g:sortableColumn action="show"  property="inventoryItemPurchaseType"
     423                                                                                title="Type" params="[paginate: 'purchases']" />
     424                                            <th>
     425                                                <img  src="${resource(dir:'images/skin',file:'database_go_grey.png')}" alt="Show" title="Show" />
     426                                            </th>
     427                                            <th>
     428                                                <img  src="${resource(dir:'images/skin',file:'basket_put_grey.png')}" alt="Receive" title="Receive" />
     429                                            </th>
     430                                            <th>
     431                                                <img  src="${resource(dir:'images/skin',file:'tick_grey.png')}" alt="Approve" title="Approve Payment" />
     432                                            </th>
     433                                        </tr>
     434                                    </thead>
     435                                    <tbody>
     436                                        <g:each in="${inventoryItemPurchases}" status="i" var="purchase">
     437                                            <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}"/>
     438
     439                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
     440                                                    ${fieldValue(bean:purchase, field:'purchaseOrderNumber')}
     441                                                </td>
     442                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
     443                                                    <g:formatDate date="${purchase.dateEntered}" format="EEE, dd-MMM-yyyy"/>
     444                                                </td>
     445                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
     446                                                    ${fieldValue(bean:purchase, field:'costCode')}
     447                                                </td>
     448                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
     449                                                    ${fieldValue(bean:purchase, field:'quantity')}
     450                                                </td>
     451                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
     452                                                    ${fieldValue(bean:purchase, field:'orderValueAmount')}
     453                                                    ${fieldValue(bean:purchase, field:'orderValueCurrency')}
     454                                                </td>
     455                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
     456                                                    ${fieldValue(bean:purchase, field:'invoiceNumber')}
     457                                                </td>
     458                                                <td onclick='window.location = "${request.getContextPath()}/inventoryItemPurchaseDetailed/show/${purchase.id}"'>
     459                                                    ${fieldValue(bean:purchase, field:'inventoryItemPurchaseType')}
     460                                                </td>
     461                                                <td>
     462                                                    <g:link controller="inventoryItemPurchaseDetailed" action="show" id="${purchase.id}">
     463                                                        <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" title="Show" />
     464                                                    </g:link>
     465                                                </td>
     466                                                <g:if test="${purchase.inventoryItemPurchaseType.id == 1}">
     467                                                    <g:if test="${!purchase.receivedComplete}">
     468                                                        <td>
     469                                                            <g:link controller="inventoryItemPurchaseDetailed" action="receive" id="${purchase.id}">
     470                                                                <img  src="${resource(dir:'images/skin',file:'basket_put.png')}" alt="Receive" title="Receive" />
     471                                                            </g:link>
     472                                                        </td>
     473                                                    </g:if>
     474                                                    <g:else>
     475                                                        <td>
     476                                                        </td>
     477                                                    </g:else>
     478                                                    <g:if test="${!purchase.invoicePaymentApproved}">
     479                                                        <td>
     480                                                            <g:link controller="inventoryItemPurchaseDetailed" action="approveInvoicePayment" id="${purchase.id}">
     481                                                                <img  src="${resource(dir:'images/skin',file:'tick.png')}" alt="Approve" title="Approve Payment" />
     482                                                            </g:link>
     483                                                        </td>
     484                                                    </g:if>
     485                                                    <g:else>
     486                                                        <td>
     487                                                        </td>
     488                                                    </g:else>
     489                                                </g:if>
     490                                                <g:else>
     491                                                    <td>
     492                                                    </td>
     493                                                    <td>
     494                                                    </td>
     495                                                </g:else>
     496
     497                                            </tr>
     498                                        </g:each>
     499                                    </tbody>
     500                                </table>
     501                            </div>
     502
     503                            <div class="buttons">
     504                                <g:form controller="inventoryItemPurchaseDetailed">
     505                                    <g:hiddenField name="inventoryItem.id" value="${inventoryItemInstance.id}" />
     506                                    Results: ${inventoryItemPurchases.size()} / ${inventoryItemPurchasesTotal}
     507                                    <span class="button"><g:actionSubmit action="create" class="add" value="Order" /></span>
     508                                </g:form>
     509                            </div>
     510
     511                            <div class="paginateButtons">
     512                                <g:paginate action="show"
     513                                                        id="${inventoryItemInstance?.id}"
     514                                                        total="${inventoryItemPurchasesTotal}"
     515                                                        params="[paginate: 'purchases']" />
     516                            </div>
     517
     518                        </g:else>
     519
     520                    </richui:tabContent>
     521<!-- End Movement tab -->
     522
    386523                </richui:tabContents>
    387524            </richui:tabView>
    388 
    389525
    390526        </div>
Note: See TracChangeset for help on using the changeset viewer.