Wednesday, April 19, 2023
2 changes · master
Resolved issues and error corrections
This fixes an issue in Point of Sale where removing an order line could cause the customer display to crash. The display update is now delayed slightly so it only refreshes once the order data is stable, improving reliability during checkout.
Original PR description
Steps to reproduce: - Activate customer display. - Open a pos session. - Open the customer display. - Add orderline. - Delete the orderline. Then there's traceback. This is caused by the fact that the `effect` used to update the customer display is synchronous, and when removing an order, `splice` is applied in multiple steps, and causes multiple notifications to the underlying reactive. At some of those steps, the reactive state is inconsistent (ie, one of the slots of the reactive array is empty) causing the call to map to result in an array with empty slots which cannot be used in `Object.fromEntries`. This commit fixes that my batching the updates to the customer display in the next microtask tick, meaning that the update will never be done with an inconsistent state.
List view totals for monetary fields now avoid showing misleading aggregates when records use different currencies. When totals are valid, the relevant currency is displayed so users can interpret amounts correctly.
Original PR description
This commit fixes how monetary fields are handled when doing aggregates in list view: aggregates should not be computed when all values are not in the same currency and the currency should be displayed with the aggregate when this is not the case. Steps to reproduce: create a list view with a monetary field in studio, add an aggregate of the values of this field and check the behavior with and without a currency field present. opw-2822174