From bf5e2b415961f7c6a404bc0623258b3080c2477a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yasser=20Carre=C3=B3n?= Date: Fri, 28 Oct 2016 12:33:21 -0500 Subject: [PATCH] Fix #5931 Shipment closed correctly Refreshes page when shipment is closed or billed to avoid a second action call. --- htdocs/expedition/card.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index fb45993f567..1e91afe156f 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -10,6 +10,7 @@ * Copyright (C) 2014-2015 Francis Appels * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016 Ferran Marcet + * Copyright (C) 2016 Yasser Carreón * * 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 @@ -534,13 +535,21 @@ if (empty($reshook)) elseif ($action == 'classifybilled') { $object->fetch($id); - $object->set_billed(); + $result = $object->set_billed(); + if($result >= 0) { + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); + exit(); + } } elseif ($action == 'classifyclosed') { $object->fetch($id); - $object->setClosed(); + $result = $object->setClosed(); + if($result >= 0) { + header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id); + exit(); + } } include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';