Subversion Repositories SmartDukaan

Rev

Rev 6821 | 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>
        #foreach($supplier in $action.getSuppliers())
            <div id="supplier-$supplier.getId()">
                <input supplierId="$supplier.getId()" type="button" value="Create PO with $supplier.getName()"/>
                <input readonly value="0" type="text" name="total_amount"/>
                <br />
                <table>
                    <thead >
                        <tr >
                            <th >Item Id</th>
                            <th >Product Name</th>
                            <th >Quantity (COD/Prepaid)</th>
                            <th >Unit price</th>
                            <th >Total amount</th>
                            <th ></th>
                        </tr>
                    </thead>
                    <tbody >
                        <tr id="sample-lineitem">
                            <td><input type="text" class="required digits" name="item_id" disabled /></td>
                            <td><div id="model_name"></div></td>
                            <td ><input type="text" class="required digits" name="quantity" disabled /> </td>
                            <td ><input type="text" class="required number" name="unit_price" disabled /> </td>
                            <td ><div id="amount">0</div></td>
                            <td ><a id="remove-lineitem" href="#">remove</a></td>
                        </tr>
                        #foreach($lineitem in $action.getLineItemsBySupplier().get($supplier.getId()))
                            <tr >
                                <td><input type="text" class="required digits" name="item_id" value="$lineitem.getItemId()" /></td>
                                <td><div id="model_name">$action.getName($lineitem)</div></td>
                                #set($prepaidCount = $lineitem.getQuantity() - $lineitem.getCodCount())
                                <td ><input type="text" class="required digits" name="quantity" value="$lineitem.getQuantity() ($lienitem.getCodCount()/$prepaidCount)" /> </td>
                                <td ><input type="text" class="required number" name="unit_price" value="$lineitem.getUnitPrice()" /> </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="submit" value="Create Purchase Order"/>
                    <input id="cancel" type="button" value="Cancel"/>                    
                </div>
            </div>
        #end
    </body>
</html>