mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-03 13:23:00 -04:00
Fix discount parsing (#3114)
This commit is contained in:
@@ -125,9 +125,9 @@ class Receivings extends Secure_Controller
|
||||
$serialnumber = $this->input->post('serialnumber');
|
||||
$price = parse_decimals($this->input->post('price'));
|
||||
$quantity = parse_quantity($this->input->post('quantity'));
|
||||
$discount = parse_decimals($this->input->post('discount'));
|
||||
$discount_type = $this->input->post('discount_type');
|
||||
$item_location = $this->input->post('location');
|
||||
$discount = $discount_type ? parse_quantity($this->input->post('discount')) : parse_decimals($this->input->post('discount'));
|
||||
|
||||
$receiving_quantity = $this->input->post('receiving_quantity');
|
||||
|
||||
if($this->form_validation->run() != FALSE)
|
||||
|
||||
@@ -476,8 +476,8 @@ class Sales extends Secure_Controller
|
||||
$serialnumber = $this->input->post('serialnumber');
|
||||
$price = parse_decimals($this->input->post('price'));
|
||||
$quantity = parse_quantity($this->input->post('quantity'));
|
||||
$discount = parse_decimals($this->input->post('discount'));
|
||||
$discount_type = $this->input->post('discount_type');
|
||||
$discount = $discount_type ? parse_quantity($this->input->post('discount')) : parse_decimals($this->input->post('discount'));
|
||||
|
||||
$item_location = $this->input->post('location');
|
||||
$discounted_total = $this->input->post('discounted_total') != '' ? $this->input->post('discounted_total') : NULL;
|
||||
|
||||
@@ -167,7 +167,7 @@ if (isset($success))
|
||||
?>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<?php echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>to_decimals($item['discount'], 0), 'onClick'=>'this.select();')); ?>
|
||||
<?php echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>$item['discount_type'] ? to_currency_no_money($item['discount']) : to_decimals($item['discount'], 0), 'onClick'=>'this.select();')); ?>
|
||||
<span class="input-group-btn">
|
||||
<?php echo form_checkbox(array('id'=>'discount_toggle', 'name'=>'discount_toggle', 'value'=>1, 'data-toggle'=>"toggle",'data-size'=>'small', 'data-onstyle'=>'success', 'data-on'=>'<b>'.$this->config->item('currency_symbol').'</b>', 'data-off'=>'<b>%</b>', 'data-line'=>$line, 'checked'=>$item['discount_type'])); ?>
|
||||
</span>
|
||||
|
||||
@@ -195,7 +195,7 @@ if(isset($success))
|
||||
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<?php echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>$item['discount'], 'tabindex'=>++$tabindex, 'onClick'=>'this.select();')); ?>
|
||||
<?php echo form_input(array('name'=>'discount', 'class'=>'form-control input-sm', 'value'=>$item['discount_type'] ? to_currency_no_money($item['discount']) : to_decimals($item['discount'], 0), 'tabindex'=>++$tabindex, 'onClick'=>'this.select();')); ?>
|
||||
<span class="input-group-btn">
|
||||
<?php echo form_checkbox(array('id'=>'discount_toggle', 'name'=>'discount_toggle', 'value'=>1, 'data-toggle'=>"toggle",'data-size'=>'small', 'data-onstyle'=>'success', 'data-on'=>'<b>'.$this->config->item('currency_symbol').'</b>', 'data-off'=>'<b>%</b>', 'data-line'=>$line, 'checked'=>$item['discount_type'])); ?>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user