I just downloaded the invoicing app and it works as it should. I'm using version 5.51 (latest version as of this writing) and have yet to encounter a problem, such as the one discussed in this thread. I have encountered a corrupt AppGini .axp file, one time, and simply restored a previous version to resolve that problem. Other than that, I've found AppGini to be solid. More often, especially early on in my use of AppGini, I encounter problems caused by my own lack of understanding of how AppGini works
Maybe you can explain, when you say 'calculate a total', exactly what you are attempting to do. There are several factors that come into play: using readonly or hidden fields, attempting to do things before_insert vs before_update, etc.
For example, in the sample invoicing app, the fields on the invoice page that are not inputs, are readonly. If you want to modify them, you cannot do it before_insert/update using the $data array. You have to do it after_insert/update using sql to update the database. There's a split second difference in when the insert vs update changes occur, but a vast difference in their environments.
To see why you can't modify subtotal, tax and total before_insert, add the following to the invoices_before_insert (and invoices_before_update) functions:
Code: Select all
You cannot modify fields in $data that do not exist. Readonly and hidden fields are not added to $data. Therefore, as the subtotal and tax and total fields are readonly, they aren't able to be changed in the before_insert/update functions.