---
title: "Purchase"
description: "Dostawcy i zamówienia zakupu. Każda aplikacja jest modułem na jednym modelu danych."
canonical: "https://obop-platform.sliplane.app/pl/apps/purchase/"
lang: "pl"
---

# Purchase

## Do czego służy

Keep vendors and the purchase orders you send them, with order lines and a draft to received flow. Totals are entered, not summed from the lines.

## Co pakiet robi, a czego nie robi

Vendors, purchase orders and order lines with a draft, sent, confirmed, received and cancelled flow. Order totals are entered, not summed from the lines.

## Modele

### `purchase_vendor`

Purchasing terms for a contact you buy from

Grupa odczytu: `purchase.user`. Grupa zapisu: `purchase.manager`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `party_id` | ref → party | `none` | nie | `purchase.user` | jawnie | The contact record of the vendor |
| `vendor_reference` | text | `none` | nie | `purchase.user` | jawnie | Your customer number at this vendor |
| `payment_terms_days` | number | `none` | nie | `purchase.user` | jawnie | Days allowed to pay an invoice |
| `lead_time_days` | number | `none` | nie | `purchase.user` | jawnie | Usual days between order and delivery |
| `iban` | text | `financial` | tak | `purchase.manager` | wstrzymane | Bank account the vendor is paid into |
| `active` | bool | `none` | nie | `purchase.user` | jawnie | Whether you still buy from this vendor |

### `purchase_order`

A request to a vendor to supply goods or services

Grupa odczytu: `purchase.user`. Grupa zapisu: `purchase.user`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `reference` | text | `none` | nie | `purchase.user` | jawnie | Order number printed on the document |
| `vendor_id` | ref → purchase_vendor | `none` | nie | `purchase.user` | jawnie | The vendor ordered from |
| `ordered_on` | date | `none` | nie | `purchase.user` | jawnie | Date the order was placed (YYYY-MM-DD) |
| `expected_on` | date | `none` | nie | `purchase.user` | jawnie | Date the goods are expected (YYYY-MM-DD) |
| `currency` | text | `none` | nie | `purchase.user` | jawnie | ISO 4217 currency code, for example EUR |
| `total` | money | `none` | nie | `purchase.user` | jawnie | Order total as agreed with the vendor (minor currency units, e.g. cents) |
| `notes` | longtext | `none` | nie | `purchase.user` | jawnie | Delivery instructions and remarks for the vendor |
| `state` | select (draft, sent, confirmed, received, cancelled) | `none` | nie | `purchase.user` | jawnie | Order status: draft, sent, confirmed, received, cancelled |

### `purchase_order_line`

One product or service on a purchase order

Grupa odczytu: `purchase.user`. Grupa zapisu: `purchase.user`.

| Pole | Rodzaj | Klasa danych | Dane osobowe | Grupa | Agenci widzą | Opis |
|---|---|---|---|---|---|---|
| `order_id` | ref → purchase_order | `none` | nie | `purchase.user` | jawnie | The order the line belongs to |
| `product_id` | ref → product | `none` | nie | `purchase.user` | jawnie | The product ordered |
| `description` | text | `none` | nie | `purchase.user` | jawnie | Wording for the vendor if different from the product name |
| `quantity` | number | `none` | nie | `purchase.user` | jawnie | Units ordered |
| `unit_price` | money | `none` | nie | `purchase.user` | jawnie | Agreed price per unit (minor currency units, e.g. cents) |
| `received_quantity` | number | `none` | nie | `purchase.user` | jawnie | Units received so far |

## Przepływy pracy

### `purchase_order`

| Akcja | Przenosi | Kto może uruchomić | Zatwierdzenie |
|---|---|---|---|
| `purchase_order.send` | state: draft → sent | `purchase.user` | nie |
| `purchase_order.confirm` | state: sent → confirmed | `purchase.manager` | tak |
| `purchase_order.receive` | state: confirmed → received | `purchase.user` | nie |
| `purchase_order.cancel` | state: draft → cancelled | `purchase.user` | nie |

## Grupy uprawnień

Grupy używane przez tę aplikację:

- `purchase.manager`
- `purchase.user`

## Kroki zatwierdzania

Kroki, które agent może tylko zaproponować:

- `purchase_order.confirm`

## Co agenci mogą, a czego nie mogą

Agent może odczytywać, wyszukiwać, tworzyć i aktualizować rekordy tej aplikacji oraz uruchamiać akcje niewymagające zatwierdzenia, w ramach grup uprawnień swojego tokenu.

Te kroki może tylko zaproponować, a człowiek musi je zatwierdzić: `purchase_order.confirm`, `purchase_vendor.delete`, `purchase_order.delete`, `purchase_order_line.delete`.

Te pola są całkowicie wstrzymane i niedostępne dla agentów: `purchase_vendor.iban`.

## Zależności

- `base`
- `product`

## Instalacja

Zainstaluj ją w aplikacji Customize (Marketplace) lub z wiersza poleceń:

```bash
obop modules install-from purchase
```

Wymaga bazy danych i uprawnień administratora.

## Zbuduj własną

[Przewodnik po modułach pokazuje, jak pisze się takie aplikacje](/pl/docs/reference/module-manifest/)
