I have a table “facturas” with three stored calculations:
total with this code:
if(utils.hasRecords(facturas_to_albaranes)){
return facturas_to_albaranes.sum_total_pd; // Which is an aggregation in the table albaranes
}
return 0;
pagado with this code:
if(utils.hasRecords(facturas_to_lineas_pagos_clientes)){
return facturas_to_lineas_pagos_clientes.sumImporte; // Which is an aggregation in the table lineas_pagos_clientes
}
return 0;
pendiente with this code:
return total-pagado; // This is just the last two fields
The facturas table is invoices and it is filled when the user wants to with data from other tables, likes services, etc. The first two calculations are being stored only if I do a ```
databaseManager.recalculate(_record)
Am I missing anything?
Thanks.