Skip to content

Commit

Permalink
Fix: When creating invoice from other object, type must be standard only
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 17, 2013
1 parent d2074d1 commit b434f58
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions htdocs/compta/facture.php
Expand Up @@ -1919,32 +1919,35 @@
$desc=$form->textwithpicto($langs->trans("InvoiceDeposit"),$langs->transnoentities("InvoiceDepositDesc"),1);
print $desc;
print '</td></tr>'."\n";
}

// Replacement
print '<tr height="18"><td valign="middle">';
print '<input type="radio" name="type" value="1"'.(GETPOST('type')==1?' checked="checked"':'');
if (! $options) print ' disabled="disabled"';
print '>';
print '</td><td valign="middle">';
$text=$langs->trans("InvoiceReplacementAsk").' ';
$text.='<select class="flat" name="fac_replacement" id="fac_replacement"';
if (! $options) $text.=' disabled="disabled"';
$text.='>';
if ($options)
{
$text.='<option value="-1"></option>';
$text.=$options;
}
else
{
$text.='<option value="-1">'.$langs->trans("NoReplacableInvoice").'</option>';
}
$text.='</select>';
$desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1);
print $desc;
print '</td></tr>'."\n";
// Replacement
print '<tr height="18"><td valign="middle">';
print '<input type="radio" name="type" value="1"'.(GETPOST('type')==1?' checked="checked"':'');
if (! $options) print ' disabled="disabled"';
print '>';
print '</td><td valign="middle">';
$text=$langs->trans("InvoiceReplacementAsk").' ';
$text.='<select class="flat" name="fac_replacement" id="fac_replacement"';
if (! $options) $text.=' disabled="disabled"';
$text.='>';
if ($options)
{
$text.='<option value="-1"></option>';
$text.=$options;
}
else
{
$text.='<option value="-1">'.$langs->trans("NoReplacableInvoice").'</option>';
}
$text.='</select>';
$desc=$form->textwithpicto($text,$langs->transnoentities("InvoiceReplacementDesc"),1);
print $desc;
print '</td></tr>'."\n";

// Credit note
if (empty($origin))
{
// Credit note
print '<tr height="18"><td valign="middle">';
print '<input type="radio" name="type" value="2"'.(GETPOST('type')==2?' checked=true':'');
if (! $optionsav) print ' disabled="disabled"';
Expand Down

0 comments on commit b434f58

Please sign in to comment.