M
M
Mark2019-04-26 08:59:57
Electronic accounting
Mark, 2019-04-26 08:59:57

How to implement payments on the site from the replenishment amount?

Hello, please tell me how to implement it on the site so that the funds are distributed among employees?
For example, they made a payment on the account, the money fell into the general account and distributions for three people were sent from the general account?
500 rubles came
and immediately left
1 person 75 rubles
2 people 212.50 rubles
3 people 212.50 rubles

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Moses Fender, 2019-04-26
@mosesfender

There are entities:
1. General account
2. People's accounts
3. Funds transfer order
When an entity 3 is created for 500 rubles on entity 1, we instantly create entities 3 for the corresponding amounts for entities 2. Accordingly, entities 2 will each have one entity 3.
All simply.
It's even better to ask an accountant how it's done, and do the same, because accounting is an old science, and OOP is a little fresher.

K
Kirill Gorelov, 2019-04-26
@Kirill-Gorelov

Is that the idea??
I would do that.
Made a table. And in it I registered the id of the employees and to whom how much to pay and revisions, all of a sudden, someone needs to translate more than others.
And in the second table stored all names. And then I would just take the id of the employees, take the details and translate.
Of course, you can store everything in one table, but it already depends on the "nature" of your application.
And the code is how you write it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question