Difference between revisions of "Information Systems:CPR Description"
(Created page with "Some items cannot be sold to some customers. For example, schedule 1 drugs cannot be sold to a store that does not have a pharmacist, or vendors can refuse to sell to stores...") |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 36: | Line 36: | ||
- If so, read order file to find out how many the customer has already ordered today. The quantity the customer is allowed to purchase is the restriction quantity less what they have already purchased. |
- If so, read order file to find out how many the customer has already ordered today. The quantity the customer is allowed to purchase is the restriction quantity less what they have already purchased. |
||
| + | |||
| + | [[Category: Extensions]] |
||
Latest revision as of 10:09, 30 June 2016
Some items cannot be sold to some customers. For example, schedule 1 drugs cannot be sold to a store that does not have a pharmacist, or vendors can refuse to sell to stores that they think have unusual usage, indicating that they may be an internet pharmacy.
- File RSCULIP (CPR -- Customer to Restriction Class Linkages) contains restriction classes that a customer can purchase.
- File RSVILIP (RSR -- Item to Restriction linkage) contains restriction classes that items are in.
Also, when we cannot get enough of an item we can put daily quantity limits on it.
- File RSPCUDP (RSR – Period Restriction Customer Group Details) links individual customers to a customer group (STAFF, SHARE, NONSHARE).
- File RSPICLP (RSR – Period Restriction Group to Customer Group Links) links customer groups to period restriction groups.
- File RSPITDP (RSR – Period Restriction Item Groups Details) contains allowed purchase quantities by item, and links that item to a period restriction group.
RPG program RSRUT900 (CPR -- Check an order line for restrictions) is the black box that does all checking for restrictions. Basically, it receives item, customer, date, and requested quantity, then returns the allowed quantity, and the reason (if it is different).
The high level process is –
- Read RSVILIP to see if item is currently in a restriction class.
- If so, read RSCULIP to see if the customer is authorized to that restriction class.
- If the item is in a restriction class that the customer is not authorized to, they cannot purchase this item.
- Read RSVILIP to see if the main supplier of this item has vendor level restrictions.
- If so, read RSCULIP to see if the customer is restricted by that vendor.
- If the item has vendor level restrictions, and the customer is restricted, they cannot purchase this item
- Read RSPITDP to see if this item has any period restrictions.
- If so, read RSPICLP to get the customer groups linked to the period restriction group from RSPITDP.
- For each customer group, read RSPCUDP to see if the customer is in it.
- If so, read order file to find out how many the customer has already ordered today. The quantity the customer is allowed to purchase is the restriction quantity less what they have already purchased.