Since that logic was factored into its own sub and is basically the same
as what was used here, let's use it here too.
This is still somewhat duplicated functionality from products::command.
Should adding addons be done in _read_products instead?
In hindsight, it was a bad idea to allow manipulating the cart (entries)
in hook_checkout, because that hook is used by the `log` plugin. You now
get unused entries in the log.
Although that plugin should maybe have used hook_checkout_done, existing
log file readers (including scripts) and custom plugins may depend on
the CHECKOUT items in the log being before the BALANCE items.
Activating statiegeld_tokens will limit the use of the statiegeld plugin
for container deposit refunds to what was bought at this venue.
Still needs documentation.
Changes to 'statiegeld' and 'undo' were made to support the new
plugin, specifically:
- metadata (attributes) added in $cart->add, for the statiegeld_tokens
plugin to use.
- statiegeld plugin now shares a global variable (configuration).
- undo can now be rolled back during hook_checkout.
add_info was a thing that grew organically to account for hidden
contras, but just wasn't right. The assumption was that if the
contra account is hidden, the contra itself should be hidden from
view - the sign of the amount would be wrong anyway.
The correct approach, however, would of course to flip the sign so it
matches the user's perspective, and to add a separate description string
to display to the user.
Beginning of a line was already trimmed, courtesy of the whitespace
split. The end of a line was previously not trimmed because of the limit
for split.
Replaced by 3 lines in revbank.products:
BOUNTY1 -10.00@-expenses/bounties Bedankt voor het vegen/stofzuigen
BOUNTY2 -10.00@-expenses/bounties Bedankt voor het afvoeren van het afval
BOUNTY3 -25.00@-expenses/bounties Bedankt voor het dweilen
Originally written as a proof of concept demo. Reportedly it's broken
and cumbersome to use anyway, because of the external config file.
I don't think anyone is actually using this right now.
Now implemented via a hidden user called '-cash'.
This also introduces the concept of hidden accounts, that begin with '+' or
'-', for result accounts and balance accounts. Future versions can further
use this for more detailed bookkeeping. The idea behind the sign is that
'-' accounts should be inverted to get the intuitive value. So if the account
'-cash' has -13.37, that means there should be +13.37 in the cash box (or,
well, once the rest of this is implemented and the initial values are then set
correctly.)
This should have been done much earlier, but wasn't done for nostalgic reasons.
To new users, it didn't make sense that you could just enter an amount, and
revbank would just accept that as "withdrawal or unlisted product". It existed
for backwards compatibility with the very first revbank version, which didn't
have a product list, and which was not yet used with a barcode scanner. You
would simply enter the amount and your name, and there were no further
statistics.
Nowadays, there are statistics that are messed up if you don't use the product
codes. And some people were looking for a withdrawal command, and try 'take' as
that seems closest to it, but which instead transfers money to another account.
Additionally, some texts were changed for improved clarity. ("Enter username to
pay", when withdrawing, was confusing: one expects money back, not to pay more.)