From 98149ae3167a857267bbc60a60f609c9d8c2d0f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Dec 2017 23:31:42 +0100 Subject: [PATCH 1/2] Fix regression --- htdocs/compta/facture/class/facture-rec.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 9a751157c4a..43d691ca5bd 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -437,8 +437,8 @@ class FactureRec extends CommonInvoice // Retreive all extrafield for line // fetch optionals attributes and labels require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); - $extrafieldsline=new ExtraFields($line->db); - $extrafieldsline=$extrafieldsline->fetch_name_optionals_label($line->table_element,true); + $extrafieldsline=new ExtraFields($this->db); + $extrafieldsline=$extrafieldsline->fetch_name_optionals_label('facturedet_rec',true); $sql = 'SELECT l.rowid, l.fk_product, l.product_type, l.label as custom_label, l.description, l.product_type, l.price, l.qty, l.vat_src_code, l.tva_tx, '; $sql.= ' l.localtax1_tx, l.localtax2_tx, l.localtax1_type, l.localtax2_type, l.remise, l.remise_percent, l.subprice,'; From 74a63ca18cb7afebaab0c0b3b8ec015381678d3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Dec 2017 23:43:59 +0100 Subject: [PATCH 2/2] Fix scrutinizer --- htdocs/core/class/commoninvoice.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 4c9eb7fdcaf..b9ff5dd8670 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -319,7 +319,8 @@ abstract class CommonInvoice extends CommonObject // TODO If there is payment in bookkeeping, check payment is not dispatched in accounting // ... - if ($this->situation_cycle_ref) { + if ($this->situation_cycle_ref && method_exists($this, 'is_last_in_cycle')) + { $last = $this->is_last_in_cycle(); if (! $last) return -3; }