38471-vm/patch_showreceipt.php
2026-02-26 05:15:35 +00:00

23 lines
978 B
PHP

<?php
$content = file_get_contents('index.php');
$search = <<<'JS'
document.getElementById('receiptAmountWords').textContent = data.amount_words;
// Update labels for Purchase vs Sale
JS;
$replace = <<<'JS'
document.getElementById('receiptAmountWords').textContent = data.amount_words;
const rcn = document.getElementById('receiptCompanyName');
if(rcn) rcn.textContent = data.outlet_name || "<?= htmlspecialchars($data['settings']['company_name'] ?? 'Accounting System') ?>";
const rca = document.getElementById('receiptCompanyAddress');
if(rca) rca.innerHTML = data.outlet_address ? data.outlet_address.replace(/\n/g, '<br>') : "<?= nl2br(htmlspecialchars($data['settings']['company_address'] ?? '')) ?>";
// Update labels for Purchase vs Sale
JS;
$content = str_replace($search, $replace, $content);
file_put_contents('index.php', $content);