Update: 2026-05-04 16:06:15
This commit is contained in:
@@ -59,17 +59,18 @@ try {
|
||||
|
||||
$invoices = $stmt->fetchAll();
|
||||
|
||||
// 3. Decrypt sensitive fields for display
|
||||
// 3. Decrypt sensitive fields for display (Robustly)
|
||||
$decrypt = fn($val) => Encryption::decrypt($val ?? '') ?: ($val ?? '-');
|
||||
foreach ($invoices as &$inv) {
|
||||
$inv['supplier_name'] = Encryption::decrypt($inv['supplier_name'] ?? '') ?: ($inv['supplier_name'] ?? '-');
|
||||
$inv['supplier_tin'] = Encryption::decrypt($inv['supplier_tin'] ?? '') ?: ($inv['supplier_tin'] ?? '-');
|
||||
$inv['buyer_name'] = Encryption::decrypt($inv['buyer_name'] ?? '') ?: ($inv['buyer_name'] ?? '-');
|
||||
$inv['supplier_name'] = $decrypt($inv['supplier_name']);
|
||||
$inv['supplier_tin'] = $decrypt($inv['supplier_tin']);
|
||||
$inv['buyer_name'] = $decrypt($inv['buyer_name']);
|
||||
|
||||
if (!empty($inv['company_name'])) {
|
||||
$inv['company_name'] = Encryption::decrypt($inv['company_name']) ?: $inv['company_name'];
|
||||
$inv['company_name'] = $decrypt($inv['company_name']);
|
||||
}
|
||||
if (!empty($inv['tenant_name'])) {
|
||||
$inv['tenant_name'] = Encryption::decrypt($inv['tenant_name']) ?: $inv['tenant_name'];
|
||||
$inv['tenant_name'] = $decrypt($inv['tenant_name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user