Subversion Repositories SmartDukaan

Rev

Rev 4687 | Rev 6827 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>
            Inventory Management::Create Purchase Order
        </title>
        <script type="text/javascript" src="/inventory/js/jquery-1.4.2.js"></script>
        <script type="text/javascript" src="/inventory/js/purchase-order-common.js"></script>
        <script type="text/javascript" src="/inventory/js/purchase-order-events.js"></script>
        <link rel="stylesheet" href="/inventory/css/common.css" type="text/css" />
    </head>
    <body>
        <a href="/inventory">Go to Home page</a>
        <br />                
        <div class="error">
            #set($messages = $action.getActionErrors())
            #if($messages && $messages.size() != 0)
                <label >Please fix below errors first to see accurate requirements</label> <br/>
                #foreach($message in $messages)
                    $message <br/>
                #end
            #end
            <br />
        </div>
        <table id="suppliers">
            <thead >
                <tr >
                    <th >Supplier</th>
                    <th >Quantity</th>
                    <th >COD/Prepaid</th>
                    <th >Amount</th>
                    <th ></th>
                </tr>
            </thead>
            <tbody >
                #foreach($supplier in $action.getSuppliers().values())
                <tr >
                    <td >$supplier.getName()</td>
                    <td id="total-quantity-$supplier.getId()">$action.getQuantityString($supplier.getId())</td>
                    <td >$action.getCODPrepaidString($supplier.getId())</td>
                    <td id="total-amount-$supplier.getId()" supplierId="$supplier.getId()">$action.getAmount($supplier.getId())</td>
                    <td ><a class="show-details" supplierId="$supplier.getId()" href="#">Show details</a></td>
                </tr>
                #end
            </tbody>
        </table>
        #foreach($supplierId in $action.getSuppliers().keySet())
            <div id="lineitems-$supplierId" class="lineitems hidden" supplierId="$supplierId">
                <br />
                <form class="create-purchase-order">
                <table class="lineitems">
                    <thead >
                        <tr >
                            <th >Item Id</th>
                            <th >Product Name</th>
                            <th >Quantity</th>
                            <th >COD/Prepaid</th>
                            <th >Transfer price</th>
                            <th >Total amount</th>
                            <th ></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr id="sample-lineitem" class="hidden">
                            <td><input type="text" class="required digits" name="itemId" supplierId="$supplierId" disabled /></td>
                            <td><div id="modelName"></div></td>
                            <td ><input type="text" class="required digits" name="quantity" disabled /> </td>
                            <td >0/0</td>
                            <td id="transferPrice"><input type="text" class="required number" name="unitPrice" disabled readonly /> </td>
                            <td ><div id="amount">0</div></td>
                            <td ><a id="remove-lineitem" href="#">remove</a></td>
                        </tr>
                        #foreach($lineItem in $action.getLineItemsBySupplier().get($supplierId))
                            <tr >
                                <td><input type="text" class="required digits" name="itemId" value="$lineItem.getItemId()" /></td>
                                <td><div id="modelName">$action.getName($lineItem)</div></td>
                                #set($prepaidCount = $lineItem.getQuantity() - $lineItem.getCodCount())
                                <td ><input type="text" class="required digits" name="quantity" value="$lineItem.getQuantity()" /> </td>
                                <td >$lineItem.getCodCount()/$prepaidCount</td>
                                <td id="transferPrice"><input type="text" class="required number" name="unitPrice" value="$lineItem.getUnitPrice()" readonly /> </td>
                                #set($amount = $lineItem.getQuantity() * $lineItem.getUnitPrice())
                                <td ><div id="amount">$amount</div></td>
                                <td ><a id="remove-lineitem" href="#">remove</a></td>
                            </tr>
                        #end
                    </tbody>
                </table>
                <div >
                    <input id="add-lineitem" type="button" value="Add New Item"/> <br /> <br />
                    <input type="hidden" name="supplierId" value="$supplierId"/>
                    <input type="submit" value="Create Purchase Order"/>
                    <input id="cancel" type="button" value="Cancel"/>
                </div>
                </form>
            </div>
        #end
    </body>
</html>