fix: new company defaults is_active=true

Creating a company with the Activa checkbox unchecked (or missing)
set is_active=0, silently disabling the bot for that company.
New companies now default to active; existing companies keep their
current value when the form loads.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-06-29 10:02:52 -05:00
co-authored by Claude Sonnet 4.6
parent e3be2d5b3f
commit 6dd9995b7f
+1 -1
View File
@@ -1006,7 +1006,7 @@ HTML;
$config_json = $cv('config_json');
$bot_type = $company['bot_type'] ?? 'normal';
$requires_approval = !empty($company['requires_approval']);
$is_active = !empty($company['is_active']);
$is_active = $isEdit ? !empty($company['is_active']) : true; // default active for new companies
$erp_active_users = (int)($company['erp_active_users'] ?? 0);
$reqAprChecked = $requires_approval ? 'checked' : '';
$isActChecked = $is_active ? 'checked' : '';