Resolving issue #3997 for discount type toggle not staying put.

This commit is contained in:
Steve Ireland
2024-07-17 07:41:54 -04:00
committed by jekkos
parent d2622e94d7
commit 82aac4ec79
2 changed files with 2 additions and 2 deletions

View File

@@ -1309,7 +1309,7 @@ class Sale_lib
$line['quantity'] = $quantity;
$line['discount'] = $discount;
if(!empty($discount_type))
if($discount_type != null)
{
$line['discount_type'] = $discount_type;
}

View File

@@ -241,7 +241,7 @@ if(isset($success))
<div class="input-group">
<?= form_input (['name' => 'discount', 'class' => 'form-control input-sm', 'value' => $item['discount_type'] ? to_currency_no_money($item['discount']) : to_decimals($item['discount']), 'tabindex' => ++$tabindex, 'onClick' => 'this.select();']) ?>
<span class="input-group-btn">
<?= form_checkbox (['id' => 'discount_toggle', 'name' => 'discount_toggle', 'value' => 1, 'data-toggle' => "toggle",'data-size' => 'small', 'data-onstyle' => 'success', 'data-on' => '<b>' . $config['currency_symbol'] . '</b>', 'data-off' => '<b>%</b>', 'data-line' => $line, 'checked' => $item['discount_type']]) ?>
<?= form_checkbox (['id' => 'discount_toggle', 'name' => 'discount_toggle', 'value' => 1, 'data-toggle' => "toggle",'data-size' => 'small', 'data-onstyle' => 'success', 'data-on' => '<b>' . $config['currency_symbol'] . '</b>', 'data-off' => '<b>%</b>', 'data-line' => $line, 'checked' => $item['discount_type'] == 1]) ?>
</span>
</div>
</td>