From e83e2bbbd709f48bf1ed07ca8c5c16a069ea5313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 25 Feb 2014 01:17:38 +0100 Subject: [PATCH] Fixed bug #1123: Paid deposit invoices are always shown as partially paid when fully paid --- ChangeLog | 1 + htdocs/compta/paiement/class/paiement.class.php | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 90b6922d60b..b3aeb46a3a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ Fix: Page load not ending when large number of thirdparies. We combo feature that is root cause of problem. Fix: [ bug #1231 ] PDF always generated in interventions Fix: Be sure there is no duplicate default rib. +Fix: [ bug #1123 ] Paid deposit invoices are always shown as partially paid when fully paid ***** ChangeLog for 3.5 compared to 3.4.* ***** For users: diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 7ef5f44fb88..a3e6bfbe286 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002-2004 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2014 Marcos GarcĂ­a * * 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 @@ -209,7 +210,15 @@ class Paiement extends CommonObject } } - if ($invoice->type != 0 && $invoice->type != 1 && $invoice->type != 2) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note. We do nothing more."); + //Invoice types that are eligible for changing status to paid + $affected_types = array( + 0, + 1, + 2, + 3 + ); + + if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice. We do nothing more."); else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more."); else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more."); else $result=$invoice->set_paid($user,'','');