Advanced Audit Programme Generator
Advanced Audit Programme Generator | CMAknowledge.inOutput Canvas
Click text below to edit directly
Standards & Assertions Library
Click any item to add it to your objectives automatically.
Financial Statement Assertions (SA 315)
Standard Audit Procedures (SA 330)
`;
const printWindow = window.open('', '_blank');
printWindow.document.write(printContent);
printWindow.document.close();
}function exportToExcel() {
if (!currentAuditData) return;
try {
const wb = XLSX.utils.book_new();
const summaryData = [
['AUDIT PROGRAMME & STRATEGY DOCUMENT', '', '', '', '', ''],
['', '', '', '', '', ''],
['Entity Name:', currentAuditData.client, '', '', 'Audit Category:', currentAuditData.auditType],
['Financial Period:', currentAuditData.periodFrom + ' to ' + currentAuditData.periodTo, '', '', 'Framework:', currentAuditData.framework],
['Planning Materiality:', formatCurrency(currentAuditData.materiality), '', '', 'Generated On:', currentAuditData.generatedDate],
['', '', '', '', '', ''],
['Detailed Audit Procedures', '', 'Responsibility', 'W/P Ref.', 'Status', 'Reviewer Comments']
];
// Extracted steps for Excel (matching SA structure)
const steps = [
['PLANNING (SA 300)', '1.1', 'Agreeing Terms of Engagement & Independence', 'Partner', '', '', ''],
['PLANNING (SA 300)', '1.2', 'Establish Audit Strategy & Scope', 'Manager', '', '', ''],
['PLANNING (SA 320)', '1.3', 'Determine Materiality', 'Manager', '', '', ''],
['PLANNING (SA 315)', '1.4', 'Understand Entity & Controls', 'Senior', '', '', ''],
['RISK (SA 315)', '2.1', 'Assess Fraud Risks (Revenue/Overrides)', 'Manager', '', '', ''],
['RISK (SA 330)', '2.2', 'Test of Controls (Walkthroughs & TOC)', 'Senior', '', '', ''],
['EXECUTION (SA 520)', '3.1', 'Substantive Analytical Procedures', 'Senior', '', '', ''],
['EXECUTION (SA 500)', '3.2', 'Test of Details (Vouching/Tracing)', 'Associate', '', '', ''],
['EXECUTION (SA 505)', '3.3', 'External Confirmations', 'Associate', '', '', ''],
['EXECUTION (SA 501)', '3.4', 'Physical Inventory Observation', 'Senior', '', '', ''],
['REPORTING (SA 450)', '4.1', 'Evaluate Misstatements', 'Manager', '', '', ''],
['REPORTING (SA 570)', '4.2', 'Going Concern Assessment', 'Partner', '', '', ''],
['REPORTING (SA 580)', '4.3', 'Obtain Written Representations', 'Manager', '', '', ''],
['REPORTING (SA 700)', '4.4', 'Draft Auditor’s Report', 'Partner', '', '', '']
];
steps.forEach(step => summaryData.push(step));
const summarySheet = XLSX.utils.aoa_to_sheet(summaryData);
summarySheet['!cols'] = [{ wch: 18 }, { wch: 6 }, { wch: 45 }, { wch: 15 }, { wch: 12 }, { wch: 12 }, { wch: 25 }];
// Risk matrix sheet
const riskData = [['SIGNIFICANT RISK ASSESSMENT MATRIX (SA 315)', '', '', '', ''], ['', '', '', '', ''], ['Ref', 'Identified Inherent Risk', 'Assertions Affected', 'Planned Audit Response', 'W/P Ref']];
currentAuditData.risks.forEach((risk, index) => {
riskData.push(['R' + (index + 1), risk, 'TBD', 'Substantive testing required', '']);
});
const riskSheet = XLSX.utils.aoa_to_sheet(riskData);
riskSheet['!cols'] = [{ wch: 6 }, { wch: 40 }, { wch: 25 }, { wch: 40 }, { wch: 10 }];
XLSX.utils.book_append_sheet(wb, summarySheet, 'Audit Strategy');
XLSX.utils.book_append_sheet(wb, riskSheet, 'Risk Register');
const filename = 'Audit_Strategy_' + currentAuditData.client.replace(/[^a-zA-Z0-9]/g, '_') + '.xlsx';
XLSX.writeFile(wb, filename);
showStatus('Excel documentation downloaded!');
} catch (error) {
showStatus('Error generating Excel file.', 'error');
}
}function resetForm() {
if (!confirm('Clear all fields and reset the generator?')) return;
document.getElementById('client').value = '';
document.getElementById('auditType').value = 'Statutory Audit (SA Compliant)';
document.getElementById('framework').value = 'Ind AS / Schedule III';
document.getElementById('materiality').value = '';
document.getElementById('customRisks').value = '';
document.getElementById('objectives').value = '';
document.getElementById('notes').value = '';
setDefaultDates();
document.querySelectorAll('.pill.active').forEach(pill => pill.classList.remove('active'));
document.getElementById('programme').value = '';
document.getElementById('editNotice').style.display = 'none';
document.getElementById('meta').innerHTML = '';
document.getElementById('copyBtn').disabled = true;
document.getElementById('excelBtn').disabled = true;
document.getElementById('printBtn').disabled = true;
currentAuditData = null;
showStatus('Form has been reset.');
}