Subversion Repositories SmartDukaan

Rev

Rev 32912 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<script type="text/javascript">
    $(function () {
        getVendorAheadOptions($("#typeaheadVendor"), function (selectedVendor) {
            $('#vendorId').val(selectedVendor.id + "");
        });

        // Set the max date for the actualDate input to today
        var today = new Date().toISOString().split('T')[0];
        $('#actualDate').attr('max', today);
    });

    $(document).ready(function () {
        var dtable = $('#open-invoices').DataTable({});
    });
</script>

<section class="wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header"><i class="icon_document_alt"></i>Receive New Invoice</h3>
            <ol class="breadcrumb">
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
                <li><i class="icon_document_alt"></i>Receive New Invoice</li>
            </ol>
        </div>
    </div>
    <div class="row">


        <div id="filter-details" style="background:white;background-color:white;padding:10px;">
            <div class="row">

                <div class="col-lg-2 form-group">
                    <label>Actual Invoice Date</label>
                    <input type="date" class="form-control" id="actualDate" autocomplete="off"
                           placeholder="Actual Date"/>
                </div>

                <div class="col-lg-2 form-group">
                    <label>Vendor</label>

                    <input placeholder="Enter Vendor Name" type="text" class="typeahead form-control"
                           id="typeaheadVendor" name="Item" data-provide="typeahead" value="" autocomplete="off">
                    <input id="vendorId" type="hidden"/>
                </div>


                <div class="col-lg-2 form-group">
                    <label>Invoice Number</label>

                    <input type="text" class="form-control" id="invoiceNumber" autocomplete="off"
                           placeholder="Invoice Number"/>
                </div>

                <div class="col-lg-2 form-group">
                    <label>Warehouse</label>

                    <select class="form-control input-sm" id="warehouseMap" name="warehouseMap" placeholder="Warehouse">
                        <option value="" disabled selected>Warehouse</option>
                        #foreach($wm in $warehouseMap.entrySet()))
                            <option value="$wm.getKey()">$wm.getValue()</option>
                        #end
                    </select>

                </div>

                <div class="col-lg-2 form-group">
                    <label>Number of items</label>
                    <input type="number" class="form-control" id="numberofItems" autocomplete="off"
                           placeholder="Number of Items"/>
                </div>

            </div>

            <div class="row">


                <div class="col-lg-2 form-group">
                    <label>Total Value</label>
                    <input type="number" class="form-control" id="totalValue" autocomplete="off"
                           placeholder="Total Value"/>
                </div>


                <div class="col-lg-2 form-group">
                    <label>Invoice</label>

                    <input type="hidden" id="invoicehidden" value=""/>
                    <input type="file" id="invoice" placeholder="invoice" name="invoice"
                           value="">

                </div>

                <div class="col-lg-2 form-group">
                    <label>Action</label>

                    <input class="form-control btn btn-primary createReceiveInvoice" type="button" value="Receive">
                </div>


            </div>
        </div>
    </div>


    <div class="row">

        <div class="col-lg-12">
            <table id="open-invoices" class="table table-striped table-advance table-hover">
                <thead>
                <tr>
                    <th>Invoice Id</th>
                    <th>Supplier</th>
                    <th>Invoice Number</th>
                    <th>Invoice Date</th>
                    <th>Num Items</th>
                    <th>Total Value</th>
                    <th>Warehouse</th>
                    <th>Rcv. Date</th>
                    <th>Rcv. By</th>
                    <th>Req Status</th>
                    <th>Actions</th>
                </tr>
                </thead>

                <tbody>


                    #foreach($supplierInvoice in $supplierInvoices)
                    <tr id="$supplierInvoice.getId()">
                        <td>$supplierInvoice.getId()</td>
                        <td>$supplierMap.get($supplierInvoice.getSupplierId()).getName()</td>
                        <td>
                            <a onclick="getInvoiceItems($supplierInvoice.getId())">$supplierInvoice.getInvoiceNumber() </a>
                        </td>
                        <td>$supplierInvoice.getInvoiceDate().format($dateTimeFormatter)</td>
                        <td>$supplierInvoice.getNumItems()</td>
                        <td>$supplierInvoice.getTotalValue()</td>
                        <td>$warehouseMap.get($supplierInvoice.getWarehouseId()) </td>
                        <td>$supplierInvoice.getCreateDate().format($dateTimeFormatter)</td>
                        <td>$supplierInvoice.getReceivedFrom()</td>
                        #if($grnRequestMap.get($supplierInvoice.getId()))
                            <td>$grnRequestMap.get($supplierInvoice.getId()).getStatus() </td>
                        #else
                            <td> -</td>
                        #end
                        <td>
                            <a href="${rc.contextPath}/download-attachment?documentId=$supplierInvoice.getInvoiceDocId()"
                               class="download">Download</a><br>
                            #if($isL2)
                                <a onclick="removeInvoice($supplierInvoice.getId())" href="javascript:void(0)">Remove Invoice</a><br>
                                #if($grnRequestMap.get($supplierInvoice.getId()))
                                    <a onclick="removeGrnRequest($supplierInvoice.getId())" href="javascript:void(0)">
                                        Remove Request
                                    </a>
                                #end
                            #end
                        </td>

                    </tr>
                    #end

                </tbody>
            </table>
        </div>
    </div>
    <div class="row">
        <p></p>
        <div class="col-lg-12">
            <div class="invoiceadditemcontainer">

            </div>
        </div>

    </div>


</section>