From 48419da7698617d50b69ebcdd56510f5850be975 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 10 Sep 2019 14:58:55 +0200 Subject: [PATCH] FIX new invoice with generic thirdparty in takepos by default, new invoice should always create with default thirdparty and avoid errors : creating new invoice with last customer and forget to change it... --- htdocs/takepos/invoice.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 6ae5429d062..accc4befe82 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -280,8 +280,10 @@ if ($action == "delete") { $resql1 = $db->query($sql); $sql = "DELETE FROM " . MAIN_DB_PREFIX . "facturedet where fk_facture = ".$placeid; $resql2 = $db->query($sql); + $sql="UPDATE ".MAIN_DB_PREFIX."facture set fk_soc=".$conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]}." where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; + $resql3 = $db->query($sql); - if ($resql1 && $resql2) + if ($resql1 && $resql2 && $resql3) { $db->commit(); }