Assets from purchase invoice lines, straight-line depreciation/amortization with salvage value, disposals, and [Asset Mgmt] sources in Batch GL Entries. Green third workspace with an app access guard.
73 lines
3.1 KiB
Plaintext
73 lines
3.1 KiB
Plaintext
<?php
|
|
|
|
//<><><><><><><><> MAIN CONFIG (docker-generated) <><><><><><><><>//
|
|
if(true){
|
|
$isTest = "master";
|
|
$base_url = "/wms-app/";
|
|
$server_url = $base_url."app/";
|
|
$include_url = $_SERVER['DOCUMENT_ROOT'].$server_url;
|
|
|
|
$db_server = "db";
|
|
$db_user = "root";
|
|
$db_pass = "${DB_ROOT_PASSWORD}";
|
|
$db_type = "mysql";
|
|
$db_database = "wms";
|
|
$db_database2 = "wms2";
|
|
|
|
$db_server2 = (!empty($db_server2))?$db_server2:$db_server;
|
|
$db_user2 = (!empty($db_user2))?$db_user2:$db_user;
|
|
$db_pass2 = (!empty($db_pass2))?$db_pass2:$db_pass;
|
|
$db_type2 = (!empty($db_type2))?$db_type2:$db_type;
|
|
|
|
$time_zone = "Asia/Bangkok";
|
|
}
|
|
|
|
// ── Real-time Node.js server ─────────────────────────────────────────────────
|
|
if (!defined('NODE_PUBLIC_URL')) {
|
|
define('NODE_PUBLIC_URL', 'http://${PUBLIC_HOST}:3000');
|
|
}
|
|
if (!defined('NODE_EMIT_URL')) {
|
|
define('NODE_EMIT_URL', 'http://node:3000/emit');
|
|
}
|
|
if (!defined('NODE_EMIT_SECRET')) {
|
|
define('NODE_EMIT_SECRET', '${EMIT_SECRET}');
|
|
}
|
|
|
|
// ── Login OTP ────────────────────────────────────────────────────────────────
|
|
// Set from OTP_REQUIRED in .env and reconciled by the entrypoint on every start.
|
|
// Off by default: anything other than the boolean true leaves the OTP step off.
|
|
if (!defined('OTP_REQUIRED')) {
|
|
define('OTP_REQUIRED', ${OTP_REQUIRED});
|
|
}
|
|
|
|
// ── App registry ─────────────────────────────────────────────────────────────
|
|
// Apps a user can be given access to (Setting → Users Access). Keys must match
|
|
// the user.app_access enum; assets/utils/app_registry.php supplies this default
|
|
// for configs that do not define it.
|
|
$app_registry = [
|
|
'wms' => ['label' => 'WMS', 'icon' => 'ti-box', 'color' => 'bg-label-primary', 'home' => 'dashboard/index.php'],
|
|
'accounting' => ['label' => 'Accounting', 'icon' => 'ti-calculator', 'color' => 'bg-label-info', 'home' => 'ac_dashboard/index.php'],
|
|
'asset' => ['label' => 'Asset Management', 'icon' => 'ti-building-warehouse', 'color' => 'bg-label-success', 'home' => 'asset_dashboard/index.php'],
|
|
];
|
|
|
|
// ── Usage packages ───────────────────────────────────────────────────────────
|
|
$packages = [
|
|
'starter' => [
|
|
'daily_limit' => 30,
|
|
'weekly_limit' => 100,
|
|
'lock_on_limit' => ['dashboard'],
|
|
],
|
|
];
|
|
|
|
// unique key — used for SMTP password encryption, keep consistent across deploys
|
|
$pinkey = "wms";
|
|
|
|
$SMTP = [];
|
|
$SMTP['server'] = "smtp.gmail.com";
|
|
$SMTP['username'] = "${SMTP_USERNAME}";
|
|
$SMTP['port'] = "587";
|
|
$SMTP['password'] = "${SMTP_PASSWORD}"; // Gmail app password, not your login password
|
|
$method = "AES-256-CBC";
|
|
$iv = "1234567890123456"; // Must be exactly 16 bytes
|
|
$SMTP['password'] = openssl_encrypt($SMTP['password'], $method, $pinkey, 0, $iv);
|