mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-04-26 18:09:06 -04:00
Tidy up js in Sales/manage and Items/manage, commented out invoice js part as not used (#116)
This commit is contained in:
@@ -9,7 +9,7 @@ $(document).ready(function()
|
||||
enable_row_selection();
|
||||
|
||||
var widget = enable_search({suggest_url : '<?php echo site_url("$controller_name/suggest")?>',
|
||||
confirm_message : '<?php echo $this->lang->line("common_confirm_search")?>',
|
||||
confirm_search_message : '<?php echo $this->lang->line("common_confirm_search")?>',
|
||||
extra_params : {
|
||||
'is_deleted' : function () {
|
||||
return $("#is_deleted").is(":checked") ? 1 : 0;
|
||||
@@ -20,6 +20,7 @@ $(document).ready(function()
|
||||
$("#is_deleted").change(function() {
|
||||
widget.flushCache();
|
||||
});
|
||||
|
||||
enable_delete('<?php echo $this->lang->line($controller_name."_confirm_delete")?>','<?php echo $this->lang->line($controller_name."_none_selected")?>');
|
||||
enable_bulk_edit('<?php echo $this->lang->line($controller_name."_none_selected")?>');
|
||||
|
||||
@@ -35,6 +36,7 @@ $(document).ready(function()
|
||||
$(this).attr('href','index.php/items/generate_barcodes/'+selected.join(':'));
|
||||
});
|
||||
|
||||
// when any filter is clicked
|
||||
$("#search_filter_section input").click(function()
|
||||
{
|
||||
// reset page number when selecting a specific page number
|
||||
@@ -42,12 +44,14 @@ $(document).ready(function()
|
||||
do_search(true);
|
||||
});
|
||||
|
||||
// accept partial suggestion to trigger a search on enter press
|
||||
$('#search').keypress(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('#search_form').submit();
|
||||
}
|
||||
});
|
||||
|
||||
// initialise the datetime picker and trigger a search on any change date
|
||||
$(".date_filter").datetimepicker({
|
||||
format: "<?php echo dateformat_bootstrap($this->config->item('dateformat')); ?>",
|
||||
startDate: '01/01/2010',
|
||||
@@ -97,7 +101,8 @@ function init_table_sorting()
|
||||
0: { sorter: false},
|
||||
8: { sorter: false},
|
||||
9: { sorter: false},
|
||||
10: { sorter: false}
|
||||
10: { sorter: false},
|
||||
11: { sorter: false}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -119,7 +124,7 @@ function post_item_form_submit(response)
|
||||
}
|
||||
else //refresh entire table
|
||||
{
|
||||
do_search(true,function()
|
||||
do_search(true, function()
|
||||
{
|
||||
//highlight new row
|
||||
hightlight_row(response.item_id);
|
||||
@@ -162,7 +167,7 @@ function post_bulk_form_submit(response)
|
||||
<div id="pagination"><?= $links ?></div>
|
||||
|
||||
<div id="titleTextImg">
|
||||
<div style="float:left;vertical-align:text-top;"><?php echo $this->lang->line('common_search_options'); ?> :</div>
|
||||
<div style="float:left;vertical-align:text-top;"><?php echo $this->lang->line('common_search_options'). ': '; ?></div>
|
||||
<a id="imageDivLink" href="javascript:show_hide_search_filter('search_filter_section', 'imageDivLink');" style="outline:none;">
|
||||
<img src="<?php echo base_url().'images/plus.png'; ?>" style="border:0;outline:none;padding:0px;margin:0px;position:relative;top:-5px;"></a>
|
||||
</div>
|
||||
|
||||
@@ -16,16 +16,21 @@ $(document).ready(function()
|
||||
on_complete : on_complete});
|
||||
enable_delete('<?php echo $this->lang->line($controller_name."_confirm_delete")?>','<?php echo $this->lang->line($controller_name."_none_selected")?>');
|
||||
|
||||
$("#search_filter_section #only_invoices").change(function() {
|
||||
do_search(true, on_complete);
|
||||
return false;
|
||||
});
|
||||
$("#search_filter_section input").click(function()
|
||||
{
|
||||
// reset page number when selecting a specific page number
|
||||
$('#limit_from').val("0");
|
||||
do_search(true, on_complete);
|
||||
});
|
||||
|
||||
$("#search_filter_section #only_cash").change(function() {
|
||||
do_search(true, on_complete);
|
||||
return false;
|
||||
});
|
||||
// accept partial suggestion to trigger a search on enter press
|
||||
$('#search').keypress(function (e) {
|
||||
if (e.which == 13) {
|
||||
$('#search_form').submit();
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
var show_renumber = function() {
|
||||
var value = $("#only_invoices").val();
|
||||
var $button = $("#update_invoice_numbers").parents("li");
|
||||
@@ -35,6 +40,13 @@ $(document).ready(function()
|
||||
$("#only_invoices").change(show_renumber);
|
||||
show_renumber();
|
||||
|
||||
$("#update_invoice_numbers").click(function() {
|
||||
$.ajax({url : "<?php echo site_url('sales') ?>/update_invoice_numbers", dataType: 'json', success : post_bulk_form_submit });
|
||||
return false;
|
||||
});
|
||||
*/
|
||||
|
||||
// initialise the datetime picker and trigger a search on any change date
|
||||
$(".date_filter").datetimepicker({
|
||||
format: "<?php echo dateformat_bootstrap($this->config->item('dateformat'))?>",
|
||||
startDate: '01/01/2010',
|
||||
@@ -43,14 +55,7 @@ $(document).ready(function()
|
||||
todayHighlight: true,
|
||||
language: "<?php echo $this->config->item('language'); ?>"
|
||||
}).on('changeDate', function(event) {
|
||||
do_search(true, function(response) {
|
||||
$("#payment_summary").html(response.payment_summary);
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
$("#update_invoice_numbers").click(function() {
|
||||
$.ajax({url : "<?php echo site_url('sales') ?>/update_invoice_numbers", dataType: 'json', success : post_bulk_form_submit });
|
||||
do_search(true, on_complete);
|
||||
return false;
|
||||
});
|
||||
});
|
||||
@@ -196,7 +201,7 @@ function init_table_sorting()
|
||||
<div id="table_action_header">
|
||||
<ul>
|
||||
<li class="float_left"><span><?php echo anchor($controller_name . "/delete",$this->lang->line("common_delete"),array('id'=>'delete')); ?></span></li>
|
||||
<!-- li class="float_left"><span><?php echo anchor($controller_name . "/update_invoice_numbers", $this->lang->line('sales_invoice_update'),array('id'=>'update_invoice_numbers')); ?></span></li-->
|
||||
<!-- li class="float_left"><span><?php echo anchor($controller_name . "/update_invoice_numbers", $this->lang->line('sales_invoice_update'),array('id'=>'update_invoice_numbers')); ?></span></li -->
|
||||
<li class="float_right">
|
||||
<img src='<?php echo base_url()?>images/spinner_small.gif' alt='spinner' id='spinner' />
|
||||
<input type="text" name ='search' id='search'/>
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
|
||||
#search_filter_section
|
||||
{
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
background-color: transparent;
|
||||
position: relative;
|
||||
|
||||
|
||||
//background-color: #EEEEEE;
|
||||
}
|
||||
|
||||
@@ -63,12 +65,6 @@
|
||||
color:#FFF;
|
||||
}
|
||||
|
||||
#search_filter_section
|
||||
{
|
||||
padding: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#table_holder
|
||||
{
|
||||
position:relative;
|
||||
|
||||
Reference in New Issue
Block a user