From 237c29d4283eb9bcbe0417a9f89527b6b96ffd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Sat, 31 Aug 2019 00:07:14 +0200 Subject: [PATCH 1/7] FIX #11427 require product class Fixes POST /supplierinvoices REST API endpoint --- htdocs/fourn/class/fournisseur.facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f8e9dbcdbd1..86fe84f5c4a 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 From c84f1baf175ad13c0e33600fe07a3c02385a6a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean=20Traulle=CC=81?= Date: Sat, 31 Aug 2019 00:18:53 +0200 Subject: [PATCH 2/7] Fix #11683 Correct links to create a new product or service from search results --- htdocs/product/list.php | 4 ++++ 1 file changed, 4 insertions(+) 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); From c8bfc7441e34cf2ae7ab0cbf2f70a2c99baaa75b Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Mon, 2 Sep 2019 09:44:59 +0200 Subject: [PATCH 3/7] fix avoid error message Divided By 0 --- htdocs/core/class/commondocgenerator.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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']=''; } } From b45d3ea1a0f8f4033e9c02bca784695c8d3aeef3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 2 Sep 2019 17:38:59 +0200 Subject: [PATCH 4/7] FIX #11804 --- htdocs/ticket/list.php | 6 ++++++ 1 file changed, 6 insertions(+) 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') From f9df175efc0cc5e82c27de3e98507b1eda95de75 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Mon, 2 Sep 2019 21:26:44 +0200 Subject: [PATCH 5/7] FIX takepos layout clear or focus search fix focus for compatibility with barcode scanner --- htdocs/takepos/takepos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index b7061c0e135..70add232ed6 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(); } From 0c5859d2bfffdf47219729ee138718a646edd334 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 11:37:25 +0200 Subject: [PATCH 6/7] Update takepos.php --- htdocs/takepos/takepos.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 70add232ed6..bfe15aadd32 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -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() { From 6996e83390a34384a5e19a2ed033a39a2fa21113 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 3 Sep 2019 11:40:19 +0200 Subject: [PATCH 7/7] Update takepos.php --- htdocs/takepos/takepos.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index bfe15aadd32..fccaa222fcd 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -399,6 +399,7 @@ function New() { $("#poslines").load("invoice.php?action=delete&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); + ClearSearch(); } }