Subversion Repositories SmartDukaan

Rev

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

Rev 9725 Rev 9734
Line 72... Line 72...
72
}
72
}
73
 
73
 
74
input[type="text"][disabled] {
74
input[type="text"][disabled] {
75
   background-color: #D1D1D1;
75
   background-color: #D1D1D1;
76
}
76
}
-
 
77
 
-
 
78
.border-highlight{
-
 
79
	border : 3px solid #00BFFF;
-
 
80
}
77
</style>
81
</style>
78
<link href="/Support/css/jquery.alerts.css" type="text/css" rel="stylesheet">
82
<link href="/Support/css/jquery.alerts.css" type="text/css" rel="stylesheet">
79
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
83
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
80
<script type="text/javascript" src="/Support/js/jquery.alerts.js"></script>
84
<script type="text/javascript" src="/Support/js/jquery.alerts.js"></script>
81
<script type="text/javascript">
85
<script type="text/javascript">
Line 86... Line 90...
86
});
90
});
87
</script>
91
</script>
88
<script type="text/javascript">
92
<script type="text/javascript">
89
function calculateStuff()
93
function calculateStuff()
90
{
94
{
-
 
95
$('input#minPosTp').removeClass("border-highlight");
-
 
96
$('input#minPosSp').removeClass("border-highlight");
-
 
97
$('input#transferPrice').removeClass("border-highlight");
-
 
98
$('input#serviceTax').removeClass("border-highlight");
-
 
99
$('input#commission').removeClass("border-highlight");
-
 
100
$('input#margin').removeClass("border-highlight");
-
 
101
$('input#marginPer').removeClass("border-highlight");
91
var itemWeight=$('#itemWeight').val();
102
var itemWeight=$('#itemWeight').val();
92
itemWeight = itemWeight+.05;
103
itemWeight = itemWeight+.05;
93
if (itemWeight==0){
104
if (itemWeight==0){
94
	var courierCost =45;
105
	var courierCost =45;
95
}
106
}
Line 108... Line 119...
108
var othCost=parseFloat(otherCost);
119
var othCost=parseFloat(otherCost);
109
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
120
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
110
	$('input#courierCost').val('0.00');
121
	$('input#courierCost').val('0.00');
111
	$('input#commission').val('0.00');
122
	$('input#commission').val('0.00');
112
	$('input#serviceTax').val('0.00');
123
	$('input#serviceTax').val('0.00');
-
 
124
	$('input#transferPrice').val('0.00');
-
 
125
	$('input#minPosTp').val('0.00');
113
	$('input#').val('0.00');
126
	$('input#minPosSp').val('0.00');
114
}
127
}
115
else{
128
else{
116
var comRate=$('#commissionRate').val();
129
var comRate=$('#commissionRate').val();
117
var margin=$('#margin').val();
130
var margin=$('#margin').val();
118
var vatRate=$('#vat').val();
131
var vatRate=$('#vat').val();
119
var vat=vatRate/100;
132
var vat=vatRate/100;
120
var commisionPrice=((comRate/100)*sellingPrice).toFixed(2);
133
var commisionPrice=((comRate/100)*sellingPrice).toFixed(2);
121
var ourTp=(sellingPrice-sellingPrice*1.1236*(comRate/100)-((courierCost+0)*1.1236));
134
var ourTp=(sellingPrice-sellingPrice*1.1236*(comRate/100)-((courierCost+0)*1.1236));
122
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
135
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
-
 
136
console.log(vatValue);
123
inHouseCost=(+vatValue+15+((.5/100)*sellingPrice)+othCost);
137
inHouseCost=(+vatValue+15+((.5/100)*sellingPrice)+othCost);
124
var lowestTp=(+nlc+inHouseCost).toFixed(2);
138
var lowestTp=(+nlc+inHouseCost).toFixed(2);
125
var lowestSp=((+lowestTp+courierCost)/(1-((comRate/100)*(1+.1236)))).toFixed(2);
139
var lowestSp=(+nlc+(courierCost+0)*1.1236*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate/100+0)*1.1236*(1+vat)-.005*(1+vat));
126
ourTp = (parseFloat(ourTp)).toFixed(2);
140
ourTp = (parseFloat(ourTp)).toFixed(2);
127
$('input#minPosTp').val(lowestTp);
141
$('input#minPosTp').val(lowestTp);
128
$('input#minPosSp').val(lowestSp);
142
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
129
$('input#transferPrice').val(ourTp);
143
$('input#transferPrice').val(ourTp);
130
var serviceTax=(.1236*commisionPrice).toFixed(2);
144
var serviceTax=(.1236*(+commisionPrice+courierCost)).toFixed(2);
131
lowest_possible_tp=parseFloat(lowestTp);
145
lowest_possible_tp=parseFloat(lowestTp);
132
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
146
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
133
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
147
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
134
$('input#marginPer').val(marginPercentage);
148
$('input#marginPer').val(marginPercentage);
135
$('input#margin').val(newMargin);
149
$('input#margin').val(newMargin);
136
$('input#sellingPrice').val(sellingPrice);
150
$('input#sellingPrice').val(sellingPrice);
137
$('input#courierCost').val(courierCost);
151
$('input#courierCost').val(courierCost);
138
$('input#commission').val(commisionPrice);
152
$('input#commission').val(commisionPrice);
139
$('input#serviceTax').val(serviceTax);
153
$('input#serviceTax').val(serviceTax);
-
 
154
$('input#minPosTp').addClass("border-highlight");
-
 
155
$('input#minPosSp').addClass("border-highlight");
-
 
156
$('input#transferPrice').addClass("border-highlight");
-
 
157
$('input#serviceTax').addClass("border-highlight");
-
 
158
$('input#commission').addClass("border-highlight");
-
 
159
$('input#margin').addClass("border-highlight");
-
 
160
$('input#marginPer').addClass("border-highlight");
140
}
161
}
141
}
162
}
142
</script>
163
</script>
143
<script type="text/javascript">
164
<script type="text/javascript">
144
$('#getMxNlc').live('click', function(){
165
$('#getMxNlc').live('click', function(){
Line 154... Line 175...
154
        $('#ajax-spinner').hide();
175
        $('#ajax-spinner').hide();
155
        },
176
        },
156
        success : function(json){
177
        success : function(json){
157
		var parsedData = JSON.parse(json);
178
		var parsedData = JSON.parse(json);
158
		$('input#maxNlc').val(parsedData.MaxNlc);
179
		$('input#maxNlc').val(parsedData.MaxNlc);
-
 
180
		calculateStuff();
159
        },
181
        },
160
		error : function() {
182
		error : function() {
161
			$('input#warehouseId').val('');
183
			$('input#warehouseId').val('');
162
			alert("Unable to get max nlc possibly wrong warehouse");
184
			alert("Unable to get max nlc possibly wrong warehouse");
163
		 },
185
		 },
Line 257... Line 279...
257
	<input id="currentTp" name="currentTp" value='$mpDetail.getCurrentTp()'type="text" readonly/></td>
279
	<input id="currentTp" name="currentTp" value='$mpDetail.getCurrentTp()'type="text" readonly/></td>
258
</tr>
280
</tr>
259
#set ($margin = $mpDetail.getCurrentTp() - $mpDetail.getMinimumPossibleTp())
281
#set ($margin = $mpDetail.getCurrentTp() - $mpDetail.getMinimumPossibleTp())
260
<tr>
282
<tr>
261
<td class="detail">Margin</td>
283
<td class="detail">Margin</td>
262
<td class="value"><input id="margin" name="margin" value='$action.getRoundOfValue("$margin")'type="text" disabled/></td>
284
<td class="value"><input id="margin" name="margin" value='$action.getRoundOfValue("$margin")'type="text" style="width:20%;" disabled/>
-
 
285
#if($mpDetail.getCurrentSp()==0)
-
 
286
	#set ($marginPercentage = 0)
-
 
287
#else
-
 
288
	#set ($marginPercentage = ($margin/$mpDetail.getCurrentSp()*100))
-
 
289
#end
-
 
290
#set($roundMarginPer = $action.getRoundOfValue("$marginPercentage"))
-
 
291
<span style="font-weight:bold;color:black;">Margin&nbsp;&#37;</span><input id="marginPer" name="marginPer" value='$roundMarginPer' type="text" style="width:20%;" disabled/></td>
263
</tr>
292
</tr>
264
<tr>
293
<tr>
265
<td class="detail">Last Updated Inventory</td>
294
<td class="detail">Last Updated Inventory</td>
266
<td class="value"><input id="lastUpdatedInventory" name="lastUpdatedInventory" value='$itemDetail.getLastUpdatedInventory()' type="text" disabled></td>
295
<td class="value"><input id="lastUpdatedInventory" name="lastUpdatedInventory" value='$itemDetail.getLastUpdatedInventory()' type="text" disabled></td>
267
</tr>
296
</tr>
Line 271... Line 300...
271
		<td class="value"><input id="lastUpdatedInventoryTimestamp" name="lastUpdatedInventoryTimestamp" value='Not Available' type="text" disabled/></td>
300
		<td class="value"><input id="lastUpdatedInventoryTimestamp" name="lastUpdatedInventoryTimestamp" value='Not Available' type="text" disabled/></td>
272
	  #else
301
	  #else
273
		<td class="value"><input id="lastUpdatedInventoryTimestamp" name="lastUpdatedInventoryTimestamp" value='$action.getLastUpdatedInventoryTimestamp()' type="text" disabled/></td>
302
		<td class="value"><input id="lastUpdatedInventoryTimestamp" name="lastUpdatedInventoryTimestamp" value='$action.getLastUpdatedInventoryTimestamp()' type="text" disabled/></td>
274
#end
303
#end
275
</tr>
304
</tr>
276
<tr>
305
<!--<tr>
277
<td class="detail">Last Checked Price Timestamp</td>
306
<td class="detail">Last Checked Price Timestamp</td>
278
#if ($mpDetail.getLastCheckedTimestamp()==0)
307
#if ($mpDetail.getLastCheckedTimestamp()==0)
279
	<td class="value"><input id="lastCheckedPriceTimestamp" name="lastCheckedPriceTimestamp" value='Not Available' type="text" disabled/></td>
308
	<td class="value"><input id="lastCheckedPriceTimestamp" name="lastCheckedPriceTimestamp" value='Not Available' type="text" disabled/></td>
280
#else
309
#else
281
<td class="value"><input id="lastCheckedPriceTimestamp" name="lastCheckedPriceTimestamp" value='$action.getLastCheckedTimestamp()' type="text" disabled/></td>
310
<td class="value"><input id="lastCheckedPriceTimestamp" name="lastCheckedPriceTimestamp" value='$action.getLastCheckedTimestamp()' type="text" disabled/></td>
282
#end
311
#end
283
</tr>
312
</tr>
-
 
313
-->
284
</tbody>
314
</tbody>
285
</table>
315
</table>
286
</div>
316
</div>
287
<div class="left" style="float: right; width: 48%;">
317
<div class="left" style="float: right; width: 48%;">
288
<table id="upload" style="text-align: center;width: 100%;height:200px;">
318
<table id="upload" style="text-align: center;width: 100%;height:200px;">
Line 351... Line 381...
351
		<select name="isManualFavourite"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
381
		<select name="isManualFavourite"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
352
	  #end
382
	  #end
353
</td>
383
</td>
354
</tr>
384
</tr>
355
<tr>
385
<tr>
356
<td class="detail">Margin&nbsp;&#37;</td>
-
 
357
#if($mpDetail.getCurrentSp()==0)
-
 
358
	#set ($marginPercentage = 0)
-
 
359
#else
-
 
360
	#set ($marginPercentage = ($margin/$mpDetail.getCurrentSp()*100))
-
 
361
#end
-
 
362
#set($roundMarginPer = $action.getRoundOfValue("$marginPercentage"))
-
 
363
<td class="value"><input id="marginPer" name="marginPer" value='$roundMarginPer' type="text" disabled/></td>
-
 
364
</tr>
-
 
365
<tr>
-
 
366
<td class="detail">Commission&nbsp;&#37;</td>
386
<td class="detail">Commission&nbsp;&#37;</td>
367
<td class="value"><input id="commissionRate" name="commissionRate" value='$mpDetail.getCommission()'type="text" disabled/></td>
387
<td class="value"><input id="commissionRate" name="commissionRate" value='$mpDetail.getCommission()'type="text" disabled/></td>
368
</tr>
388
</tr>
369
<tr>
389
<tr>
370
<td class="detail">Exception Price</td>
390
<td class="detail">Exception Price</td>
Line 427... Line 447...
427
</div>
447
</div>
428
<div class="inventory-details">
448
<div class="inventory-details">
429
	<table id="inventory-info" style="width: 100%">
449
	<table id="inventory-info" style="width: 100%">
430
        <thead>
450
        <thead>
431
            <tr>
451
            <tr>
432
				<th>Warehouse Id</th>
452
				<th>Id</th>
433
				<th>Warehouse Desc</th>
453
				<th>Warehouse Desc</th>
-
 
454
				<th>Warehouse Location</th>
434
				<th>Warehouse Type</th>
455
				<th>Warehouse Type</th>
435
				<th>Inventory Type</th>
456
				<th>Inventory Type</th>
436
				<th>Availability</th>
457
				<th>Availability</th>
437
				<th>Reserved</th>
458
				<th>Reserved</th>
438
				<th>Held</th>
459
				<th>Ebay Held</th>
-
 
460
				<th>Flipkart Held</th>
-
 
461
				<th>Snapdeal Held</th>
439
            </tr>
462
            </tr>
440
        </thead>
463
        </thead>
441
        <tbody>
464
        <tbody>
442
	#set($itemInventory = $action.getItemInventory("$itemDetail.getItem_id()"))
465
	#set($itemInventory = $action.getItemInventory("$itemDetail.getItem_id()"))
443
	#set($availability = $itemInventory.getAvailability())
466
	#set($availability = $itemInventory.getAvailability())
444
	#set($reserved = $itemInventory.getReserved())
467
	#set($reserved = $itemInventory.getReserved())
445
	#set($held = $itemInventory.getHeld())
468
	#set($held = $itemInventory.getHeld())
-
 
469
			#foreach( $keyAvailable in $availability.keySet() )
-
 
470
			#if($keyAvailable!=16)
446
            <tr style="border: 1px">
471
				<tr style="border: 1px">
447
				#foreach( $keyAvailable in $availability.keySet() )
472
					#set($whObj = $action.getWarehouse("$keyAvailable","$itemDetail.getItem_id()"))
448
					#set($whObj = $action.getWarehouse("$keyAvailable"))
473
					#set($holdInventoryMap = $action.getHoldInventoryMapForItem())
449
					#set($warehouseCheck="False")
474
					#set($warehouseCheck="False")
450
					#if ($whObj.getWarehouseType()=="OURS" && $whObj.getInventoryType()=="GOOD")
475
					#if ($whObj.getWarehouseType()=="OURS" && $whObj.getInventoryType()=="GOOD")
451
						#set($warehouseCheck="True")
476
						#set($warehouseCheck="True")
452
					#end
477
					#end
453
					<td style="text-align:center;width:10%;">$keyAvailable</td>
478
					<td style="text-align:center;width:5%;">$keyAvailable</td>
454
					<td style="text-align:center;width:20%;">$whObj.getDisplayName()</td>
479
					<td style="text-align:center;width:10%;">$whObj.getDisplayName()</td>
-
 
480
					<td style="text-align:center;width:30%;">$whObj.getLocation()</td>
455
					<td style="text-align:center;width:10%;">$whObj.getWarehouseType()</td>
481
					<td style="text-align:center;width:10%;">$whObj.getWarehouseType()</td>
456
					<td style="text-align:center;width:10%;">$whObj.getInventoryType()</td>
482
					<td style="text-align:center;width:5%;">$whObj.getInventoryType()</td>
457
					<td style="text-align:center;width:10%;">$availability.get($keyAvailable)</td>
483
					<td style="text-align:center;width:5%;">$availability.get($keyAvailable)</td>
458
					<td style="text-align:center;width:10%;">$reserved.get($keyAvailable)</td>
484
					<td style="text-align:center;width:5%;">$reserved.get($keyAvailable)</td>
-
 
485
					<td style="text-align:center;width:5%;">#if($$holdInventoryMap.get(6))$holdInventoryMap.get(6)#{else}0#end</td>
-
 
486
					<td style="text-align:center;width:5%;">#if($$holdInventoryMap.get(8))$holdInventoryMap.get(8)#{else}0#end</td>
459
					<td style="text-align:center;">
487
					<td style="text-align:center;">
460
						#if ($warehouseCheck=="True")
488
						#if ($warehouseCheck=="True")
461
							<input id="heldInventory_$keyAvailable" name="heldInventory" value='$held.get($keyAvailable)' type="text" style="width:25%;"/>
489
							<input id="heldInventory_$keyAvailable" name="heldInventory" value='#if($holdInventoryMap.get(7))$holdInventoryMap.get(7)#{else}0#end' type="text" style="width:20%;"/>
462
							<input type="button" class="changeHeld" value="Update" warehouse_id="$keyAvailable" item_id="$itemDetail.getItem_id()" style="width:25%;margin-left:10px;">
490
							<input type="button" class="changeHeld" value="Update" warehouse_id="$keyAvailable" item_id="$itemDetail.getItem_id()" style="width:20%;margin-left:10px;">
463
						#else
491
						#else
464
							<input id="heldInventory_$keyAvailable" name="heldInventory" value='$held.get($keyAvailable)' type="text" style="width:25%;" readonly/>
492
							<input id="heldInventory_$keyAvailable" name="heldInventory" value='#if($holdInventoryMap.get(7))$holdInventoryMap.get(7)#{else}0#end' type="text" style="width:20%;" readonly/>
465
							<input type="button" value="Update" style="width:25%;margin-left:10px;" disabled/>
493
							<input type="button" value="Update" style="width:20%;margin-left:10px;" disabled/>
466
						#end
494
						#end
467
					</td>
495
					</td>
468
            </tr>
496
            </tr>
-
 
497
			#end
469
				#end
498
			#end
470
        </tbody>
499
        </tbody>
471
    </table>
500
    </table>
472
</div>
501
</div>
473
<!--Inventory details end-->
502
<!--Inventory details end-->
474
<!--
503
<!--