diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index fadd0c02fde..c9865cffe59 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -497,8 +497,16 @@ abstract class CommonDocGenerator $resarray['object_total_up'] = $totalUp; $resarray['object_total_up_locale'] = price($resarray['object_total_up'], 0, $outputlangs); if (method_exists($object, 'getTotalDiscount')) { - $resarray['object_total_discount'] = round(100 / $totalUp * $object->getTotalDiscount(), 2); + $totalDiscount=$object->getTotalDiscount(); + } else { + $totalDiscount=0; + } + if (!empty($totalUp) && !empty($totalDiscount)) { + $resarray['object_total_discount'] = round(100 / $totalUp * $totalDiscount, 2); $resarray['object_total_discount_locale'] = price($resarray['object_total_discount'], 0, $outputlangs); + } else { + $resarray['object_total_discount']=''; + $resarray['object_total_discount_locale']=''; } } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 436a3a1de86..91310ef9138 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -36,6 +36,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/class/commoninvoice.class.php'; require_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; /** * Class to manage suppliers invoices diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7677e82e1b4..43188c5fe7c 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -450,6 +450,10 @@ if ($resql) if($type == Product::TYPE_SERVICE) $rightskey='service'; if($user->rights->{$rightskey}->creer) { + if ($type === "") { + $newcardbutton.= dolGetButtonTitle($langs->trans('NewProduct'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type=0'); + $type = Product::TYPE_SERVICE; + } $label='NewProduct'; if($type == Product::TYPE_SERVICE) $label='NewService'; $newcardbutton.= dolGetButtonTitle($langs->trans($label), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/card.php?action=create&type='.$type); diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index b7061c0e135..fccaa222fcd 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -149,7 +149,7 @@ if(localStorage.hasKeyboard) { function ClearSearch() { console.log("ClearSearch"); $("#search").val(''); - browser->layer == 'classic') { ?> + browser->layout == 'classic') { ?> setFocusOnSearchField(); } @@ -349,6 +349,7 @@ function deleteline() { $("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } function Customer() { @@ -398,6 +399,7 @@ function New() { $("#poslines").load("invoice.php?action=delete&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 2a4195cb07b..26b9756006c 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2018 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2018 Regis Houssin + * Copyright (C) 2019 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -210,6 +211,11 @@ $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)"; $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; +if ($socid > 0) +{ + $sql.= " AND t.fk_soc = ".$socid; +} + foreach($search as $key => $val) { if ($key == 'fk_statut')