You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although this dependency can be enforced in new Stock records by the application, existing records in a database file may not be consistent.
Handling of dependent information in Stock Views
For new stock records, purchaseValue can be a calculated (read-only) field in StockEditView. The stock dialog in MMEX Desktop accepts purchasePrice as input and calculates purchaseValue.
For existing stock records with inconsistent purchaseValue, an error indicator can be shown, together with a button to fix the inconsistency.
Some care is needed in order to check the equality of two Double numbers. Since both sides of the equation represent an amount, they can be converted to String with the applicable currency formatter, after which the amount comparison reduces to a String comparison.
Handling of dependent information in reports
MMEX Desktop mostly uses purchaseValue as source of truth in reports. mmex-ios can do the same.
The text was updated successfully, but these errors were encountered:
The following fields in StockData are dependent:
purchaseValue = purchasePrice * numShares
Although this dependency can be enforced in new Stock records by the application, existing records in a database file may not be consistent.
Handling of dependent information in Stock Views
For new stock records,
purchaseValue
can be a calculated (read-only) field in StockEditView. The stock dialog in MMEX Desktop acceptspurchasePrice
as input and calculatespurchaseValue
.For existing stock records with inconsistent
purchaseValue
, an error indicator can be shown, together with a button to fix the inconsistency.Some care is needed in order to check the equality of two Double numbers. Since both sides of the equation represent an amount, they can be converted to String with the applicable currency formatter, after which the amount comparison reduces to a String comparison.
Handling of dependent information in reports
MMEX Desktop mostly uses
purchaseValue
as source of truth in reports. mmex-ios can do the same.The text was updated successfully, but these errors were encountered: