'Saved in settings', 'environment' => 'Environment variable', 'derived' => 'Derived from app name', 'default' => 'Built-in fallback', ]; $savedLicenseAppName = trim((string)($data['settings']['license_app_name'] ?? '')); $savedLicenseAppSlug = trim((string)($data['settings']['license_app_slug'] ?? '')); $licenseAppNameInput = $savedLicenseAppName; $licenseAppSlugInput = $savedLicenseAppSlug; $settingsTabs = [ 'company' => ['label' => 'Company', 'label_ar' => 'الشركة', 'icon' => 'bi-building'], 'system' => ['label' => 'System', 'label_ar' => 'النظام', 'icon' => 'bi-sliders'], 'branding' => ['label' => 'Branding', 'label_ar' => 'الهوية البصرية', 'icon' => 'bi-palette'], 'integrations' => ['label' => 'Integrations', 'label_ar' => 'التكاملات', 'icon' => 'bi-plug'], ]; $requestedSettingsTab = strtolower(trim((string)($_GET['tab'] ?? ($_POST['settings_active_tab'] ?? 'company')))); $activeSettingsTab = array_key_exists($requestedSettingsTab, $settingsTabs) ? $requestedSettingsTab : 'company'; $currentTimezone = (string)($data['settings']['timezone'] ?? date_default_timezone_get()); $timezoneIdentifiers = DateTimeZone::listIdentifiers(); $smtpConfigured = !empty($data['settings']['smtp_host']) && !empty($data['settings']['smtp_user']); $wablasConfigured = !empty($data['settings']['wablas_api_url']) && !empty($data['settings']['wablas_token']) && !empty($data['settings']['wablas_security_key']); ?>

Company Profile & Settings

Manage your business identity, operations, branding, and integrations

One place for business, system, branding, and integration settings
Tabs keep the page shorter and preserve the selected section after you save.

Company Details

Legal and tax identity used across documents

Contact Information

Shown in invoices, receipts, and customer-facing documents

System Configuration

Operational rules that affect inventory and barcode behavior

Shows a fixed discount amount field on POS and Sales invoices.
%
Example: 5 means users can apply manual discount up to 5% of the invoice profit margin. Uses each item's cost price. 0 blocks manual discounts; 100 allows the full profit margin.
13-digit scale barcode format: 2-digit prefix + 5-digit item code + 5-digit value + 1 check digit. Full 13-digit scale barcodes are reserved and cannot be saved on items or imported.

License App Identity

Stable product identity used by the central license manager

Name source: · Slug source:
Use one stable identity per product. Change the slug only when you intentionally rename or split a product.
Leave blank only if you want to fall back to environment/default values.
Use one slug per product, not per customer or installation.
Current effective identity: ·

Loyalty Program

Control how customers earn and redeem loyalty points

Visual Identity

Upload the brand assets used across receipts, browser tabs, and approvals

Company logo
PNG or SVG recommended.
Favicon
Square icon works best.
Manager signature
Used on approvals and printouts.
Integration profiles are now grouped here
SMTP settings are saved from the admin UI for integration workflows, while the built-in MailService still remains the app’s email engine. Wablas connection, security key, recipients, templates, and schedule fields are now grouped here for WhatsApp automation flows.

SMTP Email

Store the outgoing email profile used by your business

Wablas WhatsApp Gateway

Keep the WhatsApp channel profile ready for alerts and automations

Use the API URL, token, and security key from your Wablas dashboard. This profile will be ready for WhatsApp notifications and future automation hooks.

WhatsApp Templates & Schedule

Prepare invoice and daily summary messages with fixed recipients and a saved send time

Ready for automation

Invoice Message

Choose who receives invoice WhatsApp messages and keep a reusable template

Optional. Leave blank if invoices should go out immediately when the invoice workflow is triggered.
Use one number per line or separate numbers with commas. Include the country code.
Placeholders: {invoice_no} {customer_name} {grand_total} {invoice_url} {company_name} {invoice_date} {due_date} {status} {outlet_name}

Daily Summary Report

Store the WhatsApp recap template, target numbers, and preferred report time

Set the daily report delivery time. Default is 20:00 if left empty.
Use one number per line or separate numbers with commas. Include the country code.
Placeholders: {report_date} {report_time} {invoice_count} {sales_total} {paid_total} {cash_total} {card_total} {due_total} {company_name}
Scheduling note
Invoice notifications are now queued from the sales workflow, and daily summaries are queued/sent by cron_wablas.php using the enable/disable switches above. Run the cron script every minute so due WhatsApp messages are dispatched automatically.

Wablas Manual Tools

Use these controls to send a test WhatsApp or run the due queue immediately without waiting for cron.

View Dispatch Logs
Save before testing
Manual tools use the saved Wablas credentials and templates. If you just changed the gateway settings above, click Save All Changes first.
Use one number per line or separate numbers with commas. The saved default country code is applied when needed.
This sends immediately and writes the result to the Wablas dispatch log.

Run Due Queue Now

This checks whether today’s daily summary is already due, then processes pending/failed Wablas jobs immediately.

  • Respects the master Wablas enable/disable switch
  • Keeps future-scheduled jobs pending until they are due
  • Useful for testing invoices and same-day summaries