Better fix for type of discount
This commit is contained in:
parent
92259810c1
commit
855aaaffd8
@ -377,7 +377,11 @@ if ($object->id > 0)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
$isCustomer = ($object->client == 1 || $object->client == 3);
|
||||
|
||||
// Relative discounts (Discounts-Drawbacks-Rebates)
|
||||
if ($isCustomer)
|
||||
{
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans("CustomerRelativeDiscountShort");
|
||||
@ -409,6 +413,7 @@ if ($object->id > 0)
|
||||
//else print $langs->trans("DiscountNone");
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Max outstanding bill
|
||||
if ($object->client)
|
||||
|
||||
@ -106,7 +106,7 @@ if ($socid > 0)
|
||||
|
||||
$head = societe_prepare_head($object);
|
||||
|
||||
$isCustomer = $object->client == 1 || $object->client == 3;
|
||||
$isCustomer = ($object->client == 1 || $object->client == 3);
|
||||
$isSupplier = $object->fournisseur == 1;
|
||||
|
||||
print '<form method="POST" action="remise.php?id='.$object->id.'">';
|
||||
@ -155,24 +155,27 @@ if ($socid > 0)
|
||||
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
/*if (! ($isCustomer && $isSupplier))
|
||||
{
|
||||
if ($isCustomer && ! $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="0" />';
|
||||
}
|
||||
|
||||
if (! $isCustomer && $isSupplier) {
|
||||
print '<input type="hidden" name="discount_type" value="1" />';
|
||||
}
|
||||
}*/
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
if($isCustomer || $isSupplier) {
|
||||
if ($isCustomer || $isSupplier)
|
||||
{
|
||||
// Discount type
|
||||
print '<tr><td class="titlefield fieldrequired">'.$langs->trans('DiscountType').'</td><td>';
|
||||
if ($isCustomer) {
|
||||
print '<input type="radio" name="discount_type" id="discount_type_0" selected value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
|
||||
print '<input type="radio" name="discount_type" id="discount_type_0" checked value="0"/> <label for="discount_type_0">'.$langs->trans('Customer').'</label>';
|
||||
}
|
||||
if ($isSupplier) {
|
||||
print ' <input type="radio" name="discount_type" id="discount_type_1" selected value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
|
||||
print ' <input type="radio" name="discount_type" id="discount_type_1"'.($isCustomer?'':' checked').' value="1"/> <label for="discount_type_1">'.$langs->trans('Supplier').'</label>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user