Bookmarklet para calcular automaticamente os impostos da NF-e
Abrir página com o bookmarklet (links com JS não funcionam no Gist)
Bookmarklet para calcular automaticamente os impostos da NF-e
Abrir página com o bookmarklet (links com JS não funcionam no Gist)
<p>Bookmarklet: <a href="javascript:(function()%7Bfunction%20callback()%7BcalcImpostos()%7Dvar%20s%3Ddocument.createElement(%22script%22)%3Bs.src%3D%22https%3A%2F%2Fgist.githubusercontent.com%2Fandersonfreitas%2F45a94e97f441ba749a3e%2Fraw%2Fnfe-impostos.js%22%3Bif(s.addEventListener)%7Bs.addEventListener(%22load%22%2Ccallback%2Cfalse)%7Delse%20if(s.readyState)%7Bs.onreadystatechange%3Dcallback%7Ddocument.body.appendChild(s)%3B%7D)()" class="bookmarklet">Impostos NF-e</a></p> |
var calcImpostos = function() { | |
var valorString = $("#ctl00_body_tbValor").val(); | |
var valor = parseFloat(valorString.replace(".", "").replace(",", ".")); | |
var irrf = 0.015 * valor; // 1.5% | |
var csll = 0.01 * valor; // 1.0% | |
var cofins = 0.03 * valor; // 3.0% | |
var pis = 0.0065 * valor; // 0.65% | |
irrf = irrf.toFixed(2).replace(".", ""); | |
csll = csll.toFixed(2).replace(".", ""); | |
cofins = cofins.toFixed(2).replace(".", ""); | |
pis = pis.toFixed(2).replace(".", ""); | |
$("#ctl00_body_tbIRRF").val(FmtValorMonetario(irrf)); | |
$("#ctl00_body_tbCSLL").val(FmtValorMonetario(csll)); | |
$("#ctl00_body_tbCOFINS").val(FmtValorMonetario(cofins)); | |
$("#ctl00_body_tbPISPASEP").val(FmtValorMonetario(pis)); | |
} |
Substitua a URL por:
https://rawgit.com/andersonfreitas/45a94e97f441ba749a3e/raw/nfe-impostos.js
No FF 50.1 começou a dar erro "blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)"