Browse Source

* ADD: barcode generator class
* ADD: distinta print label page
* ADD: print icon on prebolla table and ventilazione table
* CHG: renamed import.tpl to message.tpl for general usage
* ADD: new collapse header menu for more user friendly
* ADD: some new messages for ending operations
* CHG: led settings and formula for finxbox service leds

Giancarlo Voci 8 years ago
parent
commit
27e52742ac

+ 5 - 4
src/Modules/Dimatec/Dimatec.php

@@ -25,13 +25,14 @@ class Dimatec extends PluginStrategy
     $this->AddRoute("GET /dualframe", __NAMESPACE__ . '\Dimatec->IcamControlIFrame');
     $this->AddRoute("GET /dualframe", __NAMESPACE__ . '\Dimatec->IcamControlIFrame');
     $this->AddRoute("GET /mav2as400/@step", __NAMESPACE__ . '\Pages->MAV2AS400');
     $this->AddRoute("GET /mav2as400/@step", __NAMESPACE__ . '\Pages->MAV2AS400');
     $this->AddRoute('GET /importfromas400', __NAMESPACE__ . '\Pages->ImportFromAS400');
     $this->AddRoute('GET /importfromas400', __NAMESPACE__ . '\Pages->ImportFromAS400');
+    $this->AddRoute("GET /printlabel/@id/@qty", __NAMESPACE__ . '\Pages->PrintLabel');
 
 
     $imgClass = 'shadow p-3 rounded bg-white';
     $imgClass = 'shadow p-3 rounded bg-white';
 
 
-    $this->AddMenuItem('mav2as400', ['order' => 1, 'url' => 'mav2as400/1', 'imgClass' => $imgClass, 'image' => 'ui/images/mav2as400.png', 'permissionName' => 'importdata']);
-    $this->AddMenuItem('ImportFromAS400', ['order' => 2, 'url' => 'importfromas400', 'imgClass' => $imgClass, 'image' => 'ui/images/import.png', 'permissionName' => 'importdata']);
-    $this->AddMenuItem('bind', ['url' => 'bind', 'imgClass' => $imgClass, 'image' => 'ui/images/bind.png']);
-    $this->AddMenuItem('pick2light', ['url' => 'pick2light/1', 'imgClass' => $imgClass, 'image' => 'ui/images/magazzinoverticale.png']);
+    $this->AddMenuItem('MAV -> AS400', ['order' => 1, 'url' => 'mav2as400/1', 'imgClass' => $imgClass, 'image' => 'ui/images/mav2as400.png', 'permissionName' => 'importdata']);
+    $this->AddMenuItem('Importa Missioni', ['order' => 2, 'url' => 'importfromas400', 'imgClass' => $imgClass, 'image' => 'ui/images/import.png', 'permissionName' => 'importdata']);
+    $this->AddMenuItem('Bind', ['url' => 'bind', 'imgClass' => $imgClass, 'image' => 'ui/images/bind.png']);
+    $this->AddMenuItem('Ventilazione', ['url' => 'pick2light/1', 'imgClass' => $imgClass, 'image' => 'ui/images/magazzinoverticale.png']);
   }
   }
 
 
   public function IcamControlIFrame($f3)
   public function IcamControlIFrame($f3)

+ 42 - 0
src/Modules/Dimatec/Distinta.php

@@ -170,4 +170,46 @@ class Distinta
       return $label[0]['label_id'];
       return $label[0]['label_id'];
     return null;
     return null;
   }
   }
+
+  /**
+   * Checn if $label_id is already binded in OM-Link
+   *
+   * @param string $label_id
+   * @return bool true if is binded
+   */
+  public function isLabelBinded(string $label_id)
+  {
+    $bindings = $this->getListeBinded();
+    $bindingListByColumn = array_column($bindings, 'label_id');
+    $indexFind = array_search($label_id, $bindingListByColumn);
+    return $indexFind !== false;
+  }
+
+  /**
+   * Facility for getting printing data
+   *
+   * @param int $id
+   * @return array|FALSE|int
+   */
+  public function GetPrintingData(int $id)
+  {
+    return $this->dbHandle->exec("SELECT `commessa`, `barcode`, `codcliente`, `descrizione` FROM `distinte` WHERE id=$id");
+  }
+
+  /**
+   * Get Barcode from article code
+   *
+   * @param string $barcode
+   * @return array|null
+   */
+  public function getCodCliente(string $barcode): ?array
+  {
+    $arr = $this->dbHandle->exec("SELECT `barcode`, `codcliente`, `descrizione` FROM `distinte` WHERE `barcode`='$barcode'");
+
+    if(count($arr)>0)
+      return $arr;
+
+    return null;
+  }
+
 }
 }

+ 3 - 3
src/Modules/Dimatec/MigrationData.php

@@ -100,7 +100,7 @@ class MigrationData
     $pendingCount = count($this->query('SELECT * FROM SMEDAT_DIM.INTMAV0F WHERE MXSTAT=' . MigrationData::STATUS_PENDING));
     $pendingCount = count($this->query('SELECT * FROM SMEDAT_DIM.INTMAV0F WHERE MXSTAT=' . MigrationData::STATUS_PENDING));
     if ($pendingCount > 0) {
     if ($pendingCount > 0) {
       $this->query(
       $this->query(
-        "UPDATE SMEDAT_DIM.INTMAV0F SET MXSTAT=" . MigrationData::STATUS_NEW . " WHERE MXSTAT=" . MigrationData::STATUS_PENDING
+        "UPDATE SMEDAT_DIM.INTMAV0F SET MXSTAT=" . MigrationData::STATUS_NEW . ", MXNCON='', MXNOLS='' WHERE MXSTAT=" . MigrationData::STATUS_PENDING
       );
       );
     }
     }
   }
   }
@@ -228,7 +228,7 @@ EOF;
    */
    */
   private function fixOperationTypeValue(string $operation)
   private function fixOperationTypeValue(string $operation)
   {
   {
-    return ($operation == 'CARICO') ? "MXTIPM == 'C'" : "MXTIPM <> 'C'";
+    return ($operation == 'CARICO') ? "MXTIPM = 'C'" : "MXTIPM = 'S'";
   }
   }
 
 
   /**
   /**
@@ -388,7 +388,7 @@ EOF;
       ];
       ];
     }
     }
     // Sort menus buy 'order' option
     // Sort menus buy 'order' option
-    usort($ret, function ($obj1, $obj2) {
+    uasort($ret, function ($obj1, $obj2) {
       return $obj1['uds'] <=> $obj2['uds'];
       return $obj1['uds'] <=> $obj2['uds'];
     });
     });
     return $ret;
     return $ret;

+ 78 - 43
src/Modules/Dimatec/Pages.php

@@ -13,6 +13,7 @@ use OpenMind\FindBox\QueueCommand;
 use OpenMind\FindBox\SmartESL;
 use OpenMind\FindBox\SmartESL;
 use OpenMind\System\QueueSystem;
 use OpenMind\System\QueueSystem;
 use OpenMind\Web\Controller;
 use OpenMind\Web\Controller;
+use Picqer\Barcode\BarcodeGeneratorPNG;
 
 
 class Pages extends Controller
 class Pages extends Controller
 {
 {
@@ -45,7 +46,7 @@ class Pages extends Controller
       $msgBlink = new QueueCommand($labelid);
       $msgBlink = new QueueCommand($labelid);
       $msgSaveP = new QueueCommand($labelid);
       $msgSaveP = new QueueCommand($labelid);
 
 
-      $msgBlink->setLeds(2, 1, 1000, 16, 0);
+      $msgBlink->setLeds(2, 1, 500, 10, 0);
       $msgSaveP->saveProducts($commessa['descrizione'], [
       $msgSaveP->saveProducts($commessa['descrizione'], [
         'Q.ta' => $commessa['qta_prelevare'],
         'Q.ta' => $commessa['qta_prelevare'],
         'Commessa' => $commessa['commessa']
         'Commessa' => $commessa['commessa']
@@ -155,8 +156,13 @@ class Pages extends Controller
     $sql = $migData->strQueryMassificazioneByUDS();
     $sql = $migData->strQueryMassificazioneByUDS();
     $listaProdotti = $this->dbHandle->exec($sql);
     $listaProdotti = $this->dbHandle->exec($sql);
 
 
-    $f3->set('PRODUCTS', $listaProdotti);
-    $f3->set('CONTENT', 'pick2light.tpl');
+    if (count($listaProdotti) == 0) {
+      $f3->set('MESSAGE', 'Non ci sono prodotti da ventilare.');
+      $f3->set('CONTENT', 'message.tpl');
+    } else {
+      $f3->set('PRODUCTS', $listaProdotti);
+      $f3->set('CONTENT', 'pick2light.tpl');
+    }
     echo \Template::instance()->render('masterpage.tpl');
     echo \Template::instance()->render('masterpage.tpl');
   }
   }
 
 
@@ -167,45 +173,56 @@ class Pages extends Controller
 
 
     if (count($params)) {
     if (count($params)) {
       $bindData = array_map('strtoupper', $params);
       $bindData = array_map('strtoupper', $params);
-      //$err = $this->findBoxCore->Bind($bindData['labelid'], $bindData['labelid']);
-      $label = new SmartESL($this->findBoxCore, [$bindData['labelid']]);
 
 
-      $labelTemplateId = $f3->get("LABELS.TEMPLATES.DT31");
+      if (strlen($bindData['labelid']) != 8) {
+        $f3->set('INFOTEXT', 'Codice etichetta non corretto. Ripetere la procedura.');
+      } else {
+
+        if ($distinta->isLabelBinded($bindData['labelid'])) {
+          $f3->set('INFOTEXT', 'Codice etichetta già bindato.');
+        } else {
 
 
-      $err = $label->Display($labelTemplateId, $bindData['labelid']);
+          //$err = $this->findBoxCore->Bind($bindData['labelid'], $bindData['labelid']);
+          $label = new SmartESL($this->findBoxCore, [$bindData['labelid']]);
 
 
-      //
-      $msgReset = new QueueCommand($bindData['labelid']);
+          $labelTemplateId = $f3->get("LABELS.TEMPLATES.DT31");
 
 
-      $j_eslData = [
-        'Q.ta' => 0,
-        'Commessa' => $bindData['commessa']
-      ];
+          $err = $label->Display($labelTemplateId, $bindData['labelid']);
 
 
-      $msgReset->saveProducts('', $j_eslData);
+          //
+          $msgReset = new QueueCommand($bindData['labelid']);
 
 
-      $qm = new QueueSystem('FindBoxService');
-      $qm->send($msgReset);
-
-      // Add or Update label
-      $label = new SQL\Mapper($f3->get('DB'), 'label_bindings');
-      $label->load(['label_id=?', $bindData['labelid']]);
-      $label->label_id = $bindData['labelid'];
-      $label->barcode = $bindData['commessa'];
-      $label->template_id = $labelTemplateId;
-      $label->esl_datafields = json_encode($j_eslData);
-      $label->descrizione = $bindData['desccliente'];
-      $label->save();
-
-      $md = new MigrationData();
-      $md->DB2Connector();
-      $md->SetMissionsBarcodes($bindData['labelid'], $bindData['commessa']);
-
-      /*      $this->dbHandle->exec("DELETE FROM label_bindings WHERE label_id='{$bindData['labelid']}'");
-            $this->dbHandle->exec(
-              "INSERT INTO label_bindings (label_id, barcode, template_id, esl_datafields, descrizione) VALUES " .
-              "('{$bindData['labelid']}', '{$bindData['commessa']}', '{$labelTemplateId}', '{$j_eslData}', '{$bindData['desccliente']}')"
-            );*/
+          $j_eslData = [
+            'Q.ta' => 0,
+            'Commessa' => $bindData['commessa']
+          ];
+
+          $msgReset->saveProducts('', $j_eslData);
+
+          $qm = new QueueSystem('FindBoxService');
+          $qm->send($msgReset);
+
+          // Add or Update label
+          $label = new SQL\Mapper($f3->get('DB'), 'label_bindings');
+          $label->load(['label_id=?', $bindData['labelid']]);
+          $label->label_id = $bindData['labelid'];
+          $label->barcode = $bindData['commessa'];
+          $label->template_id = $labelTemplateId;
+          $label->esl_datafields = json_encode($j_eslData);
+          $label->descrizione = $bindData['desccliente'];
+          $label->save();
+
+          $md = new MigrationData();
+          $md->DB2Connector();
+          $md->SetMissionsBarcodes($bindData['labelid'], $bindData['commessa']);
+
+          /*      $this->dbHandle->exec("DELETE FROM label_bindings WHERE label_id='{$bindData['labelid']}'");
+                $this->dbHandle->exec(
+                  "INSERT INTO label_bindings (label_id, barcode, template_id, esl_datafields, descrizione) VALUES " .
+                  "('{$bindData['labelid']}', '{$bindData['commessa']}', '{$labelTemplateId}', '{$j_eslData}', '{$bindData['desccliente']}')"
+                );*/
+        }
+      }
     }
     }
 
 
     $liste = $distinta->getListeToBind();
     $liste = $distinta->getListeToBind();
@@ -267,7 +284,7 @@ class Pages extends Controller
     // Sum by article quantity for MAV
     // Sum by article quantity for MAV
     $dataFullMaxed = $migData->query($migData->strQueryPerMAV('SCARICO'));
     $dataFullMaxed = $migData->query($migData->strQueryPerMAV('SCARICO'));
     if (count($dataFullMaxed) == 0)
     if (count($dataFullMaxed) == 0)
-      $f3->set('IMPORT_RESULT', "Non ci sono nuove missioni da elaborare.");
+      $f3->set('MESSAGE', "Non ci sono nuove missioni da elaborare.");
     else {
     else {
       // Clean all bind table
       // Clean all bind table
       $d = new Distinta();
       $d = new Distinta();
@@ -279,7 +296,7 @@ class Pages extends Controller
       $idList = $migData->soapCompileFrom($dataFullMaxed_Elaborata, 'SCARICO');
       $idList = $migData->soapCompileFrom($dataFullMaxed_Elaborata, 'SCARICO');
 
 
       if (!$migData->sendToIcam()) {
       if (!$migData->sendToIcam()) {
-        $f3->set('IMPORT_RESULT', "Errore durante l'invio della lista al Magazzino Verticale.<br/><br/>Controllare la console ICAM per gli errori.");
+        $f3->set('MESSAGE', "Errore durante l'invio della lista al Magazzino Verticale.<br/><br/>Controllare la console ICAM per gli errori.");
       } else {
       } else {
         // Importo la lista nel database di OM-Link solamente se non ci sono stati errori nell'invio al Magazzino Verticale
         // Importo la lista nel database di OM-Link solamente se non ci sono stati errori nell'invio al Magazzino Verticale
 
 
@@ -289,14 +306,14 @@ class Pages extends Controller
 
 
         $migData->saveDistinta($dataOMLINK_elaborata);
         $migData->saveDistinta($dataOMLINK_elaborata);
         $count = count($dataFullMaxed_Elaborata);
         $count = count($dataFullMaxed_Elaborata);
-        $f3->set('IMPORT_RESULT', "Liste inviate correttamente al Magazzino Verticale<br/><br/>Righe con massimizzazione importate: $count");
+        $f3->set('MESSAGE', "Liste inviate correttamente al Magazzino Verticale<br/><br/>Righe con massimizzazione importate: $count");
 
 
         $migData->selectAvailableMissions('SCARICO');
         $migData->selectAvailableMissions('SCARICO');
         $migData->InitializeMissionsToPending($idList);
         $migData->InitializeMissionsToPending($idList);
       }
       }
     }
     }
 
 
-    $f3->set('CONTENT', 'import.tpl');
+    $f3->set('CONTENT', 'message.tpl');
     echo \Template::instance()->render('masterpage.tpl');
     echo \Template::instance()->render('masterpage.tpl');
   }
   }
 
 
@@ -309,7 +326,7 @@ class Pages extends Controller
   {
   {
     switch ($args['step']) {
     switch ($args['step']) {
       case 1:
       case 1:
-        $f3->set('IMPORT_RESULT', "Importazione in corso, attendere qualche secondo per la conferma.");
+        $f3->set('MESSAGE', "Importazione in corso, attendere qualche secondo per la conferma.");
         $url = ltrim(rtrim($args[0], '1'), '/') . '2';
         $url = ltrim(rtrim($args[0], '1'), '/') . '2';
         $this->setRedirect($url, 0);
         $this->setRedirect($url, 0);
         break;
         break;
@@ -319,10 +336,28 @@ class Pages extends Controller
         $migData->DB2Connector();
         $migData->DB2Connector();
         $migData->MAVDatabaseConnector();
         $migData->MAVDatabaseConnector();
         $inserted = $migData->transferFromMAV_as400();
         $inserted = $migData->transferFromMAV_as400();
-        $f3->set('IMPORT_RESULT', "Sono stati inviati $inserted articoli dal MAV ad as400.");
+        $f3->set('MESSAGE', "Sono stati inviati $inserted articoli dal MAV ad as400.");
         break;
         break;
     }
     }
-    $f3->set('CONTENT', 'import.tpl');
+    $f3->set('CONTENT', 'message.tpl');
     echo \Template::instance()->render('masterpage.tpl');
     echo \Template::instance()->render('masterpage.tpl');
   }
   }
+
+
+  public function PrintLabel($f3, $args)
+  {
+    $d = new Distinta();
+    if ($args['qty'] != -1) {
+      $data = $d->GetPrintingData($args['id']);
+    } else {
+      $data = $d->getCodCliente($args['id']);
+      $args['qty'] = '';
+    }
+    $generator = new BarcodeGeneratorPNG();
+    $imgSrcData = 'data:image/png;base64,' . base64_encode($generator->getBarcode($data[0]['codcliente'], $generator::TYPE_EAN_13));
+    $data[0]['srcdata'] = $imgSrcData;
+    $data[0]['qty'] = $args['qty'];
+    $f3->set('PRINT_DATA', $data);
+    echo \Template::instance()->render('printlabel.tpl');
+  }
 }
 }

+ 0 - 21
src/OpenMind/Backend/Backend.php

@@ -1,21 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: Giancarlo
- * Date: 31/07/2018
- * Time: 10:38
- */
-
-namespace OpenMind\Backend;
-
-use OpenMind\System\PluginStrategy;
-
-class Backend extends PluginStrategy
-{
-  public function __construct()
-  {
-  }
-}
-
-/** @var \OpenMind\Backend $Backend*/
-Global $Backend;

+ 1 - 0
src/OpenMind/FindBox/FindBoxService.php

@@ -130,6 +130,7 @@ class FindBoxService
         // ----------
         // ----------
         // Restart blink if blink is ended
         // Restart blink if blink is ended
         $blinkEndTime = time() - $label->tsLastLongBlink;
         $blinkEndTime = time() - $label->tsLastLongBlink;
+        /** @var QueueCommand $label*/
         $calcDuration = $label->getBlinkDuration();
         $calcDuration = $label->getBlinkDuration();
         if ($blinkEndTime > $calcDuration) {
         if ($blinkEndTime > $calcDuration) {
           echo $this->getStrTime() . "Auto restart blinking for label $label->id\n";
           echo $this->getStrTime() . "Auto restart blinking for label $label->id\n";

+ 1 - 1
src/OpenMind/FindBox/QueueCommand.php

@@ -61,7 +61,7 @@ class QueueCommand
    */
    */
   public function getBlinkDuration(): int
   public function getBlinkDuration(): int
   {
   {
-    return (($this->params['iter_time'] / 1000) * $this->params['iterations']) * $this->params['repeat'];
+    return (($this->params['iter_time'] / 1000) * ($this->params['iterations'] - 1)) * $this->params['repeat'];
   }
   }
 
 
   /**
   /**

+ 1 - 0
src/OpenMind/System/System.php

@@ -35,6 +35,7 @@ class System extends PluginStrategy
           \PDO::ATTR_PERSISTENT => $dbMode  // To avoid massive new persistent connections due to php-cgi processes
           \PDO::ATTR_PERSISTENT => $dbMode  // To avoid massive new persistent connections due to php-cgi processes
         ));
         ));
 
 
+      // This fix memory leak in ->exec() and all methods of F3 that use this function like load, find, findone etc...
       $db->log(FALSE);
       $db->log(FALSE);
 
 
       $f3->set('DB', $db);
       $f3->set('DB', $db);

+ 3 - 3
src/OpenMind/Web/Web.php

@@ -15,7 +15,7 @@ class Pages extends Controller
   public function HomeMenu($f3)
   public function HomeMenu($f3)
   {
   {
     // Sort menus buy 'order' option
     // Sort menus buy 'order' option
-    usort($f3->ref('GLOBALMENU'), function ($menu1, $menu2) {
+    uasort($f3->ref('GLOBALMENU'), function ($menu1, $menu2) {
       return $menu1['order'] <=> $menu2['order'];
       return $menu1['order'] <=> $menu2['order'];
     });
     });
 
 
@@ -43,8 +43,8 @@ class Pages extends Controller
 
 
     $output .= '<br/>... end import<br/>';
     $output .= '<br/>... end import<br/>';
 
 
-    $f3->set('IMPORT_RESULT', $output);
-    $f3->set('CONTENT', 'import.tpl');
+    $f3->set('MESSAGE', $output);
+    $f3->set('CONTENT', 'message.tpl');
     echo \Template::instance()->render('masterpage.tpl');
     echo \Template::instance()->render('masterpage.tpl');
   }
   }
 }
 }

+ 7 - 0
ui/bind.tpl

@@ -1,5 +1,12 @@
 <div class="row h-100 justify-content-center w-100">
 <div class="row h-100 justify-content-center w-100">
 	<div class="col-xs-12 col-md-9 col-lg-5 align-self-center">
 	<div class="col-xs-12 col-md-9 col-lg-5 align-self-center">
+
+		<check if="{{ isset(@INFOTEXT) }}">
+			<div class="alert alert-danger" role="alert">
+				{{@INFOTEXT}}
+			</div>
+		</check>
+
 		<check if="{{ count(@LISTE)>0 }}">
 		<check if="{{ count(@LISTE)>0 }}">
 			<false>
 			<false>
 				<div class="alert alert-danger" role="alert">
 				<div class="alert alert-danger" role="alert">

+ 0 - 8
ui/customizations/lamborghini.js

@@ -1,8 +0,0 @@
-/**
- * Child JS file
- *
- * @author Open Mind
- * @date 27/06/2018
- * @time 17:42
- */
-

+ 0 - 30
ui/customizations/lamborghini.scss

@@ -1,30 +0,0 @@
-/**
- * Child SCSS file
- *
- * @author Open Mind
- * @date 27/06/2018
- * @time 17:42
- */
-
-// Background color
-//$mainColor: #eee !important;
-$mainColor: #1a1a1a !important;
-
-// Main text color
-$textColor: #ffd242 !important;
-
-// Upper and Lower navbar background color
-$navbarsColor: rgba(94, 107, 116, 0.95) !important;
-
-// drop-shadow and box-shadow color
-$shadowColor: #444444;
-
-// All input tag colors
-$inputBgColor: #484848;
-$inputColor: #ffd242;
-
-$placeholderColor: gray !important;
-
-.customerlogo {
-  max-width: 50% !important;
-}

BIN
ui/favicon_lamborghini.ico


+ 17 - 1
ui/header.tpl

@@ -1,5 +1,21 @@
-<nav class="navbar sticky-top navbar-dark om-shadow navbar-expand">
+<nav class="navbar navbar-expand-sm  navbar-dark bg-dark om-shadow">
 	<a href="{{@BASEURL}}/"><img class="img-fluid om-shadow navbar-brand customerlogo" src="{{@LOGO_CUSTOMER}}"/></a>
 	<a href="{{@BASEURL}}/"><img class="img-fluid om-shadow navbar-brand customerlogo" src="{{@LOGO_CUSTOMER}}"/></a>
+	<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#headerMenu" aria-controls="headerMenu" aria-expanded="false" aria-label="Toggle navigation">
+		<span class="navbar-toggler-icon"></span>
+	</button>
+
+	<div class="collapse navbar-collapse" id="headerMenu">
+		<ul class="navbar-nav">
+			<repeat group="{{@GLOBALMENU}}" key="{{ @ikey }}" value="{{@menuitem}}">
+				<check if="{{ !empty(@menuitem.url) }}">
+					<li class="nav-item">
+						<a role="button" class="nav-link btn btn-secondary" href="{{@BASEURL . '/' . @menuitem.url}}">{{@ikey}}</a>
+					</li>
+				</check>
+			</repeat>
+		</ul>
+	</div>
+
 	<div class="ml-auto dropdown dropleft navbar-brand">
 	<div class="ml-auto dropdown dropleft navbar-brand">
 		<a id="notification_area_button" class="disabled" href="javascript:void(0)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="mr-3" style="position: relative">
 		<a id="notification_area_button" class="disabled" href="javascript:void(0)" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="mr-3" style="position: relative">
 			<img src="{{@BASEURL}}/ui/images/bell.png"/>
 			<img src="{{@BASEURL}}/ui/images/bell.png"/>

+ 1 - 1
ui/import.tpl → ui/message.tpl

@@ -1,3 +1,3 @@
 <div class="d-flex flex-wrap justify-content-around align-items-center flex-fill">
 <div class="d-flex flex-wrap justify-content-around align-items-center flex-fill">
-	<div class="shadow p-3 rounded bg-info text-light">{{@IMPORT_RESULT | raw}}</div>
+	<div class="shadow p-3 rounded bg-info text-light">{{@MESSAGE | raw}}</div>
 </div>
 </div>

+ 10 - 3
ui/pick2light.tpl

@@ -1,5 +1,5 @@
 <div class="row h-100 justify-content-center w-100">
 <div class="row h-100 justify-content-center w-100">
-	<div class="col-md-4 align-self-center">
+	<div class="col-md-4 align-self-start pt-3">
 
 
 		<check if="{{ isset(@INFOTEXT) }}">
 		<check if="{{ isset(@INFOTEXT) }}">
 			<div class="alert alert-danger" role="alert">
 			<div class="alert alert-danger" role="alert">
@@ -21,13 +21,14 @@
 					<table class="table table-sm table-striped table-light">
 					<table class="table table-sm table-striped table-light">
 						<thead class="bg-secondary">
 						<thead class="bg-secondary">
 						<tr>
 						<tr>
-							<th colspan="2" class="text-center text-uppercase text-white" scope="col">In attesa del completamento delle seguenti ceste</th>
+							<th colspan="3" class="text-center text-uppercase text-white" scope="col">In attesa del completamento delle seguenti ceste</th>
 						</tr>
 						</tr>
 						</thead>
 						</thead>
 						<tbody>
 						<tbody>
 						<repeat group="{{ @COMMESSE }}" key="{{@key}}" value="{{ @COMMESSA }}">
 						<repeat group="{{ @COMMESSE }}" key="{{@key}}" value="{{ @COMMESSA }}">
 							<tr>
 							<tr>
 								<td>{{@COMMESSA.commessa}}</td>
 								<td>{{@COMMESSA.commessa}}</td>
+								<td><a target="_blank" href="{{@BASEURL}}/printlabel/{{@COMMESSA.id}}/{{@COMMESSA.qta_prelevare}}"><img src="{{@BASEURL}}/ui/images/printer.png"/></a></td>
 								<td align="right">Q.ta <b>{{@COMMESSA.qta_prelevare}}</b></td>
 								<td align="right">Q.ta <b>{{@COMMESSA.qta_prelevare}}</b></td>
 							</tr>
 							</tr>
 						</repeat>
 						</repeat>
@@ -60,7 +61,7 @@
 				<tr style="font-size: 12pt">
 				<tr style="font-size: 12pt">
 					<th scope="col">UDS</th>
 					<th scope="col">UDS</th>
 					<th scope="col">Articoli</th>
 					<th scope="col">Articoli</th>
-					<th scope="col">Q.ta</th>
+					<th colspan="2" scope="col">Q.ta</th>
 				</tr>
 				</tr>
 				</thead>
 				</thead>
 				<tbody>
 				<tbody>
@@ -71,6 +72,12 @@
 					<th scope="row">{{@PRODUCT.uds}}</th>
 					<th scope="row">{{@PRODUCT.uds}}</th>
 					<td>{{@PRODUCT.barcode}}</td>
 					<td>{{@PRODUCT.barcode}}</td>
 					<td>{{@PRODUCT.qta}}</td>
 					<td>{{@PRODUCT.qta}}</td>
+					<td>
+						<check if="{{trim(@SESSION.barcode_mv)==trim(@PRODUCT.barcode)}}">
+							<a target="_blank" href="{{@BASEURL}}/printlabel/{{@PRODUCT.barcode}}/-1"><img src="{{@BASEURL}}/ui/images/printer.png"/></a>
+						</check>
+					</td>
+
 					</tr>
 					</tr>
 				</repeat>
 				</repeat>
 				</tbody>
 				</tbody>

+ 47 - 0
ui/printlabel.tpl

@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<html lang="it">
+<head>
+	<meta charset="UTF-8">
+	<meta name="viewport" content="width=device-width, initial-scale=1">
+	<title>{{@SITENAME}} error page</title>
+	<link type="text/css" rel="stylesheet" href="{{@BASEURL}}/bundle.css"/>
+</head>
+<body>
+
+<div class="card m-2 p-3 rounded" style="font-size: 12pt; width: 50%;">
+
+	<div class="d-flex flex-row">
+		<div class="col-3 pl-0 align-self-center">Preb:</div>
+		<div id="commessa" class=" align-self-center flex-fill font-weight-bold">{{@PRINT_DATA[0].commessa}}</div>
+		<div class="align-self-center pr-2" style="font-size: 14pt">Q.ta</div>
+		<div id="qty" class=" align-self-center font-weight-bold" style="font-size: 14pt">{{@PRINT_DATA[0].qty}}</div>
+		<div class="align-self-center font-weight-bold pl-2" style="font-size: 14pt">pz</div>
+	</div>
+
+	<div class="d-flex flex-row mt-1">
+		<div class="col-3 pl-0 align-self-center">Articolo</div>
+		<div id="barcode" class=" flex-fill align-self-center font-weight-bold" style="font-size: 20pt">{{@PRINT_DATA[0].barcode}}</h4></div>
+	</div>
+
+	<div class="d-flex flex-row mt-1">
+		<div class=" align-self-center d-inline-block font-weight-bold text-truncate" style="font-size: 16pt">{{@PRINT_DATA[0].descrizione}}</div>
+	</div>
+
+	<div class="d-flex flex-row mt-1">
+		<div id="imgbarcode" class=" flex-fill font-weight-bold">
+			<img src="{{@PRINT_DATA[0].srcdata}}"/>
+		</div>
+		<div class="">
+			<b>DIMATEC Spa</b><br/>
+			<span style="font-size: 17pt">
+			Via G.Gallilei, 7<br/>
+			GUANZATE CO<br/>
+			I-22070<br/>
+			</span>
+		</div>
+	</div>
+
+	<script src="{{@BASEURL}}/bundle.js"></script>
+
+</body>
+</html>