From c4be1b141d723dac1622137887aa943757690b39 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Wed, 19 Dec 2018 22:52:16 +0100 Subject: [PATCH] Temporary ticket improvement in TakePOS --- htdocs/langs/en_US/cashdesk.lang | 1 + htdocs/langs/es_ES/cashdesk.lang | 1 + htdocs/langs/fr_FR/cashdesk.lang | 1 + htdocs/takepos/invoice.php | 64 +------------------------------- htdocs/takepos/takepos.php | 34 +++++++++++++++-- 5 files changed, 34 insertions(+), 67 deletions(-) diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang index 442b5f9b907..0fce5c908b9 100644 --- a/htdocs/langs/en_US/cashdesk.lang +++ b/htdocs/langs/en_US/cashdesk.lang @@ -42,3 +42,4 @@ Place=Place TakeposConnectorNecesary='TakePOS Connector' required OrderPrinters=Order printers SearchProduct=Search product +Receipt=Receipt diff --git a/htdocs/langs/es_ES/cashdesk.lang b/htdocs/langs/es_ES/cashdesk.lang index f5158188810..43c8d8f687c 100644 --- a/htdocs/langs/es_ES/cashdesk.lang +++ b/htdocs/langs/es_ES/cashdesk.lang @@ -42,3 +42,4 @@ Place=Lugar TakeposConnectorNecesary='TakePOS Connector' required OrderPrinters=Impresoras de pedidos SearchProduct=Buscar producto +Receipt=Comprobante diff --git a/htdocs/langs/fr_FR/cashdesk.lang b/htdocs/langs/fr_FR/cashdesk.lang index 5ac48903600..1e511bed995 100644 --- a/htdocs/langs/fr_FR/cashdesk.lang +++ b/htdocs/langs/fr_FR/cashdesk.lang @@ -42,3 +42,4 @@ Place=Marché TakeposConnectorNecesary='TakePOS Connector' required OrderPrinters=Commande imprimantes SearchProduct=Rechercher un produit +Receipt=Le reçu diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index a70980893b2..1701b82a770 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -208,69 +208,6 @@ if ($action == "order" and $placeid != 0) { $invoice->fetch($placeid); } -// temporary ticket feature - -if ($action == "temp" and $placeid != 0) { - include_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; - - // issues with special characters with jPosBoxprinting ->javascript, stringCleanCharts() temporarily fix them until to find a more elegant solution. - - function stringCleanCharts($text) - { - $utf8 = array( - '/[áàâãªä]/u' => 'a', - '/[ÁÀÂÃÄ]/u' => 'A', - '/[ÍÌÎÏ]/u' => 'I', - '/[íìîï]/u' => 'i', - '/[éèêë]/u' => 'e', - '/[ÉÈÊË]/u' => 'E', - '/[óòôõºö]/u' => 'o', - '/[ÓÒÔÕÖ]/u' => 'O', - '/[úùûü]/u' => 'u', - '/[ÚÙÛÜ]/u' => 'U', - '/ç/' => 'c', - '/Ç/' => 'C', - '/ñ/' => 'n', - '/Ñ/' => 'N', - '/–/' => '-', - '/[’‘‹›‚\']/u' => ' ', - '/[“”«»„]/u' => ' ', - '/ /' => ' ', - ); - return preg_replace(array_keys($utf8), array_values($utf8), $text); - } - - $mysocname = stringCleanCharts($mysoc->name); - $mysocaddress = stringCleanCharts($mysoc->address); - $mysoctown = stringCleanCharts($mysoc->town); - $mysoczip = stringCleanCharts($mysoc->zip); - $mysocphone = stringCleanCharts($mysoc->phone); - $mysocurl = stringCleanCharts($mysoc->url); - $header_soc = '
' . $mysocname . '
' . $mysocaddress . '
' . $mysoczip . ' ' . $mysoctown . '

' . $langs->trans("Phone") . ': ' . $mysocphone . '
' . $mysocurl; - $header_ticket = '

' . $langs->trans("Temporary ticket") . '
' . $langs->trans("date") . ':
' . dol_print_date(dol_now(), 'dayhour') . '
' . $langs->trans('Place') . ' ' . $place . '


'; - $body_ticket = ''; - $footer_ticket = '

' . $langs->trans("Cashier") . ': ' . $user->firstname . '
' . $langs->trans("Thanks for your coming !") . '
'; - $ticket_printer1 = ""; - $catsprinter1 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_1); - foreach($invoice->lines as $line) - { - if ($line->special_code == "3") { continue; - } - $c = new Categorie($db); - $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id'); - $result = array_intersect($catsprinter1, $existing); - $count = count($result); - if ($count > 0) { - $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='3' where rowid=$line->rowid"; - $db->query($sql); - $ticket_printer1.= ''; - $ticket_total = '
' . $langs->trans("Label") . '' . $langs->trans("Qty") . '' . $langs->trans("Price") . '' . $langs->trans("TotalTTC") . '
' . $line->product_label . '' . $line->qty . '' . $line->total_ttc / $line->qty . '' . $line->total_ttc . '
' . $langs->trans("TotalHT") . ': ' . price($invoice->total_ht, 1, '', 1, -1, -1, $conf->currency) . '
' . $langs->trans("TotalVAT") . ': ' . price($invoice->total_tva, 1, '', 1, -1, -1, $conf->currency) . '
' . $langs->trans("TotalTTC") . ': ' . price($invoice->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '
'; - } - } - - $invoice->fetch($placeid); -} - ?>