Advertisement
teknoraver

irpef

Oct 17th, 2014
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var aliquote_irpef = [
  2.     { soglia :     0, percentuale : 23 },
  3.     { soglia : 15000, percentuale : 27 },
  4.     { soglia : 28000, percentuale : 38 },
  5.     { soglia : 55000, percentuale : 41 },
  6.     { soglia : 75000, percentuale : 43 }
  7. ];
  8.  
  9. function progressiva(lordo, aliquote) {
  10.     var tmp = 0;
  11.     for(var i = aliquote.length - 1; i >= 0; i--) {
  12.         if(lordo > aliquote[i].soglia) {
  13.             tmp += (lordo - aliquote[i].soglia) * aliquote[i].percentuale / 100;
  14.             lordo = aliquote[i].soglia;
  15.         }
  16.     }
  17.     return tmp;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement