1

I am a web developer and building an accounting system for a client however I am almost good at programming but very bad at accounting and maths; and my client is not able to explain/communicate properly and present the equation of the calculations. So, here is the matter:

This is about creating bill of sale of products and calculating rate, discount, tax and total. Screenshot of a related portion of the software

Suppose,

Original price (op) = 100
Discount (d) = 5
So, selling price (sp) (including tax) = 95
Tax rate (tr) = 15%

There are textboxes for showing product rate (pr), tax amount (ta) and taxable value (tv) which need to be calculated from about data. I am able to calculate these initially as following:

tv = sp / (1 + (tr / 100))
   = 95 / (1 + (15 / 100))
   = 95 / 1.15
   = 82.61

ta = tv * (tr / 100)
   = 82.61 * (15 / 100)
   = 82.61 * 0.15
   = 12.39

pr = tv + d
   = 82.61 + 5
   = 87.61

But I don't know and the client is not able to explain properly how to find other value (discount or product rate) if I change any of these two. If I change the discount then product rate and tax amount need to be recalculated, and if I change the product rate then discount and tax amount need to be recalculated. The tax rate (tr) 15 and selling price (sp) 95 are constants/fixed/readonly/non-editable.

According to this description, please give equations to find discount and product rate if any of these two is changed.

  • In just 5 minutes, got 2 down-votes, wow! Would anybody care to tell me the reason behind down-voting? – Nikunj Bhatt Jan 31 '20 at 18:50
  • Can you clarify what of the above will change, what stays the same and what do you want to calculate? – shortmanikos Jan 31 '20 at 22:22
  • @shortmanikos tax rate (15%) and selling price (95) are constants. Product rate, taxable value and discount need to be recalculated if product rate or discount is changed. I have already mentioned these in the question's description, so if these info also doesn't seems enough then please let me know what exactly you need. – Nikunj Bhatt Feb 01 '20 at 08:14

2 Answers2

1

Given that sp and tr are constant and that tv is a calculated value from sp and tr, by definition tv is also constant.

And considering that ta also is calculated based off of constant values, ta is also constant in both below scenarios.

ta = tv * tr / 100

Scenario 1, for discount changes,

pr = tv + d

Scenario 2, for product rate changes,

d = pr - tv

Is there anything i am missing?

0

Assume you have a new pair of product rate ($pr$) and discount ($d$). Then $ tv = pr - d $

Tax amount ($ ta $) can then be calculated in the exact same way as before from the new taxable value ($tv$). Selling price ($sp$) equals

$ sp = \dfrac{100+tr}{100} \cdot tv $.

Let's see what happens if we assume a constant selling price ($sp$) and a constant tax rate ($tr$). Then

$tv = \dfrac{sp}{1 + \dfrac{tr}{100}}$

This means that taxable value ($tv$) is also constant. Now this implies that tax amount is also constant. In this case all that can change if we change the discount is
$pr = tv + d$
and if we change the product rate all that changes is discount
$d = pr - tv$.

shortmanikos
  • 1,425
  • No. sp = 95 is constant. – Nikunj Bhatt Feb 02 '20 at 15:37
  • I tried some calculation. On changing either discount or rate, if I can find the taxable value (tv) then I can get the other value (d or tr). As selling price (sp) 95 is calculated on basis of taxable value (tv) as following: tv + (tv * (tr / 100)) = sp tv + (tv * 0.15) = 95 if one can give me the equation to find the value of tv (from this equation) then I think it will be possible to find rate or discount from it. – Nikunj Bhatt Feb 02 '20 at 15:57
  • @NikunjBhatt I edited my answer to account for a constant sp. You are providing the equation that you are asking for in the beginning of your post... tv = sp / (1 + (tr / 100)) but since sp and tr do not change, then neither will tv... – shortmanikos Feb 02 '20 at 20:08