Update: 2026-05-04 00:23:45
This commit is contained in:
@@ -48,8 +48,19 @@ try {
|
||||
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
");
|
||||
|
||||
// Determine tenant_id: Super Admin chooses, Admin uses own
|
||||
$tenantId = null;
|
||||
if ($decoded['role'] === 'super_admin') {
|
||||
if (empty($data['tenant_id'])) {
|
||||
json_error('يجب اختيار المكتب المحاسبي', 422);
|
||||
}
|
||||
$tenantId = $data['tenant_id'];
|
||||
} else {
|
||||
$tenantId = $decoded['tenant_id'];
|
||||
}
|
||||
|
||||
$stmt->execute([
|
||||
$decoded['tenant_id'], // Correctly using tenant_id from JWT
|
||||
$tenantId,
|
||||
$encryptedName,
|
||||
$encryptedNameEn,
|
||||
$data['tax_identification_number'],
|
||||
|
||||
Reference in New Issue
Block a user