Fixed bug #1123: Paid deposit invoices are always shown as partially paid when fully paid

This commit is contained in:
Marcos García de La Fuente 2014-02-25 01:17:38 +01:00
parent 46d1181aed
commit e83e2bbbd7
2 changed files with 11 additions and 1 deletions

View File

@ -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:

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* 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,'','');