Probleme in Version 2.9.10 beim Stornieren von Belegen
Verfasst: So 16. Nov 2025, 13:47
Foren-Seite zur Kassensoftware OrderSprinter
http://ordersprinter-support.de/forum/

Code: Alles auswählen
172.18.0.2 - 16/Nov/2025:21:40:52 +0000 "POST /php/contenthandler.php" 500
NOTICE: PHP message: PHP Fatal error: Uncaught PDOException: SQLSTATE[25001]: Active sql transaction: 1568 Transaction characteristics can't be changed while a transaction is in progress in /var/www/html/webapp/php/commonutils.php:452
Stack trace:
#0 /var/www/html/webapp/php/commonutils.php(452): PDOStatement->execute()
#1 /var/www/html/webapp/php/commonutils.php(577): CommonUtils::execSql()
#2 /var/www/html/webapp/php/bill.php(1235): CommonUtils::setTransactionSerializable()
#3 /var/www/html/webapp/php/bill.php(1320): Bill::cashActionCoreTask()
#4 /var/www/html/webapp/php/bill.php(2150): Bill::doCashActionCore()
#5 /var/www/html/webapp/php/bill.php(237): Bill->cancelBill()
#6 /var/www/html/webapp/php/contenthandler.php(87): Bill->handleCommand()
#7 {main}
thrown in /var/www/html/webapp/php/commonutils.php on line 452
172.18.0.2 - 16/Nov/2025:21:40:52 +0000 "POST /php/contenthandler.php" 200
172.18.0.2 - 16/Nov/2025:21:40:53 +0000 "POST /php/debug.php" 200
Code: Alles auswählen
diff --git a/webapp/php/bill.php b/webapp/php/bill.php
index 0dc3ba15..0e705282 100755
--- a/webapp/php/bill.php
+++ b/webapp/php/bill.php
@@ -1231,9 +1231,11 @@ class Bill {
}
CommonUtils::log($pdo, "QUEUE", "Cash action with money '$money' at billtime '$datetime' with cashtype '$cashtype' of payment " . $paymentid);
- if ($allowOwnTransactions == ALLOW_TRANSACTIONS) {
+ $startedTransaction = false;
+ if ($allowOwnTransactions == ALLOW_TRANSACTIONS && !$pdo->inTransaction()) {
CommonUtils::setTransactionSerializable($pdo);
$pdo->beginTransaction();
+ $startedTransaction = true;
}
$nextbillid = self::testForNewBillIdAndUpdateWorkTable($pdo);
@@ -1286,12 +1288,12 @@ class Bill {
$status = self::signValueByTseAndUpdateBill($pdo, $lastId, $signStr);
if ($status["status"] != "OK") {
- if ($allowOwnTransactions == ALLOW_TRANSACTIONS) {
+ if ($startedTransaction) {
$pdo->rollBack();
CommonUtils::resetTransactionIsolationLevel($pdo);
}
}
- if ($allowOwnTransactions == ALLOW_TRANSACTIONS) {
+ if ($startedTransaction) {
$pdo->commit();
CommonUtils::resetTransactionIsolationLevel($pdo);
}
diff --git a/webapp/php/commonutils.php b/webapp/php/commonutils.php
index 31d2e7f9..4827747c 100755
--- a/webapp/php/commonutils.php
+++ b/webapp/php/commonutils.php
@@ -574,10 +574,16 @@ class CommonUtils {
}
public static function setTransactionSerializable($pdo) {
- CommonUtils::execSql($pdo, 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE',null);
+ if (method_exists($pdo, 'inTransaction') && $pdo->inTransaction()) {
+ return;
+ }
+ CommonUtils::execSql($pdo, 'SET TRANSACTION ISOLATION LEVEL SERIALIZABLE',null);
}
public static function resetTransactionIsolationLevel($pdo) {
- CommonUtils::execSql($pdo, 'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ',null);
+ if (method_exists($pdo, 'inTransaction') && $pdo->inTransaction()) {
+ return;
+ }
+ CommonUtils::execSql($pdo, 'SET TRANSACTION ISOLATION LEVEL REPEATABLE READ',null);
}
public static function callPlugin($pdo,$fct,$condition) {
Code: Alles auswählen
public static function doCashActionCore($pdo,$money,$remark, $datetime,$userId,$cashtype,$paymentid,int $allowOwnTransactions,$checkForPermissions)