> For the complete documentation index, see [llms.txt](https://axcos.gitbook.io/axcos-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://axcos.gitbook.io/axcos-docs/scripts/boss-menu.md).

# BOSS MENU

İşletme patron menüsü – çalışan yönetimi, sermaye, efor analitiği ve tedarik (supply chain) siparişleri tek bir NUI dashboard üzerinden yönetilir.

***

## Özellikler

* **Dashboard:** Bakiye, aktif çalışan sayısı, işten çıkarılan sayısı
* **Çalışanlar:** Online çalışanları görme, grade güncelleme, işten çıkarma
* **Eski Çalışanlar:** İşten çıkarılanlar listesi, nedeni güncelleme
* **Efor Analitiği:** Günlük / haftalık / aylık / yıllık gelir-gider, Chart.js grafikleri, teslimat sayıları
* **Sermaye Yönetimi:** Banka hesabından işletmeye para yatırma / işletmeden çekme
* **Tedarik (Supply Chain):**
  * Bizim siparişlerimiz (tedarikçiye verdiğimiz)
  * Bize gelen siparişler (onayla / reddet)
  * Sipariş oluştur (tedarikçi seç, katalogdan ürün ekle)
* **Web UI (NUI):** Modern dashboard, Chart.js ile grafikler
* **Alternatif:** `Config.UseWebUI = false` ile ox\_lib context menü

***

## Gereksinimler

* **ox\_lib** (zorunlu)
* **oxmysql** (zorunlu)
* **axcos\_core** (zorunlu)

***

## Kurulum

{% stepper %}
{% step %}

#### Bağımlılıkları ekleyin

```cfg
ensure ox_lib
ensure oxmysql
ensure axcos_core
ensure axcos_bossmenu
```

{% endstep %}

{% step %}

#### Veritabanını import edin

```bash
# axcos_bossmenu/sql/axcos_bossmenu.sql
# (axcos_core db tabloları da gereklidir)
```

{% endstep %}

{% step %}

#### Config'i düzenleyin

`shared/config.lua` içinde işletmeleri, katalogları ve tedarik ayarlarını yapılandırın.
{% endstep %}
{% endstepper %}

***

## Kullanım

* **Komut:** `/bossmenu` (Config.Command ile değiştirilebilir)
* **Erişim:** Oyuncunun job'ı ile eşleşen işletmede, `boss_grade` veya üzeri derecede olmalı (patron)
* **Açılış:** NUI sadece komut ile açılır; resource start'ta otomatik açılmaz
* **Kapatma:** Panelde × veya ESC

***

## Config Referansı

### İşletmeler (Config.Businesses)

Her işletme için `label`, `catalog`, `bossGrade` tanımlanır. Katalog, tedarik sipariş sayfasında tedarikçi olarak gösterilir.

```lua
Config.Businesses = {
  nox = {
    label = 'Nox Nightclub',
    catalog = { Catalog_Alcohol, Catalog_Drinks },
    bossGrade = 4,
  },
  cutecafe = {
    label = 'Cafe Cute',
    catalog = { Catalog_Snacks, Catalog_Dessert, Catalog_Drinks },
    bossGrade = 4,
  },
}
```

### Katalog Yapısı

Katalog tabloları `{ name, category, price }` formatında:

```lua
local Catalog_Example = {
  { name = 'ax_burger', category = 'food', price = 45 },
  { name = 'ax_cola', category = 'drinks', price = 25 },
}
```

**Kategoriler:** `food`, `dessert`, `elite`, `drinks`, `alcohol` (küçük harf, locales ile `category_*` eşleşir)

### Tedarik İzinleri (Config.SupplychainAllowedBuyers)

Hangi alıcı hangi tedarikçilerden sipariş verebilir:

```lua
-- nil = tüm işletmeler (kendisi hariç) sipariş verebilir
Config.SupplychainAllowedBuyers = nil

-- Veya kısıtlı: cutecafe sadece nox'tan sipariş verebilir
Config.SupplychainAllowedBuyers = {
  cutecafe = { 'nox' },
}
```

### Genel Ayarlar

| Parametre                         | Açıklama                                      | Varsayılan     |
| --------------------------------- | --------------------------------------------- | -------------- |
| `Config.Command`                  | Bossmenu açma komutu                          | `'bossmenu'`   |
| `Config.DefaultBossGrade`         | Varsayılan patron derecesi                    | `4`            |
| `Config.UnemployedJob`            | İşten çıkarıldığında atanacak job             | `'unemployed'` |
| `Config.EffortDays`               | Efor raporu için gün sayısı                   | `30`           |
| `Config.AllowUnsafeCapitalAdjust` | Sermaye ekleme/çekme izni                     | `true`         |
| `Config.UseWebUI`                 | true = NUI Dashboard, false = ox\_lib context | `true`         |
| `Config.Debug`                    | Konsol logları                                | `true`         |

### Çalışan Listesi (Player Groups)

| Parametre                             | Açıklama                        | Varsayılan        |
| ------------------------------------- | ------------------------------- | ----------------- |
| `Config.UsePlayerGroupsForActiveList` | player\_groups tablosunu kullan | `true`            |
| `Config.PlayerGroupsTable`            | Tablo adı                       | `'player_groups'` |
| `Config.PlayerGroupsJobColumn`        | Job sütunu                      | `'group'`         |
| `Config.PlayerGroupsTypeColumn`       | Tip sütunu                      | `'type'`          |
| `Config.PlayerGroupsTypeValue`        | type değeri (job)               | `'job'`           |
| `Config.PlayerGroupsIdentifierColumn` | Identifier sütunu               | `'citizenid'`     |
| `Config.PlayersTableForNames`         | İsim için tablo                 | `'players'`       |

***

## Sipariş Akışı (Tedarik)

{% stepper %}
{% step %}

#### Sipariş oluşturma

Patron Tedarik > Sipariş Oluştur sekmesinden tedarikçi seçer, ürün ekler, sipariş oluşturur.
{% endstep %}

{% step %}

#### Beklemede (pending)

Tedarikçi işletmesinin patronu bossmenu'de "Bize gelen siparişler"den onaylar veya reddeder.
{% endstep %}

{% step %}

#### Onaylandı (available)

Kuryepanelinde (axcos\_supplychain\_delivery) sipariş alınabilir hale gelir.
{% endstep %}

{% step %}

#### Yolda (assigned / in\_transit)

Kurye görevi almış, teslime gidiyor.
{% endstep %}

{% step %}

#### Teslim edildi (delivered)

Teslim noktasında tamamlanmış.
{% endstep %}
{% endstepper %}

***

## Veritabanı Tabloları

### axcos\_businesses

| Sütun       | Tip         | Açıklama          |
| ----------- | ----------- | ----------------- |
| job         | VARCHAR(64) | İşletme adı (PK)  |
| label       | VARCHAR(64) | Görünen ad        |
| boss\_grade | TINYINT     | Patron derecesi   |
| margin\_pct | DOUBLE      | Kar marjı yüzdesi |
| created\_at | TIMESTAMP   | Oluşturulma       |

### axcos\_business\_employees

| Sütun                                                      | Tip         | Açıklama               |
| ---------------------------------------------------------- | ----------- | ---------------------- |
| job                                                        | VARCHAR(64) | İşletme                |
| identifier                                                 | VARCHAR(96) | Oyuncu (citizenid)     |
| name\_cache                                                | VARCHAR(96) | İsim önbelleği         |
| grade                                                      | TINYINT     | Derece                 |
| status                                                     | VARCHAR(16) | active \| eski kayıt   |
| hired\_at, ended\_at, ended\_by\_identifier, ended\_reason |             | İşe alınma / çıkarılma |

***

## Dosya Yapısı

```
axcos_bossmenu/
├── shared/
│   ├── config.lua    # İşletmeler, katalog, ayarlar
│   └── locales.lua   # TR/EN metinleri
├── client/
│   └── main.lua      # NUI, callback'ler
├── server/
│   └── main.lua      # Callback'ler, DB işlemleri
├── ui/
│   ├── index.html
│   ├── css/style.css
│   └── js/app.js     # Dashboard, Chart.js
├── sql/
│   └── axcos_bossmenu.sql
├── fxmanifest.lua
└── README.md
```

***

## Grafik (Chart.js)

Web UI Chart.js CDN üzerinden yüklenir. Sunucu dış ağa kapalıysa:

1. `chart.umd.min.js` indirip `ui/` klasörüne koyun
2. `index.html` içinde script src'yi bu dosyaya çevirin

***

## supplychainEnabled

`axcos_core:IsModuleEnabled('supplychain_delivery')` ile Tedarik sayfası ve nav butonu kontrol edilir. Modül kapalıysa Tedarik gizlenir.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://axcos.gitbook.io/axcos-docs/scripts/boss-menu.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
