Subversion Repositories SmartDukaan

Rev

Rev 25120 | 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>
                        Warehouse Management::Purchase Order $action.getPurchaseOrder().getId()
                </title>
        <script type="text/javascript" src="/inventory/js/jquery-1.4.2.js"></script>
                <link rel="stylesheet" href="/inventory/css/colorbox.css" type="text/css" />
                <script type="text/javascript" src="/inventory/js/jquery.colorbox-min.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 />        
                <h2>Start a Purchase</h2>
                #set($purchases = $action.getPurchases())
                #if($purchases)
                <p>Previous Purchases for PO $action.getPurchaseOrder().getPoNumber()</p>
                        #foreach($purchase in $purchases)
        <ul>
            <li><span>Purchase no. $purchase.getId()</span>&nbsp;&nbsp;&nbsp;<span>Purchase Comments: #if($purchase.getPurchaseComments()) $purchase.getPurchaseComments() #else NA #end</span></li>
                </ul>
                        #end
                #end
                
                #if($action.getPurchaseOrder().getStatus().getValue()==1 || $action.getPurchaseOrder().getStatus().getValue()==2)
                  <a href="/inventory/purchase/new/?poId=$action.getPurchaseOrder().getId()">Start a new Purchase</a>
                #end
                <br>
                <a href="/inventory/check-grn-imei">Check IMEI Status</a>
                <br />
                <a class = "link-requiring-itemid-for-productlabel" href="/inventory/purchase-order!generateProductLabel">Generate Product Label</a>
                 <br>
        <div >
            <br />
            <div class="error">#set($messages = $action.getActionErrors())
                    #if($messages && $messages.size() != 0)
                        #foreach($message in $messages)
                            $message <br/>
                        #end
                    #end
            </div>
                        #if($action.isPermitted("po:closedAmend") && $action.canPurchaseOrderBeOpened($action.getPurchaseOrder().getId()))
                                <input type = "button" id = "open-po-button" poId = "$action.getPurchaseOrder().getId()" value = "Open Purchase-Order"/>
                        #end
                        <br/>
          
            <table class="bordered" border="1">
                <thead >
                    <tr class="bordered">
                        <th >Item Id</th>
                        <th >Product Name</th>
                                                <th >MRP</th>
                                                <th >Invoice Price</th>
                        <th >Quantity ordered</th>
                        <th >Unfulfilled Quantity</th>
                                                <!--
                                                <th >Scanned Quantity</th> 
                                                <th >Item Weight</th>
                                                <th >Inventory Adjust</th> 
                        <th >Set Weight</th> -->
                    </tr>
                </thead>
                <tbody >
                    #foreach($lineitem in $action.getPurchaseOrder().getLineitems())
                        <tr class="bordered">
                            <td id="itemId">$lineitem.getItemId()</td>
                            <td >$action.getName($lineitem)</td>
                                                        <td >$lineitem.getMrp()</td>
                                                        #if($lineitem.getQuantity() > $lineitem.getUnfulfilledQuantity() && $lineitem.getInvoicePrice() > 0 )
                                                                <td><input data-id="$lineitem.getItemId()" type="number" value="$lineitem.getInvoicePrice()" readonly></td>
                                                        #else
                                                                <td><input data-id="$lineitem.getItemId()" type="number" value="$lineitem.getInvoicePrice()"></td>
                                                        #end
                            <td >$lineitem.getQuantity()</td>
                            <td >$lineitem.getUnfulfilledQuantity()</td>
                        </tr>
                    #end
                </tbody>
            </table>
            <input type="hidden" id="poId" value="$action.getPurchaseOrder().getId()"/>
        </div>
    </body>
    <script type="text/javascript">
        $("td input:not([readonly])").change(function(){
                if(!isNaN($(this).val()) && $(this).val() > 0){
                        updateModelNameInvoicePrice(this, $(this).attr('data-id'), $(this).val(), $action.getPurchaseOrder().getId());
                } 
        });
    </script>
</html>