I have a script for calculating discounts in percent, then I want to add a second discount, what is the script formula?
<td>Rp<?= number_format((($r->jual * $r->jumlah) - ($r->jual*$r->jumlah*$r->diskon/100)) ?? 0);?>,-</td>
This works for the first discount, how to calculate the second discount
You can do something like this
Example
Notes : Put above function in your code and just call this function in td by passing argument as above said.