Select a contract from the 'Contract Management' tab and click 'Send for Signing' to activate this portal.
Audit Trail & Compliance Log
This document outlines the terms of service, intellectual property rights, and confidentiality obligations. This agreement is set to expire on ${new Date(contract.expires).toLocaleDateString()}. By signing, you agree to all terms and conditions contained within the full agreement.
`;
},
renderComplianceLog() {
const rows = this.logs.map(log => {
const contract = this.contracts.find(c => c.id === log.contractId);
return [
new Date(log.timestamp).toLocaleString(),
contract ? contract.name : `Contract ID ${log.contractId}`,
log.action
];
});
this.dom.complianceLogTable.innerHTML = this.createTable(['Timestamp', 'Contract', 'Action'], rows.reverse());
},
// --- ACTIONS ---
handleContractFormSubmit(e) {
e.preventDefault();
const newContract = {
id: Date.now(),
name: e.target.elements['contract-name'].value,
counterparty: e.target.elements['counterparty-name'].value,
expires: e.target.elements['expiration-date'].value,
status: 'Draft',
created: new Date().toISOString().split('T')[0],
signed: null
};
this.contracts.push(newContract);
this.addLog(newContract.id, `Contract created for ${newContract.counterparty}.`);
this.dom.contractForm.reset();
this.renderAll();
},
sendForSigning(id) {
const contract = this.contracts.find(c => c.id === id);
if (contract && contract.status === 'Draft') {
contract.status = 'Pending Signature';
this.addLog(id, 'Contract sent for signature.');
this.renderAll();
alert('Contract has been sent for signing!');
}
},
activateSigning(id) {
this.renderSigningPortal(id);
this.changeTab(2);
},
signContract(id) {
const agreeCheckbox = document.getElementById('agree-checkbox');
if (!agreeCheckbox || !agreeCheckbox.checked) {
alert('You must agree to the terms before signing.');
return;
}
const contract = this.contracts.find(c => c.id === id);
if (contract) {
contract.status = 'Fully Executed';
contract.signed = new Date().toISOString().split('T')[0];
this.addLog(id, `Contract signed and fully executed by ${contract.counterparty}.`);
this.renderAll();
this.dom.signingPortalContent.innerHTML = `