Skip to content

Instantly share code, notes, and snippets.

@vivascau
Last active November 15, 2019 14:16
Show Gist options
  • Save vivascau/26a153d37a5629d2f1219426d90c47aa to your computer and use it in GitHub Desktop.
Save vivascau/26a153d37a5629d2f1219426d90c47aa to your computer and use it in GitHub Desktop.
FreeAgent Assign `N/A` or `Exempt` VAT in Full report
const START_FROM_ENTRY_IN_LIST_NO = 8
const assign0VAT = () => {
const expense = document.querySelector(`#vat_purchases > tbody > tr:nth-child(${START_FROM_ENTRY_IN_LIST_NO}) > td:nth-child(2) > a`)
expense.click();
setTimeout(setValues, 1500);
}
const setValues = () => {
const purchase = document.querySelector('#purchase_sales_tax_rate');
const expense = document.querySelector('#expense_sales_tax_rate');
if (purchase) {
purchase.value = "-2.0";
} else if (expense) {
expense.value = "-4.0"
}
document.querySelector('input[name="commit"]').click();
}
assign0VAT()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment