Subversion Repositories SmartDukaan

Rev

Rev 32256 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
32192 tejbeer 1
       <div class="row">
2
	    	<div class="col-lg-12">
3
	    	    <table class="table table-border table-condensed table-bordered" id="invoice-purchase-validate" style="width:100%">
4
	    			<thead>
5
	    				<tr>
6
 
7
	    					<th>Po Id</th>
8
	    					<th>Item Id </th>
9
	    					<th>Item</th>
10
	    					<th>Type</th>
11
	    					<th>Qty </th>
12
	    					<th>Issue</th>
13
	    				    <th>Imeis</th>
14
 
15
 
16
	    				</tr>
17
	    			</thead>
18
	    			<tbody>
19
	    			   #if(!$invoicePurchaseModel.getWarehousePurchaseModel().isEmpty())
20
	    			   #foreach($invoicePurchase in $invoicePurchaseModel.getWarehousePurchaseModel())
21
	    			   <tr>
22
	    			   <td class="purchaseId"> $invoicePurchase.getPoId()</td>
23
	    			   <td class="itemId"> $invoicePurchase.getItemId() </td>
24
						<td> $invoicePurchase.getItemDescription() </td>
25
						#if($invoicePurchase.isSerialized())
26
						<td class="itemType">Serialized</td>
27
						#else
28
						<td class="itemType">Non Serialized</td>
29
						#end
30
						<td class="qty"> $invoicePurchase.getQty() </td>
31
						#if($invoicePurchase.getIssue())
32
						<td> $invoicePurchase.getIssue()</td> 
33
						#else
34
							<td>Validated</td> 
35
 
36
						#end
37
						#if($invoicePurchaseModel.isValidate() && $invoicePurchase.isSerialized())
38
						 <td>   <div> <input type="text" class="imeis-to-grn" placeholder=""> </div></td>
39
						#else
40
						<td> - </td>
41
						#end
42
					 </tr> 
43
 
44
				    	#end		   
45
	    			   #end
46
 
47
	    			</tbody>
48
	    		</table>
49
 
50
	    	</div>
51
	    </div>
52
 
53
	    <div class="row"> 
54
 
55
	    	#if($invoicePurchaseModel.isValidate())
56
 
57
	         <div class="col-lg-2 form-group">
58
	         	<input class="form-control btn btn-primary purchaseGrn" data-invoiceid = "$invoicePurchaseModel.getInvoiceId()"  type="button" value="Grn">	
59
			</div>
60
 
61
			#end
62
 
63
 
64
    </div>	
65
 
66
 
67
    <script>
68
    $(function () {
69
        //debugger;
70
        $("#invoice-purchase-validate > tbody > tr").each(function() {
71
 
72
 
73
		var qty = $(this).find(".qty").text();
74
 
75
		imeisToValidate = [];
76
 
77
        let imeiInputElem = $(".imeis-to-grn");
78
        imeiInputElem.tagsinput({
79
            maxTags:qty,
80
            trimValue: true,
81
            allowDuplicates: false,
82
            confirmKeys: [13, 44, 188, 32],
83
            delimiterRegex: ',',
84
            trimValue: true,
85
            tagClass: function (item) {
86
                if (item.valid == null) return 'label label-primary';
87
                if (item.valid) {
88
                    return 'label label-success';
89
                } else {
90
                    return 'label label-danger';
91
                }
92
            },
93
        });
94
 
95
 
96
		 imeiInputElem.on('beforeItemAdd', (event) => {
97
            if (event.item.indexOf(' ') > 0) {
98
                event.cancel = true;
99
                let strItem = event.item.replaceAll(' ', '');
100
                imeiInputElem.tagsinput('add', strItem);
101
            }
102
        });
103
 
104
		});
105
 
106
 
107
 
108
 
109
 
110
 
111
    });
112
 
113
</script>