-
-
Save gohanman/fa9e763b8e496a59170572484d8f5e50 to your computer and use it in GitHub Desktop.
ChangePlugin.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use COREPOS\pos\lib\ReceiptLib; | |
use COREPOS\pos\lib\Database; | |
use COREPOS\pos\plugins\Plugin; | |
class ChangePlugin extends Plugin | |
{ | |
public function plugin_transaction_reset() | |
{ | |
$ref = ReceiptLib::mostRecentReceipt(); | |
list($emp,$reg,$trans) = explode('-', $ref); | |
$dbc = Database::tDataConnect(); | |
$prep = $dbc->prepare(' | |
SELECT SUM(total) | |
FROM localtranstoday | |
WHERE emp_no=? | |
AND register_no=? | |
AND trans_no=? | |
AND trans_type=\'T\' | |
AND trans_subtype=\'CA\' | |
AND description=\'Change\' | |
'); | |
$change = $dbc->getValue($prep, [$emp,$reg,$trans]); | |
if ($change) { | |
// dispenser voodoo goes here | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment