Skip to content

Instantly share code, notes, and snippets.

@tosyu
Last active July 19, 2018 13:23
Show Gist options
  • Save tosyu/3d0e8297778c21d391165f2c5371459f to your computer and use it in GitHub Desktop.
Save tosyu/3d0e8297778c21d391165f2c5371459f to your computer and use it in GitHub Desktop.
function money(workdays, hnetto, zus, costs) {
workdays = workdays !== undefined ? workdays : 0;
hnetto = hnetto !== undefined ? hnetto : 0;
zus = zus !== undefined ? zus : 0;
costs = costs !== undefined ? costs : 0;
var mnetto = workdays * 8 * hnetto;
var costs_netto = costs/1.23;
var costs_vat = costs - costs_netto;
var vat = mnetto*0.23;
var brutto = mnetto+vat;
var tohand = mnetto - zus - ((mnetto-costs_netto)*0.19);
console.log('faktura brutto: ' + brutto + ', vat: ' + (vat - costs_vat) + ', earned: ' + tohand);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment