From 9a951e4d6d00fc749eeb96268d3621396734f809 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Feb 2013 17:12:19 +0100 Subject: [PATCH] Fix: When creating invoice from other object, type must be standard only --- htdocs/compta/facture.php | 105 ++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 7c42593f70b..49604013c19 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1935,63 +1935,66 @@ if ($action == 'create') $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); print $desc; print ''."\n"; + } - if ($socid > 0) - { - // Replacement - print ''; - print ''; - print ''; - $text=$langs->trans("InvoiceReplacementAsk").' '; - $text.=''; - $desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1); - print $desc; - print ''."\n"; + if ($socid > 0) + { + // Replacement + print ''; + print ''; + print ''; + $text=$langs->trans("InvoiceReplacementAsk").' '; + $text.=''; + $desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1); + print $desc; + print ''."\n"; + } - // Credit note - print ''; - print ''; - print ''; - $text=$langs->transnoentities("InvoiceAvoirAsk").' '; - // $text.=''; - $text.=''; - $desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceAvoirDesc"),1); - print $desc; - print ''."\n"; - } + if (empty($origin) && $socid > 0) + { + // Credit note + print ''; + print ''; + print ''; + $text=$langs->transnoentities("InvoiceAvoirAsk").' '; + // $text.=''; + $text.=''; + $desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceAvoirDesc"),1); + print $desc; + print ''."\n"; } print ''; print ''; - if($socid>0) + if ($socid > 0) { // Discounts for third party print ''.$langs->trans('Discounts').'';