diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index f186c1d21da..cb7d40d3c7a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4062,7 +4062,8 @@ class Product extends CommonObject $linkend=''; $result.=$linkstart; - if ($withpicto) { + if ($withpicto) + { if ($this->type == Product::TYPE_PRODUCT) { $result.=(img_object(($notooltip?'':$label), 'product', ($notooltip?'class="paddingright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1)); } if ($this->type == Product::TYPE_SERVICE) { $result.=(img_object(($notooltip?'':$label), 'service', ($notooltip?'class="paddinright"':'class="paddingright classfortooltip"'), 0, 0, $notooltip?0:1)); @@ -4151,11 +4152,11 @@ class Product extends CommonObject { // phpcs:enable global $conf, $langs; - + $langs->load('products'); if (! empty($conf->productbatch->enabled)) { $langs->load("productbatch"); } - + if ($type == 2) { switch ($mode) { @@ -4177,9 +4178,9 @@ class Product extends CommonObject return dolGetStatus($langs->trans('Unknown')); } } - + $statuttrans=empty($status)?'status5':'status4'; - + if($status == 0){ // $type 0=Status "to sell", 1=Status "to buy", 2=Status "to Batch" if($type==0){ @@ -4210,8 +4211,8 @@ class Product extends CommonObject $labelstatutShort = $langs->trans('ProductStatusOnBatchShort'); } } - - + + if($mode>6){ return dolGetStatus($langs->trans('Unknown'), '', '', 'status0', 0); } diff --git a/htdocs/takepos/css/pos.css b/htdocs/takepos/css/pos.css index a94e737f273..9993105e288 100644 --- a/htdocs/takepos/css/pos.css +++ b/htdocs/takepos/css/pos.css @@ -18,7 +18,6 @@ button.calcbutton { width:24%; height:24%; font-weight: bold; - color: #555555; } button.calcbutton2 { @@ -33,7 +32,6 @@ button.calcbutton2 { width:24%; height:24%; font-weight: bold; - color: #555555; } button.calcbutton3 { @@ -70,11 +68,11 @@ div.wrapper{ height:25%; margin:0; padding:1px; - border: 0.1em solid; - box-shadow: 3px 3px 2px #888; + border: 2px solid #D1D1D1; + /*box-shadow: 3px 3px 3px #bbb; */ text-align: center; box-sizing: border-box; - background-color:#f0eeee; + background-color:#fff; } div.wrapper2{ @@ -84,11 +82,11 @@ div.wrapper2{ height:25%; margin:0; /* padding:1px; */ - border: 0.1em solid; - box-shadow: 2px 2px 1px #888; + border: 2px solid #D1D1D1; + /*box-shadow: 3px 3px 3px #bbb;*/ text-align: center; box-sizing: border-box; - background-color:#f0eeee; + background-color:#fff; } button:active{ @@ -119,8 +117,26 @@ div.catwatermark{ text-align:center; font-size: 20px; display: none; + opacity: 0.8; } +table.postablelines tr td { + line-height: unset; + padding-top: 3px; + padding-bottom: 3px; +} +.posinvoiceline td { + height: 40px !important; +} +.poscolordelete { + color: #600; +} +.poscolorgreen { + color: #060; +} +.poscolorblue { + color: #006; +} @media only screen and (max-aspect-ratio: 6/4) { div.description{ min-height:20%; diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 856616ee7b0..e1e5e675198 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -415,7 +415,7 @@ if (! empty($conf->use_javascript_ajax)) print '
';
print '';
@@ -450,13 +450,19 @@ if ($placeid > 0)
{
$htmlforlines = '';
- $htmlforlines.= '| ';
- $htmlforlines.= $line->product_label;
+ //if ($line->product_label) $htmlforlines.= ''.$line->product_label.'';
+ if (isset($line->product_type))
+ {
+ if (empty($line->product_type)) $htmlforlines.=img_object('', 'product').' ';
+ else $htmlforlines.=img_object('', 'service').' ';
+ }
+ if ($line->product_label) $htmlforlines.= $line->product_label;
if ($line->product_label && $line->desc) $htmlforlines.= ' | '; if ($line->product_label != $line->desc) { diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index 8e48a606483..24a57e17b52 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -117,9 +117,17 @@ var pageactions=0; var place=""; var editaction="qty"; var editnumber=""; + function PrintCategories(first) { + console.log("PrintCategories"); for (i = 0; i < ; i++) { - if (typeof (categories[parseInt(i)+parseInt(first)]) == "undefined") break; + if (typeof (categories[parseInt(i)+parseInt(first)]) == "undefined") + { + $("#catdesc"+i).text(""); + $("#catimg"+i).attr("src","genimg/empty.png"); + $("#catwatermark"+i).hide(); + continue; + } $("#catdesc"+i).text(categories[parseInt(i)+parseInt(first)]['label']); $("#catimg"+i).attr("src","genimg/index.php?query=cat&id="+categories[parseInt(i)+parseInt(first)]['rowid']); $("#catdiv"+i).data("rowid",categories[parseInt(i)+parseInt(first)]['rowid']); @@ -156,16 +164,19 @@ function MoreCategories(moreorless) { $("#catdiv"+i).data("rowid",categories[i+( * pagecategories)]['rowid']); $("#catwatermark"+i).show(); } + + $("#search").focus(); } function LoadProducts(position, issubcat=false) { + console.log("LoadProducts"); var maxproduct = ; $('#catimg'+position).animate({opacity: '0.5'}, 1); $('#catimg'+position).animate({opacity: '1'}, 100); if (issubcat==true) currentcat=$('#prodiv'+position).data('rowid'); else currentcat=$('#catdiv'+position).data('rowid'); - if (currentcat==undefined) return; + if (currentcat == undefined) return; pageproducts=0; ishow=0; //product to show counter @@ -206,9 +217,12 @@ function LoadProducts(position, issubcat=false) { idata++; //Next data everytime } }); + + $("#search").focus(); } function MoreProducts(moreorless) { + console.log("MoreProducts"); var maxproduct = ; if (moreorless=="more"){ @@ -251,9 +265,12 @@ function MoreProducts(moreorless) { idata++; //Next data everytime } }); + + $("#search").focus(); } function ClickProduct(position) { + console.log("ClickProduct"); $('#proimg'+position).animate({opacity: '0.5'}, 1); $('#proimg'+position).animate({opacity: '1'}, 100); if ($('#prodiv'+position).data('iscat')==1){ @@ -269,15 +286,18 @@ function ClickProduct(position) { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } + $("#search").focus(); } function deleteline() { + console.log("Delete line"); $("#poslines").load("invoice.php?action=deleteline&place="+place+"&idline="+selectedline, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } function Customer() { + console.log("Open box to select the thirdparty"); $.colorbox({href:"../societe/list.php?contextpage=poslist&nomassaction=1&place="+place, width:"90%", height:"80%", transition:"none", iframe:"true", title:"trans("Customer");?>"}); } @@ -288,30 +308,34 @@ function CloseBill() { } function Floors() { + console.log("Open box to select floor"); $.colorbox({href:"floors.php?place="+place, width:"90%", height:"90%", transition:"none", iframe:"true", title:"trans("Floors");?>"}); } function FreeZone() { + console.log("Open box to enter a free product"); $.colorbox({href:"freezone.php?action=freezone&place="+place, onClosed: function () { Refresh(); },width:"80%", height:"30%", transition:"none", iframe:"true", title:"trans("FreeZone");?>"}); } function TakeposOrderNotes() { + console.log("Open box to order notes"); $.colorbox({href:"freezone.php?action=addnote&place="+place+"&idline="+selectedline, onClosed: function () { Refresh(); },width:"80%", height:"30%", transition:"none", iframe:"true", title:"trans("OrderNotes");?>"}); } function Refresh() { + console.log("Refresh"); $("#poslines").load("invoice.php?place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } -function Search() { - $("#poslines").load("invoice.php?action=search&place="+place, function() { - //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); - }); +function ClearSearch() { + console.log("ClearSearch"); + $("#search").val('').focus(); } function Search2() { + console.log("Search2"); pageproducts=0; $.getJSON('./ajax.php?action=search&term='+$('#search').val(), function(data) { for (i = 0; i < 30; i++) { @@ -329,20 +353,26 @@ function Search2() { }); } -function Edit(number){ +function Edit(number) { + + if (typeof(selectedtext) == "undefined") return; // We click on an action on the number pad but there is no line selected + var text=selectedtext+" "; + if (number=='c'){ editnumber=""; Refresh(); return; } else if (number=='qty'){ + console.log("Edit "+number); if (editaction=='qty' && editnumber!=""){ $("#poslines").load("invoice.php?action=updateqty&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { editnumber=""; //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); $("#qty").html("trans("Qty"); ?>"); }); + $("#search").focus(); return; } else { @@ -350,12 +380,14 @@ function Edit(number){ } } else if (number=='p'){ + console.log("Edit "+number); if (editaction=='p' && editnumber!=""){ $("#poslines").load("invoice.php?action=updateprice&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { editnumber=""; //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); $("#price").html("trans("Price"); ?>"); }); + $("#search").focus(); return; } else { @@ -363,12 +395,14 @@ function Edit(number){ } } else if (number=='r'){ + console.log("Edit "+number); if (editaction=='r' && editnumber!=""){ $("#poslines").load("invoice.php?action=updatereduction&place="+place+"&idline="+selectedline+"&number="+editnumber, function() { editnumber=""; //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); $("#reduction").html("trans("ReductionShort"); ?>"); }); + $("#search").focus(); return; } else { @@ -400,18 +434,21 @@ function Edit(number){ } function TakeposPrintingOrder(){ + console.log("TakeposPrintingOrder"); $("#poslines").load("invoice.php?action=order&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } function TakeposPrintingTemp(){ + console.log("TakeposPrintingTemp"); $("#poslines").load("invoice.php?action=temp&place="+place, function() { //$('#poslines').scrollTop($('#poslines')[0].scrollHeight); }); } function OpenDrawer(){ + console.log("OpenDrawer"); $.ajax({ type: "POST", url: 'http://global->TAKEPOS_PRINT_SERVER;?>:8111/print', @@ -466,8 +503,8 @@ $( document ).ready(function() { - - + + ''.$langs->trans("SearchProduct"), - 'action'=>'Search();'); -$menus[$r++]=array('title'=>$langs->trans("FreeZone"), - 'action'=>'FreeZone();'); -$menus[$r++]=array('title'=>''.$langs->trans("Customer"), - 'action'=>'Customer();'); -$menus[$r++]=array('title'=>''.$langs->trans("BackOffice"), - 'action'=>'window.open(\''.(DOL_URL_ROOT ? DOL_URL_ROOT : '/').'\', \'_backoffice\');'); -$menus[$r++]=array('title'=>$langs->trans("DoPayment"), - 'action'=>'CloseBill();'); -$menus[$r++]=array('title'=>''.$langs->trans("Logout"), - 'action'=>'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php\';'); +//$menus[$r++]=array('title'=>''.$langs->trans("SearchProduct"), 'action'=>'Search();'); +$menus[$r++]=array('title'=>''.$langs->trans("Customer"), 'action'=>'Customer();'); +$menus[$r++]=array('title'=>''.$langs->trans("FreeZone"), 'action'=>'FreeZone();'); +$menus[$r++]=array('title'=>''.$langs->trans("Payment"), 'action'=>'CloseBill();'); // BAR RESTAURANT specific menu -if($conf->global->TAKEPOS_BAR_RESTAURANT){ - $menus[$r++]=array('title'=>$langs->trans("Floors"), 'action'=>'Floors();'); - if ($conf->global->TAKEPOS_ORDER_PRINTERS){ - $menus[$r++]=array('title'=>$langs->trans("Order"), - 'action'=>'TakeposPrintingOrder();'); +if ($conf->global->TAKEPOS_BAR_RESTAURANT) +{ + $menus[$r++]=array('title'=>''.$langs->trans("Floors"), 'action'=>'Floors();'); + if ($conf->global->TAKEPOS_ORDER_PRINTERS) + { + $menus[$r++]=array('title'=>$langs->trans("Order"), 'action'=>'TakeposPrintingOrder();'); } //add temp ticket button - if ($conf->global->TAKEPOS_BAR_RESTAURANT){ - if ($conf->global->TAKEPOSCONNECTOR) $menus[$r++]=array('title'=>$langs->trans("Receipt"),'action'=>'TakeposPrinting(placeid);'); - else $menus[$r++]=array('title'=>$langs->trans("Receipt"),'action'=>'Print(placeid);'); + if ($conf->global->TAKEPOS_BAR_RESTAURANT) + { + if ($conf->global->TAKEPOSCONNECTOR) $menus[$r++]=array('title'=>''.$langs->trans("Receipt"),'action'=>'TakeposPrinting(placeid);'); + else $menus[$r++]=array('title'=>''.$langs->trans("Receipt"),'action'=>'Print(placeid);'); } - if ($conf->global->TAKEPOSCONNECTOR && $conf->global->TAKEPOS_ORDER_NOTES==1){ - $menus[$r++]=array('title'=>$langs->trans("OrderNotes"), - 'action'=>'TakeposOrderNotes();'); + if ($conf->global->TAKEPOSCONNECTOR && $conf->global->TAKEPOS_ORDER_NOTES==1) + { + $menus[$r++]=array('title'=>$langs->trans("OrderNotes"), 'action'=>'TakeposOrderNotes();'); } } -if ($conf->global->TAKEPOSCONNECTOR){ - $menus[$r++]=array( - 'title'=>$langs->trans("DOL_OPEN_DRAWER"), - 'action'=>'OpenDrawer();' - ); +if ($conf->global->TAKEPOSCONNECTOR) { + $menus[$r++]=array('title'=>$langs->trans("DOL_OPEN_DRAWER"), 'action'=>'OpenDrawer();'); } $hookmanager->initHooks(array('takeposfrontend')); @@ -543,34 +571,48 @@ if (!empty($reshook)) { $menus[$r++]=$reshook; } -?> -
-'', 'style'=>'visibility: hidden;');
-$i = 0;
-foreach($menus as $menu) {
- $i++;
- if (count($menus)>9 and $i==9)
- {
- echo '';
- echo '';
- }
- elseif ($i>9) echo '';
- else echo '';
-}
+$menus[$r++]=array('title'=>''.$langs->trans("BackOffice"), 'action'=>'window.open(\''.(DOL_URL_ROOT ? DOL_URL_ROOT : '/').'\', \'_backoffice\');');
+$menus[$r++]=array('title'=>''.$langs->trans("Logout"), 'action'=>'window.location.href=\''.DOL_URL_ROOT.'/user/logout.php\';');
+
+?>
+
+
+ 9 and $i == 9)
+ {
+ echo '';
+ echo '';
+ }
+ elseif ($i>9) echo '';
+ else echo '';
+ }
+
+ print ''."\n";
+ print '
';
+ print ' ';
+ print ''.img_picto('', 'searchclear').'';
+ print ' ';
?>
+
+
- id='catdiv'>
- id="catdiv">
+
+
- onclick="MoreProducts('less');" onclick="MoreProducts('more');" >
-
-
+ onclick="MoreProducts('less');" onclick="MoreProducts('more');" >
+
+
+
|