Hi all,
after quite some time, this is the new App version with needed functionality.
Here is the Export link:
This App is almost exact copy of MS Access AccountTransactions Template. As seen here:
It also demonstrates how to use a function within the function. In this case it is:
function on_field_changed
It "fires" another function called "calculate" when any of below two fields change:
function on_field_changed(field, lookup_item) {
var item = field.owner;
if (field.field_name === 'transaction_amount' || field.field_name
=== 'category') {
calculate(item);
}
}
The calculate function is this:
function calculate(item) {
if (item.income_or_expense.value) {
item.actual_amount.value = item.transaction_amount.value;
if (item.income_or_expense.display_text === 'Expense') {
item.actual_amount.value = -item.actual_amount.value;
}
}
else {
item.actual_amount.value = 0;
}
}
The "Expense" is hard coded as it is in MS Access. The function changes the value to a negative value if we select Expense. It changes the same value to positive value if we select Income.
I think the same functionality in Access is done by the VBA or macro.
If App is using some other language, we would need to use that instead of Expense.
To finish this App as per Access template, only a few reports are needed and maybe an Master-Details for Expenses/Income.
Take care.