';
@@ -315,13 +321,23 @@ var selectedline=0;
var selectedtext="";
var placeid= 0 ? $placeid : 0);?>;
$(document).ready(function() {
- $('table tbody tr').click(function(){
- $('table tbody tr').removeClass("selected");
+ var idoflineadded = ;
+
+ $('.posinvoiceline').click(function(){
+ console.log("Click done on "+this.id);
+ $('.posinvoiceline').removeClass("selected");
$(this).addClass("selected");
if (selectedline==this.id) return; // If is already selected
- else selectedline=this.id;
+ else selectedline=this.id;
selectedtext=$('#'+selectedline).find("td:first").html();
});
+
+ /* Autoselect the line */
+ if (idoflineadded > 0)
+ {
+ console.log("Auto select "+idoflineadded);
+ $('.posinvoiceline#'+idoflineadded).click();
+ }
-
- $('table tbody tr').click(function(){
- console.log("We click on a line");
- $('table tbody tr').removeClass("selected");
- $(this).addClass("selected");
- if (selectedline==this.id) return; // If is already selected
- else selectedline=this.id;
- selectedtext=$('#'+selectedline).find("td:first").html();
- });
-
@@ -439,7 +443,7 @@ print '
'.$sectionwithinvoicelink;
print '';
print '' . $langs->trans('ReductionShort') . ' | ';
print '' . $langs->trans('Qty') . ' | ';
-print '' . $langs->trans('TotalHTShort') . ' | ';
+print '' . $langs->trans('TotalHTShort') . ' | ';
print "\n";
if ($placeid > 0)
diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php
index fbfa8a6e975..0950851054b 100644
--- a/htdocs/takepos/takepos.php
+++ b/htdocs/takepos/takepos.php
@@ -153,18 +153,10 @@ function ClearSearch() {
// Set the focus on search field but only on desktop. On tablet or smartphone, we don't to avoid to have the keyboard open automatically
function setFocusOnSearchField() {
console.log("Call setFocusOnSearchField in page takepos.php");
- browser->layout == 'classic') {
- ?>
- if (app.hasKeyboard)
- {
+ browser->layout == 'classic') { ?>
console.log("has keyboard from localStorage, so we can force focus on search field");
$("#search").focus();
- }
-
+
}
function PrintCategories(first) {
@@ -653,7 +645,7 @@ $menus[$r++]=array('title'=>'<
print ''."\n";
print '';
?>