0% found this document useful (0 votes)
76 views27 pages

Fee Calculator

The document outlines a web form for calculating potential earnings from selling products on various online marketplaces. It includes fields for entering the MRP, selling price, GST percentage, and selecting product categories and shipping types. Additionally, it provides a configuration for different marketplaces, their commission rates, and shipping costs based on product weight.

Uploaded by

Deepesh barod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views27 pages

Fee Calculator

The document outlines a web form for calculating potential earnings from selling products on various online marketplaces. It includes fields for entering the MRP, selling price, GST percentage, and selecting product categories and shipping types. Additionally, it provides a configuration for different marketplaces, their commission rates, and shipping costs based on product weight.

Uploaded by

Deepesh barod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

<!

DOCTYPE
HTML>
<html lang="en-
US">

</
style>
<div class="wrapper">
<div class="page">

<div class="title-text">
<h4>Find out how much you can earn by selling on top
marketplaces!</h4>
</div>
<div class="form-horizontal" role="form"
id="calculateView" style="display: none;">
<div class="row row1">
<div class="form-group sell_price">
<label class="control-label col-sm-4" for=" sellingprice"
style="margin-left: 15px;">MRP</label>
<div class="col-sm-4">
<input type="number" id="marketprice" class="form-
control mrp marketprice rates txtNumeric"
placeholder="MRP" name="mrpprice" value="">
</div>
</div>
<div class="form-group sell_price">
<label class="control-label col-sm-4" for="pwd"
style="margin-left: 15px;">Selling Price</label>
<div class="col-sm-4">
<input type="number" id="sprice" class="form-control
sprice mrp txtNumeric" placeholder="Selling Price"
name="sellingprice" value="">
</div>
<span class="difference">50.0% Discount</span>
</div>
<div class="form-group sell_price">
<label class="control-label col-sm-4" for="pwd"
style="margin-left: 15px;">Enter GST%</label>
<div class="col-sm-4">
<input type="number" placeholder="GST %" class="form-
control sprice mrp txtNumeric" id="gst-input"
maxlength="5" name="gstcollected" value="">
</div>
<span style="">%</span>
</div>
</div>
<div class="row row1">
<div class="form-group ch-category">
<label class="control-label col-sm-4 package"
for="email">Choose a Category</label>
<div class="col-sm-7" style="padding-left: 13px !
important;">
<select class="form-control cat_list" id="category"
value="cat1" style=" padding:0px!important; font-size:13px
!important;">
</select>
</div>
</div>
<div class="form-group ch-category">
<label class="control-label col-sm-4" for="pwd"
style="padding-left: 0px;">Choose Package Type</label>
<div class="col-sm-7">
<select type="email" class="form-control" class="cat_list"
id="shipping" placeholder="" style=" padding:0px!
important; font-size:13px !important;">
</select>
</div>
</div>
<div class="form-group col-md-7 button-container">
<button type="submit" class="btn btn-info btn-lg calc-
submit" id="calculate">Calculate</button>
</div>
</div>
</div>

<div class="clear"></div>
<div class="loader"></div>

<div class="bs-example" data-example-id="condensed-


table">

</div>
<div class="desc" style="display: none;">
<p>*Note: Above calculations are not 100% accurate.
These are approximate figures only and may vary based on
exact product<br/> weight and packaging
dimensions.</p>
</div>
</div>
</div>

</div>
</div>

</div>

<div class="clear"></div>
<div class="loader"></div>

<script type="text/javascript">
function _getBTcalcConfig(){
var config = {
"marketPlaces": [ /* To add a new market. Add an object
with required key, name (optional) & logo (optional). Also
update the appropriate key value pairs under weights,
categories, serviceGst, marketplacePaymentFee objects */
{
"key": "flipkart",
"name": "Flipkart",
"logo":
"http://browntape.com/wp-content/uploads/2015/09/flipkart
.png",
"column": "1"
},
{
"key": "snapdeal",
"name": "Snapdeal",
"logo":
"http://browntape.com/wp-content/uploads/2015/09/snapde
al.png",
"column": "2"
},
{
"key": "amazon",
"name": "Amazon",
"logo":
"http://browntape.com/wp-content/uploads/2015/09/amazon
.png",
"column": "3"
},
{
"key": "paytm",
"name": "Paytm",
"logo":
"http://browntape.com/wp-content/uploads/2015/09/paytm.
png",
"column": "4"
},
{
"key": "shopclues",
"name": "Shopclues",
"logo":
"http://browntape.com/wp-content/uploads/2015/09/shopclu
es.png",
"column": "5"
},
{
"key": "ebay",
"name": "&nbsp;&nbsp;&nbsp;Ebay",
"logo":
"http://browntape.com/wp-content/uploads/2015/09/ebay.p
ng",
"column": "6"
}
],
"weights": { /* Add a new weight 'wX' section here with
appropriate name & marketplace commissions under the
shippingComm object (property name should match value
of key property in marketplaces array) */
"w1":{
"name": "< 250gms | 20cm x 22cm x 3cm",
"shippingComm": {
"flipkart": "55",
"snapdeal": "50",
"amazon": "40",
"paytm": "45",
"shopclues": "50",
"ebay": "38"
}
},
"w2":{
"name": "< 500gms | 20cm x 22cm x 3cm",
"shippingComm": {
"flipkart": "55",
"snapdeal": "50",
"amazon": "40",
"paytm": "45",
"shopclues": "50",
"ebay": "47"
}
},
"w3":{
"name": "500gms | 30cm x 14cm x 5cm",
"shippingComm": {
"flipkart": "55",
"snapdeal": "50",
"amazon": "40",
"paytm": "45",
"shopclues": "50",
"ebay": "47"
}
},
"w4":{
"name": "1kg | 10cm x 10cm x 9.5cm",
"shippingComm": {
"flipkart": "95",
"snapdeal": "50",
"amazon": "80",
"paytm": "90",
"shopclues": "90",
"ebay": "94"
}
},
"w5":{
"name": "5kgs | 38.8cm x 34cm x 50.3cm",
"shippingComm": {
"flipkart": "415",
"snapdeal": "1050",
"amazon": "400",
"paytm": "450",
"shopclues": "410",
"ebay": "470"
}
},
"w6":{
"name": "8kgs | 41.8cm x 38.2cm x 65.2cm",
"shippingComm": {
"flipkart": "655",
"snapdeal": "1610",
"amazon": "640",
"paytm": "720",
"shopclues": "650",
"ebay": "752"
}
},
"w7":{
"name": "9kg | 45.40 cm x 31.43 cm x 7.62 cm",
"shippingComm": {
"flipkart": "735",
"snapdeal": "170",
"amazon": "720",
"paytm": "810",
"shopclues": "730",
"ebay": "846"
}
},
"w8":{
"name": "10kg | 40.16 cm x 32.86 cm x 25.88 cm",
"shippingComm": {
"flipkart": "815",
"snapdeal": "490",
"amazon": "800",
"paytm": "900",
"shopclues": "810",
"ebay": "940"
}
},
"w9":{
"name": "25kg | 54.8 cm x 42.1 cm x 33.5 cm",
"shippingComm": {
"flipkart": "2015",
"snapdeal": "1210",
"amazon": "2000",
"paytm": "2250",
"shopclues": "2010",
"ebay": "2350"
}
}
},
"categories":{ /* Add a new category 'cX' section here with
appropriate name & marketplace commission percetages
under the marketComm object (property name should
match value of key property in marketplaces array) */
"c1": {
"name": "Apparels & Accessories",
"marketComm":{
"flipkart": "15",
"snapdeal": "15",
"amazon": "8",
"paytm": "14",
"shopclues": "15",
"ebay": "7"
}
},
"c2":{
"name": "Jewellery",
"marketComm":{
"flipkart": "25",
"snapdeal": "14",
"amazon": "15",
"paytm": "7",
"shopclues": "17",
"ebay": "10"
}
},
"c3":{
"name": "Shoes",
"marketComm":{
"flipkart": "13",
"snapdeal": "10",
"amazon": "11",
"paytm": "12",
"shopclues": "15",
"ebay": "7"
}
},
"c4": {
"name": "Deodorants & Cosmetics",
"marketComm":{
"flipkart": "7",
"snapdeal": "7",
"amazon": "5",
"paytm": "7",
"shopclues": "15",
"ebay": "2"
}
},
"c5": {
"name": "Perfumes",
"marketComm":{
"flipkart": "7",
"snapdeal": "5",
"amazon": "5",
"paytm": "7",
"shopclues": "15",
"ebay": "7"
}
},
"c6": {
"name": "Home Furnishings and Furniture",
"marketComm":{
"flipkart": "15",
"snapdeal": "13",
"amazon": "5",
"paytm": "15",
"shopclues": "10",
"ebay": "7"
}
},
"c7": {
"name": "Health,Gourmet,Beverages",
"marketComm":{
"flipkart": "7",
"snapdeal": "9",
"amazon": "5",
"paytm": "11",
"shopclues": "8",
"ebay": "7"
}
},
"c8": {
"name": "Kitchen & Bar",
"marketComm":{
"flipkart": "5",
"snapdeal": "13",
"amazon": "5",
"paytm": "15",
"shopclues": "8",
"ebay": "7"
}
},
"c9": {
"name": "Home Appliances",
"marketComm":{
"flipkart": "5",
"snapdeal": "4",
"amazon": "5",
"paytm": "7",
"shopclues": "4",
"ebay": "5"
}
},
"c10": {
"name": "Personal Care",
"marketComm":{
"flipkart": "7",
"snapdeal": "8",
"amazon": "8",
"paytm": "3",
"shopclues": "15",
"ebay": "2"
}
},
"c11": {
"name": "Car & Bike Accessories",
"marketComm":{
"flipkart": "15",
"snapdeal": "20",
"amazon": "5",
"paytm": "7",
"shopclues": "6",
"ebay": "7"
}
},
"c12": {
"name": "Hand Towel & Power Tools",
"marketComm":{
"flipkart": "7",
"snapdeal": "16",
"amazon": "5",
"paytm": "15",
"shopclues": "6",
"ebay": "7"
}
},
"c13": {
"name": "Stationary",
"marketComm":{
"flipkart": "11",
"snapdeal": "5",
"amazon": "5",
"paytm": "7",
"shopclues": "5",
"ebay": "7"
}
},
"c14": {
"name": "Travel Gear & Luggage",
"marketComm":{
"flipkart": "15",
"snapdeal": "15",
"amazon": "11",
"paytm": "13",
"shopclues": "15",
"ebay": "7"
}
},
"c15": {
"name": "Memory Card, Pen Drive & Hard Disk",
"marketComm":{
"flipkart": "7",
"snapdeal": "7",
"amazon": "5",
"paytm": "3",
"shopclues": "4",
"ebay": "1"
}
},
"c16": {
"name": "Mobile & Accessories",
"marketComm":{
"flipkart": "15",
"snapdeal": "20",
"amazon": "5",
"paytm": "2",
"shopclues": "10",
"ebay": "5"
}
}
},
"serviceGst": { /* Add GST for a particular vendor (property
name should match value of key property in marketplaces
array) */
"flipkart": "18",
"snapdeal": "18",
"amazon": "18",
"paytm": "18",
"shopclues": "18",
"ebay": "18",
"jabong": "18"
},
"marketplacePaymentFee": { /* Add market place payment
fee for a particular vendor (property name should match
value of key property in marketplaces array) */
"flipkart": {
"type": "slab",
"variable": true,
"grad": {
"sellingPrice": {
"below": {
"250": 0,
"500": 5
},
"above": {
"500": 10
}
}
}
},
"snapdeal": {
"type": "mixed",
"variable": true,
"grad": {
"minSlabComm": "20",
"perComm": "3.2"
}
},
"amazon": {
"type": "slab",
"variable": false,
"val": 10
},
"paytm": {
"type": "percent",
"variable": false,
"val": 3.03
},
"shopclues": {
"type": "slab",
"variable": false,
"val": 0
},
"ebay": {
"type": "percent",
"variable": false,
"val": 4.5
}
},
"defaults":{ /* Default value to be set */
"mrp": "2000",
"sellPrice": "1000",
"gst": "18",
"category": "c1",
"weight": "w1",
"tablerows": [ /* Rows to be shown in the table. Setting the
display property to 'false' will hide the associated row */
{
"id": "sellPrice",
"name": "Selling Price",
"display": true,
"bold": true
},
{
"id": "marketCommission",
"name": "Marketplace Commission",
"display": true,
"mar_comm_meta": true,
"neg": true
},
{
"id": "gstOnCommission",
"name": "GST on Commission @18%",
"display": true,
"neg": true
},
{
"id": "marketPayFee",
"name": "Marketplace Payment Fee",
"display": true,
"mar_pay_fee_meta": true,
"neg": true
},
{
"id": "gstOnMarketFee",
"name": "GST on Payment Fee @18%",
"display": true,
"neg": true
},
{
"id": "gst",
"name": "GST on Item (as on top)",
"display": true,
"neg": true
},
{
"id": "shippingCommission",
"name": "Shipping (incl. GST)",
"display": true,
"neg": true
},
{
"id": "netSlab",
"name": "Net in Hand*",
"display": true,
"showRs": true,
"class": "red"
},
{
"id": "deductionPercent",
"name": "Deductions",
"display": true,
"neg": true,
"per": true
},
{
"id": "gainPercent",
"name": "Net In Hand%",
"display": true,
"per": true,
"class": "red"
}
]
}
} //end config
return config;
}
jQuery(document).ready(function($){

var _loader = $(".loader");


// _loader.css("display", "block");
// _loader.fadeOut(1000);
var bsExample = $(".bs-example");

bsExample.animate({
opacity: 1,
}, 4000, function() {
// Animation complete.
});

function sellerCalcConstructor(){
console.log('sellerCalc constructor init')
}

var sellerCalc = new sellerCalcConstructor();


sellerCalc.config = _getBTcalcConfig();
console.log("config json:",sellerCalc.config);

var _categories = sellerCalc.config.categories;


var _weights = sellerCalc.config.weights;
var _serTax = sellerCalc.config.serviceGst;
var _marketPlacePayFee =
sellerCalc.config.marketplacePaymentFee;
var _marketPlaces = sellerCalc.config.marketPlaces;

// var _marketPlaceKeys = Object.keys(_marketPlaces);


var _tableRows = sellerCalc.config.defaults.tablerows;

var _calculateView = $("#calculateView");


var _desc = $(".desc");
var _mrpHandle = $("#marketprice");
var _spHandle = $("#sprice");
var _gstHandle = $("#gst-input");
var _selCategory = $("#category");
var _selWeight = $("#shipping");
var _dscntHandle = $(".difference");

function _appendOptions(selector,ref){
var optionString = '';
for(var i in ref){
optionString += "<option value='" + i + "'>" + ref[i].name
+ "</option>";
}
$(selector).append(optionString);
}
sellerCalc._appendOptions = _appendOptions;
var _tableBody = null;

function _startCalc(mrp,sp,gst,category,weight){
console.log("start calc");
sp = Number(sp);
// sellerCalc._showSpAlert()
var rowVals = {};

for(var iz in _marketPlaces){
var mkt = _marketPlaces[iz];
for(var iy in mkt){
if(iy !== "logo" && iy !== "key" && iy !== "name"){
mkt[iy] = '';
}
}
}

for(var iz in _tableRows){
var obj = _tableRows[iz];
switch(obj.id){
case "sellPrice": {
var mk = _addRowVals(sp,obj.id);
sellerCalc._appendRow(obj, mk);
};break;
case "marketCommission": {
var catRef = null
for(var z in _categories){
if(z === category){
catRef = _categories[z];
break;
}
}

rowVals = {};
for(var z in _marketPlaces){
for(var y in catRef.marketComm){
if(_marketPlaces[z].key === y){
var mpc = Math.round( Number(catRef.marketComm[y]) /
100 * sp );
_marketPlaces[z][obj.id] = mpc
_marketPlaces[z]["mar_comm_meta"] = " (" +
catRef.marketComm[y] + "%)";
rowVals[z] = {
key: y,
val: mpc
}
break;
}
}
}
// console.log("rowVals",rowVals);
// console.log("_marketPlaces:", _marketPlaces);

sellerCalc._appendRow(obj, rowVals);
};break;
case "gstOnCommission": {
rowVals = {};
for(var z in _marketPlaces){
for(var y in _serTax){
if(_marketPlaces[z].key === y){
var stc = Math.round( Number(_serTax[y]) / 100 *
_marketPlaces[z].marketCommission );
_marketPlaces[z][obj.id] = stc;
rowVals[z] = {
key: y,
val: stc
}
break;
}
}
}
sellerCalc._appendRow(obj, rowVals);
};break;
case "marketPayFee":{
rowVals = {};

for(var z in _marketPlaces){
var mrpf = 0;
for(var y in _marketPlacePayFee){
if(_marketPlaces[z].key === y){
var mrCommRef = _marketPlacePayFee[y];
if(mrCommRef.variable){
var gradSpRef = mrCommRef.grad.sellingPrice;
if(mrCommRef.type === "slab"){

if(gradSpRef){ //flipkart case


for(var j in gradSpRef.below){
var num = Number(j);
if(sp < num){
console.log("below:",j)
mrpf = gradSpRef.below[j]
break;
}
}

for(var j in gradSpRef.above){
var num = Number(j);
if(sp >= num){
console.log("above",j)
mrpf = gradSpRef.above[j]
break;
}
}
}
// else{ //snapdeal case
// console.log("snapdeal case")
// mrpf =
Math.round( Number( mrCommRef.grad.perComm ) / 100 *
sp );
// var minSlabComm =
Number( mrCommRef.grad.minSlabComm );
// if(mrpf < minSlabComm){
// mrpf = minSlabComm;
// }
// }

}
else if(mrCommRef.type === "mixed"){
if(gradSpRef){

}
else{ //snapdeal case
console.log("snapdeal case")
mrpf =
Math.round( Number( mrCommRef.grad.perComm ) / 100 *
sp );
var minSlabComm =
Number( mrCommRef.grad.minSlabComm );
if(mrpf < minSlabComm){
mrpf = minSlabComm;
}
else{
_marketPlaces[z]["mar_pay_fee_meta"] = " (" +
mrCommRef.grad.perComm + "%)";
}
}
}
else{
console.warn("unhandled type for market payment
fee:",mrCommRef.type)
}
}
else{
if(mrCommRef.type === "slab"){
mrpf = Number( mrCommRef.val);
// _marketPlaces[z][obj.key] = mrpf;
}
else{
mrpf = Math.round( Number( mrCommRef.val ) / 100 *
sp );
_marketPlaces[z]["mar_pay_fee_meta"] = " (" +
mrCommRef.val + "%)";
// _marketPlaces[z][obj.key] = mrpf;
}
}

_marketPlaces[z][obj.id] = mrpf;
rowVals[z] = {
key: y,
val: mrpf
}
break;

}
}
} //end for

sellerCalc._appendRow(obj, rowVals);
};break;
case "gstOnMarketFee": {
rowVals = {}
for(var z in _marketPlaces){
var sTax = 0;
for(var y in _serTax){
if(_marketPlaces[z].key === y){
sTax = Math.round( Number(_serTax[y]) / 100 *
Number( _marketPlaces[z]["marketPayFee"] ) )
_marketPlaces[z][obj.id] = sTax;
rowVals[z] = {
key: y,
val: sTax
}
break;
}
}
}

sellerCalc._appendRow(obj, rowVals);
};break;
case "gst":{
var gst = sp - Math.round( ( sp / ( 1 + gst / 100 ) ) );
var mk = _addRowVals(gst,obj.id);
sellerCalc._appendRow(obj, mk);
};break;
case "shippingCommission":{
var wgtRef = null
for(var z in _weights){
if(z === weight){
wgtRef = _weights[z];
break;
}
}

rowVals = {};
for(var z in _marketPlaces){
for(var y in wgtRef.shippingComm){
if(_marketPlaces[z].key === y){
var ship =
Math.round( Number(wgtRef.shippingComm[y]) );
_marketPlaces[z][obj.id] = ship;
rowVals[z] = {
key: y,
val: ship
}
break;
}
}
}
sellerCalc._appendRow(obj, rowVals);
};break;
case "netSlab": {
rowVals = {}
for(var z in _marketPlaces){
var netSlab = 0;
netSlab = Math.round( _marketPlaces[z]["sellPrice"] -
(_marketPlaces[z]["marketCommission"] +
_marketPlaces[z]["gstOnCommission"]
+ _marketPlaces[z]["gstOnMarketFee"]
+ _marketPlaces[z]["marketPayFee"] + _marketPlaces[z]
["gst"] + _marketPlaces[z]["shippingCommission"]) )

_marketPlaces[z][obj.id] = netSlab;
rowVals[z] = {
key: y,
val: netSlab
}
}
sellerCalc._appendRow(obj, rowVals);
};break;
case "deductionPercent": {
rowVals = {}
for(var z in _marketPlaces){
var dedPer = 0;
dedPer = Math.round( ( 1 - ( _marketPlaces[z]["netSlab"] /
_marketPlaces[z]["sellPrice"] ) ) * 100 );

_marketPlaces[z][obj.id] = dedPer;

rowVals[z] = {
key: y,
val: dedPer
}
}
sellerCalc._appendRow(obj, rowVals);
};break;
case "gainPercent": {
rowVals = {}
for(var z in _marketPlaces){
var gainPer = 0;
gainPer = Math.round( ( _marketPlaces[z]["netSlab"] /
_marketPlaces[z]["sellPrice"] * 100 ) );

_marketPlaces[z][obj.id] = gainPer;

rowVals[z] = {
key: y,
val: gainPer
}
}
sellerCalc._appendRow(obj, rowVals);
};break;
default: console.warn(obj.id + " case not handled");
} //end switch
}
console.log("_marketPlaces:", _marketPlaces);
} //end _startCalc

function _calcFees(){
console.log('cal start')
_mrpHandle.removeClass("borderClass");
_spHandle.removeClass("borderClass");
_gstHandle.removeClass("borderClass");
_selCategory.removeClass("borderClass");
_selWeight.removeClass("borderClass");

var mrp = _mrpHandle.val(), sp = _spHandle.val(), gst =


_gstHandle.val()
category = $("#category option:selected").val(),
weight = $("#shipping option:selected").val();
console.log("mrp: " + mrp + " sp: " + sp + " gst: " + gst + "
category: " + category + " weight: " + weight)
if(mrp && sp && gst && category && weight){

_loader.css("display", "block");
_loader.fadeOut(2000);

sellerCalc._setRowValues();
setTimeout(
_startCalc,
500,
mrp,sp,gst,category,weight
);
}// end if
else{
if(!mrp){
_mrpHandle.addClass("borderClass");
}

if(!sp){
_spHandle.addClass("borderClass");
}

if(!gst){
_gstHandle.addClass("borderClass");
}

if(!category){
_selCategory.addClass("borderClass");
}

if(!weight){
_selWeight.addClass("borderClass");
}
} //end if else
}//end _calcFees
sellerCalc._calcFees = _calcFees;

sellerCalc._showSpAlert = function(){
var mrp = Number(_mrpHandle.val());
var sp = Number(_spHandle.val());
if(mrp < sp){
alert("Selling price cannot be greater than MRP!")
_spHandle.val(mrp)
}
return true
}

sellerCalc._calcDiscount = function(){
var mrp = Number(_mrpHandle.val());
var sp = Number(_spHandle.val());
var dscnt = "na";
if(mrp && sp && mrp > sp){
var dscnt = (1 - sp/mrp) * 100;
dscnt = dscnt.toFixed(1)
dscnt += "% Discount"
}
else{
sellerCalc._showSpAlert()
}
_dscntHandle.text(dscnt)
}

function _appendRow(row,markets){
if(!row.display) return;

var tbRow = null;


if(row.handle){
tbRow = row.handle;
tbRow.empty();
}
else{
tbRow =
$("<tr></tr>").attr("id",row.id).addClass("value");
if(row.bold){
tbRow.css("font-weight","700");
}
}
tbRow.append("<th scope='row'></th>");
var td1 = $("<td></td>")
td1.attr("align","left")
td1.text(row.name)

if(row.class){
td1.addClass(row.class);
}

tbRow.append(td1)

// console.log(row.key,markets);

for(var x in _marketPlaces){
if(typeof _marketPlaces[x] === "object"){
var td = $("<td></td>");
td.addClass("alignleft");

var textVal = 'na';


if(markets[x]){
if(markets[x].val === '-'){
textVal = '-';
}
else{
if(isNaN(markets[x].val)){
// do nothing
}
else{

if(row.neg && markets[x].val){


textVal = "-" + markets[x].val
}
else{
textVal = markets[x].val
}
if(row.showRs){
textVal = "&#8377; " + textVal;
}

if(row.mar_comm_meta &&
_marketPlaces[x].mar_comm_meta){
// console.log("showMEta",row.mar_comm_meta)
textVal += _marketPlaces[x].mar_comm_meta;
}

if(row.mar_pay_fee_meta &&
_marketPlaces[x].mar_pay_fee_meta){
textVal += _marketPlaces[x].mar_pay_fee_meta;
}

if(row.per){
textVal = textVal + "%";
}
} //end if else
} //end if else
}

td.html(textVal);

if(row.class){
td.addClass(row.class)
}
tbRow.append(td)

// td = $("<td></td>");
// tbRow.append(td);
}
}
return tbRow;
} //end _appendRow
sellerCalc._appendRow = _appendRow;

function _getHandles(){
for(var x in _tableRows){
_tableRows[x].handle = $("#" + _tableRows[x].id);
}
console.log("table roes with handles:", _tableRows)
}

function _createTable(){
var table = $("<table></table>").addClass("table table-
condensed"),
tableHeader = $("<thead></thead>"),
tbRow = $("<tr></tr>").addClass("imgclass");

tbRow.append("<th></th><th class='logos'></th>");

for(var x in _marketPlaces){
if(typeof _marketPlaces[x] === "object"){
var th = $("<th></th>");
th.addClass("imgsection");
var img = $("<img/>");
img.attr("src",_marketPlaces[x].logo);
img.css("margin-right","12px");
img.css("float","left");
th.append(img);
var label = $("<label></label>");
label.html(_marketPlaces[x].name);
label.css("text-align","left");
th.append(label);
tbRow.append(th);
}
}

tableHeader.append(tbRow);
table.append(tableHeader);

_tableBody = $("<tbody></body>");

sellerCalc._setRowValues(true);

table.append(_tableBody);
bsExample.append(table);
console.log(bsExample);
_getHandles();
_desc.css("display","block");
} //end _createTable
sellerCalc._createTable = _createTable;

function _setRowValues(append){
for(var z in _tableRows){
var rowItem = _tableRows[z];
if(typeof rowItem === "object"){
var mk = _addRowVals();
// rowItem.id = rowItem.key;
var row = sellerCalc._appendRow(rowItem, mk);
if(append){
_tableBody.append(row);
}
}
}
}
sellerCalc._setRowValues = _setRowValues;

function _addRowVals(val,key){
mrkts = {}
for(var x in _marketPlaces){
if(key){
_marketPlaces[x][key] = val;
}
mrkts[x] = {
key: _marketPlaces[x].key,
val: val ? val : '-'
}
}
// console.log("mrkts:",mrkts);
return mrkts
}

function _setDefaults(){
_mrpHandle.val(Number(sellerCalc.config.defaults.mrp));
_spHandle.val(Number(sellerCalc.config.defaults.sellPrice))
;
_gstHandle.val(Number(sellerCalc.config.defaults.gst));
_selCategory.val(sellerCalc.config.defaults.category);
_selWeight.val(sellerCalc.config.defaults.weight);
sellerCalc._calcDiscount()
setTimeout(
sellerCalc._calcFees
,1000);
}
sellerCalc._setDefaults = _setDefaults;

sellerCalc._appendOptions("#category",_categories);
sellerCalc._appendOptions("#shipping",_weights);

_mrpHandle.on("input",sellerCalc._calcDiscount);
_spHandle.on("input",sellerCalc._calcDiscount);
$("#calculate").click(sellerCalc._calcFees);
_calculateView.css("display","block");
sellerCalc._createTable();
sellerCalc._setDefaults();

});

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy