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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue