Subversion Repositories SmartDukaan

Rev

Rev 32311 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32311 Rev 32349
Line 1... Line 1...
1
       <div class="row">
1
<div class="row">
2
	    	<div class="col-lg-12">
2
    <div class="col-lg-12">
3
	    	    <table class="table table-border table-condensed table-bordered" id="invoice-purchase-validate" style="width:100%">
3
        <table class="table table-border table-condensed table-bordered" id="invoice-purchase-validate"
4
	    			<thead>
4
               style="width:100%">
5
	    				<tr>
5
            <thead>
6
	    				
6
            <tr>
7
	    					<th>Po Id</th>
7
 
8
	    					<th>Item Id </th>
8
                <th>Po Id</th>
9
	    					<th>Item</th>
9
                <th>Item Id</th>
10
	    					<th>Type</th>
10
                <th>Item</th>
11
	    					<th>Qty </th>
11
                <th>Type</th>
12
	    					<th>Excess Qty </th>
12
                <th>Qty</th>
13
	    					<th>Price Mismatch</th>
13
                <th>Excess Qty</th>
14
	    					<th>Issues</th>
14
                <th>Price Mismatch</th>
15
	    				    <th>Imeis</th>
15
                <th>Issues</th>
16
	    				    <th>Return Imeis</th>
16
                <th>Imeis</th>
17
	    								
17
                <th>Return Imeis</th>
18
	    								
18
 
19
	    				</tr>
19
 
20
	    			</thead>
20
            </tr>
21
	    			<tbody>
21
            </thead>
22
	    			   #if(!$invoicePurchaseModel.getWarehousePurchaseModel().isEmpty())
22
            <tbody>
23
	    			   #foreach($invoicePurchase in $invoicePurchaseModel.getWarehousePurchaseModel())
23
                #if(!$invoicePurchaseModel.getWarehousePurchaseModel().isEmpty())
24
	    			   <tr>
24
                    #foreach($invoicePurchase in $invoicePurchaseModel.getWarehousePurchaseModel())
25
	    			   <td class="purchaseId"> $invoicePurchase.getPoId()</td>
25
                    <tr>
26
	    			   <td class="itemId"> $invoicePurchase.getItemId() </td>
26
                        <td class="purchaseId"> $invoicePurchase.getPoId()</td>
27
						<td> $invoicePurchase.getItemDescription() </td>
27
                        <td class="itemId"> $invoicePurchase.getItemId() </td>
28
						#if($invoicePurchase.isSerialized())
28
                        <td> $invoicePurchase.getItemDescription() </td>
29
						<td class="itemType">Serialized</td>
29
                        #if($invoicePurchase.isSerialized())
30
						#else
30
                            <td class="itemType">Serialized</td>
31
						<td class="itemType">Non Serialized</td>
31
                        #else
32
						#end
32
                            <td class="itemType">Non Serialized</td>
33
						<td class="qty"> $invoicePurchase.getQty() </td>
33
                        #end
34
						
34
                        <td class="qty"> $invoicePurchase.getQty() </td>
35
					   <td class="excessQty"> $invoicePurchase.getExcessQty() </td>
35
 
36
					   #if($invoicePurchase.getMismatch())
36
                        <td class="excessQty"> $invoicePurchase.getExcessQty() </td>
37
					   <td class="priceMismatch"> $invoicePurchase.getMismatch()</td>
37
                        #if($invoicePurchase.getMismatch())
38
					   #else
38
                            <td class="priceMismatch"> $invoicePurchase.getMismatch()</td>
39
					   
39
                        #else
40
					    <td>-</td>
40
 
41
					
41
                            <td>-</td>
42
					   #end
42
 
43
						#if(!$invoicePurchase.getIssues().isEmpty())
43
                        #end
44
						<td> $invoicePurchase.getIssues()</td> 
44
                        #if(!$invoicePurchase.getIssues().isEmpty())
45
						#else
45
                            <td> $invoicePurchase.getIssues()</td>
46
							<td>Validated</td> 
46
                        #else
47
					
47
                            <td>Validated</td>
48
						#end
48
 
49
						#if($invoicePurchaseModel.isValidate() && $invoicePurchase.isSerialized())
49
                        #end
50
						 <td width="20%"> <input type="text" class="imeis-to-grn" placeholder=""> </td>
50
                        #if($invoicePurchaseModel.isValidate() && $invoicePurchase.isSerialized())
51
						#else
51
                            <td width="20%"><input type="text" class="imeis-to-grn" placeholder=""></td>
52
						<td> - </td>
52
                        #else
53
						#end
53
                            <td> -</td>
54
						
54
                        #end
55
					    #if($invoicePurchaseModel.isValidate() && $invoicePurchase.isSerialized() && $invoicePurchase.getExcessQty() > 0)
55
 
56
						 <td width = "20%">  <input type="text" class="imeis-to-grn-return" placeholder=""> </td>
56
                        #if($invoicePurchaseModel.isValidate() && $invoicePurchase.isSerialized() && $invoicePurchase.getExcessQty() > 0)
57
						#else
57
                            <td width="20%"><input type="text" class="imeis-to-grn-return" placeholder=""></td>
58
						<td> - </td>
58
                        #else
59
						#end
59
                            <td> -</td>
60
					 </tr> 
60
                        #end
61
				    			  
61
                    </tr>
62
				    	#end		   
62
 
63
	    			   #end
63
                    #end
64
	    			   
64
                #end
65
	    			</tbody>
65
 
66
	    		</table>
66
            </tbody>
67
	    		
67
        </table>
68
	    	</div>
68
 
69
	    </div>
69
    </div>
70
	    
70
</div>
71
	    <div class="row"> 
71
 
72
	    
72
<div class="row">
73
	    #if($invoicePurchaseModel.getStatus() == "pending")
73
 
74
	    
74
    #if($invoicePurchaseModel.getStatus() == "pending")
75
	       <div class="col-lg-2 form-group">
75
 
76
	         	<input class="form-control btn btn-primary"   type="button" value="Grn">	
76
        <div class="col-lg-2 form-group">
77
			</div>
77
            <input class="form-control btn btn-primary" type="button" value="Grn">
78
	    
78
        </div>
79
	    #else
79
 
80
	    	#if($invoicePurchaseModel.isValidate())
80
    #else
81
      
81
        #if($invoicePurchaseModel.isValidate())
82
	         <div class="col-lg-2 form-group">
82
 
83
	         	<input class="form-control btn btn-primary purchaseGrn" data-invoiceid = "$invoicePurchaseModel.getInvoiceId()"  type="button" value="Grn">	
83
            <div class="col-lg-2 form-group">
84
			</div>
84
                <input class="form-control btn btn-primary purchaseGrn"
85
			
85
                       data-invoiceid="$invoicePurchaseModel.getInvoiceId()" type="button" value="Grn">
86
			
86
            </div>
87
			#else
87
 
88
			
88
 
89
			   <div class="col-lg-2 form-group">
89
        #else
90
	         	<input class="form-control btn btn-primary grnRequest" data-invoiceid = "$invoicePurchaseModel.getInvoiceId()"  type="button" value="Raise Grn Request">	
90
 
91
			</div>
91
            <div class="col-lg-2 form-group">
92
			
92
                <input class="form-control btn btn-primary grnRequest"
93
			
93
                       data-invoiceid="$invoicePurchaseModel.getInvoiceId()" type="button" value="Raise Grn Request">
94
			#end
94
            </div>
95
	
95
 
96
	 #end
96
 
97
			
97
        #end
98
			
98
 
99
    </div>	
99
    #end
100
    
100
 
101
    
101
</div>
102
    <script>
102
 
-
 
103
 
-
 
104
<script>
103
    $(function () {
105
    $(function () {
104
        //debugger;
106
        //debugger;
105
        $("#invoice-purchase-validate > tbody > tr").each(function() {
107
        $("#invoice-purchase-validate > tbody > tr").each(function () {
106
	
108
 
107
		
109
 
108
		var qty = $(this).find(".qty").text();
110
            var qty = $(this).find(".qty").text();
109
		
111
 
110
		imeisToValidate = [];
112
            imeisToValidate = [];
111
        
113
 
112
        
114
 
113
		let imeiInputElem = $(this).find(".imeis-to-grn");
115
            let imeiInputElem = $(this).find(".imeis-to-grn");
114
		     imeiInputElem.tagsinput({
116
            imeiInputElem.tagsinput({
115
            maxTags:qty,
117
                maxTags: qty,
116
            trimValue: true,
118
                trimValue: true,
117
            allowDuplicates: false,
119
                allowDuplicates: false,
118
            confirmKeys: [13, 44, 188, 32],
120
                confirmKeys: [13, 44, 188, 32],
119
            delimiterRegex: ',',
121
                delimiterRegex: /[,\s]/,
120
            trimValue: true,
-
 
121
            tagClass: function (item) {
122
                tagClass: function (item) {
122
                if (item.valid == null) return 'label label-primary';
123
                    if (item.valid == null) return 'label label-primary';
123
                if (item.valid) {
124
                    if (item.valid) {
124
                    return 'label label-success';
125
                        return 'label label-success';
125
                } else {
126
                    } else {
126
                    return 'label label-danger';
127
                        return 'label label-danger';
127
                }
128
                    }
128
            },
129
                },
129
        });
-
 
130
		
-
 
131
		
-
 
132
		 imeiInputElem.on('beforeItemAdd', (event) => {
-
 
133
            if (event.item.indexOf(' ') > 0) {
-
 
134
                event.cancel = true;
-
 
135
                let strItem = event.item.replaceAll(' ', '');
-
 
136
                imeiInputElem.tagsinput('add', strItem);
-
 
137
            }
130
            });
138
        });
131
        });
139
		
-
 
140
		});
-
 
141
        
-
 
142
   $("#invoice-purchase-validate > tbody > tr").each(function() {
-
 
143
	  
-
 
144
     var excessQty = $(this).find(".excessQty").text();
-
 
145
 
132
 
-
 
133
        $("#invoice-purchase-validate > tbody > tr").each(function () {
146
 
134
 
-
 
135
            var excessQty = $(this).find(".excessQty").text();
147
 
136
 
148
		imeisToValidate = [];
-
 
149
 
-
 
150
		let imeiInputElem = $(this).find(".imeis-to-grn-return");
-
 
151
		imeiInputElem.tagsinput({
-
 
152
			maxTags: excessQty,
-
 
153
			trimValue: true,
-
 
154
			allowDuplicates: false,
-
 
155
			confirmKeys: [13, 44, 188, 32],
-
 
156
			delimiterRegex: ',',
-
 
157
			trimValue: true,
-
 
158
			tagClass: function(item) {
-
 
159
				if (item.valid == null) return 'label label-primary';
-
 
160
				if (item.valid) {
-
 
161
					return 'label label-success';
-
 
162
				} else {
-
 
163
					return 'label label-danger';
-
 
164
				}
-
 
165
			},
-
 
166
		});
-
 
167
 
-
 
168
 
-
 
169
		imeiInputElem.on('beforeItemAdd', (event) => {
-
 
170
			if (event.item.indexOf(' ') > 0) {
-
 
171
				event.cancel = true;
-
 
172
				let strItem = event.item.replaceAll(' ', '');
-
 
173
				imeiInputElem.tagsinput('add', strItem);
-
 
174
			}
-
 
175
		});
-
 
176
		console.log(imeiInputElem);
-
 
177
 
137
 
-
 
138
            imeisToValidate = [];
-
 
139
 
-
 
140
            let imeiInputElem = $(this).find(".imeis-to-grn-return");
-
 
141
            imeiInputElem.tagsinput({
-
 
142
                maxTags: excessQty,
-
 
143
                allowDuplicates: false,
-
 
144
                confirmKeys: [13, 44, 188, 32],
-
 
145
                delimiterRegex: /[,\s]/,
-
 
146
                trimValue: true,
-
 
147
                tagClass: function (item) {
-
 
148
                    if (item.valid == null) return 'label label-primary';
-
 
149
                    if (item.valid) {
-
 
150
                        return 'label label-success';
-
 
151
                    } else {
-
 
152
                        return 'label label-danger';
-
 
153
                    }
-
 
154
                },
-
 
155
            });
-
 
156
 
-
 
157
 
-
 
158
            imeiInputElem.on('beforeItemAdd', (event) => {
-
 
159
                if (event.item.indexOf(' ') > 0) {
-
 
160
                    event.cancel = true;
-
 
161
                    let strItem = event.item.replaceAll(' ', '');
-
 
162
                    imeiInputElem.tagsinput('add', strItem);
-
 
163
                }
-
 
164
            });
-
 
165
            console.log(imeiInputElem);
178
 
166
 
179
		console.log(imeisToValidate);
-
 
180
 
167
 
-
 
168
            console.log(imeisToValidate);
-
 
169
 
181
     });
170
        });
182
 
171
 
183
    });
172
    });
184
 
173
 
185
</script>
174
</script>
186
175