Commit graph

356 commits

Author SHA1 Message Date
Juerd Waalboer
50e11f3ece Rewrap UPGRADING.md 2023-09-20 20:23:02 +02:00
Juerd Waalboer
a2bdf4dd79 Nitpick in UPGRADING.md 2023-09-20 20:22:29 +02:00
Juerd Waalboer
c07f9f484e update README 2023-09-20 20:20:46 +02:00
Juerd Waalboer
560242a4bc Bump version to 4.0.0; change transaction ID scheme 2023-09-20 20:15:43 +02:00
Juerd Waalboer
e613ff28e6 Update default/example revbank.plugins 2023-09-20 20:13:16 +02:00
Juerd Waalboer
3ca6db357d New plugin: adduser_note 2023-09-20 20:12:42 +02:00
Juerd Waalboer
f6338fe9fc gtin: fix spamurl, support element string without parentheses
The spam url has uppercase letters.
2023-09-20 00:06:12 +02:00
Juerd Waalboer
827a600f8e vat: remove unused variable 2023-09-18 15:30:00 +02:00
Juerd Waalboer
5a160fcff0 vat: match accounts case insensitively, show VAT for non-hidden accounts
Also fixed unintended masking of $vat variable.
2023-09-18 15:09:03 +02:00
Juerd Waalboer
e979c695c4 Document vat plugin 2023-09-18 15:08:55 +02:00
Juerd Waalboer
ac519c05c8 VAT plugin
No hackerspace probably needs this, but I just realised that
implementing VAT support would be very easy, so why not.
2023-09-18 05:15:13 +02:00
Juerd Waalboer
e6746afde5 Add rant 2023-09-18 01:57:37 +02:00
Juerd Waalboer
8f781dae6c Add simple GS1 "Digital Link" and "Element String" support
Also has a regex for some known promotional URLs that don't adhere to
the Digital Link standard.
2023-09-18 01:37:35 +02:00
Juerd Waalboer
0dcacfc659 Upstream support for angel-foo input as alias for foo.
This replaces the revspace_angel plugin at RevSpace.
2023-09-18 01:35:11 +02:00
Juerd Waalboer
0245f80961 url: Print line but don't skip "no such product/..." error message 2023-09-18 01:33:35 +02:00
Juerd Waalboer
fbb178d5ac Formal mechanism for retrying input
This allows for alias plugins with better error messages and better
logging than with the $_[2] =~ s/// hack.
2023-09-18 01:31:13 +02:00
Juerd Waalboer
b3cd3833f1 products: clear products cache before reading products list
Fixes bug where a product would remain available if it is removed from
revbank.products during runtime.
2023-09-18 00:04:00 +02:00
Juerd Waalboer
f2506bdc74 Reword documentation
"When things don't add up" sounds like RevBank (or Perl) has a broken
addition(+) operator... :)
2023-09-10 02:56:25 +02:00
Juerd Waalboer
be47e08dc6 Small documentation update 2023-09-10 02:52:55 +02:00
Juerd Waalboer
705a431ba2 Update documentation
This adds the missing file lib/RevBank.pod which was written some time
ago.
2023-09-10 02:41:55 +02:00
Juerd Waalboer
59387ddba4 Use formerly experimental Perl features with "use experimental"
This is semantically equivalent to use feature + no warnings, but less
noisy. I've also added comments to indicate when the line can be
removed.
2023-09-10 02:13:33 +02:00
Juerd Waalboer
c465ae1445 Update README.md 2023-09-10 02:05:03 +02:00
Juerd Waalboer
f4e7d5660e revbank2beancount: reword comment 2023-09-10 02:03:25 +02:00
Juerd Waalboer
62aae74dfb Script to convert RevBank data to Beancount 2023-08-31 03:04:12 +02:00
Juerd Waalboer
6f110ee783 Update shebang to use /usr/bin/env 2023-08-21 03:43:52 +02:00
Juerd Waalboer
c43764afbb Deal with @_ in signatured sub being experimental in Perl 5.36 2023-07-17 21:56:13 +02:00
Juerd Waalboer
459e5619a7 Place cursor at start of rejected input instead of end
The cursor was placed after the rejected input, both to indicate where
the mistake was, and to make it easy to <backspace> it out. But since
"retry" is only used when there are trailing words, that means the
cursor would be placed on the space between the mistake and the trailing
input. By putting it at the first character of the rejected input, it
is less visually ambiguous. The user can now use <delete> instead of
<backspace>.
2023-07-12 22:12:30 +02:00
Juerd Waalboer
0202ab38ac users: color negative balance red 2023-07-11 22:41:39 +02:00
Juerd Waalboer
acb47457c1 tail: Reformat output
Similar to the previous commit to plugins/users, with the additional
change of dynamically sizing the username column.

I believe this is the last place where GAIN/LOSE was displayed to end
users.
2023-07-11 04:00:50 +02:00
Juerd Waalboer
be204b9ad8 users: reformat user log view
Shaves 7 characters off for most lines, and gets rid of infamous
GAIN/LOSE display.

The terms "GAIN" and "LOSE" were originally introduced because having
negative numbers everywhere would look too, er, negative, and having a
"+" for positive numbers would get hard to notice in a right aligned
list. The visibility of the "+" was fixed a while ago, simply by adding
a space between the sign and the number, and now the same style is
applied to the user log view.

Old:
2023-07-05 06:24:54 LOSE   2   1.80 Example [2x 0.90]
2023-07-07 20:55:53 GAIN   1  20.00 Received from someone (example)

New:
2023-07-05 06:24:54     1.80 2x Example [2x 0.90]
2023-07-07 20:55:53  + 20.00 Received from someone (example)
2023-07-11 03:37:09 +02:00
Juerd Waalboer
338ea37127 statiegeld: fix typo in ansi escape 2023-06-10 22:26:21 +02:00
Juerd Waalboer
194ba4990c idle: use underline instead of dim/faint
Was always intended as underline. Our old IBM terminal renders 2 as
underline. Other things interpret it as dim/faint though...
2023-06-10 22:24:14 +02:00
Juerd Waalboer
a00384bb0e statiegeld: repeat color code on 2nd line of prompt
Found in interaction with `idle` plugin, which causes redraw.
2023-06-10 22:23:31 +02:00
Juerd Waalboer
bf8d69b5e6 Split documentation for RevBank::Global 2023-05-23 12:56:34 +02:00
Juerd Waalboer
701f9541cd Fix bug: statiegeld_ignore would stay true for market products 2023-05-13 01:12:11 +02:00
Juerd Waalboer
dd00f56fda Typo 2023-05-08 05:26:30 +02:00
Juerd Waalboer
d194cb8dfa statiegeld_tokens: Fix data loss on undo
Wrote one big line because of missing \n.
2023-04-14 21:01:01 +02:00
Juerd Waalboer
c71455fb0a Broaden assertion
abundance of caution etc
2023-04-13 23:10:51 +02:00
Juerd Waalboer
615ba66655 Add message to donate command 2023-04-12 16:19:04 +02:00
Juerd Waalboer
dd5b77ce47 Update limit 19.84 -> 22.00 2023-04-11 23:53:55 +02:00
Juerd Waalboer
d33cc1fa18 Spelling 2023-04-09 22:40:35 +02:00
Juerd Waalboer
2b0fd9b22c statiegeld: case insensitive usernames
Shouldn't usually matter because these are already normalized, but would
matter if the case of an existing username ever changes.
2023-04-08 22:26:50 +02:00
Juerd Waalboer
2015e6362d Some more tests by ChatGPT
This is hilarious.
2023-03-16 00:30:48 +01:00
Juerd Waalboer
b052292a22 ChatGPT wrote some unit tests and found a small bug.
When asked to fix the bug, it came up with a different regex, which
would completely change what's valid and what's not, so that's totally
wrong:

    /^\s*(-)?([0-9]+)(?:[,.]([0-9]{1,2}))?\s*$/

When asked to fix it in another way, without changing the regex, it
suggested stripping the sign completely, which is even more wrong.

So I fixed it myself :)
2023-03-16 00:00:26 +01:00
Juerd Waalboer
06d4591e8a Fix tab completion bug
When there were several matches that shared the same common prefix, but
with a different case, readline would eat the input from the case
sensitive longest common prefix up to where the case began to differ.

e.g. when "ibutton" and "iButton-touwtje" were available, typing
"ibu<tab>" would truncate the input to just "i" and on second tab show
both matches, but without ever completing beyond the "i".
2023-02-22 01:39:13 +01:00
Juerd Waalboer
d0f3debbe5 New plugin: cash_drawer (example code; incomplete) 2023-02-14 00:31:41 +01:00
Juerd Waalboer
ba6fa8e305 statiegeld_tokens: add comment to explain rationale 2023-02-13 02:52:39 +01:00
Juerd Waalboer
0e1aa77fe5 statiegeld_tokens: simplify void
- No more red messages
- Accept "yes" case insensitively
- Change entry description and amount so the voiding is logged, which is
  more code but less complex than passing an attribute to be used during
  checkout.
2023-02-13 02:44:02 +01:00
Juerd Waalboer
ff4ffd16f8 statiegeld: use correct id for deduplication key
Bug introduced in fffb2d72
2023-02-13 02:43:24 +01:00
Juerd Waalboer
8e9a037d1c Annoy user when they type 'y' instead of 'yes' :) 2023-02-13 02:28:58 +01:00