+
+load->view("partial/footer"); ?>
\ No newline at end of file
diff --git a/application/views/sales/receipt.php b/application/views/sales/receipt.php
index 5f18d4d81..196d727e6 100644
--- a/application/views/sales/receipt.php
+++ b/application/views/sales/receipt.php
@@ -134,7 +134,7 @@ if (isset($error_message))
?>
",
diff --git a/css/invoice.css b/css/invoice.css
index 4c9249143..19907fc87 100755
--- a/css/invoice.css
+++ b/css/invoice.css
@@ -12,7 +12,7 @@
#page-wrap table { border-collapse: collapse; }
#page-wrap table td, #page-wrap table th { border: 1px solid black; padding: 5px; }
-#header { height: 30px; width: 100%; margin: 20px 0; background: #222; text-align: center; color: white; font: bold 26px Helvetica, Sans-Serif; text-decoration: uppercase; letter-spacing: 4px; padding: 8px 0px; }
+#header { height: 30px; width: 100%; margin: 20px 0; background: #222; text-align: center; color: white; font: bold 26px Helvetica, Sans-Serif; text-transform: uppercase; letter-spacing: 4px; padding: 8px 0px; }
/* first row */
#logo { text-align: right; margin-top: 15px; float: left; position: relative; border: 1px solid #fff; max-width: 150px; max-height: 150px; overflow: hidden; }
diff --git a/css/register.css b/css/register.css
index 52425579f..9d5f46e87 100644
--- a/css/register.css
+++ b/css/register.css
@@ -156,3 +156,9 @@
margin: 0 4px 8px 0;
}
+#sales_overview
+{
+ position:absolute;
+ top:3px;
+ right:99px;
+}
\ No newline at end of file
diff --git a/database/2.3.1_to_2.3.2.sql b/database/2.3.1_to_2.3.2.sql
index bfdda05a6..b2af88413 100644
--- a/database/2.3.1_to_2.3.2.sql
+++ b/database/2.3.1_to_2.3.2.sql
@@ -31,4 +31,8 @@ ALTER TABLE `ospos_items`
ALTER TABLE `ospos_people`
ADD COLUMN `gender` int(1) DEFAULT NULL;
-
+
+-- drop redundant payment_type column in sales, add index to sale_time to speed up sorting
+ALTER TABLE `ospos_sales`
+ DROP COLUMN `payment_type`,
+ ADD INDEX `sale_time` (`sale_time`);
diff --git a/database/database.sql b/database/database.sql
index 4838ccf92..54de41969 100644
--- a/database/database.sql
+++ b/database/database.sql
@@ -478,10 +478,10 @@ CREATE TABLE `ospos_sales` (
`comment` text NOT NULL,
`invoice_number` varchar(32) DEFAULT NULL,
`sale_id` int(10) NOT NULL AUTO_INCREMENT,
- `payment_type` varchar(512) DEFAULT NULL,
PRIMARY KEY (`sale_id`),
KEY `customer_id` (`customer_id`),
KEY `employee_id` (`employee_id`),
+ KEY `sale_time` (`sale_time`),
UNIQUE KEY `invoice_number` (`invoice_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -572,7 +572,6 @@ CREATE TABLE `ospos_sales_suspended` (
`comment` text NOT NULL,
`invoice_number` varchar(32) DEFAULT NULL,
`sale_id` int(10) NOT NULL AUTO_INCREMENT,
- `payment_type` varchar(512) DEFAULT NULL,
PRIMARY KEY (`sale_id`),
KEY `customer_id` (`customer_id`),
KEY `employee_id` (`employee_id`),
diff --git a/js/manage_tables.js b/js/manage_tables.js
index 6147119e4..aae664b6b 100644
--- a/js/manage_tables.js
+++ b/js/manage_tables.js
@@ -12,8 +12,13 @@ function checkbox_click(event)
}
}
-function enable_search(suggest_url,confirm_search_message)
+function enable_search(suggest_url,confirm_search_message,format_item)
{
+ if (!format_item) {
+ format_item = function(results) {
+ return results[0];
+ };
+ }
//Keep track of enable_email has been called
if(!enable_search.enabled)
enable_search.enabled=true;
@@ -23,16 +28,19 @@ function enable_search(suggest_url,confirm_search_message)
$(this).attr('value','');
});
- $("#search").autocomplete(suggest_url,{max:100,delay:10, selectFirst: false});
+ $("#search").autocomplete(suggest_url,{max:100,delay:10, selectFirst: false, formatItem : format_item});
$("#search").result(function(event, data, formatted)
{
do_search(true);
});
+ attach_search_listener();
+
$('#search_form').submit(function(event)
{
event.preventDefault();
-
+ // reset page number when selecting a specific page number
+ $('#limit_from').val(0);
if(get_selected_values().length >0)
{
if(!confirm(confirm_search_message))
@@ -43,6 +51,21 @@ function enable_search(suggest_url,confirm_search_message)
}
enable_search.enabled=false;
+function attach_search_listener()
+{
+ // prevent redirecting to link when search enabled
+ $("#pagination a").click(function(event) {
+ if ($("#search").val()) {
+ event.preventDefault();
+ // set limit_from to value included in the link
+ var uri_segments = event.currentTarget.href.split('/');
+ var limit_from = uri_segments.pop();
+ $('#limit_from').val(limit_from);
+ do_search(true);
+ }
+ });
+}
+
function do_search(show_feedback,on_complete)
{
//If search is not enabled, don't do anything
@@ -50,21 +73,28 @@ function do_search(show_feedback,on_complete)
return;
if(show_feedback)
- $('#spinner').show();
+ $('#search').addClass("ac_loading");
- $('#sortable_table tbody').load($('#search_form').attr('action'),{'search':$('#search').val()},function()
- {
- if(typeof on_complete=='function')
- on_complete();
-
- $('#spinner').hide();
- //re-init elements in new table, as table tbody children were replaced
- tb_init('#sortable_table a.thickbox');
- update_sortable_table();
- enable_row_selection();
- $('#sortable_table tbody :checkbox').click(checkbox_click);
- $("#select_all").attr('checked',false);
- });
+ $.post(
+ $('#search_form').attr('action'),
+ // serialize all the input fields in the form
+ $('#search_form').serialize(),
+ function(response) {
+ $('#sortable_table tbody').html(response.rows);
+ if(typeof on_complete=='function')
+ on_complete();
+ $('#search').removeClass("ac_loading");
+ //$('#spinner').hide();
+ //re-init elements in new table, as table tbody children were replaced
+ tb_init('#sortable_table a.thickbox');
+ $('#pagination').html(response.pagination);
+ $('#sortable_table tbody :checkbox').click(checkbox_click);
+ $("#select_all").attr('checked',false);
+ update_sortable_table();
+ enable_row_selection();
+ attach_search_listener();
+ }, "json"
+ );
}
function enable_email(email_url)
@@ -108,7 +138,7 @@ function enable_delete(confirm_message,none_selected_message)
if(!enable_delete.enabled)
enable_delete.enabled=true;
- $('#delete').click(function(event)
+ $("#delete").click(function(event)
{
event.preventDefault();
if($("#sortable_table tbody :checkbox:checked").length >0)
@@ -150,10 +180,9 @@ function do_delete(url)
});
});
- // update rows that were affected by this delete
- for(index in response.ids) {
- update_row(response.ids[index],url.replace(/[^\/]+$/,'get_row'));
- }
+// for(index in response.ids) {
+// update_row(response.ids[index],url.replace(/[^\/]+$/,'get_row'));
+// }
set_feedback(response.message,'success_message',false);
}
@@ -277,7 +306,7 @@ function get_table_row(id) {
id = id || $("input[name='sale_id']").val();
var $element = $("#sortable_table tbody :checkbox[value='" + id + "']");
if ($element.length === 0) {
- $element = $("#sortable_table a.thickbox[href*='" + id + "']");
+ $element = $("#sortable_table tbody a[href*='" + id + "']");
}
return $element;
}
@@ -310,7 +339,7 @@ function reinit_row(checkbox_id)
function animate_row(row,color)
{
color = color || "#e1ffdd";
- row.find("td").animate({backgroundColor:color},"slow","linear")
+ row.find("td").css("backgroundColor", "#ffffff").animate({backgroundColor:color},"slow","linear")
.animate({backgroundColor:color},5000)
.animate({backgroundColor:"#ffffff"},"slow","linear");
}
diff --git a/translations/common_lang.csv b/translations/common_lang.csv
index 3194a24d1..ef2b3cc51 100644
--- a/translations/common_lang.csv
+++ b/translations/common_lang.csv
@@ -43,3 +43,4 @@ common_gender,Geslacht,Gender,Gender,Gender,Gender,Gender,Gender,Gender,Gender
common_gender_male,M,M,M,M,M,M,M,M,M
common_gender_female,V,F,F,F,V,V,V,V,V
common_date,Datum,Date,Date,Date,Date,Date,Date,Date,Date
+common_search_options,Zoek criteria,Search options,Search options,Search options,Search options,Search options,Search options,Search options,Search options
diff --git a/translations/sales_lang.csv b/translations/sales_lang.csv
index 5144ce976..86aa9fb03 100644
--- a/translations/sales_lang.csv
+++ b/translations/sales_lang.csv
@@ -91,10 +91,19 @@ sales_unsuspend_and_delete,,Retomar y Borrar,,,取消暫停銷售並刪除,Ра
sales_giftcard_balance,Waardebon Resterend,Giftcard Balance,Giftcard Balance,Giftcard Balance,Giftcard Balance,Giftcard Balance,Giftcard Balance,Giftcard Balance,Giftcard Balance
sales_discount_included,% korting inbegrepen,% discount included,% discount included,% discount included,% discount included,% discount included,% discount included,% discount included,% discount included
sales_print_after_sale,Print Ticket,Imprimir recibo después de una venta,Print after sale,Imprimer un recu après vente,出貨時打印收據,Распечатать квитанцию после продажи,พิมพ์บิลหลังการขาย,Satıştan sonra yazdır,Cetak Faktur setelah penjualan
-sales_invoice,Factuur,Invoice,Invoice,Invoice,Invoice,Invoice,Invoice,Invoice,Invoice
+sales_invoice,Factuur,tarjeta de Crédito,Invoice,Invoice,Invoice,Invoice,Invoice,Invoice,Invoice
sales_total_tax_exclusive,Totaal,Tax excluded,Tax excluded,Tax excluded,Tax excluded,Tax excluded,Tax excluded,Tax excluded,Tax excluded
sales_send_invoice,Vestuur Factuur,Send Invoice,Send Invoice,Send Invoice,Send Invoice,Send Invoice,Send Invoice,Send Invoice,Send Invoice
sales_invoice_confirm,Deze factuur zal verstuurd worden naar,This invoice will be sent to,This invoice will be sent to,This invoice will be sent to,This invoice will be sent to,This invoice will be sent to,This invoice will be sent to,This invoice will be sent to,This invoice will be sent to
sales_invoice_no_email,Er werd geen email adres gevonden voor deze klant,This customer does not have a valid email address,This customer does not have a valid email address,This customer does not have a valid email address,This customer does not have a valid email address,This customer does not have a valid email address,This customer does not have a valid email address,This customer does not have a valid email address,This customer does not have a valid email address
sales_invoice_sent,Factuur verstuurd naar,Invoice sent to,Invoice sent to,Invoice sent to,Invoice sent to,Invoice sent to,Invoice sent to,Invoice sent to,Invoice sent to
sales_invoice_unsent,Fout bij het versturen van factuur naar,Invoice failed to be sent to,Invoice failed to be sent to,Invoice failed to be sent to,Invoice failed to be sent to,Invoice failed to be sent to,Invoice failed to be sent to,Invoice failed to be sent to,Invoice failed to be sent to
+sales_invoice_filter,Facturen,Invoices,Invoices,Invoices,Invoices,Invoices,Invoices,Invoices,Invoices
+sales_no_filter,Alle,All,All,All,All,All,All,All,All
+sales_no_sales_to_display,Er werden geen aankopen gevonden,No sales to display,No sales to display,No sales to display,No sales to display,No sales to display,No sales to display,No sales to display,No sales to display
+sales_show_invoice,factuur,invoice,invoice,invoice,invoice,invoice,invoice,invoice,invoice
+sales_show_receipt,ticket,receipt,receipt,receipt,receipt,receipt,receipt,receipt,receipt
+sales_invoice_filter,Filter tickets op ,Filter sales for ,Filter sales for ,Filter sales for ,Filter sales for ,Filter sales for ,Filter sales for ,Filter sales for ,Filter sales for
+sales_overview,Overzicht,Overview,Overview,Overview,Overview,Overview,Overview,Overview,Overview
+sales_update,Bewerk Ticket,Edit Sale,Edit Sale,Edit Sale,Edit Sale,Edit Sale,Edit Sale,Edit Sale,Edit Sale
+sales_confirm_delete,Bent u zeker dat u de geselecteerde aankopen wil verwijderen?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?,Are you sure you want to delete the selected sales?