Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23405 amit.gupta 1
<style>
2
	.btn:hover{
3
  		color: grey;
4
  		text-decoration: none;
5
	}
6
	.btn-primary:hover{
7
  		color: grey;
8
  		text-decoration: none;
9
	}
10
	.retailer-details{
11
		cursor:pointer;
12
	}
26176 tejbeer 13
	.indentMessage{
14
	text-transform: lowercase;
15
	display: inline-block;
16
	}
17
	.indentMessage:first-letter{
18
	text-transform: UpperCase;
19
	}
23405 amit.gupta 20
</style>
21
 
22
<section class="wrapper">            
23
	<div class="row">
26748 tejbeer 24
	<div class="col-lg-12">
25
		#if ($isAdmin)
30260 tejbeer 26
			<h3 class="page-header"><i class="icon_document_alt"></i>Create/Edit PURCHASE PLAN</h3>
23405 amit.gupta 27
			<ol class="breadcrumb">
28
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
23786 amit.gupta 29
				#if($retailerName)
30
				<script type="text/javascript">
31
					currentFofoId=${retailerId};
32
				</script>
33
				<li><i class="icon_document_alt"></i><b>Allocation for $retailerName (Counter Size - $counterSize)</b></li>
34
				#else
35
				<li><i class="icon_document_alt"></i><b>Standard Allocation (Counter Size - $counterSize)</b></li>
36
				#end
23405 amit.gupta 37
			</ol>
26748 tejbeer 38
		#else
26952 amit.gupta 39
			<h3 class="page-header"><i class="icon_document_alt"></i>My Business Plan <span style ="font-size:18px";>(Open from <b>21<sup>st</sup> till end of Month</b>)</span></h3>
26082 tejbeer 40
 
26748 tejbeer 41
		#end
23405 amit.gupta 42
		</div>
26131 tejbeer 43
 
44
 
23405 amit.gupta 45
	</div>
46
 
47
    <div>
26748 tejbeer 48
 
49
 
23786 amit.gupta 50
    	<div class="row">
26176 tejbeer 51
    		   <div class="col-lg-3" style="text-align:left;">
26721 tejbeer 52
		                 #if(!$isAdmin)
26176 tejbeer 53
						<button type="button" class="btn btn-default previous-month" aria-label="Previous" >
54
							$previousPlanningMonth</button> 
55
						<button type="button" class="btn btn-default current-month" aria-label="Current" >
56
							$currentPlanningMonth</button> 
26721 tejbeer 57
							#end
26176 tejbeer 58
	           	</div>
59
 
60
	         #if($freezed&&$planningMonth)
61
			<div style = "font-size:20px;font-weight:bold;color:red;"  class="indentMessage"> $planningMonth Month Planning is <b>Closed</b></div>
62
			#else
63
			<div style = "font-size:20px;font-weight:bold;color:Green;" >$planningMonth Month Planning is <b>Open</b></div>
64
			#end
65
    	</div>
23405 amit.gupta 66
	         <div class="row">
26176 tejbeer 67
 
25721 tejbeer 68
	    		<div class="col-lg-8" id="indent-container">
26176 tejbeer 69
 
23405 amit.gupta 70
	    			<table class="table table-striped table-condensed table-bordered" id="entire-catalog-table">
71
		    			<thead>
72
				            <tr>
73
								<th>Id</th>
25721 tejbeer 74
	    						<th style="width:30%">Description</th>
24229 amit.gupta 75
	    						<th style="width:12%">DP</th>
23405 amit.gupta 76
	    						<th>MOP</th>
25721 tejbeer 77
	    						<th style="width:20%">Planned Qty</th>
26176 tejbeer 78
	    						#if($previousMonth||$mtd)
26131 tejbeer 79
	    						<th style="width:6%">Sale</th>
80
	    						#else		
25721 tejbeer 81
	    						<th style="width:6%">15 days sale</th>
26131 tejbeer 82
	    						#end
23855 amit.gupta 83
	    						<th style="width:9%">In Stock</th>
84
	    						<th style="width:9%">In Transit</th>
25721 tejbeer 85
	    						<th style="width:6%">Recommended</th>
86
	    						<th style="width:6%">Minimum</th>
87
 
26176 tejbeer 88
	    						<th>Remaining</th>
89
 
90
 
23405 amit.gupta 91
				            </tr>
92
				        </thead>
93
	    				<tbody>
24229 amit.gupta 94
	    					#foreach( $modelListing in $catalogTagListings )
23405 amit.gupta 95
	    					<tr>
24229 amit.gupta 96
	    						<td>$modelListing.getCatalogId()</td>
25701 amit.gupta 97
	    						<td>$modelListing.getItemDescription()</td>
24229 amit.gupta 98
	    						<td class="currency">$modelListing.getDp()</td>
99
	    						<td class="currency">$modelListing.getMop()</td>
26748 tejbeer 100
	    						#if($freezed&&$previousMonth)
23796 amit.gupta 101
	    						<td>
26293 tejbeer 102
	    						<input type="number" min="0" max="40" 
24229 amit.gupta 103
	    						data-catalog-id="$modelListing.getCatalogId()"
104
	    						data-selling-price="$modelListing.getDp()"
25721 tejbeer 105
	    						data-brand-name="$modelListing.getBrand()"
24229 amit.gupta 106
	    						data-description="$modelListing.getItemDescription()" 
25721 tejbeer 107
	    						value="$modelListing.getAllocatedQuantity()" readonly/>
108
	    						</td>
26748 tejbeer 109
	    						#elseif($freezed)
25721 tejbeer 110
	    						<td>
26293 tejbeer 111
	    						<input type="number" min="0" max="40" 
26131 tejbeer 112
	    						data-catalog-id="$modelListing.getCatalogId()"
113
	    						data-selling-price="$modelListing.getDp()"
114
	    						data-brand-name="$modelListing.getBrand()"
115
	    						data-description="$modelListing.getItemDescription()" 
116
	    						value="$modelListing.getAllocatedQuantity()" readonly/>
117
	    						</td>
118
	    						#else 
119
	    						<td>
26293 tejbeer 120
						    	<input type="number" min="0" max="40" 
25721 tejbeer 121
	    						data-catalog-id="$modelListing.getCatalogId()"
122
	    						data-selling-price="$modelListing.getDp()"
123
	    						data-brand-name="$modelListing.getBrand()"
124
	    						data-description="$modelListing.getItemDescription()" 
125
	    						value="$modelListing.getAllocatedQuantity()"/> 						
126
	    						</td>
23796 amit.gupta 127
	    						#end
26131 tejbeer 128
	    						#if($previousMonth)
129
	    						<td>$modelListing.getLastMonthSaleMap()</td>
26176 tejbeer 130
	    						#elseif($mtd)
131
	    						<td>$modelListing.getLast15DaysSale()</td>
26131 tejbeer 132
	    						#else
25721 tejbeer 133
	    						<td>$modelListing.getLast15DaysSale()</td>
26131 tejbeer 134
	    						#end
24229 amit.gupta 135
	    						<td>$modelListing.getStockInHand()</td>
136
	    						<td>$modelListing.getInTransitQuantity()</td>
25721 tejbeer 137
	    						<td>$modelListing.getRecommendedQty()</td>
138
	    						<td>$modelListing.getMinimumQty()</td>
26176 tejbeer 139
	    						#if($mtd)
140
	    						<td>$modelListing.getRemaining()</td>
141
	    						#else
142
	    						<td></td>
143
	    						#end
23405 amit.gupta 144
	    					</tr>
145
	    					#end
146
	    				</tbody>
147
	    			</table>
148
	    		</div>
23786 amit.gupta 149
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
150
	    		<div class="col-lg-4">
23405 amit.gupta 151
	    			<div class="panel panel-default">
26748 tejbeer 152
	    		##	#if(!$isAdmin) 
25721 tejbeer 153
	                <div class="panel-heading">Allocation Update Summary #if($retailerName) (Counter Size - $counterSize) #end</div>
23405 amit.gupta 154
	                  <div class="panel-content">
25721 tejbeer 155
		                  <div id="plansummary">
156
		                  </div>
157
		                  <div id="planbuttons">
158
					       <!--  <button class="btn btn-primary mk_submit_indent">Update Allocation</button>
159
					          <button class="btn btn-primary bk_toedit_indent" style="display:none">Edit</button> -->
160
 
26131 tejbeer 161
					          #if($freezed&&$previousMonth)
162
					           <button class="btn btn-primary confirm_indent" disabled>Confirm Update</button>
163
					          #elseif($freezed)
26748 tejbeer 164
					          <button class="btn btn-primary confirm_indent" disabled >Confirm Update</button>
25721 tejbeer 165
					          #else
166
					           <button class="btn btn-primary confirm_indent" style="display:none">Confirm Update</button>
167
					          #end
168
				          </div>
23405 amit.gupta 169
	                  </div>
170
                	</div>
25736 tejbeer 171
 
26748 tejbeer 172
 
25736 tejbeer 173
 
174
    	         	<div class="panel panel-default">
175
	                <div class="panel-heading">Brand Stock</div>
176
	                  <div class="panel-content">
177
		                 <table class="table table-sm" id="stock-table">
178
	                  		  <thead>
179
							    <tr>
180
							      <th>Brand</th>
181
							      <th>Qty(pc)</th>
182
							      <th>Value</th>
183
 
184
							    </tr>
185
							  </thead>
186
							  <tbody>
187
 
188
							   #foreach( $brandStockPrice in $brandStockPrices )
189
			    				<tr class="stockInfo" >
190
			    					<td>$brandStockPrice.getBrand()</td>
191
			    					<td>$brandStockPrice.getTotalQty()</td>
192
			    					<td><span class="currency">$brandStockPrice.getTotalValue()</span></td>
193
							    </tr>
194
							    #end
195
							   </tbody>
196
							</table>
197
	                  </div>
198
                  	</div>
26748 tejbeer 199
 
25736 tejbeer 200
    	        </div>
23405 amit.gupta 201
	    		</div>
202
	    	</div>
203
    	</div>
25736 tejbeer 204
 
205
 
23405 amit.gupta 206
</section>
207
<script type="text/javascript">
23796 amit.gupta 208
totalAmount = $totalAmount;
23405 amit.gupta 209
/* Create an array with the values of all the input boxes in a column */
210
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
211
{
212
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
213
        return $('input', td).val();
214
    } );
215
}
216
 
217
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
218
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
219
{
220
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
221
        return $('input', td).val() * 1;
222
    } );
223
}
224
 
225
/* Create an array with the values of all the select options in a column */
226
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
227
{
228
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
229
        return $('select', td).val();
230
    } );
231
}
232
 
233
/* Create an array with the values of all the checkboxes in a column */
234
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
235
{
236
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
237
        return $('input', td).prop('checked') ? '1' : '0';
238
    } );
239
}
240
 
241
/* Initialise the table with the required column ordering data types */
23786 amit.gupta 242
var customRetailers = ${customRetailers};
23405 amit.gupta 243
$(document).ready(function() {
26176 tejbeer 244
 
23405 amit.gupta 245
    indentTable = $('#entire-catalog-table').DataTable({
23786 amit.gupta 246
    	"scrollY":"600px",
23405 amit.gupta 247
    	"columns": [
25736 tejbeer 248
 
249
 
250
            { "visible": false }, null,null, null,
26176 tejbeer 251
            { "orderDataType": "dom-text-numeric" }, null, null, null,null,null,null
23786 amit.gupta 252
        ],
23796 amit.gupta 253
        "lengthMenu":[[25,50],[25,50]],
254
        "order": []
23405 amit.gupta 255
	});
26176 tejbeer 256
 
23405 amit.gupta 257
	indentMap = {};
258
	indentTable.rows().data().each(function(arr){
23796 amit.gupta 259
		var $input = $(arr[4]);
23405 amit.gupta 260
		quantity = parseInt($input.val(), 10);
261
		if(quantity > 0){
25721 tejbeer 262
			 var brandName = arr[1].split(" ")[0];
263
			 if(indentMap[brandName] == undefined) {
264
				 indentMap[brandName] = {};
265
			 }
266
			 indentMap[brandName][parseInt(arr[0])] 
267
			 					= {"initialQuantity": quantity, "quantity": quantity, 
268
			 					"sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
23405 amit.gupta 269
	    }
25721 tejbeer 270
	})
23884 amit.gupta 271
	$("#partnerId").typeahead({
23786 amit.gupta 272
	  source: customRetailers,
273
	  autoSelect: true,
274
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
275
	  afterSelect:	function(currentItem){
276
	  					currentFofoId = currentItem.partnerId;
277
	  				}
278
	});
25701 amit.gupta 279
	populateIndentSummary();
23405 amit.gupta 280
});
281
 
282
</script>