14. oktober 2006 - 23:11Der er
7 kommentarer og 1 løsning
øv, moms
Jeg har denne kode
timeogkvarterpris skal ikke være incl. moms.
<script> function addformdata(theform) { var total = 0; var tal; tal = parseFloat(theform.softwarepris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.hardwarepris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.netværkpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.tilbehørpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.timeogkvarterpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } theform.momspris.value = (total.toFixed(2)*0.25).toFixed(2); theform.total.value=parseFloat(total.toFixed(2)) + parseFloat(theform.momspris.value); }
var callvals={};
function callval(e){
var f=e.form;
var tv=parseFloat(e.value);
var tv2=(tmp=callvals[e.name])?tmp:0; callvals[e.name]=tv;
<script> function addformdata(theform) { var total = 0; var tal; tal = parseFloat(theform.softwarepris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.hardwarepris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.netværkpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.tilbehørpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } tal = parseFloat(theform.timeogkvarterpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } theform.momspris.value = (total.toFixed(2)*0.25).toFixed(2); theform.total.value=parseFloat(total.toFixed(2)); }
var callvals={};
function callval(e){
var f=e.form;
var tv=parseFloat(e.value);
var tv2=(tmp=callvals[e.name])?tmp:0; callvals[e.name]=tv;
-- du sætter bare moms-beregningen før time-prisen:
... tal = parseFloat(theform.tilbehørpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } theform.momspris.value = (total*0.25).toFixed(2); tal = parseFloat(theform.timeogkvarterpris.value.replace(/,/g,".")); if (isNaN(tal)==false) { total += tal; } theform.total.value=parseFloat(total.toFixed(2)) + parseFloat(theform.momspris.value); } ...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.