Skip to content

Instantly share code, notes, and snippets.

@Szeliga
Created June 7, 2017 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Szeliga/8c993226af3776141c9180f9009fc737 to your computer and use it in GitHub Desktop.
Save Szeliga/8c993226af3776141c9180f9009fc737 to your computer and use it in GitHub Desktop.
Koszta prowadzenia dzialalnosci
puts "Podaj dochod netto: "
total_income = gets.to_i
puts "Podaj rate leasingu netto"
leasing_payment = gets.to_i
leasing_payment_gross = (leasing_payment * 1.23).round(2)
vat = (leasing_payment_gross - leasing_payment).round(2)
puts "Rata Brutto #{leasing_payment_gross}"
puts "VAT #{vat}"
half_vat = (vat / 2.0).round(2)
puts "Zwrot VAT #{half_vat}"
tax = ((total_income - leasing_payment - half_vat) * 0.19).round(2)
puts "Podatek dochodowy #{tax}"
tax_difference = (total_income * 0.19).round(2) - tax
puts "Roznica podatku #{tax_difference}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment