Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
26846 tejbeer 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
	}
13
	.indentMessage{
14
	text-transform: lowercase;
15
	display: inline-block;
16
	}
17
	.indentMessage:first-letter{
18
	text-transform: UpperCase;
19
	}
20
</style>
21
 
22
<section class="wrapper">            
23
	<div class="row">
24
	<div class="col-lg-12">
25
		#if ($isAdmin)
26
			<h3 class="page-header"><i class="icon_document_alt"></i>Create Po </h3>
27
			<ol class="breadcrumb">
28
				<li><i class="fa fa-home"></i><a href="${rc.contextPath}/dashboard">Home</a></li>
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
37
			</ol>
38
		#else
39
			<h3 class="page-header"><i class="icon_document_alt"></i>My Business Plan <span style ="font-size:18px";>(Open from <b>26<sup>th</sup> to 7<sup>th</sup></b> of each Month)</span></h3>
40
 
41
		#end
42
		</div>
43
 
44
 
45
	</div>
46
 
47
    <div>
48
 
49
 
50
    	<div class="row">
51
    	#if($userWallet)
52
					<h4>Wallet Amount:-Rs.$userWallet.getAmount()</h4>	
53
				#else
54
					<h4>Wallet Amount:- NA</h4>
55
				#end
56
    	</div>
57
	         <div class="row">
32771 raveendra. 58
 
26846 tejbeer 59
	    		<div class="col-lg-8" id="indent-container">
60
 
61
	    			<table class="table table-striped table-condensed table-bordered" id="entire-inventory-table">
62
		    			<thead>
63
				            <tr>
64
								<th>Id</th>
32771 raveendra. 65
	    						<th style="width:30%">#springMessage("monthlyplanning.description")</th>
66
	    						<th style="width:12%">#springMessage("monthlyplanning.dp")</th>
67
	    						<th>#springMessage("mop")</th>
68
	    						<th style="width:20%">#springMessage("plannedqty")</th>
26846 tejbeer 69
	    						#if($previousMonth||$mtd)
32771 raveendra. 70
	    						<th style="width:6%">#springMessage("sale")</th>
26846 tejbeer 71
	    						#else		
72
	    						<th style="width:6%">15 days sale</th>
73
	    						#end
32771 raveendra. 74
	    						<th style="width:9%">#springMessage("instock")</th>
75
	    						<th style="width:9%">#springMessage("ourstock")</th>
76
	    						<th style="width:9%">#springMessage("intransit")</th>
77
	    						<th style="width:3%">#springMessage("recommended")</th>
78
	    						<th style="width:3%">#springMessage("minimum")</th>
79
	    						<th style="width:3%">#springMessage("obvrecommended")</th>
80
	    						<th style="width:3%">#springMessage("obvminimum")</th>
26846 tejbeer 81
 
32771 raveendra. 82
	    						<th>#springMessage("remaining")</th>
26846 tejbeer 83
 
84
 
85
				            </tr>
86
				        </thead>
87
	    				<tbody>
88
	    					#foreach( $modelListing in $catalogTagListings )
89
	    					<tr>
90
	    						<td>$modelListing.getCatalogId()</td>
91
	    						<td>$modelListing.getItemDescription()</td>
92
	    						<td class="currency">$modelListing.getDp()</td>
93
	    						<td class="currency">$modelListing.getMop()</td>
94
	    				        <td><a class = "selectItemQty" data-catalog-id="$modelListing.getCatalogId()" data-toggle="modal" data-target="#selectItem" > Add to po </a> 						
95
	    						</td>
96
	    						#if($previousMonth)
97
	    						<td>$modelListing.getLastMonthSaleMap()</td>
98
	    						#elseif($mtd)
99
	    						<td>$modelListing.getLast15DaysSale()</td>
100
	    						#else
101
	    						<td>$modelListing.getLast15DaysSale()</td>
102
	    						#end
103
	    						<td>$modelListing.getStockInHand()</td>
27768 tejbeer 104
	    						<td>$modelListing.getOurStockQty()</td>
26846 tejbeer 105
	    						<td>$modelListing.getInTransitQuantity()</td>
106
	    						<td>$modelListing.getRecommendedQty()</td>
107
	    						<td>$modelListing.getMinimumQty()</td>
29707 tejbeer 108
	    						<td>$modelListing.getObsRecommendedQty()</td>
109
	    						<td>$modelListing.getObsMinimumQty()</td>
110
 
26846 tejbeer 111
	    						#if($mtd)
112
	    						<td>$modelListing.getRemaining()</td>
113
	    						#else
114
	    						<td></td>
115
	    						#end
116
	    					</tr>
117
	    					#end
118
	    				</tbody>
119
	    			</table>
120
	    		</div>
121
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
122
	    		<div class="col-lg-4">
123
	    			<div class="panel panel-default">
124
	    		    <div class="panel-heading">Create Po #if($retailerName) (Counter Size - $counterSize) #end</div>
125
	                  <div class="panel-content">
126
		                  <div id="posummary">
127
		                   <table class="table table-sm" id="po-table">
128
	                  		  <thead>
129
							    <tr>
130
							      <th>itemId</th>
131
							      <th>Name</th>
132
							      <th>Quantity</th>
133
 
134
							    </tr>
135
							  </thead>
136
							    <tbody>
137
 
138
							   </tbody>
139
							</table>
140
		                  </div>
141
		                  <div id="pobuttons">
142
 
143
 
144
					           <button class="btn btn-primary confirm_po">Confirm Po</button>
145
 
146
				          </div>
147
	                  </div>
148
                	</div>
149
 
150
 
151
 
152
    	         	<div class="panel panel-default">
32771 raveendra. 153
	                <div class="panel-heading">#springMessage("monthlyplanning.brandstock")</div>
26846 tejbeer 154
	                  <div class="panel-content">
155
		                 <table class="table table-sm" id="stock-table">
156
	                  		  <thead>
157
							    <tr>
32771 raveendra. 158
							      <th>#springMessage("monthlyplanning.brand")</th>
159
							      <th>#springMessage("monthlyplanning.qty(pc)")</th>
160
							      <th>#springMessage("monthlyplanning.value")</th>
26846 tejbeer 161
 
162
							    </tr>
163
							  </thead>
164
							  <tbody>
165
 
166
							   #foreach( $brandStockPrice in $brandStockPrices )
167
			    				<tr class="stockInfo" >
168
			    					<td>$brandStockPrice.getBrand()</td>
169
			    					<td>$brandStockPrice.getTotalQty()</td>
170
			    					<td><span class="currency">$brandStockPrice.getTotalValue()</span></td>
171
							    </tr>
172
							    #end
173
							   </tbody>
174
							</table>
175
	                  </div>
176
                  	</div>
177
 
178
    	        </div>
179
	    		</div>
180
	    	</div>
181
    	</div>
182
 
183
 
184
 
185
   <div class="select-item-container">
186
   <div  class="modal  text-center" id="selectItem">
187
	<div class="modal-dialog">
188
    <div class="modal-content">
189
    </div>
190
    </div>
191
    </div>
192
    </div>
193
 
194
</section>
195
<script type="text/javascript">
196
totalAmount = $totalAmount;
197
/* Create an array with the values of all the input boxes in a column */
198
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
199
{
200
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
201
        return $('input', td).val();
202
    } );
203
}
204
 
205
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
206
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
207
{
208
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
209
        return $('input', td).val() * 1;
210
    } );
211
}
212
 
213
/* Create an array with the values of all the select options in a column */
214
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
215
{
216
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
217
        return $('select', td).val();
218
    } );
219
}
220
 
221
/* Create an array with the values of all the checkboxes in a column */
222
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
223
{
224
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
225
        return $('input', td).prop('checked') ? '1' : '0';
226
    } );
227
}
228
 
229
/* Initialise the table with the required column ordering data types */
230
var customRetailers = ${customRetailers};
231
$(document).ready(function() {
232
 
233
    indentTable = $('#entire-inventory-table').DataTable({
234
    	"scrollY":"600px",
235
    	"columns": [
236
 
237
 
238
            { "visible": false }, null,null, null,
29707 tejbeer 239
            { "orderDataType": "dom-text-numeric" }, null,null, null, null,null,null,null,null,null
26846 tejbeer 240
        ],
241
        "lengthMenu":[[25,50],[25,50]],
242
        "order": []
243
	});
244
 
245
	indentMap = {};
246
	indentTable.rows().data().each(function(arr){
247
		var $input = $(arr[4]);
248
		quantity = parseInt($input.val(), 10);
249
		if(quantity > 0){
250
			 var brandName = arr[1].split(" ")[0];
251
			 if(indentMap[brandName] == undefined) {
252
				 indentMap[brandName] = {};
253
			 }
254
			 indentMap[brandName][parseInt(arr[0])] 
255
			 					= {"initialQuantity": quantity, "quantity": quantity, 
256
			 					"sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
257
	    }
258
	})
259
	$("#partnerId").typeahead({
260
	  source: customRetailers,
261
	  autoSelect: true,
262
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
263
	  afterSelect:	function(currentItem){
264
	  					currentFofoId = currentItem.partnerId;
265
	  				}
266
	});
267
	populateIndentSummary();
268
});
269
 
270
</script>