Subversion Repositories SmartDukaan

Rev

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