Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
32349 amit.gupta 1
<script type="text/javascript">
2
    $(function () {
3
        getVendorAheadOptions($("#typeaheadVendor"), function (selectedVendor) {
4
            $('#vendorId').val(selectedVendor.id + "");
5
        });
32192 tejbeer 6
 
33455 ranu 7
        // Set the max date for the actualDate input to today
8
        var today = new Date().toISOString().split('T')[0];
9
        $('#actualDate').attr('max', today);
32349 amit.gupta 10
    });
11
 
12
    $(document).ready(function () {
13
        var dtable = $('#open-invoices').DataTable({});
14
    });
32192 tejbeer 15
</script>
16
 
32349 amit.gupta 17
<section class="wrapper">
18
    <div class="row">
19
        <div class="col-lg-12">
20
            <h3 class="page-header"><i class="icon_document_alt"></i>Receive New Invoice</h3>
21
            <ol class="breadcrumb">
22
                <li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
23
                <li><i class="icon_document_alt"></i>Receive New Invoice</li>
24
            </ol>
25
        </div>
26
    </div>
27
    <div class="row">
28
 
29
 
30
        <div id="filter-details" style="background:white;background-color:white;padding:10px;">
31
            <div class="row">
32
 
33
                <div class="col-lg-2 form-group">
34
                    <label>Actual Invoice Date</label>
35
                    <input type="date" class="form-control" id="actualDate" autocomplete="off"
36
                           placeholder="Actual Date"/>
37
                </div>
38
 
39
                <div class="col-lg-2 form-group">
40
                    <label>Vendor</label>
41
 
42
                    <input placeholder="Enter Vendor Name" type="text" class="typeahead form-control"
43
                           id="typeaheadVendor" name="Item" data-provide="typeahead" value="" autocomplete="off">
44
                    <input id="vendorId" type="hidden"/>
45
                </div>
46
 
47
 
48
                <div class="col-lg-2 form-group">
49
                    <label>Invoice Number</label>
50
 
51
                    <input type="text" class="form-control" id="invoiceNumber" autocomplete="off"
52
                           placeholder="Invoice Number"/>
53
                </div>
54
 
55
                <div class="col-lg-2 form-group">
56
                    <label>Warehouse</label>
57
 
58
                    <select class="form-control input-sm" id="warehouseMap" name="warehouseMap" placeholder="Warehouse">
59
                        <option value="" disabled selected>Warehouse</option>
60
                        #foreach($wm in $warehouseMap.entrySet()))
61
                            <option value="$wm.getKey()">$wm.getValue()</option>
62
                        #end
63
                    </select>
64
 
65
                </div>
66
 
67
                <div class="col-lg-2 form-group">
68
                    <label>Number of items</label>
69
                    <input type="number" class="form-control" id="numberofItems" autocomplete="off"
70
                           placeholder="Number of Items"/>
71
                </div>
72
 
73
            </div>
74
 
75
            <div class="row">
76
 
77
 
78
                <div class="col-lg-2 form-group">
79
                    <label>Total Value</label>
80
                    <input type="number" class="form-control" id="totalValue" autocomplete="off"
81
                           placeholder="Total Value"/>
82
                </div>
83
 
84
 
85
                <div class="col-lg-2 form-group">
86
                    <label>Invoice</label>
87
 
32603 raveendra. 88
                    <input type="hidden" id="invoicehidden" value=""/>
32349 amit.gupta 89
                    <input type="file" id="invoice" placeholder="invoice" name="invoice"
90
                           value="">
91
 
92
                </div>
93
 
94
                <div class="col-lg-2 form-group">
95
                    <label>Action</label>
96
 
97
                    <input class="form-control btn btn-primary createReceiveInvoice" type="button" value="Receive">
98
                </div>
99
 
100
 
101
            </div>
102
        </div>
103
    </div>
104
 
105
 
106
    <div class="row">
107
 
108
        <div class="col-lg-12">
109
            <table id="open-invoices" class="table table-striped table-advance table-hover">
110
                <thead>
32192 tejbeer 111
                <tr>
32912 amit.gupta 112
                    <th>Invoice Id</th>
32349 amit.gupta 113
                    <th>Supplier</th>
114
                    <th>Invoice Number</th>
32912 amit.gupta 115
                    <th>Invoice Date</th>
32349 amit.gupta 116
                    <th>Num Items</th>
117
                    <th>Total Value</th>
32912 amit.gupta 118
                    <th>Warehouse</th>
119
                    <th>Rcv. Date</th>
120
                    <th>Rcv. By</th>
121
                    <th>Req Status</th>
122
                    <th>Actions</th>
32192 tejbeer 123
                </tr>
32349 amit.gupta 124
                </thead>
32192 tejbeer 125
 
32349 amit.gupta 126
                <tbody>
127
 
128
 
129
                    #foreach($supplierInvoice in $supplierInvoices)
32912 amit.gupta 130
                    <tr id="$supplierInvoice.getId()">
131
                        <td>$supplierInvoice.getId()</td>
32349 amit.gupta 132
                        <td>$supplierMap.get($supplierInvoice.getSupplierId()).getName()</td>
133
                        <td>
134
                            <a onclick="getInvoiceItems($supplierInvoice.getId())">$supplierInvoice.getInvoiceNumber() </a>
135
                        </td>
32912 amit.gupta 136
                        <td>$supplierInvoice.getInvoiceDate().format($dateTimeFormatter)</td>
32349 amit.gupta 137
                        <td>$supplierInvoice.getNumItems()</td>
138
                        <td>$supplierInvoice.getTotalValue()</td>
32912 amit.gupta 139
                        <td>$warehouseMap.get($supplierInvoice.getWarehouseId()) </td>
140
                        <td>$supplierInvoice.getCreateDate().format($dateTimeFormatter)</td>
32349 amit.gupta 141
                        <td>$supplierInvoice.getReceivedFrom()</td>
142
                        #if($grnRequestMap.get($supplierInvoice.getId()))
143
                            <td>$grnRequestMap.get($supplierInvoice.getId()).getStatus() </td>
144
                        #else
145
                            <td> -</td>
146
                        #end
147
                        <td>
148
                            <a href="${rc.contextPath}/download-attachment?documentId=$supplierInvoice.getInvoiceDocId()"
32912 amit.gupta 149
                               class="download">Download</a><br>
150
                            #if($isL2)
151
                                <a onclick="removeInvoice($supplierInvoice.getId())" href="javascript:void(0)">Remove Invoice</a><br>
152
                                #if($grnRequestMap.get($supplierInvoice.getId()))
153
                                    <a onclick="removeGrnRequest($supplierInvoice.getId())" href="javascript:void(0)">
154
                                        Remove Request
155
                                    </a>
156
                                #end
157
                            #end
32349 amit.gupta 158
                        </td>
159
 
160
                    </tr>
161
                    #end
162
 
163
                </tbody>
164
            </table>
165
        </div>
166
    </div>
167
    <div class="row">
168
        <p></p>
169
        <div class="col-lg-12">
170
            <div class="invoiceadditemcontainer">
171
 
172
            </div>
173
        </div>
174
 
175
    </div>
176
 
177
 
32192 tejbeer 178
</section>