Subversion Repositories SmartDukaan

Rev

Rev 9242 | Rev 9480 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9242 kshitij.so 1
<style>
2
* { font-family: Verdana; font-size: 96%; }
3
		label {
4
    float: left;
5
}
6
 
7
#upload > table {
8
    color: #747474;
9
    width: 100%;
10
}
11
 
12
 
13
#upload tbody {
14
    background: url("/Support/images/center-bcg.png") repeat-y scroll right top #F6F6F6;
15
    font-weight: bold;
16
}
17
 
18
.detail {
19
    background: url("/Support/images/center-blue.png") repeat-y scroll left top #E4EBF8;
20
    border-bottom: 1px solid #B3C1DB;
21
    border-right: 1px solid #CED9EC;
22
    color: #1F3D71;
23
    height: 25px;
24
    padding: 10px 0 0 24px;
25
}
26
 
27
.value {
28
    border-bottom: 1px solid #B3C1DB;
29
    border-right: 1px solid #CED9EC;
30
    height: 24px;
31
    text-align: center;
32
    color: #747474;
33
}
34
 
35
select {
36
    padding-top: 2px;
37
    vertical-align: middle;
38
	direction: ltr;
39
    font-weight: bold;
40
    width: 50%;
41
	height: 22px;
42
}
43
 
44
input {
45
    font-size: 12px;
46
    text-align: center;
47
    width: 50%;
48
    font-weight: bold;
49
}
50
</style>
51
<link href="/Support/css/jquery.alerts.css" type="text/css" rel="stylesheet">
52
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
53
<script type="text/javascript" src="/Support/js/jquery.alerts.js"></script>
54
<script type="text/javascript">
55
$(document).ready(function() {
56
  $('#cancelbutton').click(function(e) {
57
    window.location.href = '/Support/snapdeal-list';
58
});
59
});
60
</script>
61
<script type="text/javascript">
62
function calculateStuff()
63
{
64
var itemWeight=document.forms["add-new-item"]["itemWeight"].value;
65
if (itemWeight==0){
66
	var courierCost =45;
67
}
68
else{
69
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
70
var courierCost = 45;
71
for (var i=0;i<slabs;i++)
72
{
73
	courierCost = courierCost + 35;
74
}
75
}
76
var transferPrice=document.forms["add-new-item"]["transferPrice"].value;
77
if ( transferPrice==null || transferPrice=="" || isNaN(transferPrice)){
78
	$('input#sellingPrice').val('0.00');
79
	$('input#courierCost').val('0.00');
80
	$('input#commission').val('0.00');
81
	$('input#serviceTax').val('0.00');
82
	return false;
83
}
84
var sellingPrice=(((parseInt(transferPrice) + courierCost*1.1236)/(100 - 3.59*1.1236))*100).toFixed(2);
85
var commisionValue=(.0359*sellingPrice + courierCost).toFixed(2);
86
var commisionPrice=(((.0359*sellingPrice + courierCost)/sellingPrice)*100).toFixed(2);
87
var serviceTax=(commisionValue*.1236).toFixed(2);
88
$('input#sellingPrice').val(sellingPrice);
89
$('input#courierCost').val(courierCost);
90
$('input#commission').val(commisionPrice);
91
$('input#serviceTax').val(serviceTax);
92
}
93
</script>
94
<script type="text/javascript">
95
$('#populateStuff').live('click', function(){
96
	var itemId=document.forms["add-new-item"]["itemId"].value;
9478 kshitij.so 97
	var warehouseId=document.forms["add-new-item"]["warehouseId"].value;
98
	if ( warehouseId==null || warehouseId=="" || isNaN(warehouseId)){
99
		alert(warehouseId);
100
		jAlert('Please enter valid warehouse id', 'ERROR');
101
		return false;
102
	}
9242 kshitij.so 103
	jQuery.ajax({
104
        type : "GET",
9478 kshitij.so 105
        url : "/Support/snapdeal-list!getItemDetailsInJson?itemId="+itemId+"&warehouseId="+warehouseId,
9242 kshitij.so 106
		beforeSend: function(){
107
        $('#ajax-spinner').show();
108
		$('#add-new-item')[0].reset();
109
        },
110
        complete: function(){
111
        $('#ajax-spinner').hide();
112
        },
113
        success : function(json){
114
		var parsedData = JSON.parse(json);
115
		$('input#itemId').val(parsedData.ItemId);
116
		$('input#brand').val(parsedData.Brand);
117
		$('input#modelNumber').val(parsedData.ModelNumber);
118
		$('input#modelName').val(parsedData.ModelName);
119
		$('input#color').val(parsedData.Color);
120
		$('input#itemWeight').val(parsedData.Weight);
121
		$('input#risky').val(parsedData.Risky);
122
		$('input#status').val(parsedData.Status);
123
		$('input#webisteMrp').val(parsedData.MRP);
124
		$('input#webisteSellingPrice').val(parsedData.SellingPrice);
125
		$('input#sellingPrice').val('0.0');
126
		$('input#transferPrice').val('0.0');
127
		$('input#exceptionPrice').val('0.0');
128
		$('input#commission').val('0.0');
129
		$('input#serviceTax').val('0.0');
130
		$('input#courierCost').val('0.0');
9478 kshitij.so 131
		$('input#maxNlc').val(parsedData.MaxNlc);
132
		$('input#warehouseId').val(warehouseId);
9242 kshitij.so 133
        },
134
		error : function() {
9478 kshitij.so 135
			alert("Either item id is already present in snapdeal item or  not a valid item Id");
9242 kshitij.so 136
		 },
137
    });
138
	return false;
139
});
140
</script>
141
<form id="add-new-item" action="/Support/snapdeal-list!addNewItem" enctype="multipart/form-data" method="post">
142
<div class="left" style="float: left; width: 48%;">
143
<table id="upload" style="text-align: center;width: 100%;height:200px;">
144
<thead>
145
</thead>
146
<tbody>
147
<tr>
148
<td class="detail">Item Id</td>
149
<td class="value">
150
<input id="itemId" name="itemId" value=''type="text" style="width:25%;">
151
<input type="button" id="populateStuff" value="Populate" style="width:25%;">
152
</td>
153
</tr>
154
<tr>
155
<td class="detail">Brand</td>
156
<td class="value"><input id="brand" name="brand" value='' type="text" readonly/></td>
157
</tr>
158
<tr>
159
<td class="detail">Model Number</td>
160
<td class="value"><input id="modelNumber" name="modelNumber" value='' type="text" readonly/></td>
161
</tr>
162
<tr>
163
<td class="detail">Model Name</td>
164
<td class="value"><input id="modelName" name="modelName" value='' type="text" readonly/></td>
165
</tr>
166
<tr>
167
<td class="detail">Color</td>
168
<td class="value"><input id="color" name="color" value='' type="text" readonly/></td>
169
</tr>
170
<tr>
171
<td class="detail">Risky</td>
172
<td class="value">
173
	 <input id="risky" name="risky" value='' type="text" readonly style="text-transform: uppercase;"/></td>
174
</td>
175
</tr>
176
<tr>
177
<td class="detail">Status</td>
178
<td class="value"><input id="status" name="status" value='' type="text" readonly/></td>
179
</tr>
180
<tr>
181
<td class="detail">Warehouse Id</td>
182
<td class="value">
183
	<input id="warehouseId" name="warehouseId" value='' type="text"/></td>
184
</tr>
185
<tr>
186
<td class="detail">Snapdeal Selling Price</td>
187
<td class="value">
188
	<input id="sellingPrice" name="sellingPrice" value='' type="text" readonly/></td>
189
</tr>
190
<tr>
191
<td class="detail">Suppress Price Feed</td>
192
<td class="value">
193
      <select name="isSuppressPriceFeed"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
194
</td>
195
</tr>
9478 kshitij.so 196
<tr>
197
<td class="detail">Max NLC</td>
198
<td class="value"><input id="maxNlc" name="maxNlc" value=''type="text"></td>
199
</tr>
200
<tr>
9242 kshitij.so 201
</tbody>
202
</table>
203
</div>
204
<div class="left" style="float: right; width: 48%;">
205
<table id="upload" style="text-align: center;width: 100%;height:200px;">
206
<thead>
207
</thead>
208
<tbody>
209
<tr>
210
<td class="detail">Suppress Inventory Feed</td>
211
<td class="value">
212
      <select name="isSuppressInventoryFeed"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
213
</td>
214
</tr>
215
<tr>
216
<td class="detail">Transfer Price</td>
217
<td class="value"><input id="transferPrice" name="transferPrice" value='' type="text" onkeyup="calculateStuff()" /></td>
218
</tr>
219
<tr>
220
<td class="detail">Website MRP</td>
221
<td class="value"><input id="webisteMrp" name="webisteMrp" value='' type="text" readonly/></td>
222
</tr>
223
<tr>
224
<td class="detail">Website Selling Price</td>
225
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='' type="text" readonly/></td>
226
</tr>
227
<tr>
228
<td class="detail">Snapdeal Listed</td>
229
<td class="value">
230
      <select name="isListedOnSnapdeal"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
231
</td>
232
</tr>
233
<tr>
234
<td class="detail">Exception Price</td>
235
<td class="value"><input id="exceptionPrice" name="exceptionPrice" value='' type="text"/></td>
236
</tr>
237
<tr>
238
<td class="detail">Commission</td>
239
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
240
</tr>
241
<tr>
242
<td class="detail">Service Tax</td>
243
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
244
</tr>
245
<tr>
246
<td class="detail">Courier Cost</td>
247
<td class="value"><input id="courierCost" name="courierCost" value='' type="text" readonly/></td>
248
</tr>
249
<tr>
9478 kshitij.so 250
<td class="detail">Item Id &#64; Snapdeal</td>
251
<td class="value"><input id="sdItemCode" name="sdItemCode" value='' type="text"></td>
252
</tr>
253
<tr>
9242 kshitij.so 254
<td class="detail">Action</td>
255
<td class="value"><input type="submit" value="Update" name="upload" style="width: 25%;">
256
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
257
</td>
258
</tr>
259
<tr class="detail" style="display:none;"></td>
260
<td>
261
	<input id="itemWeight" name="itemWeight" value='0' type="text"/>
262
</td>
263
</tr>
264
</tbody>
265
</table>
266
</div>
267
</form>