Subversion Repositories SmartDukaan

Rev

Rev 9568 | Rev 9734 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<style>
* { font-family: Verdana; font-size: 96%; }
                label {
    float: left;
}

#upload > table {
    color: #747474;
    width: 100%;
}


#upload tbody {
    background: url("/Support/images/center-bcg.png") repeat-y scroll right top #F6F6F6;
    font-weight: bold;
}

.detail {
    background: url("/Support/images/center-blue.png") repeat-y scroll left top #E4EBF8;
    border-bottom: 1px solid #B3C1DB;
    border-right: 1px solid #CED9EC;
    color: #1F3D71;
    height: 25px;
    padding: 10px 0 0 24px;
}

.value {
    border-bottom: 1px solid #B3C1DB;
    border-right: 1px solid #CED9EC;
    height: 24px;
    text-align: center;
    color: #747474;
}

select {
    padding-top: 2px;
    vertical-align: middle;
        direction: ltr;
    font-weight: bold;
    width: 50%;
        height: 22px;
}

input {
    font-size: 12px;
    text-align: center;
    width: 50%;
    font-weight: bold;
}
</style>
<link href="/Support/css/jquery.alerts.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/Support/js/jquery.alerts.js"></script>
<script type="text/javascript">
$(document).ready(function() {
  $('#cancelbutton').click(function(e) {
    window.location.href = '/Support/snapdeal-list';
});
});
</script>
<script type="text/javascript">
function calculateStuff()
{
var itemWeight=document.forms["add-new-item"]["itemWeight"].value;
if (itemWeight==0){
        var courierCost =45;
}
else{
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
var courierCost = 45;
for (var i=0;i<slabs;i++)
{
        courierCost = courierCost + 35;
}
}
var transferPrice=document.forms["add-new-item"]["transferPrice"].value;
if ( transferPrice==null || transferPrice=="" || isNaN(transferPrice)){
        $('input#sellingPrice').val('0.00');
        $('input#courierCost').val('0.00');
        $('input#commission').val('0.00');
        $('input#serviceTax').val('0.00');
        return false;
}
var sellingPrice=(((parseInt(transferPrice) + courierCost*1.1236)/(100 - 3.59*1.1236))*100).toFixed(2);
var commisionValue=(.0359*sellingPrice + courierCost).toFixed(2);
var commisionPrice=(((.0359*sellingPrice + courierCost)/sellingPrice)*100).toFixed(2);
var serviceTax=(commisionValue*.1236).toFixed(2);
$('input#sellingPrice').val(sellingPrice);
$('input#courierCost').val(courierCost);
$('input#commission').val(commisionPrice);
$('input#serviceTax').val(serviceTax);
}
</script>
<script type="text/javascript">
$('#populateStuff').live('click', function(){
        var itemId=document.forms["add-new-item"]["itemId"].value;
        var warehouseId=document.forms["add-new-item"]["warehouseId"].value;
        if ( warehouseId==null || warehouseId=="" || isNaN(warehouseId)){
                jAlert('Please enter valid warehouse id', 'ERROR');
                return false;
        }
        jQuery.ajax({
        type : "GET",
        url : "/Support/snapdeal-list!getItemDetailsInJson?itemId="+itemId+"&warehouseId="+warehouseId,
                beforeSend: function(){
        $('#ajax-spinner').show();
                $('#add-new-item')[0].reset();
        },
        complete: function(){
        $('#ajax-spinner').hide();
        },
        success : function(json){
                var parsedData = JSON.parse(json);
                $('input#itemId').val(parsedData.ItemId);
                $('input#brand').val(parsedData.Brand);
                $('input#modelNumber').val(parsedData.ModelNumber);
                $('input#modelName').val(parsedData.ModelName);
                $('input#color').val(parsedData.Color);
                $('input#itemWeight').val(parsedData.Weight);
                $('input#risky').val(parsedData.Risky);
                $('input#status').val(parsedData.Status);
                $('input#webisteMrp').val(parsedData.MRP);
                $('input#webisteSellingPrice').val(parsedData.SellingPrice);
                $('input#sellingPrice').val('0.0');
                $('input#transferPrice').val('0.0');
                $('input#exceptionPrice').val('0.0');
                $('input#commission').val('0.0');
                $('input#serviceTax').val('0.0');
                $('input#courierCost').val('0.0');
                $('input#maxNlc').val(parsedData.MaxNlc);
                $('input#warehouseId').val(warehouseId);
        },
                error : function() {
                        alert("Either item id is already present in snapdeal item or  not a valid item Id");
                 },
    });
        return false;
});
</script>
<form id="add-new-item" action="/Support/snapdeal-list!addNewItem" enctype="multipart/form-data" method="post">
<div class="left" style="float: left; width: 48%;">
<table id="upload" style="text-align: center;width: 100%;height:200px;">
<thead>
</thead>
<tbody>
<tr>
<td class="detail">Item Id</td>
<td class="value">
<input id="itemId" name="itemId" value=''type="text" style="width:25%;">
<input type="button" id="populateStuff" value="Populate" style="width:25%;">
</td>
</tr>
<tr>
<td class="detail">Brand</td>
<td class="value"><input id="brand" name="brand" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Model Number</td>
<td class="value"><input id="modelNumber" name="modelNumber" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Model Name</td>
<td class="value"><input id="modelName" name="modelName" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Color</td>
<td class="value"><input id="color" name="color" value='' type="text" readonly/></td>
</tr>
<tr class="detail"></td>
        <td class="detail">Weight</td>
        <td class="value"><input id="itemWeight" name="itemWeight" value='0' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Risky</td>
<td class="value">
         <input id="risky" name="risky" value='' type="text" readonly style="text-transform: uppercase;"/></td>
</td>
</tr>
<tr>
<td class="detail">Status</td>
<td class="value"><input id="status" name="status" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Warehouse Id</td>
<td class="value">
        <input id="warehouseId" name="warehouseId" value='' type="text"/></td>
</tr>
<tr>
<td class="detail">Snapdeal Selling Price</td>
<td class="value">
        <input id="sellingPrice" name="sellingPrice" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Suppress Price Feed</td>
<td class="value">
      <select name="isSuppressPriceFeed"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
</td>
</tr>
<tr>
<td class="detail">Max NLC</td>
<td class="value"><input id="maxNlc" name="maxNlc" value=''type="text" readonly/></td>
</tr>
</tbody>
</table>
</div>
<div class="left" style="float: right; width: 48%;">
<table id="upload" style="text-align: center;width: 100%;height:200px;">
<thead>
</thead>
<tbody>
<tr>
<td class="detail">Suppress Inventory Feed</td>
<td class="value">
      <select name="isSuppressInventoryFeed"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
</td>
</tr>
<tr>
<td class="detail">Transfer Price</td>
<td class="value"><input id="transferPrice" name="transferPrice" value='' type="text" onkeyup="calculateStuff()" /></td>
</tr>
<tr>
<td class="detail">Website MRP</td>
<td class="value"><input id="webisteMrp" name="webisteMrp" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Website Selling Price</td>
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Snapdeal Listed</td>
<td class="value">
      <select name="isListedOnSnapdeal"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
</td>
</tr>
<tr>
<td class="detail">Exception Price</td>
<td class="value"><input id="exceptionPrice" name="exceptionPrice" value='' type="text"/></td>
</tr>
<tr>
<td class="detail">Commission</td>
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Service Tax</td>
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Courier Cost</td>
<td class="value"><input id="courierCost" name="courierCost" value='' type="text" readonly/></td>
</tr>
<tr>
<td class="detail">Item Id &#64; Snapdeal</td>
<td class="value"><input id="sdItemCode" name="sdItemCode" value='' type="text"></td>
</tr>
<tr>
<td class="detail">SUPC Code</td>
<td class="value"><input id="supc" name="supc" value='' type="text"></td>
</tr>
<tr>
<td class="detail">Action</td>
<td class="value"><input type="submit" value="Update" name="upload" style="width: 25%;">
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
</td>
</tr>
</tbody>
</table>
</div>
</form>