From 5a5811a716b044146421a170efd193df30e8ab14 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Sun, 9 May 2021 22:37:00 +0200 Subject: [PATCH] NEW DOL_VALUE_PLACE tag in TakePOS template Very important in restaurant orders --- htdocs/core/class/dolreceiptprinter.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 6933cf2c597..112f6f324d4 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -224,6 +224,7 @@ class dolReceiptPrinter extends Printer 'dol_value_vendor_lastname' => 'VendorLastname', 'dol_value_vendor_firstname' => 'VendorFirstname', 'dol_value_vendor_mail' => 'VendorEmail', + 'dol_value_place' => 'DOL_VALUE_PLACE', ); } @@ -564,7 +565,7 @@ class dolReceiptPrinter extends Printer */ public function sendToPrinter($object, $templateid, $printerid) { - global $conf, $mysoc, $langs, $user; + global $conf, $mysoc, $langs, $user, $db; $error = 0; $ret = $this->loadTemplate($templateid); @@ -827,6 +828,14 @@ 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); ++ if ($obj) { ++ $this->printer->text($obj->label); ++ } ++ break; default: $this->printer->text($vals[$tplline]['tag']); $this->printer->text($vals[$tplline]['value']);