From 5341811ec0bae0092e4d36800c0782698baf849d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Sep 2013 12:31:10 +0200 Subject: [PATCH] Fix: Clean awful code --- htdocs/compta/facture.php | 115 +++++++++++++++++-------------------- htdocs/societe/societe.php | 4 +- 2 files changed, 56 insertions(+), 63 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e2da54015cc..31c69d93295 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1588,6 +1588,15 @@ else if ($action == 'down' && $user->rights->facture->creer) exit; } +// Link invoice to order +if (GETPOST('linkedOrder')) +{ + $object->fetch($id); + $object->fetch_thirdparty(); + $result=$object->add_object_linked('commande',GETPOST('linkedOrder')); +} + + /* * Add file in email form */ @@ -1960,6 +1969,16 @@ $now=dol_now(); llxHeader('',$langs->trans('Bill'),'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); +print ' + +'; + /********************************************************************* * @@ -3727,74 +3746,64 @@ else if ($id > 0 || ! empty($ref)) // Linked object block $somethingshown=$object->showLinkedObjectBlock(); - if (empty($somethingshown) && $object->statut > 0) { + print '
'.$langs->trans('LinkedOrder').''; - print ''.$langs->trans('LinkedOrder').''; - - print ''; - } + // Link for paypal payment if (! empty($conf->paypal->enabled) && $object->statut != 0) { @@ -3946,20 +3955,4 @@ dol_htmloutput_mesg('',$mesgs); llxFooter(); $db->close(); -?> - - +?> \ No newline at end of file diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 7840f5e7d9e..28a3c5c2885 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2013 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2012 Marcos García * Copyright (C) 2013 Raphaël Doursenaud @@ -22,7 +22,7 @@ /** * \file htdocs/societe/societe.php * \ingroup societe - * \brief Page to show a third party + * \brief Page to show list of third parties */ require_once '../main.inc.php';