From f82e1f1155ec7b475810025ac79a1fa1daad1527 Mon Sep 17 00:00:00 2001 From: jcp Date: Fri, 19 Jul 2019 10:44:12 +0200 Subject: [PATCH 1/2] Fix: Use special_code=4 for Takepos --- htdocs/takepos/invoice.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 510b949b92b..79c7eee3d56 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -306,14 +306,14 @@ if ($action == "order" and $placeid != 0) $catsprinter2 = explode(';', $conf->global->TAKEPOS_PRINTED_CATEGORIES_2); foreach($invoice->lines as $line) { - if ($line->special_code == "3") { continue; + if ($line->special_code == "4") { 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"; + $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='4' where rowid=$line->rowid"; $db->query($sql); $order_receipt_printer1.= '' . $line->product_label . '' . $line->qty; if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer1.="
(".$line->array_options['options_order_notes'].")"; @@ -323,14 +323,14 @@ if ($action == "order" and $placeid != 0) foreach($invoice->lines as $line) { - if ($line->special_code == "3") { continue; + if ($line->special_code == "4") { continue; } $c = new Categorie($db); $existing = $c->containing($line->fk_product, Categorie::TYPE_PRODUCT, 'id'); $result = array_intersect($catsprinter2, $existing); $count = count($result); if ($count > 0) { - $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='3' where rowid=$line->rowid"; + $sql = "UPDATE " . MAIN_DB_PREFIX . "facturedet set special_code='4' where rowid=$line->rowid"; $db->query($sql); $order_receipt_printer2.= '' . $line->product_label . '' . $line->qty; if (!empty($line->array_options['options_order_notes'])) $order_receipt_printer2.="
(".$line->array_options['options_order_notes'].")"; @@ -512,7 +512,7 @@ if ($placeid > 0) $htmlforlines = ''; $htmlforlines.= 'special_code == "4") { $htmlforlines.= ' order'; } $htmlforlines.= '" id="' . $line->id . '">'; From cfaf9ce0ea906f337845a6e8029d56410194419d Mon Sep 17 00:00:00 2001 From: jcp Date: Mon, 22 Jul 2019 11:44:18 +0200 Subject: [PATCH 2/2] SET special_code=4 for existing records --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index c2d4809f958..89abab54011 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -395,3 +395,6 @@ insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) v insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (113, 'supplier_proposal', 'external', 'SERVICE', 'Contact fournisseur prestation', 1); ALTER TABLE llx_ticket_extrafields ADD INDEX idx_ticket_extrafields (fk_object); + +-- Use special_code=3 in Takepos +UPDATE llx_facturedet AS fd LEFT JOIN llx_facture AS f ON f.rowid = fd.fk_facture SET fd.special_code = 4 WHERE f.module_source = 'takepos' AND fd.special_code = 3