- $(case $vat in
- vat=nett)
- awk "BEGIN {
- printf \"Sum: %7.2f €<br/> + VAT: %7.2f €<br/> [strong Total:] %7.2f €\",
- $total, int($total * $vatrate + .5) / 100,
- $total + int($total * $vatrate + .5) / 100
- }" ;;
- vat=gross)
- awk "BEGIN {
- printf \"[strong Total:] %7.2f €<br/> incl VAT: %7.2f €<br/>+ nett: %7.2f €\",
- $total, int($total / (100 + $vatrate) * $vatrate * 100 + .5) / 100,
- $total - int($total / (100 + $vatrate) * $vatrate * 100 + .5) / 100
- }" ;;
- *) printf '[strong Total:] %.2f €' "$total" ;;
+ $(case $taxtype in
+ (nett) printf 'Sum: %7.2f €[br] + VAT: %7.2f €[br] [strong Total:] %7.2f €' \
+ $nett $tax $gross ;;
+ (gross) printf '[strong Total:] %7.2f €[br] incl. nett: %7.2f €[br] + VAT: %7.2f €' \
+ $gross $nett $tax ;;
+ (*) printf '[strong Total:] %.2f €' $nett ;;