Subversion Repositories SmartDukaan

Rev

Rev 26846 | Rev 29707 | Go to most recent revision | 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">
58
 
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>
65
	    						<th style="width:30%">Description</th>
66
	    						<th style="width:12%">DP</th>
67
	    						<th>MOP</th>
68
	    						<th style="width:20%">Planned Qty</th>
69
	    						#if($previousMonth||$mtd)
70
	    						<th style="width:6%">Sale</th>
71
	    						#else		
72
	    						<th style="width:6%">15 days sale</th>
73
	    						#end
74
	    						<th style="width:9%">In Stock</th>
27768 tejbeer 75
	    						<th style="width:9%">Our Stock</th>
26846 tejbeer 76
	    						<th style="width:9%">In Transit</th>
77
	    						<th style="width:6%">Recommended</th>
78
	    						<th style="width:6%">Minimum</th>
79
 
80
	    						<th>Remaining</th>
81
 
82
 
83
				            </tr>
84
				        </thead>
85
	    				<tbody>
86
	    					#foreach( $modelListing in $catalogTagListings )
87
	    					<tr>
88
	    						<td>$modelListing.getCatalogId()</td>
89
	    						<td>$modelListing.getItemDescription()</td>
90
	    						<td class="currency">$modelListing.getDp()</td>
91
	    						<td class="currency">$modelListing.getMop()</td>
92
	    				        <td><a class = "selectItemQty" data-catalog-id="$modelListing.getCatalogId()" data-toggle="modal" data-target="#selectItem" > Add to po </a> 						
93
	    						</td>
94
	    						#if($previousMonth)
95
	    						<td>$modelListing.getLastMonthSaleMap()</td>
96
	    						#elseif($mtd)
97
	    						<td>$modelListing.getLast15DaysSale()</td>
98
	    						#else
99
	    						<td>$modelListing.getLast15DaysSale()</td>
100
	    						#end
101
	    						<td>$modelListing.getStockInHand()</td>
27768 tejbeer 102
	    						<td>$modelListing.getOurStockQty()</td>
26846 tejbeer 103
	    						<td>$modelListing.getInTransitQuantity()</td>
104
	    						<td>$modelListing.getRecommendedQty()</td>
105
	    						<td>$modelListing.getMinimumQty()</td>
106
	    						#if($mtd)
107
	    						<td>$modelListing.getRemaining()</td>
108
	    						#else
109
	    						<td></td>
110
	    						#end
111
	    					</tr>
112
	    					#end
113
	    				</tbody>
114
	    			</table>
115
	    		</div>
116
	    		<div class="col-lg-7" id="indent-container1" style="display:none"></div>
117
	    		<div class="col-lg-4">
118
	    			<div class="panel panel-default">
119
	    		    <div class="panel-heading">Create Po #if($retailerName) (Counter Size - $counterSize) #end</div>
120
	                  <div class="panel-content">
121
		                  <div id="posummary">
122
		                   <table class="table table-sm" id="po-table">
123
	                  		  <thead>
124
							    <tr>
125
							      <th>itemId</th>
126
							      <th>Name</th>
127
							      <th>Quantity</th>
128
 
129
							    </tr>
130
							  </thead>
131
							    <tbody>
132
 
133
							   </tbody>
134
							</table>
135
		                  </div>
136
		                  <div id="pobuttons">
137
 
138
 
139
					           <button class="btn btn-primary confirm_po">Confirm Po</button>
140
 
141
				          </div>
142
	                  </div>
143
                	</div>
144
 
145
 
146
 
147
    	         	<div class="panel panel-default">
148
	                <div class="panel-heading">Brand Stock</div>
149
	                  <div class="panel-content">
150
		                 <table class="table table-sm" id="stock-table">
151
	                  		  <thead>
152
							    <tr>
153
							      <th>Brand</th>
154
							      <th>Qty(pc)</th>
155
							      <th>Value</th>
156
 
157
							    </tr>
158
							  </thead>
159
							  <tbody>
160
 
161
							   #foreach( $brandStockPrice in $brandStockPrices )
162
			    				<tr class="stockInfo" >
163
			    					<td>$brandStockPrice.getBrand()</td>
164
			    					<td>$brandStockPrice.getTotalQty()</td>
165
			    					<td><span class="currency">$brandStockPrice.getTotalValue()</span></td>
166
							    </tr>
167
							    #end
168
							   </tbody>
169
							</table>
170
	                  </div>
171
                  	</div>
172
 
173
    	        </div>
174
	    		</div>
175
	    	</div>
176
    	</div>
177
 
178
 
179
 
180
   <div class="select-item-container">
181
   <div  class="modal  text-center" id="selectItem">
182
	<div class="modal-dialog">
183
    <div class="modal-content">
184
    </div>
185
    </div>
186
    </div>
187
    </div>
188
 
189
</section>
190
<script type="text/javascript">
191
totalAmount = $totalAmount;
192
/* Create an array with the values of all the input boxes in a column */
193
$.fn.dataTable.ext.order['dom-text'] = function  ( settings, col )
194
{
195
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
196
        return $('input', td).val();
197
    } );
198
}
199
 
200
/* Create an array with the values of all the input boxes in a column, parsed as numbers */
201
$.fn.dataTable.ext.order['dom-text-numeric'] = function  ( settings, col )
202
{
203
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
204
        return $('input', td).val() * 1;
205
    } );
206
}
207
 
208
/* Create an array with the values of all the select options in a column */
209
$.fn.dataTable.ext.order['dom-select'] = function  ( settings, col )
210
{
211
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
212
        return $('select', td).val();
213
    } );
214
}
215
 
216
/* Create an array with the values of all the checkboxes in a column */
217
$.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
218
{
219
    return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
220
        return $('input', td).prop('checked') ? '1' : '0';
221
    } );
222
}
223
 
224
/* Initialise the table with the required column ordering data types */
225
var customRetailers = ${customRetailers};
226
$(document).ready(function() {
227
 
228
    indentTable = $('#entire-inventory-table').DataTable({
229
    	"scrollY":"600px",
230
    	"columns": [
231
 
232
 
233
            { "visible": false }, null,null, null,
27768 tejbeer 234
            { "orderDataType": "dom-text-numeric" }, null,null, null, null,null,null,null
26846 tejbeer 235
        ],
236
        "lengthMenu":[[25,50],[25,50]],
237
        "order": []
238
	});
239
 
240
	indentMap = {};
241
	indentTable.rows().data().each(function(arr){
242
		var $input = $(arr[4]);
243
		quantity = parseInt($input.val(), 10);
244
		if(quantity > 0){
245
			 var brandName = arr[1].split(" ")[0];
246
			 if(indentMap[brandName] == undefined) {
247
				 indentMap[brandName] = {};
248
			 }
249
			 indentMap[brandName][parseInt(arr[0])] 
250
			 					= {"initialQuantity": quantity, "quantity": quantity, 
251
			 					"sellingPrice":parseInt(arr[2]), "description": arr[1], "diff":0};
252
	    }
253
	})
254
	$("#partnerId").typeahead({
255
	  source: customRetailers,
256
	  autoSelect: true,
257
	  displayText:function(item){return item.businessName + "-" + item.address.city;},
258
	  afterSelect:	function(currentItem){
259
	  					currentFofoId = currentItem.partnerId;
260
	  				}
261
	});
262
	populateIndentSummary();
263
});
264
 
265
</script>