fix $db in class

This commit is contained in:
Frédéric FRANCE 2021-05-11 18:34:43 +02:00 committed by GitHub
parent 5943f17b94
commit e0cc6a4981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2015-2019 Frédéric France <frederic.france@netlogic.fr>
/* Copyright (C) 2015-2021 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Andreu Bisquerra <jove@bisquerra.com>
*
* 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);
}