New plugin: cash_drawer (example code; incomplete)
This commit is contained in:
parent
ba6fa8e305
commit
d0f3debbe5
2 changed files with 23 additions and 0 deletions
22
plugins/cash_drawer
Normal file
22
plugins/cash_drawer
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
sub open_drawer {
|
||||
warn "The cash_drawer plugin should be changed to actually implement the opening of a cash drawer; stub code executed";
|
||||
}
|
||||
|
||||
sub hook_add_entry($class, $cart, $entry, @) {
|
||||
$entry->attribute('is_deposit') and $entry->attribute('method') =~ /reimburse|cash/
|
||||
or $entry->attribute('is_withdrawal')
|
||||
or return;
|
||||
|
||||
open_drawer();
|
||||
}
|
||||
|
||||
sub hook_cash {
|
||||
open_drawer();
|
||||
}
|
||||
|
||||
sub hook_checkout($class, $cart, $user, $transaction_id, @) {
|
||||
$user eq '-cash' or return;
|
||||
|
||||
open_drawer();
|
||||
}
|
|
@ -6,6 +6,7 @@ log # first, so that the registrations of other plugins are logged
|
|||
|
||||
beep
|
||||
beep_terminal
|
||||
#cash_drawer
|
||||
idle
|
||||
#json
|
||||
restart
|
||||
|
|
Loading…
Add table
Reference in a new issue