Suppliers
- Code: PUR-SUP
- Module: Purchasing
- Type: Master Data
1. Overview
Suppliers are the parties that supply goods to stores, along with their addresses and the contact people who can be reached when transacting. Every supplier is attached to one entity — the master data of a person or business shared throughout the system — so an entity already registered as an employee or user can also be made a supplier without retyping its data. Suppliers are the counterparty on Purchase Orders, Goods Receipts, and Bills.
Expected outcome: every purchase has a clear counterparty along with its address and contact, so order, receipt, and billing documents are filled in automatically with the correct data.
2. Problem
Without centralized supplier data, supplier contacts and addresses are only kept in staff members’ personal notes and copied over every time a document is created. As a result:
- Contact numbers and addresses differ across documents, so delivery and billing confirmations often stall.
- One supplier is recorded many times with different spellings, so the purchase history with that supplier cannot be totaled.
- Suppliers that are no longer used still appear when creating new documents and risk being selected.
- The data of people already registered as employees or users is retyped when they become suppliers, so it easily diverges.
3. Goals & Non-goals
3.1 Goals
- Every supplier has one master record used by all purchasing documents.
- Supplier addresses and contacts are available immediately when a document is created, without retyping.
- Entities already in the system can be promoted to suppliers without rewriting their data.
- Suppliers that are no longer used can be locked from new transactions without deleting their history.
3.2 Non-goals
- Supplier ratings and rankings, for example delivery punctuality or goods quality.
- Supplier-specific payment terms and credit limits; terms are set per purchasing document.
- Supplier price catalogs; prices are set when preparing an order.
- A supplier portal and sending documents directly from the system.
- Supplier tax and bank account data.
4. Business Rules
Business rules are the set of provisions and constraints that apply to Suppliers throughout the application, on every screen and action that involves it, whoever performs it. These rules are the single source of truth: if another part of this PRD appears to differ, the rules here prevail.
- BR-01 Every supplier is attached to exactly one entity. A supplier is created from scratch, which also forms a new entity, or from an existing entity that is not yet a supplier.
- BR-02 One entity may only be one supplier; an entity that is already a supplier no longer appears as an option when creating a supplier from an entity.
- BR-03 The supplier code is set by the system when the supplier is saved and cannot be changed.
- BR-04 The entity category is chosen from Individual, Company, or Organization. Gender only applies, and is required, if the category is Individual.
- BR-05 The supplier’s name, email, and phone number are required, and the email must be a valid email address format.
- BR-06 Every supplier must have at least one address from the moment it is created.
- BR-07 The primary, billing, and shipping address roles are each held by exactly one address per supplier. Assigning a role to another address automatically moves it from the previous address.
- BR-08 The first address created automatically holds all three roles at once.
- BR-09 There may be more than one contact, and there may be none. A contact’s name and phone number are required, while email is optional but must be valid if filled in.
- BR-10 Inactive suppliers still appear in supplier search, but cannot be selected when creating a Goods Receipt without a PO. Their existing transaction data can still be viewed. Needs confirmation: whether the same restriction applies when selecting a supplier on a Purchase Order.
- BR-11 Every change to supplier data, addresses, and contacts is recorded along with its actor and time.
5. Flow
5.1 Main Flowchart
- Creation Source — Staff choose to create a supplier from scratch, or from a registered entity that is not yet a supplier (BR-01, BR-02).
- General Data — Status, name, entity category, gender if individual, email, and phone number. If created from an entity, these inputs are filled from that entity’s data.
- Address — The supplier is given at least one address. The first address automatically becomes the primary, billing, and shipping address at once (BR-08).
- Contact — People who can be reached on the supplier’s side; there may be more than one and this step may be skipped (BR-09).
- Review — All inputs are reviewed before saving.
- Validation — Inputs are checked before the supplier is saved. A supplier that violates the rules cannot be saved, and the errors are shown in the relevant step.
- Supplier Saved — The supplier code is issued and the supplier can be used on purchasing documents according to its status.
- 7a. Edit General Data — Status, name, category, gender, email, and phone number are updated together.
- 7b. Add/Edit/Delete Addresses & Contacts — Addresses and contacts are managed per row and saved instantly, including moving address roles.
- Used on Purchasing Documents — The supplier along with its contacts and addresses is referenced by Purchase Order, Goods Receipt, and Bill.
5.2 Status Lifecycle
| Status | Description | Next |
|---|---|---|
Activeis_active: true | The supplier can be selected on new purchasing documents | Inactive, or deleted |
Inactiveis_active: false | The supplier appears but cannot be selected on goods receipts without a PO | Active, or deleted |
6. Document Structure
This section defines the content of the Supplier data itself: which fields it has, their type, which are required, their initial values, and their value rules. The provisions here apply wherever the supplier is created or changed and are enforced on save, regardless of how the field is displayed.
6.1 General
| Field | Type | Required | Default | Rules |
|---|---|---|---|---|
| Code | Text | — | Generated on save | Set by the system, cannot be changed (BR-03) |
| Entity | Ref. Entity | — | A new entity, or the selected entity when created from an entity | Set on creation, one entity one supplier (BR-01, BR-02) |
| Status | Enum | Yes | Not selected | Active or Inactive |
| Supplier Name | Text | Yes | The entity’s name, if created from an entity | (BR-05) |
| Category | Enum | Yes | — | Individual, Company, or Organization (BR-04) |
| Gender | Enum | Yes, if the category is Individual | — | Male or Female (BR-04) |
| Text | Yes | — | Must be a valid email format (BR-05) | |
| Phone Number | Text | Yes | — | (BR-05) |
6.2 Address
| Field | Type | Required | Default | Rules |
|---|---|---|---|---|
| Name | Text | Yes | — | Address label, maximum 50 characters |
| Phone Number | Text | Yes | — | Maximum 15 characters |
| Full Address | Text | Yes | — | Maximum 255 characters |
| Primary Address | Boolean | — | Attached to the first address | Set by the system; exactly one per supplier (BR-07, BR-08) |
| Billing Address | Boolean | — | Attached to the first address | Set by the system; exactly one per supplier (BR-07, BR-08) |
| Shipping Address | Boolean | — | Attached to the first address | Set by the system; exactly one per supplier (BR-07, BR-08) |
6.3 Contact
| Field | Type | Required | Default | Rules |
|---|---|---|---|---|
| Name | Text | Yes | — | (BR-09) |
| Phone Number | Text | Yes | — | (BR-09) |
| Text | No | — | Must be a valid email format if filled in (BR-09) |
7. UI Structure
This section defines how Suppliers are displayed and operated: the list columns, filters, and form controls along with their option sources. Activity Logs are available as a drawer from the list page (all suppliers) and from the detail page (per supplier). This section only governs display and interaction; content and value rules still follow Document Structure.
7.1 Datatable
| Column | Sortable | Sample Value | Component |
|---|---|---|---|
| Select | — | — | Checkbox |
| No | — | 1 | Number |
| Code | Yes | SUP-0007 | Text |
| Supplier Name | Yes | PT Sumber Rejeki | Text |
| Category | — | Company | Text |
| As User | — | Yes | Badge |
| As Employee | — | No | Badge |
| Status | — | Active | Badge |
| Actions | — | View · Edit · Delete | Action Menu |
7.2 Advance Filter
| Field | Control | Options Source | Default |
|---|---|---|---|
| Status | Single Select | Active, Inactive | Empty |
| Category | Single Select | Individual, Company, Organization | Empty |
| Gender | Single Select | Male, Female | Empty |
7.3 Form & Details
Create — Starts with a source selection dialog: Create from Scratch or Create from Entity. With the second option, the dialog shows a list of entities that are not yet suppliers, searchable and sortable, and the selected entity fills in the general data. After that comes a four-step wizard: General, Address, Contact, then Review. The Next button validates the current step before moving on. Actions: Previous, Next, Save.
Edit — Three tabs, General, Address, and Contact. The General tab is saved as a whole; addresses and contacts are managed per row (add, edit, delete, assign address role), each saved instantly.
Detail — Three read-only tabs, General, Address, and Contact. Actions: Edit Data and Activity Logs.
General
| Field | Control | Options Source | Behavior |
|---|---|---|---|
| Status | Single Select | Active or Inactive | The currently selected option can be deselected, leaving the status empty |
| Supplier Name | Text Input | — | Filled from the entity if created from an entity |
| Category | Single Select | Individual, Company, Organization | Changed to something other than Individual → Gender no longer applies |
| Gender | Single Select | Male, Female | Only shown and required when the category is Individual |
| Text Input | — | — | |
| Phone Number | Text Input | — | — |
Address
| Field | Control | Options Source | Behavior |
|---|---|---|---|
| Name | Text Input | — | — |
| Phone Number | Text Input | — | — |
| Full Address | Textarea | — | — |
| Address Role | Action Menu (“Set as”) | Primary, Billing, Shipping | Only shows roles the address does not have yet; assigning a role removes it from other addresses |
Contact
| Field | Control | Options Source | Behavior |
|---|---|---|---|
| Name | Text Input | — | — |
| Phone Number | Text Input | — | — |
| Text Input | — | Optional; only validated if filled in |
8. User Stories
US-01 - Create a supplier from scratch
As purchasing staff, I want to register a new supplier along with its addresses and contacts, so that it can be used right away to create purchase orders.
| ID | Acceptance criteria |
|---|---|
| AC-01.1 | When a user with the create permission opens Add New, the creation source dialog appears with the options Create from Scratch and Create from Entity. |
| AC-01.2 | The wizard consists of General → Address → Contact → Review; the user cannot continue if the required fields in that step are not valid yet. |
| AC-01.3 | Status, name, category, email, and phone number are required; the email must be in a valid format (BR-05). |
| AC-01.4 | Gender is only required when the category is Individual (BR-04). |
| AC-01.5 | At least one address must be added before continuing from the Address step (BR-06). |
| AC-01.6 | The first address is automatically marked Primary, Billing, and Shipping (BR-08). |
| AC-01.7 | The Contact step may be skipped without adding a contact (BR-09). |
| AC-01.8 | When Save succeeds, the supplier code is issued, a success toast appears, and the user is redirected to the supplier list (BR-03). |
| AC-01.9 | When saving is rejected, error messages appear in the Review step and on the related fields. |
| AC-01.10 | When the user leaves the wizard with unsaved input, an unsaved changes confirmation appears. |
US-02 - Create a supplier from an entity
As purchasing staff, I want to promote a registered entity to a supplier, so that its data does not need to be retyped.
| ID | Acceptance criteria |
|---|---|
| AC-02.1 | The Create from Entity dialog shows a list of entities that are not yet suppliers, with search, sorting, and pagination (BR-02). |
| AC-02.2 | After an entity is selected, the General step is filled with that entity’s data and can still be adjusted. |
| AC-02.3 | The saved supplier stays attached to the selected entity, not a new entity (BR-01). |
US-03 - Manage supplier addresses
As purchasing staff, I want to add, edit, delete, and assign roles to supplier addresses, so that documents use the correct address.
| ID | Acceptance criteria |
|---|---|
| AC-03.1 | An address consists of a name (max 50), phone number (max 15), and full address (max 255); all are required. |
| AC-03.2 | The “Set as” menu only shows roles that the address does not have yet (BR-07). |
| AC-03.3 | Assigning a role to one address removes the same role from other addresses (BR-07). |
| AC-03.4 | In edit mode, every address action is saved immediately and the result appears without reloading the page. |
| AC-03.5 | Each address shows its role badges (Primary / Billing / Shipping). |
| AC-03.6 | Deleting the supplier’s last address — not prevented on screen. Needs confirmation: it must be rejected on save so that BR-06 holds. |
US-04 - Manage supplier contacts
As purchasing staff, I want to record the people who can be reached on the supplier’s side, so that orders can be confirmed with the right person.
| ID | Acceptance criteria |
|---|---|
| AC-04.1 | A contact consists of a required name and phone number, and an optional email that is only validated if filled in (BR-09). |
| AC-04.2 | Contacts can be added, edited, and deleted per row in edit mode, each saved immediately. |
| AC-04.3 | Supplier contacts become the options of the Contact field on Purchase Orders. |
US-05 - Edit supplier data
As purchasing staff, I want to change a supplier’s general data, so that its information stays accurate.
| ID | Acceptance criteria |
|---|---|
| AC-05.1 | The Edit Data button only appears for users with the update permission. |
| AC-05.2 | Validation of the General tab is the same as the General step on creation (AC-01.3, AC-01.4). |
| AC-05.3 | The open tab is kept in the URL when switching between detail and edit. |
| AC-05.4 | The supplier code and its link to the entity cannot be changed (BR-01, BR-03). |
US-06 - Supplier list and search
As an owner, I want to view and filter suppliers, so that I can quickly find a specific supplier.
| ID | Acceptance criteria |
|---|---|
| AC-06.1 | Columns: code, supplier name, category, as user marker, as employee marker, and status. |
| AC-06.2 | Keyword search, filters for status, category, and gender, pagination, and default sort by name A–Z. |
| AC-06.3 | Sortable columns: code and supplier name. |
| AC-06.4 | Row actions: View, Edit, Delete according to permissions. |
US-07 - Delete a supplier
As purchasing staff, I want to delete a supplier created by mistake, so that the list stays clean.
| ID | Acceptance criteria |
|---|---|
| AC-07.1 | Single and bulk delete require confirmation and the delete permission. |
| AC-07.2 | If the deletion is rejected, the error message appears as a toast. |
| AC-07.3 | Deleting a supplier already used on purchasing documents — Needs confirmation: whether it is rejected, or the supplier should simply be deactivated (BR-10). |
US-08 - Activity history
As an owner, I want to see the supplier activity log, so that changes to data, addresses, and contacts can be traced.
| ID | Acceptance criteria |
|---|---|
| AC-08.1 | The activity log is available for all suppliers (in the list) and per supplier (in the detail) (BR-11). |
9. User Scenarios
| Role | Scenario |
|---|---|
| Purchasing Staff | Registers a new distributor along with its warehouse address and two sales contacts, then immediately creates the first purchase order to that supplier |
| Purchasing Staff | Promotes an entity registered so far as an employee to a supplier, because that person also supplies goods to the store |
| Admin | Updates a supplier’s billing address after its office moves, then makes sure the next bill uses the new address |
| Owner | Deactivates a supplier that is no longer used so it is not selected on new goods receipts, without deleting its purchase history |
10. Permissions & Actions
10.1 Permission by Action
| Action | Permission | Condition |
|---|---|---|
| View Supplier List | purchase:supplier:list:any | — |
| View Activity Logs | purchase:supplier:list:any | — |
| View Supplier Detail | purchase:supplier:view:any | — |
| Create Supplier | purchase:supplier:create:any | — |
| Edit Supplier (General Data) | purchase:supplier:update:any | — |
| Delete Supplier | purchase:supplier:delete:any | — |
| Add Address | purchase:supplier:create:any | From the edit supplier page |
| Edit Address | purchase:supplier:update:any | From the edit supplier page |
| Delete Address | purchase:supplier:delete:any | From the edit supplier page |
| Assign Address Role | purchase:supplier:update:any | From the edit supplier page |
| Add Contact | purchase:supplier:create:any | From the edit supplier page |
| Edit Contact | purchase:supplier:update:any | From the edit supplier page |
| Delete Contact | purchase:supplier:delete:any | From the edit supplier page |
10.2 Action by Status
| Action | Active | Inactive |
|---|---|---|
| View Supplier Detail | ✓ | ✓ |
| Edit Supplier (General Data) | ✓ | ✓ |
| Manage Addresses & Contacts | ✓ | ✓ |
| Delete Supplier | ✓ | ✓ |
| Selected on Purchase Order | ✓ | ✓ |
| Selected on Goods Receipt without PO | ✓ | — |
11. Notifications
This feature does not trigger any notifications.
12. Dependencies
Related PRDs
- Purchase Order — selects the supplier along with its contact as the counterparty.
- Goods Receipt — selects an active supplier when receiving without a PO (BR-10).
- Bill — bills addressed to the supplier.
- Entities — the parent entity of each supplier (BR-01, BR-02).
Effects on other modules
- The supplier’s name and address appear on the Purchase Order and Goods Receipt PDF documents.
- The inactive status locks supplier selection on goods receipts without a PO (BR-10).
- Every change is recorded in the activity log (BR-11).