| Line 59... |
Line 59... |
| 59 |
}
|
59 |
}
|
| 60 |
|
60 |
|
| 61 |
input[type="text"][disabled] {
|
61 |
input[type="text"][disabled] {
|
| 62 |
background-color: #D1D1D1;
|
62 |
background-color: #D1D1D1;
|
| 63 |
}
|
63 |
}
|
| - |
|
64 |
.border-highlight{
|
| - |
|
65 |
border : 3px solid #00BFFF;
|
| - |
|
66 |
}
|
| 64 |
</style>
|
67 |
</style>
|
| 65 |
<link href="/Support/css/jquery.alerts.css" type="text/css" rel="stylesheet">
|
68 |
<link href="/Support/css/jquery.alerts.css" type="text/css" rel="stylesheet">
|
| 66 |
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
|
69 |
<script type="text/javascript" src="/Support/js/jquery-1.4.2.js"></script>
|
| 67 |
<script type="text/javascript" src="/Support/js/jquery.alerts.js"></script>
|
70 |
<script type="text/javascript" src="/Support/js/jquery.alerts.js"></script>
|
| 68 |
<script type="text/javascript">
|
71 |
<script type="text/javascript">
|
| Line 73... |
Line 76... |
| 73 |
});
|
76 |
});
|
| 74 |
</script>
|
77 |
</script>
|
| 75 |
<script type="text/javascript">
|
78 |
<script type="text/javascript">
|
| 76 |
function calculateStuff()
|
79 |
function calculateStuff()
|
| 77 |
{
|
80 |
{
|
| - |
|
81 |
$('input#minPosTp').removeClass("border-highlight");
|
| - |
|
82 |
$('input#minPosSp').removeClass("border-highlight");
|
| - |
|
83 |
$('input#transferPrice').removeClass("border-highlight");
|
| - |
|
84 |
$('input#serviceTax').removeClass("border-highlight");
|
| - |
|
85 |
$('input#commission').removeClass("border-highlight");
|
| - |
|
86 |
$('input#margin').removeClass("border-highlight");
|
| - |
|
87 |
$('input#marginPer').removeClass("border-highlight");
|
| 78 |
var itemWeight=$('#itemWeight').val();
|
88 |
var itemWeight=$('#itemWeight').val();
|
| 79 |
itemWeight = itemWeight+.05;
|
89 |
itemWeight = +itemWeight+.05;
|
| - |
|
90 |
console.log(itemWeight);
|
| 80 |
if (itemWeight==0){
|
91 |
if (itemWeight==0){
|
| 81 |
var courierCost =45;
|
92 |
var courierCost =45;
|
| 82 |
}
|
93 |
}
|
| 83 |
else{
|
94 |
else{
|
| 84 |
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
|
95 |
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
|
| Line 86... |
Line 97... |
| 86 |
for (var i=0;i<slabs;i++)
|
97 |
for (var i=0;i<slabs;i++)
|
| 87 |
{
|
98 |
{
|
| 88 |
courierCost = courierCost + 35;
|
99 |
courierCost = courierCost + 35;
|
| 89 |
}
|
100 |
}
|
| 90 |
}
|
101 |
}
|
| - |
|
102 |
console.log(courierCost);
|
| 91 |
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
|
103 |
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
|
| 92 |
var sellingPrice=$('#sellingPrice').val();
|
104 |
var sellingPrice=$('#sellingPrice').val();
|
| 93 |
var nlc=$('#maxNlc').val();
|
105 |
var nlc=$('#maxNlc').val();
|
| 94 |
var otherCost=$('#otherCost').val();
|
106 |
var otherCost=$('#otherCost').val();
|
| 95 |
var othCost=parseFloat(otherCost);
|
107 |
var othCost=parseFloat(otherCost);
|
| Line 111... |
Line 123... |
| 111 |
var commisionPrice=((comRate/100)*sellingPrice).toFixed(2);
|
123 |
var commisionPrice=((comRate/100)*sellingPrice).toFixed(2);
|
| 112 |
var ourTp=(sellingPrice-sellingPrice*1.1236*(comRate/100)-((courierCost+0)*1.1236));
|
124 |
var ourTp=(sellingPrice-sellingPrice*1.1236*(comRate/100)-((courierCost+0)*1.1236));
|
| 113 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
125 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
| 114 |
inHouseCost=(+vatValue+15+((.5/100)*sellingPrice)+othCost);
|
126 |
inHouseCost=(+vatValue+15+((.5/100)*sellingPrice)+othCost);
|
| 115 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
127 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
| 116 |
var lowestSp=((+lowestTp+courierCost)/(1-((comRate/100)*(1+.1236)))).toFixed(2);
|
128 |
var lowestSp=(+nlc+(courierCost+0)*1.1236*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate/100+0)*1.1236*(1+vat)-.005*(1+vat));
|
| 117 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
129 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
| 118 |
$('input#minPosTp').val(lowestTp);
|
130 |
$('input#minPosTp').val(lowestTp);
|
| 119 |
$('input#minPosSp').val(lowestSp);
|
131 |
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
|
| 120 |
$('input#transferPrice').val(ourTp);
|
132 |
$('input#transferPrice').val(ourTp);
|
| 121 |
var serviceTax=(.1236*commisionPrice).toFixed(2);
|
133 |
var serviceTax=(.1236*(+commisionPrice+courierCost)).toFixed(2);
|
| 122 |
lowest_possible_tp=parseFloat(lowestTp);
|
134 |
lowest_possible_tp=parseFloat(lowestTp);
|
| 123 |
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
|
135 |
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
|
| 124 |
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
|
136 |
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
|
| 125 |
$('input#marginPer').val(marginPercentage);
|
137 |
$('input#marginPer').val(marginPercentage);
|
| 126 |
$('input#margin').val(newMargin);
|
138 |
$('input#margin').val(newMargin);
|
| 127 |
$('input#sellingPrice').val(sellingPrice);
|
139 |
$('input#sellingPrice').val(sellingPrice);
|
| 128 |
$('input#courierCost').val(courierCost);
|
140 |
$('input#courierCost').val(courierCost);
|
| 129 |
$('input#commission').val(commisionPrice);
|
141 |
$('input#commission').val(commisionPrice);
|
| 130 |
$('input#serviceTax').val(serviceTax);
|
142 |
$('input#serviceTax').val(serviceTax);
|
| - |
|
143 |
$('input#minPosTp').addClass("border-highlight");
|
| - |
|
144 |
$('input#minPosSp').addClass("border-highlight");
|
| - |
|
145 |
$('input#transferPrice').addClass("border-highlight");
|
| - |
|
146 |
$('input#serviceTax').addClass("border-highlight");
|
| - |
|
147 |
$('input#commission').addClass("border-highlight");
|
| - |
|
148 |
$('input#margin').addClass("border-highlight");
|
| - |
|
149 |
$('input#marginPer').addClass("border-highlight");
|
| 131 |
}
|
150 |
}
|
| 132 |
}
|
151 |
}
|
| 133 |
</script>
|
152 |
</script>
|
| 134 |
<script type="text/javascript">
|
153 |
<script type="text/javascript">
|
| 135 |
$('#populateStuff').live('click', function(){
|
154 |
$('#populateStuff').live('click', function(){
|
| 136 |
var itemId=$('#itemId').val();
|
155 |
var itemId=$('#itemId').val();
|
| 137 |
var whId=$('#warehouseId').val();
|
156 |
var whId=$('#warehouseId').val();
|
| 138 |
alert(whId);
|
- |
|
| 139 |
if ( whId==null || whId=="" || isNaN(whId)){
|
157 |
if ( whId==null || whId=="" || isNaN(whId)){
|
| 140 |
jAlert('Please enter valid warehouse id', 'ERROR');
|
158 |
jAlert('Please enter valid warehouse id', 'ERROR');
|
| 141 |
return false;
|
159 |
return false;
|
| 142 |
}
|
160 |
}
|
| 143 |
jQuery.ajax({
|
161 |
jQuery.ajax({
|