const fs = require('fs');

let js = fs.readFileSync('vouchers_returns.js', 'utf8');

js = js.replace(/'edit-sales-return-id'/g, "'edit-sales-returns-id'");
js = js.replace(/'btn-save-sales-return'/g, "'btn-save-sales-returns'");

fs.writeFileSync('vouchers_returns.js', js, 'utf8');

// Bust cache again just to be 100% sure
let html = fs.readFileSync('index.html', 'utf8');
const version = Date.now().toString();
html = html.replace(/v=\d+/g, 'v=' + version);
fs.writeFileSync('index.html', html, 'utf8');

console.log('Fixed plural IDs 2 in vouchers_returns.js and busted cache.');
