# 🏢 Business Management - Universal ESX/QB-Core System
**Professional business ownership and management system with multi-language support**
---
## 📖 Description
Business Management is a complete business ownership system that allows players to purchase, manage, and profit from various types of businesses. With automatic framework detection, it seamlessly works with both ESX and QB-Core without any manual configuration.
Players can buy businesses, hire employees, manage finances, and pay weekly taxes. The system includes 17 pre-configured businesses (cafes, restaurants, bars, nightclubs, mechanic shops) with full customization support.
---
## ✨ Features
**Business System:**
- 17 pre-configured businesses with easy addition of custom locations
- Visual markers (green for available, red for owned)
- Automatic framework detection (ESX Legacy, ESX 1.9+, QB-Core)
- Configurable ownership limits per player
- Buy and sell businesses (65% return on sale)
**Employee Management:**
- Invite system - owners invite players by ID
- Full job integration with grade management
- Fire employees with permission checks
- Automatic job assignment on hire
**Financial System:**
- Society accounts (ESX) or management system (QB-Core) integration
- Deposit and withdraw from business accounts
- Complete transaction tracking
- Money transfer capabilities
**Tax & Payment System:**
- Automatic weekly tax collection
- Grace period (2 days default) before business seizure
- Payment history tracking
- Custom tax rates per business type
- Auto-seizure for unpaid taxes
**Security Features:**
- Business license requirement (optional, vms_documentsv2 integration)
- Gang member restrictions (optional, eth-gangs integration)
- Server-side validation for all actions
- SQL injection protection with parameterized queries
**Discord Integration:**
- Webhook logging for all business activities
- Rich embeds with custom colors
- Logs: purchases, sales, hires/fires, deposits/withdrawals, taxes, seizures
**Multi-Language Support:**
- Built-in English and Russian translations
- Easy to add custom languages
- 100+ translation keys across 4 categories
- Config files and locales fully editable
---
## 🎮 How It Works
**For Business Owners:**
1. Walk to a business marker and press E
2. Purchase the business if you have sufficient funds and required license
3. Manage employees - invite, set grades, fire
4. Handle finances - deposit profits, withdraw for expenses
5. Pay weekly taxes automatically from business account
6. Sell business back to government for 65% of purchase price
**For Employees:**
1. Receive invitation alert from business owner
2. Accept or decline job offer
3. Work at the business with assigned grade
4. Earn salary through the business job system
---
## 🛠️ Dependencies
**Required:**
- oxmysql - Database management
- ox_lib - UI library
- es_extended OR qb-core - Framework
- esx_addonaccount (ESX) or qb-management (QB-Core) - Society accounts
**Optional:**
- vms_documentsv2 - Business license validation
- ox_inventory - Inventory system (for license checks)
- eth-gangs - Gang system integration
- Discord webhook - Activity logging
---
## 📥 Installation
1. Extract the resource to your server's `resources` folder
2. Run the SQL file:
- **ESX**: Execute `install_esx.sql`
- **QB-Core**: Follow instructions in `install_qb.sql`
3. Configure settings in `config.lua`
4. Add to `server.cfg`:
```
ensure cgc_cafe
```
5. Restart your server
**Full installation guide included in documentation**
---
## ⚙️ Configuration
**Basic Setup:**
```lua
Config.Locale = 'en' -- Language: 'en' or 'ru'
Config.MaxBusinessesPerPlayer = 1 -- Ownership limit
Config.TaxCheckIntervalMinutes = 10080 -- 7 days
Config.GracePeriodDays = 2 -- Before seizure
Config.RequireBusinessLicense = false -- License requirement
Config.RestrictGangMembers = false -- Gang restrictions
Config.DiscordWebhook = nil -- Discord logging (optional)
```
**Add Custom Business:**
```lua
["my_business"] = {
label = "My Business",
coords = vector3(x, y, z),
ownedCoords = vector3(x, y, z),
price = 50000,
weeklyTax = 1500,
job = { name = "my_business", bossGrade = 4 },
marker = {
type = 1,
scale = vector3(1.5, 1.5, 0.5),
color = {
free = { r = 8, g = 127, b = 91, a = 100 },
owned = { r = 200, g = 50, b = 50, a = 100 },
},
},
}
```
---
## 📡 Export Functions
**Server-Side:**
```lua
exports['cgc_cafe']:GetBusinessData(businessId)
exports['cgc_cafe']:GetAllBusinesses()
exports['cgc_cafe']:IsBusinessOwner(identifier)
exports['cgc_cafe']:GetPlayerBusiness(identifier)
exports['cgc_cafe']:GetBusinessEmployees(businessId)
exports['cgc_cafe']:GetPlayerBusinessCount(identifier)
exports['cgc_cafe']:ForcePayTaxes(businessId)
```
**Client-Side:**
```lua
exports['cgc_cafe']:OpenBusinessMenu(businessId)
exports['cgc_cafe']:GetCurrentBusiness()
exports['cgc_cafe']:RefreshBusinessUI()
```
**Full API documentation included with purchase**
---
## 🌍 Languages
**Included:**
- 🇬🇧 English (Complete)
- 🇷🇺 Russian
**Add Your Own:**
1. Copy `locales/en.lua` to `locales/your_lang.lua`
2. Translate all strings
3. Set `Config.Locale = 'your_lang'`
---
## 📚 Documentation
**8 comprehensive documentation files included:**
- README.md - Complete feature overview (356 lines)
- QUICKSTART.md - 5-minute setup guide (220 lines)
- INSTALL.md - Step-by-step installation
- API.md - Export functions reference
- LOCALIZATION.md - Translation system guide (280 lines)
- LOCALIZATION_EXAMPLES.md - Code examples (450 lines)
**Total: 1,200+ lines of professional documentation**
---
## 🖼️ Screenshots


---