diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 205ee1eafe8..c109bc65733 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2015-2021 Frédéric France * Copyright (C) 2020 Andreu Bisquerra * * This program is free software; you can redistribute it and/or modify @@ -565,7 +565,7 @@ class dolReceiptPrinter extends Printer */ public function sendToPrinter($object, $templateid, $printerid) { - global $conf, $mysoc, $langs, $user, $db; + global $conf, $mysoc, $langs, $user; $error = 0; $ret = $this->loadTemplate($templateid); @@ -830,8 +830,8 @@ class dolReceiptPrinter extends Printer break; case 'DOL_VALUE_PLACE': $sql = "SELECT floor, label FROM ".MAIN_DB_PREFIX."takepos_floor_tables where rowid=".((int) str_replace(")", "", str_replace("(PROV-POS".$_SESSION["takeposterminal"]."-", "", $object->ref))); - $resql = $db->query($sql); - $obj = $db->fetch_object($resql); + $resql = $this->db->query($sql); + $obj = $this->db->fetch_object($resql); if ($obj) { $this->printer->text($obj->label); }