N
N
Nad_Sad2019-07-09 08:06:08
Algorithms
Nad_Sad, 2019-07-09 08:06:08

How to limit adding a counterparty?

Good afternoon.
There is already a working site that sells goods to both individuals and legal entities.
Registration is made on behalf of an individual - the user.
Now on the site, any user can add absolutely any counterparty (legal entity) for further purchases on his behalf.
An unlimited number of users can make purchases for the same counterparty.
There is a need to limit the addition of counterparties for users and make it unique on the basis of TIN / KPP, i.e. only one user will be able to add a counterparty with unique TIN/KPP.
If a user wants to add a counterparty that is already linked to another user, he will be prohibited from doing so.
The question is, what to do with users who already have the same counterparties added?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lone Ice, 2019-07-09
@daemonhk

what to do with users who have already added the same counterparties?

Why are you asking us this? Ask a business owner/manager a question

R
Ruslan., 2019-07-09
@LaRN

I had a project to merge several databases, there was a task to combine the customer directory and there were duplicates in both directories.
As a result, we decided as follows:
We chose a client that was entered earlier in time, and all references to the client in the related tables were replaced with the selected client, and duplicate clients were left in the database (in the client table) but marked as archived so that they could not be selected and used.
But here you need to know all the tables in which there are links to the client, and if these tables are huge, then such a conversion can take several days.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question