# Purchase entry and supplier payment permissions

Supplier is required when creating a purchase. Choose an active supplier accessible to the user. Historical purchases are unchanged.

Under Roles > Purchases, the payment status checkboxes control both the options available on purchase entry and the resulting status when paying an existing purchase:

- Select Unpaid Purchases: enter purchases without a payment. Payment method and paid amount are hidden and disabled.
- Select Partially Paid Purchases: enter a positive payment below the full total.
- Select Paid Purchases: enter full payment. The purchase form fills the paid amount from the total.
- Pay Purchase: required for ANY payment, both during purchase entry and after it has been recorded. Without it, Paid and Partial are unavailable even if their status checkboxes are ticked.

For a stock-entry clerk, enable Purchases module access, Create Purchase, View Own Purchases (or View All if needed), and Select Unpaid Purchases only. Disable Pay Purchase and the Paid/Partial status checkboxes. With only one allowed status the form shows a read-only status, not a dropdown. Payment method and paid amount are hidden for Unpaid. Server-side checks reject forged Paid/Partial submissions and unpaid purchases containing money.

For a separate payment clerk, enable Purchases module access, View All Purchases, Pay Purchase, and Select Paid Purchases / Select Partially Paid Purchases as appropriate. They do not need Create Purchase. View All is needed to access purchases entered by other staff, within assigned branches.

Paid/Partial entry requires an active payment method for the purchase branch or a global payment method. Credit and Customer Advance are not supplier payment methods. Permissions and payment amount checks are enforced server-side; changing hidden form values cannot bypass them. Existing accounting posting remains in use: unpaid amounts go to Accounts Payable and later payments reduce it.

Deployment: run `php artisan migrate --force`, then `php artisan view:clear`. The migration adds three permission records and preserves existing role access for roles that could already create or pay purchases. Restrict those existing roles using the checkboxes after upgrading. Newly created roles receive only the permissions selected by the administrator. No historical transactions are changed.
