diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 0fd061ac7ed..24af2adce15 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -659,7 +659,7 @@ if (empty($reshook)) } $qty = GETPOST('qty' . $predef); - $remise_percent = GETPOST('remise_percent' . $predef); + $remise_percent = (GETPOST('remise_percent'.$predef) != '' ? GETPOST('remise_percent'.$predef) : 0); // Extrafields $extrafieldsline = new ExtraFields($db); diff --git a/htdocs/core/class/link.class.php b/htdocs/core/class/link.class.php index 283b296b3e3..e934f26324d 100644 --- a/htdocs/core/class/link.class.php +++ b/htdocs/core/class/link.class.php @@ -334,6 +334,7 @@ class Link extends CommonObject if($this->db->num_rows($resql) > 0) { $obj = $this->db->fetch_object($resql); + $this->id=$obj->rowid; $this->entity = $obj->entity; $this->datea = $this->db->jdate($obj->datea); $this->url = $obj->url; 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(); }