Subversion Repositories SmartDukaan

Rev

Rev 23786 | Rev 23855 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 23786 Rev 23796
Line 13... Line 13...
13
</style>
13
</style>
14
 
14
 
15
<section class="wrapper">            
15
<section class="wrapper">            
16
	<div class="row">
16
	<div class="row">
17
		<div class="col-lg-12">
17
		<div class="col-lg-12">
-
 
18
		#if ($isAdmin)
18
			<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Allocation</h3>
19
			<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit Allocation</h3>
19
			<ol class="breadcrumb">
20
			<ol class="breadcrumb">
20
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
21
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
21
				#if($retailerName)
22
				#if($retailerName)
22
				<script type="text/javascript">
23
				<script type="text/javascript">
Line 25... Line 26...
25
				<li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>
26
				<li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>
26
				#else
27
				#else
27
				<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>
28
				<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>
28
				#end
29
				#end
29
			</ol>
30
			</ol>
-
 
31
		#else
-
 
32
			<h3 class="page-header"><i class="icon_document_alt"></i>Create Purchase Order</h3>
-
 
33
		#end
30
		</div>
34
		</div>
31
	</div>
35
	</div>
32
	
36
	
33
    <div>
37
    <div>
-
 
38
    	#if ($isAdmin)
34
    	<div class="row">
39
    	<div class="row">
35
	    	<!--<div class="col-lg-3">
-
 
36
                <div class="input-group">
-
 
37
                    <input type="text" class="form-control">
-
 
38
                    <div class="input-group-btn">
-
 
39
                        <button type="button" class="btn btn-default">Get Partner Allocation</span></button>
-
 
40
                    </div>
-
 
41
                </div>
-
 
42
            </div>-->
-
 
43
    		<div class="col-lg-3">
40
    		<div class="col-lg-3">
44
                <div class="input-group">
41
                <div class="input-group">
45
			    	<input id="partnerId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead" 
42
			    	<input id="partnerId" type="text" class="typeahead form-control form-control-sm" placeholder="Search Partner by Store" data-provide="typeahead" 
46
			    	 #if(${retailerName}) value="${retailerName}" #end
43
			    	 #if(${retailerName}) value="${retailerName}" #end
47
			    	 autocomplete="off"/>
44
			    	 autocomplete="off"/>
Line 60... Line 57...
60
					  #end
57
					  #end
61
			  		</ul>
58
			  		</ul>
62
				</div>
59
				</div>
63
	    	</div>
60
	    	</div>
64
    	</div>
61
    	</div>
-
 
62
    	#end
65
	         <div class="row">
63
	         <div class="row">
66
	    		<div class="col-lg-7" id="indent-container">
64
	    		<div class="col-lg-7" id="indent-container">
67
	    			<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
65
	    			<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
68
		    			<thead>
66
		    			<thead>
69
				            <tr>
67
				            <tr>
70
								<th>Id</th>
68
								<th>Id</th>
71
	    						<th>Description</th>
69
	    						<th style="width:40%">Description</th>
72
	    						<th>Selling Price</th>
70
	    						<th style="width:12%">Selling Price</th>
73
	    						<th>MOP</th>
71
	    						<th>MOP</th>
-
 
72
	    						<th style="width:12%">Allocated Quantity</th>
74
	    						<th>Stock</th>
73
	    						<th style="width:11%">In Stock</th>
75
	    						<th>30 days Sale</th>
74
	    						<th style="width:11%">In Transit</th>
76
	    						<th>Allocated Quantity</th>
75
	    						<th style="width:11%">To be Ordered</th>
77
				            </tr>
76
				            </tr>
78
				        </thead>
77
				        </thead>
79
	    				<tbody>
78
	    				<tbody>
80
	    					#foreach( $tagListing in $tagListings )
79
	    					#foreach( $tagListing in $tagListings )
81
	    					<tr>
80
	    					<tr>
82
	    						<td>$tagListing.getItemId()</td>
81
	    						<td>$tagListing.getItemId()</td>
83
	    						<td>$tagListing.getItemDescription()</td>
82
	    						<td>$tagListing.getItemDescription()</td>
84
	    						<td class="currency">$tagListing.getSellingPrice()</td>
83
	    						<td class="currency">$tagListing.getSellingPrice()</td>
85
	    						<td class="currency">$tagListing.getMop()</td>
84
	    						<td class="currency">$tagListing.getMop()</td>
86
	    						<td>$tagListing.getStockInHand()</td>
85
	    						<td>
87
	    						<td>$tagListing.getLast30DaysSale()</td>
86
	    						#if($isAdmin)
88
	    						<td><input type="number" min="0" max="10" 
87
	    						<input type="number" min="0" max="10" 
89
	    						data-item-id="$tagListing.getItemId()"
88
	    						data-item-id="$tagListing.getItemId()"
90
	    						data-selling-price="$tagListing.getSellingPrice()"
89
	    						data-selling-price="$tagListing.getSellingPrice()"
91
	    						data-description="$tagListing.getItemDescription()" 
90
	    						data-description="$tagListing.getItemDescription()" 
92
	    						value="$tagListing.getAllocatedQuantity()"/></td>
91
	    						value="$tagListing.getAllocatedQuantity()"/>
-
 
92
	    						#else
-
 
93
								$tagListing.getAllocatedQuantity()	    						
-
 
94
	    						#end
-
 
95
	    						</td>
-
 
96
	    						<td>$tagListing.getStockInHand()</td>
-
 
97
	    						<td>$tagListing.getInTransitQuantity()</td>
-
 
98
	    						<td>$tagListing.getToBeOrdered()</td>
93
	    					</tr>
99
	    					</tr>
94
	    					#end
100
	    					#end
95
	    				</tbody>
101
	    				</tbody>
96
	    			</table>
102
	    			</table>
97
	    		</div>
103
	    		</div>
98
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
104
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
99
	    		<div class="col-lg-4">
105
	    		<div class="col-lg-4">
100
	    			<div class="panel panel-default">
106
	    			<div class="panel panel-default">
-
 
107
	    			#if($isAdmin)
101
	                  <div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
108
	                  <div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
102
	                  <div class="panel-content">
109
	                  <div class="panel-content">
103
	                  	<table class="table table-sm" id="summary-table">
110
	                  	<table class="table table-sm" id="summary-table">
104
	                  		  <thead>
111
	                  		  <thead>
105
							    <tr>
112
							    <tr>
Line 112... Line 119...
112
							  <tbody>
119
							  <tbody>
113
							    <tr>
120
							    <tr>
114
							      <th class="row">Initial</th>
121
							      <th class="row">Initial</th>
115
							      <td></td>
122
							      <td></td>
116
							      <td></td>
123
							      <td></td>
117
							      <td></th>
124
							      <td></td>
118
							    </tr>
125
							    </tr>
119
							    <tr>
126
							    <tr>
120
							      <th class="row">Added</th>
127
							      <th class="row">Added</th>
121
							      <td></td>
128
							      <td></td>
122
							      <td></td>
129
							      <td></td>
123
							      <td></th>
130
							      <td></td>
124
							    </tr>
131
							    </tr>
125
							    <tr>
132
							    <tr>
126
							      <th class="row">Removed</th>
133
							      <th class="row">Removed</th>
127
							      <td></td>
134
							      <td></td>
128
							      <td></td>
135
							      <td></td>
129
							      <td></th>
136
							      <td></td>
130
							    </tr>
137
							    </tr>
131
							    <tr>
138
							    <tr>
132
							      <th class="row">Final</th>
139
							      <th class="row">Final</th>
133
							      <td></td>
140
							      <td></td>
134
							      <td></td>
141
							      <td></td>
135
							      <td></th>
142
							      <td></td>
136
							    </tr>
143
							    </tr>
137
							  <tbody>
144
							  <tbody>
138
	                  	</table>
145
	                  	</table>
139
			          <button class="btn btn-primary mk_submit_indent">Update Allocation</button>
146
			          <button class="btn btn-primary mk_submit_indent">Update Allocation</button>
140
			          <button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button>
147
			          <button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button>
141
			          <button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
148
			          <button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
142
	                  </div>
149
	                  </div>
143
                	</div>
150
                	</div>
-
 
151
                	#else
-
 
152
                	#set($diff=$totalAmount - $walletAmount)
-
 
153
	                <div class="panel-heading">PO Summary(Total Amount in Wallet - <span class="currency">$walletAmount</span>)</div>
-
 
154
	                  <div class="panel-content">
-
 
155
	                  	<table class="table table-sm" id="summary-table">
-
 
156
	                  		  <thead>
-
 
157
							    <tr>
-
 
158
							      <th class="col">#</th>
-
 
159
							      <th class="col">Total Pcs</th>
-
 
160
							      <th class="col">Amount to Pay</th>
-
 
161
							      <th class="col">Action</th>
-
 
162
							    </tr>
-
 
163
							  </thead>
-
 
164
							  <tbody>
-
 
165
							  #**
-
 
166
							    <tr>
-
 
167
							      <th class="row">Partial PO</th>
-
 
168
							      <td>$partialPcs</td>
-
 
169
							      <td>$partialAmount</td>
-
 
170
							      <td><button class="btn btn-sm btn-primary confirm_indent #if(${diff} > 0)disabled#end"
-
 
171
							      >Raise Partial PO</button></td>
-
 
172
							    </tr>
-
 
173
							   **#
-
 
174
							    <tr>
-
 
175
							      <th class="row">Complete PO</th>
-
 
176
							      <td>$totalPcs</td>
-
 
177
							      <td class="currency">$totalAmount</td>
-
 
178
							      #if($totalPcs)
-
 
179
							      <td><button class="btn btn-primary raise_po#if($diff > 0) disabled#end">Raise Complete PO</button></td>
-
 
180
							      #else
-
 
181
							      <td>Nothing to order!</td>
-
 
182
							      #end
-
 
183
							    </tr>
-
 
184
							  </tbody>	
-
 
185
	                  	</table>
-
 
186
	                  #if($diff>0)
-
 
187
	                  	<div class="alert alert-warning">
-
 
188
							<medium>Please add Rs.<span class="currency">$diff</span> to complete this transaction.</meduim>
-
 
189
						</div>
-
 
190
					  #end
-
 
191
	                  </div>
-
 
192
                	</div>
-
 
193
                	#end
-
 
194
                	#if($isAdmin)
144
                	<div class="panel panel-default">
195
                	<div class="panel panel-default">
145
                		<div class="panel-heading">Brandwise Target and Performance</div>
196
                		<div class="panel-heading">Brandwise Target and Performance</div>
146
                		<div class="panel-content">
197
                		<div class="panel-content">
147
                		<ul class="nav nav-tabs">
198
                		<ul class="nav nav-tabs">
148
						  <li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li>
199
						  <li role="presentation" class="active brandLi"><a href="javascript:void(0)">Mobiles</a></li>
Line 208... Line 259...
208
							</tbody>
259
							</tbody>
209
						</table>
260
						</table>
210
                		</div>
261
                		</div>
211
                		
262
                		
212
                	</div>
263
                	</div>
-
 
264
                	#end
213
	    		</div>
265
	    		</div>
214
	    	</div>
266
	    	</div>
215
    	</div>
267
    	</div>
216
</section>
268
</section>
217
<script type="text/javascript">
269
<script type="text/javascript">
-
 
270
totalAmount = $totalAmount;
218
/* Create an array with the values of all the input boxes in a column */
271
/* Create an array with the values of all the input boxes in a column */
219
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
272
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
220
{
273
{
221
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
274
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
222
        return $('input', td).val();
275
        return $('input', td).val();
Line 251... Line 304...
251
var customRetailers = ${customRetailers};
304
var customRetailers = ${customRetailers};
252
$(document).ready(function() {
305
$(document).ready(function() {
253
    indentTable = $('#entire-catalog-table').DataTable({
306
    indentTable = $('#entire-catalog-table').DataTable({
254
    	"scrollY":"600px",
307
    	"scrollY":"600px",
255
    	"columns": [
308
    	"columns": [
256
            null,null, null, null, null, null,
309
            null, null, null, null,
257
            { "orderDataType": "dom-text-numeric" }
310
            { "orderDataType": "dom-text-numeric" }, null, null, null
258
        ],
311
        ],
259
        "lengthMenu":[[25,50],[25,50]]
312
        "lengthMenu":[[25,50],[25,50]],
-
 
313
        "order": []
260
	});
314
	});
261
	indentMap = {};
315
	indentMap = {};
262
	indentTable.rows().data().each(function(arr){
316
	indentTable.rows().data().each(function(arr){
263
		var $input = $(arr[6]);
317
		var $input = $(arr[4]);
264
		quantity = parseInt($input.val(), 10);
318
		quantity = parseInt($input.val(), 10);
265
		if(quantity > 0){
319
		if(quantity > 0){
266
			indentMap[parseInt(arr[0])] = {"initialQuantity": quantity, "quantity": quantity, "sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
320
			indentMap[parseInt(arr[0])] = {"initialQuantity": quantity, "quantity": quantity, "sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
267
	    }
321
	    }
268
	});
322
	});
Line 272... Line 326...
272
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
326
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
273
	  afterSelect:	function(currentItem){
327
	  afterSelect:	function(currentItem){
274
	  					currentFofoId = currentItem.partnerId;
328
	  					currentFofoId = currentItem.partnerId;
275
	  				}
329
	  				}
276
	});
330
	});
-
 
331
	if($isAdmin){
277
	populateIndentSummary();
332
		populateIndentSummary();
-
 
333
	}
278
});
334
});
279
 
335
 
280
</script>
336
</script>
281
337