From 8014f7d822287a915c625dfe66abf2b4feb3c8e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Jan 2018 19:09:43 +0100 Subject: [PATCH] Fix blockedlog module must store ref of invoice once validated --- htdocs/blockedlog/class/blockedlog.class.php | 8 ++++++++ ...interface_50_modBlockedlog_ActionsBlockedLog.class.php | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 5b802fc8e2c..dc089b92747 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -364,6 +364,8 @@ class BlockedLog ))) continue; // Discard if not into a dedicated list if (!is_object($value)) $this->object_data->{$key} = $value; } + + if (! empty($object->newref)) $this->object_data->ref = $object->newref; } elseif ($this->element == 'invoice_supplier') { @@ -375,6 +377,8 @@ class BlockedLog ))) continue; // Discard if not into a dedicated list if (!is_object($value)) $this->object_data->{$key} = $value; } + + if (! empty($object->newref)) $this->object_data->ref = $object->newref; } elseif ($this->element == 'payment' || $this->element == 'payment_supplier' || $this->element == 'payment_donation') { @@ -474,10 +478,14 @@ class BlockedLog } $this->object_data->amount = $totalamount; + + if (! empty($object->newref)) $this->object_data->ref = $object->newref; } elseif($this->element == 'payment_salary') { $this->object_data->amounts = array($object->amount); + + if (! empty($object->newref)) $this->object_data->ref = $object->newref; } return 1; diff --git a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php index 03fb170650d..25dc957df02 100644 --- a/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php +++ b/htdocs/core/triggers/interface_50_modBlockedlog_ActionsBlockedLog.class.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017 ATM Consulting + * Copyright (C) 2017-2018 Laurent Destailleur * * 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