Subversion Repositories SmartDukaan

Rev

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

Rev 9569 Rev 9725
Line 45... Line 45...
45
    font-size: 12px;
45
    font-size: 12px;
46
    text-align: center;
46
    text-align: center;
47
    width: 50%;
47
    width: 50%;
48
    font-weight: bold;
48
    font-weight: bold;
49
}
49
}
-
 
50
.top-header {
-
 
51
    background-color: #2789C1;
-
 
52
    display: block;
-
 
53
    height: 20px;
-
 
54
    width: 100%;
-
 
55
}
-
 
56
 
-
 
57
input[type="text"][readonly] {
-
 
58
   background-color: #D1D1D1;
-
 
59
}
-
 
60
 
-
 
61
input[type="text"][disabled] {
-
 
62
   background-color: #D1D1D1;
-
 
63
}
50
</style>
64
</style>
51
<link href="/Support/css/jquery.alerts.css" type="text/css" rel="stylesheet">
65
<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>
66
<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>
67
<script type="text/javascript" src="/Support/js/jquery.alerts.js"></script>
54
<script type="text/javascript">
68
<script type="text/javascript">
Line 59... Line 73...
59
});
73
});
60
</script>
74
</script>
61
<script type="text/javascript">
75
<script type="text/javascript">
62
function calculateStuff()
76
function calculateStuff()
63
{
77
{
64
var itemWeight=document.forms["add-new-item"]["itemWeight"].value;
78
var itemWeight=$('#itemWeight').val();
-
 
79
itemWeight = itemWeight+.05;
65
if (itemWeight==0){
80
if (itemWeight==0){
66
	var courierCost =45;
81
	var courierCost =45;
67
}
82
}
68
else{
83
else{
69
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
84
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
Line 71... Line 86...
71
for (var i=0;i<slabs;i++)
86
for (var i=0;i<slabs;i++)
72
{
87
{
73
	courierCost = courierCost + 35;
88
	courierCost = courierCost + 35;
74
}
89
}
75
}
90
}
76
var transferPrice=document.forms["add-new-item"]["transferPrice"].value;
91
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
77
if ( transferPrice==null || transferPrice=="" || isNaN(transferPrice)){
92
var sellingPrice=$('#sellingPrice').val();
78
	$('input#sellingPrice').val('0.00');
93
var nlc=$('#maxNlc').val();
-
 
94
var otherCost=$('#otherCost').val();
-
 
95
var othCost=parseFloat(otherCost);
-
 
96
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
79
	$('input#courierCost').val('0.00');
97
	$('input#courierCost').val('0.00');
80
	$('input#commission').val('0.00');
98
	$('input#commission').val('0.00');
81
	$('input#serviceTax').val('0.00');
99
	$('input#serviceTax').val('0.00');
-
 
100
	$('input#').val('0.00');
-
 
101
}
-
 
102
else{
-
 
103
var comRate=$('#commissionRate').val();
-
 
104
var margin=$('#margin').val();
-
 
105
var vatRate=$('#vat').val();
-
 
106
if ( vatRate==null || vatRate=="" || isNaN(vatRate)){
-
 
107
	jAlert('Please enter VAT Rate for item','ERROR');
82
	return false;
108
	return false;
83
}
109
}
-
 
110
var vat=vatRate/100;
-
 
111
var commisionPrice=((comRate/100)*sellingPrice).toFixed(2);
-
 
112
var ourTp=(sellingPrice-sellingPrice*1.1236*(comRate/100)-((courierCost+0)*1.1236));
84
var sellingPrice=(((parseInt(transferPrice) + courierCost*1.1236)/(100 - 3.59*1.1236))*100).toFixed(2);
113
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
-
 
114
inHouseCost=(+vatValue+15+((.5/100)*sellingPrice)+othCost);
85
var commisionValue=(.0359*sellingPrice + courierCost).toFixed(2);
115
var lowestTp=(+nlc+inHouseCost).toFixed(2);
86
var commisionPrice=(((.0359*sellingPrice + courierCost)/sellingPrice)*100).toFixed(2);
116
var lowestSp=((+lowestTp+courierCost)/(1-((comRate/100)*(1+.1236)))).toFixed(2);
-
 
117
ourTp = (parseFloat(ourTp)).toFixed(2);
-
 
118
$('input#minPosTp').val(lowestTp);
-
 
119
$('input#minPosSp').val(lowestSp);
-
 
120
$('input#transferPrice').val(ourTp);
87
var serviceTax=(commisionValue*.1236).toFixed(2);
121
var serviceTax=(.1236*commisionPrice).toFixed(2);
-
 
122
lowest_possible_tp=parseFloat(lowestTp);
-
 
123
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
-
 
124
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
-
 
125
$('input#marginPer').val(marginPercentage);
-
 
126
$('input#margin').val(newMargin);
88
$('input#sellingPrice').val(sellingPrice);
127
$('input#sellingPrice').val(sellingPrice);
89
$('input#courierCost').val(courierCost);
128
$('input#courierCost').val(courierCost);
90
$('input#commission').val(commisionPrice);
129
$('input#commission').val(commisionPrice);
91
$('input#serviceTax').val(serviceTax);
130
$('input#serviceTax').val(serviceTax);
92
}
131
}
-
 
132
}
93
</script>
133
</script>
94
<script type="text/javascript">
134
<script type="text/javascript">
95
$('#populateStuff').live('click', function(){
135
$('#populateStuff').live('click', function(){
96
	var itemId=document.forms["add-new-item"]["itemId"].value;
136
	var itemId=$('#itemId').val();
97
	var warehouseId=document.forms["add-new-item"]["warehouseId"].value;
137
	var whId=$('#warehouseId').val();
-
 
138
	alert(whId);
98
	if ( warehouseId==null || warehouseId=="" || isNaN(warehouseId)){
139
	if ( whId==null || whId=="" || isNaN(whId)){
99
		jAlert('Please enter valid warehouse id', 'ERROR');
140
		jAlert('Please enter valid warehouse id', 'ERROR');
100
		return false;
141
		return false;
101
	}
142
	}
102
	jQuery.ajax({
143
	jQuery.ajax({
103
        type : "GET",
144
        type : "GET",
104
        url : "/Support/snapdeal-list!getItemDetailsInJson?itemId="+itemId+"&warehouseId="+warehouseId,
145
        url : "/Support/snapdeal-list!getItemDetailsInJson?itemId="+itemId+"&warehouseId="+whId,
105
		beforeSend: function(){
146
		beforeSend: function(){
106
        $('#ajax-spinner').show();
147
        $('#ajax-spinner').show();
107
		$('#add-new-item')[0].reset();
148
		$('#add-new-item')[0].reset();
108
        },
149
        },
109
        complete: function(){
150
        complete: function(){
Line 126... Line 167...
126
		$('input#exceptionPrice').val('0.0');
167
		$('input#exceptionPrice').val('0.0');
127
		$('input#commission').val('0.0');
168
		$('input#commission').val('0.0');
128
		$('input#serviceTax').val('0.0');
169
		$('input#serviceTax').val('0.0');
129
		$('input#courierCost').val('0.0');
170
		$('input#courierCost').val('0.0');
130
		$('input#maxNlc').val(parsedData.MaxNlc);
171
		$('input#maxNlc').val(parsedData.MaxNlc);
131
		$('input#warehouseId').val(warehouseId);
172
		$('input#warehouseId').val(whId);
132
        },
173
        },
133
		error : function() {
174
		error : function() {
134
			alert("Either item id is already present in snapdeal item or  not a valid item Id");
175
			alert("Either item id is already present in snapdeal item or  not a valid item Id");
135
		 },
176
		 },
136
    });
177
    });
137
	return false;
178
	return false;
138
});
179
});
139
</script>
180
</script>
-
 
181
<div class="top-header">
-
 
182
<span style="float: left; padding-left: 10px; padding-top: 2px; font-size: 14px; font-weight: bolder; color: white;">
-
 
183
ADD NEW PRODUCT
-
 
184
</span>
-
 
185
</div>
140
<form id="add-new-item" action="/Support/snapdeal-list!addNewItem" enctype="multipart/form-data" method="post">
186
<form id="add-new-item" action="/Support/snapdeal-list!addNewItem" enctype="multipart/form-data" method="post">
141
<div class="left" style="float: left; width: 48%;">
187
<div class="left" style="float: left; width: 48%;">
142
<table id="upload" style="text-align: center;width: 100%;height:200px;">
188
<table id="upload" style="text-align: center;width: 100%;height:200px;">
143
<thead>
189
<thead>
144
</thead>
190
</thead>
Line 154... Line 200...
154
<td class="detail">Brand</td>
200
<td class="detail">Brand</td>
155
<td class="value"><input id="brand" name="brand" value='' type="text" readonly/></td>
201
<td class="value"><input id="brand" name="brand" value='' type="text" readonly/></td>
156
</tr>
202
</tr>
157
<tr>
203
<tr>
158
<td class="detail">Model Number</td>
204
<td class="detail">Model Number</td>
159
<td class="value"><input id="modelNumber" name="modelNumber" value='' type="text" readonly/></td>
205
<td class="value"><input id="modelNumber" name="modelNumber" value='' type="text" disabled/></td>
160
</tr>
206
</tr>
161
<tr>
207
<tr>
162
<td class="detail">Model Name</td>
208
<td class="detail">Model Name</td>
163
<td class="value"><input id="modelName" name="modelName" value='' type="text" readonly/></td>
209
<td class="value"><input id="modelName" name="modelName" value='' type="text" disabled/></td>
164
</tr>
210
</tr>
165
<tr>
211
<tr>
166
<td class="detail">Color</td>
212
<td class="detail">Color</td>
167
<td class="value"><input id="color" name="color" value='' type="text" readonly/></td>
213
<td class="value"><input id="color" name="color" value='' type="text" disabled/></td>
168
</tr>
214
</tr>
169
<tr class="detail"></td>
215
<tr class="detail"></td>
170
	<td class="detail">Weight</td>
216
	<td class="detail">Weight</td>
171
	<td class="value"><input id="itemWeight" name="itemWeight" value='0' type="text" readonly/></td>
217
	<td class="value"><input id="itemWeight" name="itemWeight" value='0' type="text" disabled/></td>
172
</tr>
218
</tr>
173
<tr>
219
<tr>
174
<td class="detail">Risky</td>
220
<td class="detail">Risky</td>
175
<td class="value">
221
<td class="value">
176
	 <input id="risky" name="risky" value='' type="text" readonly style="text-transform: uppercase;"/></td>
222
	 <input id="risky" name="risky" value='' type="text" disabled style="text-transform: uppercase;"/></td>
177
</td>
223
</td>
178
</tr>
224
</tr>
179
<tr>
225
<tr>
180
<td class="detail">Status</td>
226
<td class="detail">Status</td>
181
<td class="value"><input id="status" name="status" value='' type="text" readonly/></td>
227
<td class="value"><input id="status" name="status" value='' type="text" disabled/></td>
182
</tr>
228
</tr>
183
<tr>
229
<tr>
184
<td class="detail">Warehouse Id</td>
230
<td class="detail">Warehouse Id</td>
185
<td class="value">
231
<td class="value">
186
	<input id="warehouseId" name="warehouseId" value='' type="text"/></td>
232
	<input id="warehouseId" name="warehouseId" value='' type="text"/></td>
187
</tr>
233
</tr>
188
<tr>
234
<tr>
189
<td class="detail">Snapdeal Selling Price</td>
235
<td class="detail">Snapdeal Selling Price</td>
190
<td class="value">
236
<td class="value">
191
	<input id="sellingPrice" name="sellingPrice" value='' type="text" readonly/></td>
237
	<input id="sellingPrice" name="sellingPrice" value='' type="text" onkeyup="calculateStuff()"></td>
192
</tr>
238
</tr>
193
<tr>
239
<tr>
194
<td class="detail">Suppress Price Feed</td>
240
<td class="detail">Transfer Price</td>
-
 
241
<td class="value"><input id="transferPrice" name="transferPrice" value='' type="text" readonly/></td>
-
 
242
</tr>
-
 
243
<tr>
-
 
244
<td class="detail">Other Cost</td>
-
 
245
<td class="value"><input id="otherCost" name="otherCost" value='0.0' type="text" onkeyup="calculateStuff()"</td>
-
 
246
</tr>
-
 
247
<tr>
-
 
248
<td class="detail">Minimum Possible SP (Calculated)</td>
-
 
249
<td class="value"><input id="minPosSp" name="minPosSp" value='' type="text" readonly/></td>
-
 
250
</tr>
-
 
251
<tr>
-
 
252
<td class="detail">Minimum Possible TP (Calculated)</td>
195
<td class="value">
253
<td class="value">
196
      <select name="isSuppressPriceFeed"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
254
	<input id="minPosTp" name="minPosTp" value='' type="text" readonly/>
197
</td>
255
</td>
198
</tr>
256
</tr>
199
<tr>
257
<tr>
-
 
258
<td class="detail">Website MRP</td>
-
 
259
<td class="value"><input id="webisteMrp" name="webisteMrp" value='' type="text" disabled/></td>
-
 
260
</tr>
-
 
261
<tr>
-
 
262
<td class="detail">Website Selling Price</td>
-
 
263
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='' type="text" disabled/></td>
-
 
264
</tr>
-
 
265
<tr>
200
<td class="detail">Max NLC</td>
266
<td class="detail">Max NLC</td>
201
<td class="value"><input id="maxNlc" name="maxNlc" value=''type="text" readonly/></td>
267
<td class="value"><input id="maxNlc" name="maxNlc" value=''type="text" readonly/></td>
202
</tr>
268
</tr>
203
</tbody>
269
</tbody>
204
</table>
270
</table>
Line 207... Line 273...
207
<table id="upload" style="text-align: center;width: 100%;height:200px;">
273
<table id="upload" style="text-align: center;width: 100%;height:200px;">
208
<thead>
274
<thead>
209
</thead>
275
</thead>
210
<tbody>
276
<tbody>
211
<tr>
277
<tr>
-
 
278
<td class="detail">Margin</td>
-
 
279
<td class="value"><input id="margin" name="margin" value=''type="text" disabled/></td>
-
 
280
</tr>
-
 
281
<tr>
-
 
282
<td class="detail">Margin&nbsp;&#37;</td>
-
 
283
<td class="value"><input id="marginPer" name="marginPer" value='' type="text" disabled/></td>
-
 
284
</tr>
-
 
285
<tr>
212
<td class="detail">Suppress Inventory Feed</td>
286
<td class="detail">Suppress Inventory Feed</td>
213
<td class="value">
287
<td class="value">
214
      <select name="isSuppressInventoryFeed"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
288
      <select name="isSuppressInventoryFeed"><option value="True">Active</option><option selected="selected" value="False">InActive</option></select>
215
</td>
289
</td>
216
</tr>
290
</tr>
217
<tr>
291
<tr>
218
<td class="detail">Transfer Price</td>
292
<td class="detail">Suppress Price Feed</td>
-
 
293
<td class="value">
219
<td class="value"><input id="transferPrice" name="transferPrice" value='' type="text" onkeyup="calculateStuff()" /></td>
294
      <select name="isSuppressPriceFeed"><option selected="selected" value="True">Active</option><option selected="selected" value="False">InActive</option></select>
-
 
295
</td>
220
</tr>
296
</tr>
221
<tr>
297
<tr>
222
<td class="detail">Website MRP</td>
298
<td class="detail">Snapdeal Listed</td>
-
 
299
<td class="value">
223
<td class="value"><input id="webisteMrp" name="webisteMrp" value='' type="text" readonly/></td>
300
      <select name="isListedOnSnapdeal"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
-
 
301
</td>
224
</tr>
302
</tr>
225
<tr>
303
<tr>
226
<td class="detail">Website Selling Price</td>
304
<td class="detail">Manual Favourite</td>
-
 
305
<td class="value">
227
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='' type="text" readonly/></td>
306
      <select name="isManualFavourite"><option value="True">Active</option><option selected="selected" value="False">InActive</option></select>
-
 
307
</td>
228
</tr>
308
</tr>
229
<tr>
309
<tr>
230
<td class="detail">Snapdeal Listed</td>
310
<td class="detail">Auto Increment</td>
231
<td class="value">
311
<td class="value">
232
      <select name="isListedOnSnapdeal"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
312
      <select name="isAutoIncrement"><option value="True">Active</option><option selected="selected" value="False">InActive</option></select>
-
 
313
</td>
-
 
314
</tr>
-
 
315
<tr>
-
 
316
<td class="detail">Auto Decrement</td>
-
 
317
<td class="value">
-
 
318
      <select name="isAutoDecrement"><option value="True">Active</option><option selected="selected" value="False">InActive</option></select>
233
</td>
319
</td>
234
</tr>
320
</tr>
235
<tr>
321
<tr>
236
<td class="detail">Exception Price</td>
322
<td class="detail">Exception Price</td>
237
<td class="value"><input id="exceptionPrice" name="exceptionPrice" value='' type="text"/></td>
323
<td class="value"><input id="exceptionPrice" name="exceptionPrice" value='' type="text"/></td>
238
</tr>
324
</tr>
239
<tr>
325
<tr>
-
 
326
<td class="detail">Commission&nbsp;&#37;</td>
-
 
327
<td class="value"><input id="commissionRate" name="commissionRate" value='3.59'type="text" disabled/></td>
-
 
328
</tr>
-
 
329
<tr>
240
<td class="detail">Commission</td>
330
<td class="detail">Commission</td>
241
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
331
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
242
</tr>
332
</tr>
243
<tr>
333
<tr>
-
 
334
<td class="detail">VAT&nbsp;&#37;</td>
-
 
335
<td class="value"><input id="vat" name="vat" value='' type="text" ></td>
-
 
336
</tr>
-
 
337
<tr>
244
<td class="detail">Service Tax</td>
338
<td class="detail">Service Tax</td>
245
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
339
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
246
</tr>
340
</tr>
247
<tr>
341
<tr>
248
<td class="detail">Courier Cost</td>
342
<td class="detail">Courier Cost</td>