simplify checkbox logic in sales/register and receiving (#116)

This commit is contained in:
FrancescoUK
2016-03-12 11:25:23 +00:00
parent c124c08f89
commit a817c8ae0a
3 changed files with 6 additions and 51 deletions

View File

@@ -206,7 +206,7 @@ function post_bulk_form_submit(response)
if (count($stock_locations) > 1)
{
?>
<li class="float_left"><span><?php echo form_dropdown('stock_location', $stock_locations, $stock_location, array('id'=>'stock_location', 'onchange'=>"$('#search_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?></span></li>
<li class="float_left"><?php echo form_dropdown('stock_location', $stock_locations, $stock_location, array('id'=>'stock_location', 'onchange'=>"$('#search_form').submit();", 'class'=>'selectpicker show-menu-arrow', 'data-style'=>'btn-default btn-sm', 'data-width'=>'fit')); ?></li>
<?php
}
?>

View File

@@ -294,15 +294,7 @@ if (isset($error))
<tr>
<td><?php echo $this->lang->line('recvs_print_after_sale'); ?></td>
<td>
<?php if ($print_after_sale)
{
echo form_checkbox(array('name'=>'recv_print_after_sale', 'id'=>'recv_print_after_sale', 'class'=>'checkbox', 'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'recv_print_after_sale', 'id'=>'recv_print_after_sale', 'class'=>'checkbox'));
}
?>
<?php echo form_checkbox(array('name'=>'recv_print_after_sale', 'id'=>'recv_print_after_sale', 'class'=>'checkbox', 'value'=>1, 'checked'=>$print_after_sale)); ?>
</td>
</tr>
@@ -313,16 +305,7 @@ if (isset($error))
<tr>
<td><?php echo $this->lang->line('recvs_invoice_enable'); ?></td>
<td>
<?php
if ($invoice_number_enabled)
{
echo form_checkbox(array('name'=>'recv_invoice_enable', 'id'=>'recv_invoice_enable', 'class'=>'checkbox', 'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'recv_invoice_enable', 'id'=>'recv_invoice_enable', 'class'=>'checkbox'));
}
?>
<?php echo form_checkbox(array('name'=>'recv_invoice_enable', 'id'=>'recv_invoice_enable', 'class'=>'checkbox', 'value'=>1, 'checked'=>$invoice_number_enabled)); ?>
</td>
</tr>
<tr>

View File

@@ -441,16 +441,7 @@ if (isset($success))
<?php echo form_label($this->lang->line('sales_print_after_sale'), 'print_after_sale', array('class'=>'control-label')); ?>
</td>
<td style="width: 20%; text-align: center; display: inline-block;">
<?php
if($print_after_sale)
{
echo form_checkbox(array('name'=>'sales_print_after_sale', 'id'=>'sales_print_after_sale', 'class'=>'checkbox', 'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'sales_print_after_sale', 'id'=>'sales_print_after_sale', 'class'=>'checkbox'));
}
?>
<?php echo form_checkbox(array('name'=>'sales_print_after_sale', 'id'=>'sales_print_after_sale', 'class'=>'checkbox', 'value'=>1, 'checked'=>$print_after_sale)); ?>
</td>
<?php
@@ -461,16 +452,7 @@ if (isset($success))
<?php echo form_label($this->lang->line('sales_email_receipt'), 'email_receipt', array('class'=>'control-label')); ?>
</td>
<td style="width: 20%; text-align: center; display: inline-block;">
<?php
if($email_receipt)
{
echo form_checkbox(array('name'=>'email_receipt', 'id'=>'email_receipt', 'class'=>'checkbox', 'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'email_receipt', 'id'=>'email_receipt', 'class'=>'checkbox'));
}
?>
<?php echo form_checkbox(array('name'=>'email_receipt', 'id'=>'email_receipt', 'class'=>'checkbox', 'value'=>1, 'checked'=>$email_receipt)); ?>
</td>
<?php
}
@@ -493,18 +475,8 @@ if (isset($success))
<?php echo form_label($this->lang->line('sales_invoice_enable'), 'invoice_enable', array('class'=>'control-label')); ?>
</td>
<td style="width: 20%; text-align: center; display: inline-block;">
<?php
if($invoice_number_enabled)
{
echo form_checkbox(array('name'=>'sales_invoice_enable', 'id'=>'sales_invoice_enable', 'class'=>'checkbox', 'checked'=>'checked'));
}
else
{
echo form_checkbox(array('name'=>'sales_invoice_enable', 'id'=>'sales_invoice_enable', 'class'=>'checkbox'));
}
?>
<?php echo form_checkbox(array('name'=>'sales_invoice_enable', 'id'=>'sales_invoice_enable', 'class'=>'checkbox', 'value'=>1, 'checked'=>$invoice_number_enabled)); ?>
</td>
<td style="width: 30%; text-align: left;">
<?php echo form_label($this->lang->line('sales_invoice_number'), 'invoice_number', array('class'=>'control-label')); ?>
</td>