-1
I have a sales system, where each user has an X percentage on their sale, at the moment I have 15 users, 10 of them with 5% profit on each sale, and the other 5 have 8% profit on each sale.
So I have my administration page where I see how much I will have to pay them all if I add up all the percentages of gain, the problem is that I have to calculate sale by sale, that is, if the user has 5% profit and the other has 8%, I have to script
do the following:
$Valor += $ValorDoProduto * ($GanhoDoUsuario / 100);
So, if I add up all users, I will have an X value that represents the amount I will pay if I add up all the winnings of each user.
But I would like to make it simpler, so that I calculate all the sales, then returning me an X value, that X value is the sales without taking away the seller’s gain, so when I have the X value that is the sum of all the products sold I would add up all the percentages, and then subtract and have the same value that you would have using the calculus up there.
Explaining better:
I have a user table on MySQL
, each user has a gain in percentage for each sale, there is the possibility to 'add' all percentages and then make a single calculation to determine how much I will have to pay commission to all of them?
Got it, I thought I’d have like... thank you!
– Cassiano José