Maklumat Tuan Rumah
Senarai Kerja Ubahsuai (Umum)
Senarai Kerja Ubahsuai (Perabot)
Senarai Kerja Ubahsuai (Elektrikal)
Konsep Rumah
Whatapps 018 464 8818 atau klik link wasap untuk direct link
Hubungi kami sekarang

 
Total 1  
11/08/2020
Sebut Harga Ubahsuai Rumah oleh MKK Rekabina 018 484 8818
Description
Quantity
Unit Price
Price
"; var totalPrice =0; var subTotal = 0; var height = 0; var tax=0; var taxrate = 0; var onTax = 'TAX_RATE_ON'; var TAX_RATE_ON = "TAX_RATE_ON"; var displayTax = taxrate; var finalTotal=0; var currencyType = 'USD'; var lastTitle = '' var currentSubsection = -1 var sections = [] var section = [] var subsection = [] for(var i=0;i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value = 0.000001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Maklumat Tuan Rumah
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list } } }else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text() jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "  
"; //Unit value for all items table_body+="
  "+priceCommaStyler( (parts[i].unit * parts[i].value).toFixed(2) )+"  
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ console.log(sections) for(var i = 0; i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value = 0.000001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Senarai Kerja Ubahsuai (Umum)
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list } } }else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text() jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "  
"; //Unit value for all items table_body+="
  "+priceCommaStyler( (parts[i].unit * parts[i].value).toFixed(2) )+"  
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ console.log(sections) for(var i = 0; i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value = 0.000001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Senarai Kerja Ubahsuai (Perabot)
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list } } }else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text() jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "  
"; //Unit value for all items table_body+="
  "+priceCommaStyler( (parts[i].unit * parts[i].value).toFixed(2) )+"  
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ console.log(sections) for(var i = 0; i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value = 0.000001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Senarai Kerja Ubahsuai (Elektrikal)
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list } } }else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text() jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "  
"; //Unit value for all items table_body+="
  "+priceCommaStyler( (parts[i].unit * parts[i].value).toFixed(2) )+"  
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ console.log(sections) for(var i = 0; i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value = 0.000001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Konsep Rumah
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list } } }else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text() jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "  
"; //Unit value for all items table_body+="
  "+priceCommaStyler( (parts[i].unit * parts[i].value).toFixed(2) )+"  
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ console.log(sections) for(var i = 0; i 0 || parts[i].value 0) || parts[i].comment) { if(parts[i].value = 0.000001){ parts[i].value = 0 } if(parts[i].subsection != currentSubsection) { section.push(subsection) subsection = [] currentSubsection = parts[i].subsection } if(lastTitle != currentTitle){ if(lastTitle != '') { sections.push(section) section = [] } table_body+="
"; table_body+=germanCharactersInverseFrontEnd("
Whatapps 018 464 8818 atau klik link wasap untuk direct link
"); height +=6; lastTitle = currentTitle; var jsonPDFrowSection = { type: "section_title", section_title: currentTitle } jsonPDF.rows.push(jsonPDFrowSection) } if(isNaN(parts[i].unit)){ parts[i].unit = 1; } var jsonPDFrow = {} var elementName = "" if(jQuery(parts[i].name).hasClass('row-fluid Product-Titles-Summary-Window')){ if(jQuery(parts[i].name).children().length == 2) { jsonPDFrow = { type: "element_dropdown", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), description: jQuery(parts[i].name).find('.product-desc-summary-scc').text(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(!parts[i].comment){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).find('.span2').text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } } } } else { if(jQuery(parts[i].name).hasClass('span2')){ jsonPDFrow = { type: "element", attr: { name: jQuery(parts[i].name).text().trim(), unit: parts[i].unit, unit_price: "", total_price: "", value: parts[i].value } } }else{ if(parts[i].custom_math) { jsonPDFrow = { type: "custom_math", attr: { value_with_currency: priceCommaStyler(parts[i].value), value: parts[i].value, type: parts[i].custom_math_type, name: jQuery(parts[i].name).text().trim(), show_detailed_list: parts[i].show_detailed_list } } }else { jsonPDFrow = { type: "element", attr: { name: (parts[i].name).trim(), unit: parts[i].unit, value: parts[i].value, unit_price: "", total_price: "" } } } } } if(parts[i].custom_math){ /* adding currency in frontend custom math: */ jQuery('.scc_custom_math_value_front_end').each(function(index, ob){ jQuery(ob).text() jQuery(ob).text((priceCommaStyler(parts[i].value))) }) /* CUSTOM MATH */ if(parts[i].show_detailed_list) { notPercentTypeWithCurrency = parts[i].custom_math_type + " " + (priceCommaStyler(parts[i].value)); notPercentTypeWithoutCurrency = parts[i].custom_math_type + " " + priceCommaStyler(parts[i].value); percentType = parts[i].value + parts[i].custom_math_type; table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
"; table_body += "
" + ( (parts[i].custom_math_type == '%') ? percentType : notPercentTypeWithCurrency ) + "
"; //table_body += "
" table_body += "
" + ( (parts[i].custom_math_type == '%') ? '' : '' ) + "
"; table_body += "
" } }else { if(parts[i].comment){ table_body += "
" table_body += "
"+parts[i].name+"
"; table_body += "
" + parts[i].text + "
"; table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(parts[i].name).find('.span2').text(), comment: parts[i].text } } jsonPDF.rows.push(jsonDPDFcomment) }else { table_body+="
"; table_body+="
"+parts[i].name+"
"; // table_body+="
"+parts[i].value+" USD
"; table_body+="
"+parts[i].unit+"
"; //Quantity for all items table_body+="
  "+priceCommaStyler(parts[i].value) + "  
"; //Unit value for all items table_body+="
  "+priceCommaStyler( (parts[i].unit * parts[i].value).toFixed(2) )+"  
"; // Price for all items jsonPDFrow.attr["unit_price"] = parts[i].value jsonPDFrow.attr["total_price"] = currencyStyle(priceCommaStyler((parts[i].unit * parts[i].value).toFixed(2))) } } jsonPDF.rows.push(jsonPDFrow) subsection.push(jsonPDFrow) table_body+="
"; // totalPrice +=(parts[i].unit*parts[i].value); height +=6; }else{ } } } section.push(subsection) sections.push(section) /* START - CUSTOM MATH CALCULATOR */ console.log(sections) for(var i = 0; i 0){ table_body +="
" table_body +="
" for(var i=0; i" table_body += "
"+comments[i].title+"
"; table_body += "
" + comments[i].text + "
"; table_body += "
" table_body += "
" var jsonDPDFcomment = { type: "comment", attr: { title: jQuery(comments[i].title).find('.span2').text(), comment: comments[i].text } } jsonPDF.rows.push(jsonDPDFcomment) } // table_body +="
" } subTotal = displayCouponDiscountInFrontEnd(subTotal) // Start of Displaying Coupon Discount if(taxrate !=0 && taxrate !=''){ tax = (subTotal * taxrate)/100; finalTotal = subTotal + tax; }else{ finalTotal = subTotal; } //table_body+="
"; table_body+="
"; if(coupon){ table_body+="
"; if(Number(coupon.discountpercentage) != -1){ var jsonPDFcoupon = { type: "coupon", attr: { title: "Coupon Discount " + coupon.discountpercentage + "%", discount_price: "" } } if(window.hasOwnProperty("translatorJson")){ if(translatorJson['Coupon Discount'] && translatorJson['Coupon Discount']['en']) { jsonPDFcoupon = { type: "coupon", attr: { title: translatorJson['Coupon Discount']['en'] + " " + coupon.discountpercentage + "%", discount_price: "" } } } } table_body+="
Coupon Discount " + coupon.discountpercentage + "%
"; jsonPDFcoupon.attr["discount_price"] = "-" + currencyStyle(priceCommaStyler(coupon.discount_value_total.toFixed(2))) +"" table_body+="
-" + priceCommaStyler(coupon.discount_value_total.toFixed(2)) +" USD
"; jsonPDF.rows.push(jsonPDFcoupon) } if(Number(coupon.discountvalue) != -1){ var jsonPDFcoupon = { type: "coupon", attr: { title: "", discount_price: "" } } jsonPDFcoupon.attr["title"] = "Coupon Discount " + currencyStyle(priceCommaStyler(Number(coupon.discountvalue).toFixed(2))) jsonPDFcoupon.attr["discount_price"] = "-" + currencyStyle(priceCommaStyler(coupon.discount_value_total.toFixed(2))) if(window.hasOwnProperty("translatorJson")){ if(translatorJson['Coupon Discount'] && translatorJson['Coupon Discount']['en']) { jsonPDFcoupon.attr["title"] = translatorJson['Coupon Discount']['en'] + " " + currencyStyle(priceCommaStyler(Number(coupon.discountvalue).toFixed(2))) } } table_body+="
Coupon Discount " + priceCommaStyler(Number(coupon.discountvalue).toFixed(2)) + " USD
"; table_body+="
-" + priceCommaStyler(coupon.discount_value_total.toFixed(2)) +" USD
"; jsonPDF.rows.push(jsonPDFcoupon) } table_body+="
" } //table_body+="
"; table_body+="
"; // Start of Displaying Sub-total Tax // End of Displaying Sub-total Tax // Start of Displaying Tax // End of Displaying Tax var jsonPDFtotal = { type: "total", attr: { title: "Total Price", price: "" } } table_body+="
Total Price
"; jsonPDFtotal.attr["price"] = currencyStyle(priceCommaStyler(finalTotal.toFixed(2))) table_body+="
" + priceCommaStyler(finalTotal.toFixed(2)) +" USD
"; jsonPDF.rows.push(jsonPDFtotal) table_body+="
"; table_body+="
"; /* table_body+="
Issue On: ".date('m/d/Y H:i')."
"; */ var xheight = 42+height - 100; if (xheight
"; // table_body+="
" // table_body+="
"; // table_body+="
"; // table_body+="
"; // table_body+="
"; // table_body+="
"; // table_body+="
"; table_body+="
"; table_body+="
"; jQuery('#sccTale_price').html(table_body); if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } jQuery('body').find('.Description').each(function(index, ob){ jsonPDF.description = jQuery(ob).text() }) jQuery('body').find('.Quantity').each(function(index, ob){ jsonPDF.quantity = jQuery(ob).text() }) jQuery('body').find('.Unit').each(function(index, ob){ jsonPDF.unit = jQuery(ob).text() }) jQuery('body').find('.Price').each(function(index, ob){ jsonPDF.price = jQuery(ob).text() }) jQuery('body').find('.subtotal_tax_for_pdf').each(function(index, ob){ for(var i= 0; i = 0; i--){ if(price.indexOf('-') === -1){ if(!dot && (i === ((price.split('').length - 1) - 3) || i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9))){ newPrice = ',' + newPrice }else if(dot && (i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9) || i === ((price.split('').length - 1) - 12))){ newPrice = ',' + newPrice } newPrice = price.split('')[i] + newPrice }else{ if(!dot && (i === ((price.split('').length - 1) - 4) || i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9))){ if(price.split('').length > 4){ newPrice = ',' + newPrice } }else if(dot && (i === ((price.split('').length - 1) - 6) || i === ((price.split('').length - 1) - 9) || i === ((price.split('').length - 1) - 12))){ if(price.split('').length > 7){ newPrice = ',' + newPrice } } newPrice = price.split('')[i] + newPrice } } if(newPrice.length >= 3 && ( newPrice.substring(newPrice.length - 3, newPrice.length - 1) === '.00' || newPrice.substring(newPrice.length - 3, newPrice.length) === '.00') ){ newPrice = newPrice.split('.')[0] } return newPrice; } return parseFloat(price).toLocaleString(navigator.languages[0]); } function hiddenClone(element){ // Create clone of element var clone = element.cloneNode(true); // Position element relatively within the // body but still out of the viewport var style = clone.style; // style.position = 'absolute'; // style.top = - window.innerHeight + 'px'; style.left = 0; style.top = 1000 + 'px' // style.background = '#FFFFFF' // Append clone to body and return the clone document.body.appendChild(clone); return clone; } function sendPDF(enable){ if(enable ==0){ jQuery('.scc-alert').remove(); return; } $ajaxQuery= { url: rt_vars.rt_urlajax, type: 'POST', xhrFields: { responseType: '' }, data: { action: 'sccSendPDF', payload: Base64.encode(JSON.stringify(jsonPDF)), tableTitle, }, success: function(b64){ const linkSource = `data:application/pdf;base64,${b64}`; const downloadLink = document.createElement("a"); const fileName = "quote.pdf"; downloadLink.href = linkSource; downloadLink.download = fileName; downloadLink.click(); }, error: function(err){ console.log('err', err) console.log('err', err.responseText) var disposition = err.getResponseHeader('content-disposition'); var matches = /"([^"]*)"/.exec(disposition); var filename = (matches != null && matches[1] ? matches[1] : 'file.pdf'); // The actual download var blob = new Blob([err.responseText], { type: 'application/pdf' }); var link = document.createElement('a'); link.href = window.URL.createObjectURL(blob); link.download = filename; document.body.appendChild(link); link.click(); document.body.removeChild(link); } } jQuery.ajax($ajaxQuery); // var xmlhttp = new XMLHttpRequest(); // xmlhttp.open("POST", rt_vars.rt_urlajax, true); // xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); // xmlhttp.send(JSON.stringify({ // action: 'sccSendPDF', // payload: JSON.stringify(jsonPDF), // })); } var isMobile = false function sendemail($enable){ if($enable ==0){ jQuery("#myModalSCCEmailQuote").modal(); jQuery('.modal-backdrop').each(function(){ jQuery(this).removeClass('modal-backdrop') }) return; } console.log("jQuery('#sscemailAddress').val().length", jQuery('#sscemailAddress').val().length) if(!jQuery('#sscemailAddress') || !jQuery('#sscemailAddress').val() || !jQuery('#sscemailAddress').val().includes('@') || !jQuery('#sscemailAddress').val().includes('.') || jQuery('#sscemailAddress').val().includes('#') || jQuery('#sscemailAddress').val().length 0){ title = titleFromDatabase } var email = jQuery('#sscemailAddress').val() var user = jQuery('#sscuserAddress').val() var phone = jQuery('#sscuserPhone').val(); bar.setValue(0.90); jQuery(document).scrollTop(currentScroll) var ipaddress = 'no IP' if(data){ if(data.origin){ if(data.origin.length > 0 ){ ipaddress = data.origin.split(',')[0] } } } var browserInfo = "" var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; var isFirefox = typeof InstallTrigger !== 'undefined'; var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)); var isIE = /*@cc_on!@*/false || !!document.documentMode; var isEdge = !isIE && !!window.StyleMedia; var isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime); var isBlink = (isChrome || isOpera) && !!window.CSS; if(isOpera) browserInfo = "Opera" if(isFirefox) browserInfo = "Firefox" if(isSafari) browserInfo = "Safari" if(isIE) browserInfo = "Internet Explorer" if(isEdge) browserInfo = "Edge" if(isChrome) browserInfo = "Chrome" $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: ipaddress, browserInfo: browserInfo, device: isMobile }, success: function(data) { bar.setValue(1); ClosePopup_scc2() setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) }) .fail(function() { $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: '', browserInfo: browserInfo, device: isMobile }, success: function(data) { bar.setValue(1) ClosePopup_scc2() setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) }) jQuery('.scc-email-popup-close').click(); setTimeout(function(){jQuery('#sccidsent').show();},600); } function check(doc,title, clone, currentScroll, bar){ jQuery.getJSON('https://httpbin.org/ip', function(data) { var titleFromDatabase = ""; if(titleFromDatabase && titleFromDatabase.length > 0){ title = titleFromDatabase } var email = jQuery('#sscemailAddress').val() var user = jQuery('#sscuserAddress').val() var phone = jQuery('#sscuserPhone').val(); bar.setValue(0.90); var pdf = btoa(doc.output()); jQuery(document).scrollTop(currentScroll) var ipaddress = 'no IP' if(data){ if(data.origin){ if(data.origin.length > 0 ){ ipaddress = data.origin.split(',')[0] } } } var browserInfo = "" var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; var isFirefox = typeof InstallTrigger !== 'undefined'; var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)); var isIE = /*@cc_on!@*/false || !!document.documentMode; var isEdge = !isIE && !!window.StyleMedia; var isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime); var isBlink = (isChrome || isOpera) && !!window.CSS; if(isOpera) browserInfo = "Opera" if(isFirefox) browserInfo = "Firefox" if(isSafari) browserInfo = "Safari" if(isIE) browserInfo = "Internet Explorer" if(isEdge) browserInfo = "Edge" if(isChrome) browserInfo = "Chrome" $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: ipaddress, browserInfo: browserInfo, device: isMobile }, success: function(data) { bar.setValue(1); ClosePopup_scc2(); document.body.removeChild(clone); setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) }) .fail(function() { $fragment_refresh={ url: rt_vars.rt_urlajax, type: 'POST', data: { action: 'sccSendEmail', payload: Base64.encode(JSON.stringify(jsonPDF)), email_to: email, user_to: user, title: title, phone: phone, ipaddress: '', browserInfo: browserInfo, device: isMobile }, success: function(data) { // jQuery('#scc_sending_email_progress_container').css('display', 'none') updateSendEmailProgress(100) ClosePopup_scc2(); document.body.removeChild(clone); setTimeout(() => { removeSendEmailProgress() jQuery('body').css({ overflow: 'visible' }); jQuery('header').css({ display: 'block' }) jQuery('footer').css({ display: 'block' }) }, 1000); jQuery('#statusMsg').html(' Thank you, '+user+'. Your quote has been sent to '+email+''); } } jQuery.ajax( $fragment_refresh ) }) } PrintDoc = function(enable){ if(enable === 0){ jQuery('.scc-alert').remove(); jQuery('body').find('.scc-detailed-list-head').each(function(index, ob){ jQuery(ob).html(""); }) return; } jQuery('.scc-buttons-visibility').each(function(index, ob){ jQuery(ob).css('display', 'none') }) jQuery('.Section-Title-Summary-Window').each(function(index, ob){ jQuery(ob).css('margin-left','15px') }) jQuery('.comments-printing-improvement').each(function(index, ob){ jQuery(ob).css('padding-left', 10) }) //jQuery('#scc-summary-view-header').css('background-color', 'grey') var printContents = document.getElementById('scctableprice').innerHTML; var originalContents = document.body.innerHTML; document.body.style.padding = "10px"; document.body.style.height = "100%"; document.body.style.width = "100%"; document.body.innerHTML = printContents; window.print(); document.body.innerHTML = originalContents; jQuery('.Section-Title-Summary-Window').each(function(index, ob){ jQuery(ob).css('margin-left:5px') }) jQuery('.scc-buttons-visibility').each(function(index, ob){ jQuery(ob).css('display', 'block') }) jQuery('.comments-printing-improvement').each(function(index, ob){ jQuery(ob).css('padding-left', 0) }) //jQuery('#scc-summary-view-header').css('background-color', '#F1F1F1') } function updateSendEmailProgress(value){ var elem = document.getElementById("myBar_scc"); elem.innerHTML = value + "%"; //jQuery('#scc_sendemail_progress_value').html(value + '%') } function removeSendEmailProgress(){ jQuery('#scc_send_email_progress_modal').modal('hide') jQuery('#scc_sending_email_progress_container').html('') jQuery('#scc_send_email_progress_modal').modal('hide') jQuery('#scc_send_email_progress_modal').modal('hide') setTimeout(() => { jQuery('#scc_send_email_progress_modal').remove() jQuery('.modal-backdrop').each((index, element) => { jQuery('#preview_modal').modal('hide') element.remove() jQuery(element).remove() setTimeout(() => { jQuery('#scc_send_email_progress_modal').modal('hide') jQuery('#scc_send_email_progress_modal').modal('hide') }, 1000); }); }, 1000); } function createSendEmailModal(){ var code = '' code += '' jQuery('#scc_sending_email_progress_container').html(code) jQuery('#scc_send_email_progress_modal').modal('show') if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)){ jQuery('#scc_send_email_progress_modal').css('left', 80) jQuery('#scc_send_email_progress_modal').css('top', 80) } } window.rp_requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||(function(callback,element){setTimeout(callback,1000/60);}); function RadialProgress(container,cfg){ container.innerHTML=""; var nc=document.createElement("div"); nc.style.width="10em"; nc.style.height="10em"; nc.style.position="relative"; container.appendChild(nc); container=nc; if(!cfg) cfg={}; this.colorBg=cfg.colorBg==undefined?"#404040":cfg.colorBg; this.colorFg=cfg.colorFg==undefined?"#007FFF":cfg.colorFg; this.colorText=cfg.colorText==undefined?"#000000":cfg.colorText; this.indeterminate=cfg.indeterminate==undefined?false:cfg.indeterminate; this.round=cfg.round==undefined?false:cfg.round; this.thick=cfg.thick==undefined?2:cfg.thick; this.progress=cfg.progress==undefined?0:cfg.progress; this.noAnimations=cfg.noAnimations==undefined?0:cfg.noAnimations; this.fixedTextSize=cfg.fixedTextSize==undefined?false:cfg.fixedTextSize; this.animationSpeed=cfg.animationSpeed==undefined?1:cfg.animationSpeed>0?cfg.animationSpeed:1; this.noPercentage=cfg.noPercentage==undefined?false:cfg.noPercentage; this.spin=cfg.spin==undefined?false:cfg.spin; if(cfg.noInitAnimation) this.aniP=this.progress; else this.aniP=0; var c=document.createElement("canvas"); c.style.position="absolute";c.style.top="0";c.style.left="0";c.style.width="100%";c.style.height="100%";c.className="rp_canvas"; container.appendChild(c); this.canvas=c; var tcc=document.createElement("div"); tcc.style.position="absolute";tcc.style.display="table";tcc.style.width="100%";tcc.style.height="100%"; var tc=document.createElement("div"); tc.style.display="table-cell";tc.style.verticalAlign="middle"; var t=document.createElement("div"); t.style.color=this.colorText;t.style.textAlign="center";t.style.overflow="visible";t.style.whiteSpace="nowrap";t.className="rp_text"; tc.appendChild(t); tcc.appendChild(tc); container.appendChild(tcc); this.text=t; this.prevW=0; this.prevH=0; this.prevP=0; this.indetA=0; this.indetB=0.2; this.rot=0; this.draw=function(f){ if(!(f==true))rp_requestAnimationFrame(this.draw); var c=this.canvas; var dp=window.devicePixelRatio||1; c.width=c.clientWidth*dp; c.height=c.clientHeight*dp; if(!(f==true)&&!this.spin&&!this.indeterminate&&(Math.abs(this.prevP-this.progress)1?1:p;}, setIndeterminate:function(i){this.indeterminate=i;}, setText:function(t){this.text.innerHTML=t;} }
"+jQuery(this).find("option:selected").attr('data-description')+"
", value:parseFloat(getDropDownValue(this)), unit: 1, section: sec, subsection: sub, paypal_name: jQuery(this).find("option:selected").text() }; parts.push(switched); } } else if ('sliderinput' == jQuery(this).attr('data-inputtype')){ totalnumber1 =jQuery(this).attr('data_range').split(","); var sliderunitprc = totalnumber1 [totalnumber1.length-1]; var slide_value = parseFloat(jQuery(this).attr('data-value')); var unitprice = sliderunitprc*slide_value; multislider[sec][sub]=slide_value; for (k=0;k
"+jQuery(this).parent().parent().parent().find('label:last').text()+"
", unit:slide_value, value: parseFloat(totalnumber1[k+2]), section: sec, subsection: sub, sliderInsubsection: true, paypal_name: jQuery(this).parent().parent().find('label:last').text()}; parts.push(switched); //price += multislider[j]*(xprice[j]+hmm[j]); break; } } } else if ('comment_input' == jQuery(this).attr('data-inputtype')){ if(jQuery(this) && jQuery(this).val() && jQuery(this).val().length > 0){ const comment = { name: "
"+jQuery(this).parent().parent().find('label:last').text()+"
", text: jQuery(this).val(), section: sec, subsection: sub, unit: 1, value: 0, comment: true, paypal_title: jQuery(this).parent().parent().find('label:last').text(), paypal_text: jQuery(this).val() } parts.push(comment); //comments.push(comment); } } else if ('number_input' == jQuery(this).attr('data-inputtype')){ var unitValue =jQuery(this).attr('data-value'); const switched={name: "
"+jQuery(this).parent().parent().find('label:last').text()+"
", unit:jQuery(this).val(), value: unitValue, section: sec, subsection: sub, numberInput: true, paypal_name: jQuery(this).parent().parent().find('label:last').text()}; parts.push(switched); hmm[sec][sub] = unitValue * jQuery(this).val() }else if('scc_custom_math' == jQuery(this).attr('data-inputtype')) { const switched={ name: jQuery(this).attr('data-name'), unit: 1, value: jQuery(this).attr('data-value'), section: sec, subsection: sub, numberInput: true, paypal_name: '', custom_math: true, custom_math_type: jQuery(this).attr('data-math-type'), show_detailed_list: jQuery(this).parent().parent().attr('data-show-detailed-list') ? jQuery(this).parent().parent().attr('data-show-detailed-list') : false }; parts.push(switched); hmm[sec][sub] = unitValue * jQuery(this).val() } else { var sld = parseFloat(jQuery(this).val()); } }); var _unit =1; var _section =9999999; var _usection =9999999; for (var j = parts.length; j--;){ if(parts[j].section != _section || parts[j].subsection != _usection){ if(!parts[j].sliderInsubsection){ _section = parts[j].section; _usection = parts[j].subsection; if(parts[j].numberInput){ if(!isNaN(parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')))){ parts[j].unit = parts[j].unit * parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')); _unit = parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')) }else{ _unit = 1 } }else{ parts[j].unit =parseFloat(jQuery('#itemcreateds_'+_section+'_'+_usection).attr('data-value')); _unit = parts[j].unit; } } }else { var secn = parts[j].section; var subsecn = parts[j].subsection; //parts[j].unit = _unit; //_unit = parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')); if(parts[j].numberInput){ if(!isNaN(parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')))){ parts[j].unit = parts[j].unit * parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')); _unit = parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')) }else{ _unit = 1 } }else{ parts[j].unit = parseFloat(jQuery('#itemcreateds_'+secn+'_'+subsecn).attr('data-value')) _unit = parts[j].unit; } } } price = CreateTable(parts, comments); /*for(i =0; i 0){ itemsToAddPaypalForm += ' ' itemsToAddPaypalForm += ' ' itemsAdded++ // } total += (items[i].unit === null ? items[i].value : (items[i].value * items[i].unit)) } /* if(tax && tax > 0){ console.log('tax included!') itemsToAddPaypalForm += ' ' itemsToAddPaypalForm += ' ' total += tax } */ jQuery('#paypal_form_add_items').html(itemsToAddPaypalForm) } //paypal ends // currency Style function starts var currencyStyleOption = 0; var currencyLabel = 'USD'; function currencyStyle(number){ switch (currencyStyleOption){ case 0: number = currencySymbol(currencyLabel) + number case 1: number = number + ' ' + currencyLabel break } return number } function currencySymbol(currency){ var currencySymbolLabel = '$' switch(currency){ case 'ANG': currencySymbolLabel = 'ƒ' break case 'ILS': currencySymbolLabel = '₪' break case 'USD': currencySymbolLabel = '$' break case 'CAD': currencySymbolLabel = '$' break case 'EUR': currencySymbolLabel = '€' break case 'JPY': currencySymbolLabel = '¥' break case 'RUB': currencySymbolLabel = '₽' break case 'TRY': currencySymbolLabel = '₺' break case 'CHF': currencySymbolLabel = 'Fr.' break case 'SEK': currencySymbolLabel = 'kr' break case 'BRL': currencySymbolLabel = 'R$' break case 'CNY': currencySymbolLabel = '¥' break case 'AUD': currencySymbolLabel = 'A$' break case 'DKK': currencySymbolLabel = 'Kr.' break case 'HKD': currencySymbolLabel = 'HK$' break case 'GBP': currencySymbolLabel = '£' break case 'ZAR': currencySymbolLabel = 'R' break case 'ZMW': currencySymbolLabel = 'K' break case '‎PKR': currencySymbolLabel = 'Rs' break case 'KRW': currencySymbolLabel = '₩' break case 'CFA': currencySymbolLabel = 'FCFA' break case 'IDR': currencySymbolLabel = 'Rp' break } return currencySymbolLabel } // currency Style function ends // check If mandatory options are choosen document.addEventListener('DOMContentLoaded', (event) => { jQuery('.btPayPalButtonCustom').click(function(e){ e.preventDefault(); var scc_mandatory = ''; jQuery('.mandatory_yes').each(function(){ jQuery(this).addClass('hehehehehehehe'); if(jQuery(this).val() ==''){ jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); jQuery(this).parent().parent().find('.alert-danger').css('display','block'); jQuery('html, body').animate({ scrollTop: jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } checkIfParentIsAccordionAndOpenIt(this) } }); if (scc_mandatory == '') { if(Number(total) && Number(total) > 0){ jQuery("#paypal_form").submit(); jQuery("#paypal_form")[0].submit(); } } }); }); function getDropDownValue($this){ price = jQuery($this).val(); if (! price) { return 0; } else return price; } function SCCOpenPopUpEmail(){ jQuery.getScript('https://www.mkkniaga.com/wp-content/plugins/stylish-cost-calculator/assets/lib/bootstrap-3.3.5/dist/js/bootstrap.min.js', function(data) { var scc_mandatory = ''; jQuery('.mandatory_yes').each(function(){ if(jQuery(this).val() ==''){ jQuery(this).parent().parent().find('.alert-danger').html('Please choose an option !'); jQuery(this).parent().parent().find('.alert-danger').css('display','block'); jQuery('html, body').animate({ scrollTop: jQuery(this).offset().top }, 1000); scc_mandatory = 'scc_remains'; if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } checkIfParentIsAccordionAndOpenIt(this) } }); if (scc_mandatory == '') { jQuery('#sccquoteModal').modal('show') jQuery('.modal-backdrop').each(function(){ jQuery(this).remove() }) } }) } document.addEventListener('DOMContentLoaded', (event) => { jQuery('.scc-email-popup-close').click(function(e){ e.preventDefault(); jQuery('#sccquoteModal').modal('hide') jQuery('.scc-email-popup').removeClass('in'); }) }); function addCouponCodeModal(){ if(!coupon){ var minWidth = "500px" var titleFontSize = "35px" if( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)){ minWidth = "250px" titleFontSize = "15px" console.log('Im mobile') } var code="" code += ''; jQuery('#coupon_code_modal_container').html(code) jQuery('#coupon_code_modal').modal('show') if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } jQuery('.modal-backdrop, fade, in:first').each(function(index, ob){ jQuery(ob).css('display', 'none') }) } } function checkCouponCode(){ jQuery('#button_check_coupon').html(' Checking...') jQuery.ajax( { url: rt_vars.rt_urlajax, type: 'GET', data: { action: 'sscCheckCoupon', coupon_code: jQuery('#coupon_code').val() }, success: function( data ){ if(typeof data === 'object'){ if(data.data){ if(data.data === false || data.data === 'false'){ jQuery('#coupon_code_error').html('This code is not valid') if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } }else if(typeof data.data === 'object'){ coupon = data.data[0] jQuery('#coupon_code_modal').modal('hide') applyCouponDiscount(coupon) } } }else if(typeof data === 'string'){ if(data.length > 0){ var responseTemp = data.split('{"success":true,"data":')[data.split('{"success":true,"data":').length -1] if(responseTemp.indexOf('false') == -1){ responseTemp = responseTemp.substring(1,responseTemp.length - 2) coupon = JSON.parse(responseTemp) jQuery('#coupon_code_modal').modal('hide') applyCouponDiscount(coupon) }else{ jQuery('#coupon_code_error').html('This code is not valid.') if(window.hasOwnProperty("translatorJson")){ jQuery('body').translate({lang: "en", t: translatorJson}) } } } }else if(!data){ } jQuery('#button_check_coupon').html('Check Coupon Code') }, error: function(errorThrown){ console.log(errorThrown); jQuery('#button_check_coupon').html('Check Coupon Code'); } }) } function applyCouponDiscount(coupon){ jQuery('.submitPrices').click(); } function displayCouponDiscountInFrontEnd(price){ // substracting discount coupon if(!price || typeof price === 'undefined') { price = 0 } if(coupon){ var canDoDiscount = false if(Number(coupon.minspend) === -1 && Number(coupon.maxspend) === -1){ canDoDiscount = true }else{ if(Number(coupon.minspend) === -1 && Number(coupon.maxspend) != -1){ if(price = coupon.minspend){ canDoDiscount = true } }else if(Number(coupon.minspend) != -1 && Number(coupon.minspend) != -1 ){ if(price >= Number(coupon.minspend) && price Discount percentage: ' + coupon.discountpercentage + '%') } if(coupon.discountvalue != -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_discount_value').html(currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discountvalue)) }else{ jQuery('#coupon_info_discount_value').html(priceCommaStyler(coupon.discountvalue) + ' ' + currencyLabel) } } } if(Number(coupon.minspend) === -1.00 && Number(coupon.maxspend) === -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range').html('

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discount_value_total) + '

') }else{ jQuery('#coupon_info_spend_range').html('

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discount_value_total) + currencyLabel + '

') } }else{ if(Number(coupon.minspend) != -1.00 && Number(coupon.maxspend) != -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) && Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discount_value_total) + '

': '

Your discount has not been applied because the total price has to be between ' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.minspend) + ' and ' + currencySymbol(currencyLabel) + priceCommaStyler(coupon.maxspend) + '

') }else{ jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) && Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discount_value_total) + currencyLabel + '

': '

Your discount has not been applied because the total price has to be between ' + priceCommaStyler(coupon.minspend) + ' ' + currencyLabel + ' and ' + priceCommaStyler(coupon.maxspend) + ' ' + currencyLabel + '

') } }else if(Number(coupon.minspend) != -1.00 && Number(coupon.maxspend) === -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) ? '

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discount_value_total) + '

': '

Your discount has not been applied because the total price has to be higher than ' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.minspend) + currencySymbol(currencyLabel) + '

') }else{ jQuery('#coupon_info_spend_range').html(Number(coupon.price_without_discount) >= Number(coupon.minspend) ? '

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discount_value_total) + currencyLabel + '

': '

Your discount has not been applied because the total price has to be higher than ' + priceCommaStyler(coupon.minspend) + ' ' + currencyLabel + '

') } }else if(Number(coupon.minspend) === -1.00 && Number(coupon.maxspend) != -1.00){ if(currencyStyleOption === 0){ jQuery('#coupon_info_spend_range').html(Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + currencySymbol(currencyLabel) + ' ' + priceCommaStyler(coupon.discountvalue) + '

': '

Your discount has not been applied because the total price has to be lower than ' + currencySymbol(currencyLabel) + priceCommaStyler(coupon.maxspend) + '

') }else{ jQuery('#coupon_info_spend_range').html(Number(coupon.maxspend) >= Number(coupon.price_without_discount) ? '

Your discount has been applied correctly. -' + ' ' + priceCommaStyler(coupon.discountvalue) + currencyLabel + '

': '

Your discount has not been applied because the total price has to be lower than ' + priceCommaStyler(coupon.maxspend) + ' ' + currencyLabel + '

') } } } } return price }

 

KLIK LINK DI BAWAH SEKARANG >

KETIK LINK WHATAPPS INI

KETIK LINK WHATAPPS INI

KETIK LINK WHATAPPS INI