mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-06 00:17:54 -05:00
Added enable invoice checkbox
This commit is contained in:
@@ -39,7 +39,10 @@ class Config extends Secure_area
|
||||
'timezone'=>$this->input->post('timezone'),
|
||||
'print_after_sale'=>$this->input->post('print_after_sale'),
|
||||
'tax_included'=>$this->input->post('tax_included'),
|
||||
'recv_invoice_enable'=>$this->input->post('recv_invoice_enable'),
|
||||
'recv_invoice_format'=>$this->input->post('recv_invoice_format'),
|
||||
'sales_invoice_enable'=>$this->input->post('sales_invoice_enable'),
|
||||
'sales_invoice_format'=>$this->input->post('sales_invoice_format'),
|
||||
'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/
|
||||
'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/
|
||||
'custom3_name'=>$this->input->post('custom3_name'),/**GARRISON ADDED 4/20/2013**/
|
||||
|
||||
@@ -36,7 +36,9 @@ $lang['config_custom10'] = 'Custom Field 10'; //GARRISON ADDED 4/21/2013
|
||||
$lang['config_stock_location'] = 'Stock location';
|
||||
$lang['config_stock_location_required'] = 'Stock location number is a required field';
|
||||
$lang['config_tax_included'] = 'Tax Included';
|
||||
$lang['config_recv_invoice_enable'] = 'Enable Recvs Inv#';
|
||||
$lang['config_recv_invoice_format'] = 'Receivings Invoice';
|
||||
$lang['config_sales_invoice_enable'] = 'Enable Sales Inv#';
|
||||
$lang['config_sales_invoice_format'] = 'Sales Invoice';
|
||||
|
||||
?>
|
||||
@@ -59,4 +59,5 @@ $lang['recvs_delete_confirmation'] = 'Are you sure you want to delete this recei
|
||||
$lang['recvs_invoice_number_duplicate'] = 'Please enter an unique invoice number';
|
||||
$lang['recvs_one_or_multiple']='receiving(s)';
|
||||
$lang['recvs_cannot_be_deleted'] = 'Receiving(s) could not be deleted';
|
||||
$lang['recvs_invoice_enable']='Create Invoice';
|
||||
?>
|
||||
@@ -92,4 +92,5 @@ $lang['sales_date_required']='A correct date needs to be filled in';
|
||||
$lang['sales_date_type']='Date field is required';
|
||||
$lang['sales_invoice_number_duplicate'] = 'Please enter an unique invoice number';
|
||||
$lang['sales_one_or_multiple']='sale(s)';
|
||||
$lang['sales_invoice_enable']='Create Invoice';
|
||||
?>
|
||||
|
||||
@@ -268,6 +268,17 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_sales_invoice_enable').':', 'sales_invoice_enable',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'sales_invoice_enable',
|
||||
'id'=>'sales_invoice_enable',
|
||||
'value'=>'sales_invoice_enable',
|
||||
'checked'=>$this->config->item('sales_invoice_enable')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_sales_invoice_format').':', 'sales_invoice_format',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
@@ -278,6 +289,17 @@ echo form_open('config/save/',array('id'=>'config_form'));
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_recv_invoice_enable').':', 'recv_invoice_enable',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
<?php echo form_checkbox(array(
|
||||
'name'=>'recv_invoice_enable',
|
||||
'id'=>'recv_invoice_enable',
|
||||
'value'=>'recv_invoice_enable',
|
||||
'checked'=>$this->config->item('recv_invoice_enable')));?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field_row clearfix">
|
||||
<?php echo form_label($this->lang->line('config_recv_invoice_format').':', 'recv_invoice_format',array('class'=>'wide')); ?>
|
||||
<div class='form_field'>
|
||||
|
||||
@@ -224,6 +224,15 @@ else
|
||||
<?php if ($mode == "receive")
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $this->lang->line('recvs_invoice_enable'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo form_checkbox(array('name'=>'recv_invoice_enable','id'=>'recv_invoice_enable','size'=>10,'checked'=>$this->config->item('recv_invoice_enable')));?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $this->lang->line('recvs_invoice_number').': ';?>
|
||||
@@ -342,6 +351,22 @@ $(document).ready(function()
|
||||
$.post('<?php echo site_url("receivings/set_invoice_number");?>', {recv_invoice_number: $('#recv_invoice_number').val()});
|
||||
});
|
||||
|
||||
var enable_invoice_number = function()
|
||||
{
|
||||
if ($("#recv_invoice_enable").is(":checked"))
|
||||
{
|
||||
$("#recv_invoice_number").removeAttr("disabled").parents('tr').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#recv_invoice_number").attr("disabled", "disabled").parents('tr').hide();
|
||||
}
|
||||
}
|
||||
|
||||
enable_invoice_number();
|
||||
|
||||
$("#recv_invoice_enable").change(enable_invoice_number);
|
||||
|
||||
$("#finish_sale_button").click(function()
|
||||
{
|
||||
if (confirm('<?php echo $this->lang->line("recvs_confirm_finish_receiving"); ?>'))
|
||||
|
||||
@@ -300,6 +300,14 @@ else
|
||||
<?php if ($mode == "sale")
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $this->lang->line('sales_invoice_enable'); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo form_checkbox(array('name'=>'sales_invoice_enable','id'=>'sales_invoice_enable','size'=>10,'checked'=>$this->config->item('sales_invoice_enable')));?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $this->lang->line('sales_invoice_number').': ';?>
|
||||
@@ -447,6 +455,22 @@ $(document).ready(function()
|
||||
{
|
||||
$.post('<?php echo site_url("sales/set_invoice_number");?>', {sales_invoice_number: $('#sales_invoice_number').val()});
|
||||
});
|
||||
|
||||
var enable_invoice_number = function()
|
||||
{
|
||||
if ($("#sales_invoice_enable").is(":checked"))
|
||||
{
|
||||
$("#sales_invoice_number").removeAttr("disabled").parents('tr').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#sales_invoice_number").attr("disabled", "disabled").parents('tr').hide();
|
||||
}
|
||||
}
|
||||
|
||||
enable_invoice_number();
|
||||
|
||||
$("#sales_invoice_enable").change(enable_invoice_number);
|
||||
|
||||
$('#email_receipt').change(function()
|
||||
{
|
||||
|
||||
@@ -82,7 +82,9 @@ INSERT INTO `ospos_grants` (`permission_id`, `person_id`) VALUES
|
||||
INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('tax_included', '0'),
|
||||
('recv_invoice_format', ''),
|
||||
('sales_invoice_format', '');
|
||||
('sales_invoice_format', ''),
|
||||
('sales_invoice_enable', '1'),
|
||||
('recv_invoice_enable', '1');
|
||||
|
||||
-- add invoice_number column to receivings table
|
||||
ALTER TABLE `ospos_receivings`
|
||||
|
||||
@@ -39,7 +39,10 @@ INSERT INTO `ospos_app_config` (`key`, `value`) VALUES
|
||||
('website', ''),
|
||||
('recv_invoice_format', ''),
|
||||
('sales_invoice_format', ''),
|
||||
('tax_included', '0');
|
||||
('tax_included', '0'),
|
||||
('recv_invoice_enable', '1'),
|
||||
('sales_invoice_enable', '1');
|
||||
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user