mediawiki-orderhelper v0.03
(help)

NAME

mediawiki-orderhelper - Read a list of orders from a wiki, create a table with amount, nickname pairs.

SYNOPSIS

http://mw-oh.finalrewind.org/?site=sitename

Where sitename must match https://wiki.chaosdorf.de/Sammelbestellung/sitename

DESCRIPTION

mediawiki-orderhelper expects to find table lines of the following kind in the wiki page:

| part no || part desc || price || amount || sum || ordered by

part no and part desc are only used to indicate lines in error messages. sum is optional, price x amount will be used if it is left blank. All calculations are done using either sum or price x amount and ordered by. If sum was specified and does match price x amount, a warning is printed.

Note that price, amount and sum must be numbers and must not contain a currency. You may specify numbers both as 1,23 and 1.23.

Example line:

| AKL 057-03 || Anreihklemme 3-polig, RM5,08 ||   0,30 ||  20 ||  6,00 || derf

Also valid:

| AKL 057-03 ||                              ||   0.30 ||  20 ||       || {{U|derf}}

Additionally, it will look for either Versandkosten: 1,23 or Versand: 1,23 to indicate the shipping price.

Based on these, it will create a new table with one entry per ordering person.

Let shipping be the shipping price, total the sum of all ordered parts, and nametotal the sum of all parts ordered by the line's person. Each line contains the person's name, their nametotal, their shipping part (calculated as shipping * nametotal / total) and the sum of these two.

Additionally, a fifth empty column is added, which can be edited manually to indicate if / how much someone has paid.

COUPONS

A part ordered by * is added to the shipping cost, which will affect all participants. This is useful for coupons: Add a coupon for * with a negative price and the price will be subtracted from the shipping cost. If saving remains after that, it will be divided between all participants, relative to their nametotal.

HANDLED ERRORS

MISCALCULATED SUM

If a line's sum does not equal its price times amount, a warning is printed. The line is still taken into account for all calculations. Only the sum will be used.

UNPARSEABLE NUMBERS

If a price / amount is not parseable, a warning will be printed and the affected line will not be used for calculations.

BUGS

Probably many. If you find one, let me know.

AUTHOR

Daniel Friesel <derf@finalrewind.org>

LICENSE

0. You just DO WHAT THE FUCK YOU WANT TO.