diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8763a8202ca..dddef99cd70 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1991,8 +1991,7 @@ if (empty($reshook)) { $line->fk_prev_id = $line->id; $line->fetch_optionals(); if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { - $line->situation_percent = $line->get_allprev_progress($object->id); - ; // get good progress including credit note + $line->situation_percent = $line->getAllPrevProgress($object->id); // get good progress including credit note } else { $line->situation_percent = $line->get_prev_progress($object->id); // get good progress including credit note } @@ -2745,7 +2744,7 @@ if (empty($reshook)) { // Invoice situation if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { - $previousprogress = $line->get_allprev_progress($line->fk_facture); + $previousprogress = $line->getAllPrevProgress($line->fk_facture); $fullprogress = price2num(GETPOST('progress', 'alpha')); if ($fullprogress < $previousprogress) { @@ -2872,7 +2871,7 @@ if (empty($reshook)) { $all_progress = GETPOSTINT('all_progress'); foreach ($object->lines as $line) { if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { - $percent = $line->get_allprev_progress($object->id); + $percent = $line->getAllPrevProgress($object->id); } else { $percent = $line->get_prev_progress($object->id); } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 134ddec5a2c..081cbcc3be9 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3624,7 +3624,7 @@ class Facture extends CommonInvoice $line = $this->lines[$i]; '@phan-var-force FactureLigne $line'; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { - $previousprogress = $line->get_allprev_progress($line->fk_facture); + $previousprogress = $line->getAllPrevProgress($line->fk_facture); $current_progress = (float) $line->situation_percent; $full_progress = $previousprogress + $current_progress; $final = ($full_progress == 100); @@ -4394,7 +4394,7 @@ class Facture extends CommonInvoice $percent = 100; } if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { - $previous_progress = $line->get_allprev_progress($line->fk_facture); + $previous_progress = $line->getAllPrevProgress($line->fk_facture); $current_progress = $percent - $previous_progress; $line->situation_percent = $current_progress; $tabprice = calcul_price_total($line->qty, $line->subprice, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 0, 'HT', 0, $line->product_type, $mysoc, array(), $current_progress); diff --git a/htdocs/compta/facture/class/factureligne.class.php b/htdocs/compta/facture/class/factureligne.class.php index ff4d5dfd981..f4191f693ba 100644 --- a/htdocs/compta/facture/class/factureligne.class.php +++ b/htdocs/compta/facture/class/factureligne.class.php @@ -890,7 +890,7 @@ class FactureLigne extends CommonInvoiceLine * @return float >= 0 * @see get_prev_progress() */ - public function get_allprev_progress($invoiceid, $include_credit_note = true) + public function getAllPrevProgress($invoiceid, $include_credit_note = true) { // phpcs:enable global $invoicecache; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 4e9e084a81b..8f40e514f23 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -231,7 +231,7 @@ abstract class CommonInvoice extends CommonObject $alreadypaid += $this->getSumCreditNotesUsed($multicurrency); $remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT'); - if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment + if ($this->status == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment $remaintopay = 0.0; } return $remaintopay; @@ -560,7 +560,7 @@ abstract class CommonInvoice extends CommonObject // We check if invoice is a temporary number (PROVxxxx) $tmppart = substr($this->ref, 1, 4); - if ($this->statut == self::STATUS_DRAFT && $tmppart === 'PROV') { // If draft invoice and ref not yet defined + if ($this->status == self::STATUS_DRAFT && $tmppart === 'PROV') { // If draft invoice and ref not yet defined return 1; } @@ -779,7 +779,7 @@ abstract class CommonInvoice extends CommonObject */ public function getLibStatut($mode = 0, $alreadypaid = -1) { - return $this->LibStatut($this->paye, $this->statut, $mode, $alreadypaid, $this->type); + return $this->LibStatut($this->paye, $this->status, $mode, $alreadypaid, $this->type); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index 42f7f17a77e..2161f41709a 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -5,10 +5,10 @@ * Copyright (C) 2012 Cédric Salvador * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2013 Florian Henry - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 OpenDSI - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro * * 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 @@ -304,7 +304,7 @@ $coldisplay++; $coldisplay++; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { $tmp_fieldv = (GETPOSTISSET('progress') ? GETPOST('progress') : $line->situation_percent); - $old_fieldv = $line->get_allprev_progress($line->fk_facture); + $old_fieldv = $line->getAllPrevProgress($line->fk_facture); $fieldv = $tmp_fieldv + $old_fieldv; print '%'; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index febbfa30ebe..e3fef9eebbc 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -7,9 +7,9 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2022 OpenDSI - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Alexandre Spangaro + * Copyright (C) 2024 Frédéric France * * 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 @@ -388,7 +388,7 @@ if (isset($this->situation_cycle_ref) && $this->situation_cycle_ref) { include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php'; $coldisplay++; if (getDolGlobalInt('INVOICE_USE_SITUATION') == 2) { - $previous_progress = $line->get_allprev_progress($object->id); + $previous_progress = $line->getAllPrevProgress($object->id); $current_progress = $previous_progress + floatval($line->situation_percent); print ''.$current_progress.'%'; $coldisplay++;