Merge pull request #17579 from frederic34/patch-5

fix $db in class
This commit is contained in:
Laurent Destailleur 2021-05-11 18:45:01 +02:00 committed by GitHub
commit fe9b6c0799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

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);
}

View File

@ -99,7 +99,6 @@ $help_url = 'EN:Module_Suppliers_Orders|FR:CommandeFournisseur|ES:Módulo_Pedido
llxHeader('', $title, $help_url);
if ($object->id > 0) {
$object->fetch_thirdparty();
$author = new User($db);