From e56e182fe90c52abf513c3fc0ba84bf3cffaf485 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Feb 2013 16:37:28 +0100 Subject: [PATCH] Fix: When creating invoice from other object, type must be "standard". --- htdocs/compta/facture.php | 111 +++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index bccac8d8354..7c42593f70b 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1915,14 +1915,6 @@ if ($action == 'create') print $desc; print ''."\n"; - // Deposit - print ''; - print ''; - print ''; - $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1); - print $desc; - print ''."\n"; - // Proforma if (! empty($conf->global->FACTURE_USE_PROFORMAT)) { @@ -1934,56 +1926,67 @@ if ($action == 'create') print ''."\n"; } - if ($socid>0) - { - // Replacement - print ''; - print ''; + if (empty($origin)) + { + // Deposit + print ''; + print ''; print ''; - $text=$langs->trans("InvoiceReplacementAsk").' '; - $text.=''; - $desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1); + $desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),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 ($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"; + } } print ''; print '';