That is the main point. If you are able to use everything without the duty
of quality control and documentation then you have found the weak point.
As I said I can only speak about the situation in Germany:
You mention a shipload of white tablets. Whats about certificats of origin
and quality? Whats about quality control?
Lets assume a German pharmacist buys 1kg (bulk) of a medical
tea and he wants to sell it as 100g tea.
The first thing is that he has to buy quality. The 1kg bulk must have a
certificat from the producer(!) about quality and purity. The methods of
quality control must be mentioned and must fullfil standards of the
pharmacopoea.
Then the pharmacist must perform an analysis of identity in his
laboratory. This has to be according to the rules of the pharmacopoea. He
must fill in a own certificate about this quality control.
Producer, Distributor (wholesaler), Buying date, serial number of
the product, performed tests, result of the analysis. decision for use of
the product or refusal. The certificate of the producer must be added.
If the health authority comes for an inspection these documents must be
available.
(You see we can go backwards: problem with substance in pharmacy ->
wholesaler -> producer -> raw materials .)
If there is anything wrong with the certificates of the producer, e.g. the
methods of measurement are not mentioned, the pharmacist has not only to
perform the test for identity, he must also do the test for purity and
quantity according to the pharmacopoea (or other reference books if the
substance is not in the pharmacopoea).
Now he is allowed to use this substance for preparations.
If he wants to keep stock of selling packages (example: 100g tea packs) he
must become a producer(!). Up to 100 packages per day he can fill in a
certificate of production (to have it available for the health authority).
He has to give a own serial number. All used ingreadients must be listed
with the used amount, product serial number and number of quality control
in this pharmacy. At least the pharmacist has to sign that according to
his knowledge he has not detected any error during production so that the
product can be used by the patient.
(If he produces more the 100 packages of one drug per day than it counts
as "Mass production" and he has to register as pharmaceutical producer at
the health authority according to the pharmaceutical law for producers
and he needs a certificat of this authority that he is allowed to
produce.)