Browse Source

Fix applicate:

Picking list:
- rimosse le 2 richieste del codice carrello
- splittata in 2 la fase delle operazioni delle label da 2" e 7", in uno step ci si occupa prima della 7" e delle prime 3 etichette, nello step successiva su una pagina di waiting, le prossime rimanenti
- sistemati alcuni bug minori ed ottimizzato il codice in Pages.php e Distinta.php
- aggiunti 2 campi in più sulla tendina di selezione della Consegna
Giancarlo 8 years ago
parent
commit
505c833404
9 changed files with 147 additions and 99 deletions
  1. 1 1
      config.ini
  2. 0 3
      index.php
  3. 2 1
      package.json
  4. 70 24
      src/Distinta.php
  5. 34 28
      src/Modules/Pages.php
  6. 1 1
      src/SmartESL.php
  7. 0 5
      ui/bind.tpl
  8. 26 36
      ui/pick2light.tpl
  9. 13 0
      ui/pick2light_savingproducts.tpl

+ 1 - 1
config.ini

@@ -15,8 +15,8 @@ HIGHLIGHT = false
 JAR.expire = {{time()+31536000}}
 JAR.expire = {{time()+31536000}}
 
 
 [CORE.fb]
 [CORE.fb]
-host=192.168.1.193
 port=50443
 port=50443
+host=192.168.1.193
 key=C0000000000011474023057
 key=C0000000000011474023057
 pass=ZrgzkvJrOKnNSCnPnGz3u{A6eHSNXVvs
 pass=ZrgzkvJrOKnNSCnPnGz3u{A6eHSNXVvs
 
 

+ 0 - 3
index.php

@@ -16,15 +16,12 @@ $config = gzuncompress(base64_decode(file_get_contents("config.bin")));
 $f3->config('config.ini', true);
 $f3->config('config.ini', true);
 $f3->config('labels.ini', true);
 $f3->config('labels.ini', true);
 
 
-
 // TODO: per testare le api
 // TODO: per testare le api
 //$CORE_SETTINGS = $f3->get('CORE.fb');
 //$CORE_SETTINGS = $f3->get('CORE.fb');
 //$findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
 //$findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
 //$label = new \SmartESL($findBoxCore, ['010714CE']);
 //$label = new \SmartESL($findBoxCore, ['010714CE']);
 //$label->Display(1004, '4ML867738');
 //$label->Display(1004, '4ML867738');
 
 
-
-
 $f3->set('DB',
 $f3->set('DB',
   new \DB\SQL(
   new \DB\SQL(
     $f3->get('DBSETTINGS'),
     $f3->get('DBSETTINGS'),

+ 2 - 1
package.json

@@ -4,7 +4,8 @@
   "description": "Lamborghini OM-Link version",
   "description": "Lamborghini OM-Link version",
   "main": "index.js",
   "main": "index.js",
   "scripts": {
   "scripts": {
-    "build": "node build.js"
+    "build": "node build.js",
+    "deploy": "zip -9 -r deploy.zip config.bin labels.ini *.php bundle.* src ui vendor"
   },
   },
   "author": "Open Mind",
   "author": "Open Mind",
   "license": "ISC",
   "license": "ISC",

+ 70 - 24
src/Distinta.php

@@ -35,30 +35,43 @@ EOF;
     $dataset = $this->dbHandle->exec($sql);
     $dataset = $this->dbHandle->exec($sql);
     $idutente = $this->userId;
     $idutente = $this->userId;
 
 
-    $CORE_SETTINGS = \F3::get('CORE.fb');
-    $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
-
-    foreach($dataset as $row) {
+    foreach ($dataset as $row) {
       $sqlInsert = "INSERT INTO distinta_esplosa (idutente, commessa, barcode, descrizione, origine, ubicazione, sequenza, qta_prelevare, anomalie)" .
       $sqlInsert = "INSERT INTO distinta_esplosa (idutente, commessa, barcode, descrizione, origine, ubicazione, sequenza, qta_prelevare, anomalie)" .
         "VALUES ({$idutente}, '{$row['consegna']}', '{$row['barcode']}', '{$row['descrizione']}', '{$row['origine']}', '{$row['ubicazione']}', '{$row['sequenza']}', '{$row['qta_prelevare']}', 0)";
         "VALUES ({$idutente}, '{$row['consegna']}', '{$row['barcode']}', '{$row['descrizione']}', '{$row['origine']}', '{$row['ubicazione']}', '{$row['sequenza']}', '{$row['qta_prelevare']}', 0)";
       $err = $this->dbHandle->exec($sqlInsert);
       $err = $this->dbHandle->exec($sqlInsert);
       if (!$err)
       if (!$err)
         die('CopyDistinta error insert in table distinta_esplosa');
         die('CopyDistinta error insert in table distinta_esplosa');
+    }
+  }
+
+  /**
+   * @param string $maxArticles the LIMIT mysql query parameter
+   * @param bool $blink true if need to blink
+   */
+  public function SaveProductsToFindBox(string $maxArticles, bool $blink)
+  {
+    $CORE_SETTINGS = \F3::get('CORE.fb');
+    $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
 
 
-      $dataFields = array(
-        'qta_prelevare' => $row['qta_prelevare']
-      );
-      $err = $findBoxCore->SaveProducts($row['barcode'], $row['descrizione'], $dataFields);
+    $datiDistinta = $this->getDistinta($maxArticles);
+    foreach ($datiDistinta as $row) {
 
 
       $labelId = $this->GetLabelIdFromBarcode($row['barcode']);
       $labelId = $this->GetLabelIdFromBarcode($row['barcode']);
       if ($labelId != null) {
       if ($labelId != null) {
+
+        $dataFields = array(
+          'qr_code' => $row['barcode'],
+          'qta_prelevare' => $row['qta_prelevare']
+        );
+
         $label = new \SmartESL($findBoxCore, [$labelId]);
         $label = new \SmartESL($findBoxCore, [$labelId]);
         $sql = "SELECT template_id FROM label_bindings WHERE label_id='{$labelId}'";
         $sql = "SELECT template_id FROM label_bindings WHERE label_id='{$labelId}'";
         $tplId = $this->dbHandle->exec($sql);
         $tplId = $this->dbHandle->exec($sql);
-//        $details = $label->getDetails();
-//        $devType = $details[$labelId]['status']['dev_type'];
-//        $dt = \F3::get("LABELS.TEMPLATES.DT{$devType}");
-//        $label->Display($dt[1], $row['barcode']);
+
+        if ($blink)
+          $label->BlinkSpecial(0, 1, 1000, 20, 1);
+
+        $findBoxCore->SaveProducts($row['barcode'], $row['descrizione'], $dataFields);
         $label->Display($tplId[0]['template_id'], $row['barcode']);
         $label->Display($tplId[0]['template_id'], $row['barcode']);
       }
       }
     }
     }
@@ -69,9 +82,9 @@ EOF;
     return $this->dbHandle->exec('SELECT distinct consegna, commessa, ordine_produzione, data_creazione, time_creazione, destinazione_merci FROM `distinte` ORDER BY data_creazione');
     return $this->dbHandle->exec('SELECT distinct consegna, commessa, ordine_produzione, data_creazione, time_creazione, destinazione_merci FROM `distinte` ORDER BY data_creazione');
   }
   }
 
 
-  public function getDistinta()
+  public function getDistinta(string $maxRows = '3')
   {
   {
-    return $this->dbHandle->exec("SELECT * FROM distinta_esplosa WHERE idutente={$this->userId} AND qta_prelevare>0 and anomalie=0 ORDER BY sequenza LIMIT 3");
+    return $this->dbHandle->exec("SELECT * FROM distinta_esplosa WHERE idutente={$this->userId} AND qta_prelevare>0 and anomalie=0 ORDER BY sequenza LIMIT {$maxRows}");
   }
   }
 
 
   public function MarkBarcodeAsAnomalia(string $labelId)
   public function MarkBarcodeAsAnomalia(string $labelId)
@@ -87,8 +100,16 @@ EOF;
 
 
   public function RemoveQuantity(string $labelId)
   public function RemoveQuantity(string $labelId)
   {
   {
-    $sql = "UPDATE distinta_esplosa d JOIN label_bindings b ON d.barcode = b.barcode SET qta_prelevare=qta_prelevare-1 WHERE idutente={$this->userId} AND b.barcode='{$labelId}'";
-    return $this->dbHandle->exec($sql);
+    $sql = "UPDATE distinta_esplosa d JOIN label_bindings b ON d.barcode = b.barcode SET qta_prelevare=qta_prelevare-1 WHERE idutente={$this->userId} AND b.barcode='{$labelId}' AND qta_prelevare>0";
+    $ret = $this->dbHandle->exec($sql);
+    return $ret;
+  }
+
+  public function GetArticleCount(string $barcode): int
+  {
+    $sql = "SELECT qta_prelevare from distinta_esplosa d JOIN label_bindings b ON d.barcode = b.barcode WHERE idutente=0 AND b.barcode='{$barcode}'";
+    $record = $this->dbHandle->exec($sql);
+    return $record[0]['qta_prelevare'];
   }
   }
 
 
   public function GetLabelIdFromBarcode(string $barcode): ?string
   public function GetLabelIdFromBarcode(string $barcode): ?string
@@ -101,7 +122,7 @@ EOF;
 
 
   private function getArticoliByConsegna(string $consegna): array
   private function getArticoliByConsegna(string $consegna): array
   {
   {
-    $sqlCommesse = "SELECT DISTINCT CONCAT(commessa, ' ', descrizione, ' ', qta_prelevare) FROM `distinta_esplosa` WHERE idutente={$this->userId} AND commessa = '{$consegna}'";
+    $sqlCommesse = "SELECT DISTINCT CONCAT(barcode, ' ', descrizione, ' ', qta_prelevare) FROM `distinta_esplosa` WHERE idutente={$this->userId} AND commessa = '{$consegna}'";
     return $this->dbHandle->exec($sqlCommesse);
     return $this->dbHandle->exec($sqlCommesse);
   }
   }
 
 
@@ -125,11 +146,11 @@ EOF;
     $articles = $this->getArticoliByConsegna($consegna);
     $articles = $this->getArticoliByConsegna($consegna);
     $joinFields = array_map('array_shift', $articles);
     $joinFields = array_map('array_shift', $articles);
     $elenco = [];
     $elenco = [];
-    for($i = 1; $i <= 10; $i++) {
+    for ($i = 1; $i <= 10; $i++) {
       $fieldName = 'campo' . str_pad($i, 2, '0', STR_PAD_LEFT);
       $fieldName = 'campo' . str_pad($i, 2, '0', STR_PAD_LEFT);
       $elenco[$fieldName] = '';
       $elenco[$fieldName] = '';
     }
     }
-    foreach($joinFields as $i => $campo) {
+    foreach ($joinFields as $i => $campo) {
       $fieldName = 'campo' . str_pad($i + 1, 2, '0', STR_PAD_LEFT);
       $fieldName = 'campo' . str_pad($i + 1, 2, '0', STR_PAD_LEFT);
       $elenco[$fieldName] = $campo;
       $elenco[$fieldName] = $campo;
     }
     }
@@ -138,17 +159,42 @@ EOF;
 
 
     $dataFields['end_operations'] = $consegna;
     $dataFields['end_operations'] = $consegna;
 
 
-    $err = $findBoxCore->SaveProducts($barcode, $consegna, $dataFields);
     $label = new \SmartESL($findBoxCore, [$labelId]);
     $label = new \SmartESL($findBoxCore, [$labelId]);
-//    $details = $label->getDetails();
-//    $devType = $details[$labelId]['status']['dev_type'];
     $devType = 79;
     $devType = 79;
     $dt = \F3::get("LABELS.TEMPLATES.DT{$devType}");
     $dt = \F3::get("LABELS.TEMPLATES.DT{$devType}");
 
 
-    $label->BlinkSpecial(0, 1, 1000, 5, 0);
+    $label->BlinkSpecial(0, 1, 1000, 2, 0);
+    $err = $findBoxCore->SaveProducts($barcode, $consegna, $dataFields);
     $label->Display($dt[1], $barcode);
     $label->Display($dt[1], $barcode);
   }
   }
 
 
+  public function SaveProductsForLabel7(string $barcode, string $consegna)
+  {
+    $CORE_SETTINGS = \F3::get('CORE.fb');
+    $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
+
+    $sqlCommesse = "SELECT DISTINCT origine, commessa, ordine_produzione, data_creazione, time_creazione, destinazione_merci FROM `distinte` WHERE consegna = '{$consegna}'";
+    $dataFields = $this->dbHandle->exec($sqlCommesse);
+
+    $dataFields = array_shift($dataFields);
+
+    $articles = $this->getArticoliByConsegna($consegna);
+    $joinFields = array_map('array_shift', $articles);
+    $elenco = [];
+    for ($i = 1; $i <= 10; $i++) {
+      $fieldName = 'campo' . str_pad($i, 2, '0', STR_PAD_LEFT);
+      $elenco[$fieldName] = '';
+    }
+    foreach ($joinFields as $i => $campo) {
+      $fieldName = 'campo' . str_pad($i + 1, 2, '0', STR_PAD_LEFT);
+      $elenco[$fieldName] = $campo;
+    }
+
+    $dataFields = array_merge($dataFields, $elenco);
+    $dataFields['end_operations'] = $consegna;
+    $err = $findBoxCore->SaveProducts($barcode, $consegna, $dataFields);
+  }
+
   public function ResetDistintaLabels(string $commessa, string $label7Id)
   public function ResetDistintaLabels(string $commessa, string $label7Id)
   {
   {
     $sql = "SELECT label_id, anomalie, b.barcode FROM distinta_esplosa d JOIN label_bindings b ON d.barcode=b.barcode WHERE idutente={$this->userId} AND commessa='{$commessa}'";
     $sql = "SELECT label_id, anomalie, b.barcode FROM distinta_esplosa d JOIN label_bindings b ON d.barcode=b.barcode WHERE idutente={$this->userId} AND commessa='{$commessa}'";
@@ -157,7 +203,7 @@ EOF;
     $CORE_SETTINGS = \F3::get('CORE.fb');
     $CORE_SETTINGS = \F3::get('CORE.fb');
     $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
     $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
 
 
-    foreach($dataset as $row) {
+    foreach ($dataset as $row) {
       $label = new \SmartESL($findBoxCore, [$row['label_id']]);
       $label = new \SmartESL($findBoxCore, [$row['label_id']]);
 //      $details = $label->getDetails();
 //      $details = $label->getDetails();
 //      $devType = $details[$row['label_id']]['status']['dev_type'];
 //      $devType = $details[$row['label_id']]['status']['dev_type'];

+ 34 - 28
src/Modules/Pages.php

@@ -38,10 +38,7 @@ class Pages extends BaseController
     }
     }
 
 
     switch ($args['step']) {
     switch ($args['step']) {
-      case 4:
-        $f3->set('INFOTEXT', 'Quando pronto, aggancia l\'etichetta elettronica al carrello e scannerizza il barcode');
-        break;
-      case 5:
+      case 3:
         $distinta = new \Distinta($f3);
         $distinta = new \Distinta($f3);
         $distinta->CleanDistintaTable();
         $distinta->CleanDistintaTable();
         $distinta->CopyDistinta($stepValues['consegna']);
         $distinta->CopyDistinta($stepValues['consegna']);
@@ -50,19 +47,19 @@ class Pages extends BaseController
         $rowsDistinta = $distinta->getDistinta();
         $rowsDistinta = $distinta->getDistinta();
         $CORE_SETTINGS = \F3::get('CORE.fb');
         $CORE_SETTINGS = \F3::get('CORE.fb');
         $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
         $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
-        foreach($rowsDistinta as $item) {
-          $lblId = $distinta->GetLabelIdFromBarcode($item['barcode']);
-          $label = new \SmartESL($findBoxCore, [$lblId]);
-          $label->BlinkSpecial(0, 1, 1000, 50, 0);
-        }
+        $distinta->SaveProductsToFindBox('3', true); // prende soltanto i primi 3 dalla tabella copia delle distinte
 
 
         $f3->set('COOKIE.p2l', json_encode($stepValues));
         $f3->set('COOKIE.p2l', json_encode($stepValues));
         $f3->set('COOKIE.consegna', $stepValues['consegna']);
         $f3->set('COOKIE.consegna', $stepValues['consegna']);
         $f3->set('COOKIE.labelid', $stepValues['labelid']);
         $f3->set('COOKIE.labelid', $stepValues['labelid']);
-        $f3->reroute("/pick2light/6");
+        $f3->reroute("/pick2light/4");
         return;
         return;
         break;
         break;
-      case 6:
+      case 4:
+        $distinta = new \Distinta($f3);
+        $distinta->SaveProductsToFindBox('3, 1000', false); // LIMIT 3,1000 perchè i primi 3 li ha fatti nel case 3
+        break;
+      case 5:
         $datiCommessa['consegna'] = $f3->get('COOKIE.consegna');
         $datiCommessa['consegna'] = $f3->get('COOKIE.consegna');
         $datiCommessa['labelid'] = $f3->get('COOKIE.labelid');
         $datiCommessa['labelid'] = $f3->get('COOKIE.labelid');
         $distinta = new \Distinta($f3);
         $distinta = new \Distinta($f3);
@@ -82,18 +79,24 @@ class Pages extends BaseController
               unset($stepValues['anomalia']);
               unset($stepValues['anomalia']);
             else
             else
               $f3->set('ANOMALIA', 'Codice non trovato!');
               $f3->set('ANOMALIA', 'Codice non trovato!');
-          } else if ($distinta->RemoveQuantity($pickedBarcode)) {
-            $CORE_SETTINGS = \F3::get('CORE.fb');
-            $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
-            $label = new \SmartESL($findBoxCore, [$distinta->GetLabelIdFromBarcode($pickedBarcode)]);
-            $label->BlinkSpecial(0, 1, 0, 0, 0);
-          } else {
-            $f3->set('INFOTEXT', 'Etichetta mancante per il barcode selezionato');
+          } else { // E' stato passato un barcode
+            if ($distinta->RemoveQuantity($pickedBarcode)) {
+              // BlinkOFF solo se non è lo stesso barcode precedente
+              if ($f3->get('COOKIE.previousbarcode') != $pickedBarcode) {
+                // SPEGNE LED ETICHETTA DOPO PICKING
+                $CORE_SETTINGS = \F3::get('CORE.fb');
+                $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
+                $label = new \SmartESL($findBoxCore, [$distinta->GetLabelIdFromBarcode($pickedBarcode)]);
+                $label->BlinkSpecial(0, 1, 0, 0, 0);
+              }
+            } else
+              $f3->set('INFOTEXT', 'Barcode non riconosciuto o non associato a nessuna etichetta elettronica arcode selezionato');
           }
           }
         }
         }
 
 
         $rowsDistinta = $distinta->getDistinta();
         $rowsDistinta = $distinta->getDistinta();
         $f3->set('PRODUCTS', $rowsDistinta);
         $f3->set('PRODUCTS', $rowsDistinta);
+        // End Picking
         if (count($rowsDistinta) == 0) {
         if (count($rowsDistinta) == 0) {
           $distinta->ResetDistintaLabels($datiCommessa['consegna'], $datiCommessa['labelid']);
           $distinta->ResetDistintaLabels($datiCommessa['consegna'], $datiCommessa['labelid']);
           $anomalie = $distinta->getAnomalieFromConsegne($datiCommessa['consegna']);
           $anomalie = $distinta->getAnomalieFromConsegne($datiCommessa['consegna']);
@@ -102,35 +105,38 @@ class Pages extends BaseController
           $CORE_SETTINGS = $f3->get('CORE.fb');
           $CORE_SETTINGS = $f3->get('CORE.fb');
           $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
           $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
           $label = new \SmartESL($findBoxCore, [$datiCommessa['labelid']]);
           $label = new \SmartESL($findBoxCore, [$datiCommessa['labelid']]);
-          $label->BlinkSpecial(0, 1, 1000, 5, 0);
+          $label->BlinkSpecial(0, 1, 1000, 20, 1);
+          $distinta->SaveProductsForLabel7($datiCommessa['labelid'], $datiCommessa['consegna']);
           $label->Display(1017, $datiCommessa['labelid']);
           $label->Display(1017, $datiCommessa['labelid']);
 
 
+          // Se non ci sono anomalie torna alla homepage
           if (count($anomalie) == 0) {
           if (count($anomalie) == 0) {
             $f3->reroute('/');
             $f3->reroute('/');
           }
           }
         } else {
         } else {
-          foreach($rowsDistinta as $rowDist) {
+          // Seleziona le prossime tre etichette
+          foreach ($rowsDistinta as $rowDist) {
             $CORE_SETTINGS = $f3->get('CORE.fb');
             $CORE_SETTINGS = $f3->get('CORE.fb');
             $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
             $findBoxCore = new \FindBoxCoreSystem(...array_values($CORE_SETTINGS));
             $labelId = $distinta->GetLabelIdFromBarcode($rowDist['barcode']);
             $labelId = $distinta->GetLabelIdFromBarcode($rowDist['barcode']);
             if ($labelId != null) {
             if ($labelId != null) {
+              sleep(2);
               $label = new \SmartESL($findBoxCore, [$labelId]);
               $label = new \SmartESL($findBoxCore, [$labelId]);
-              $label->BlinkSpecial(0, 1, 1000, 50, 0);
+              // Se è lo stesso barcode di quello appena pickato dall'operatore, non lo blinka di nuovo
+              if ($f3->get('COOKIE.previousbarcode') != $rowDist['barcode']) {
+                $label->BlinkSpecial(0, 1, 1000, 20, 1);
+              }
             }
             }
           }
           }
         }
         }
-
-//        if ($stepValues['cartcode'] != $stepValues['confirmcartcode']) {
-//          $f3->set('INFOTEXT', 'Carrello sbagliato');
-//          $f3->set('REDIRECT', "/pick2light/}");
-//        }
-
         break;
         break;
     }
     }
 
 
+    $f3->set('COOKIE.previousbarcode', $pickedBarcode);
+
     $f3->set('COOKIE.p2l', json_encode($stepValues));
     $f3->set('COOKIE.p2l', json_encode($stepValues));
 
 
-    $f3->set('DISTINTE', $f3->Get('DB')->exec('SELECT DISTINCT consegna FROM distinte ORDER BY data_creazione, time_creazione'));
+    $f3->set('DISTINTE', $f3->Get('DB')->exec('SELECT DISTINCT consegna, time_creazione, destinazione_merci FROM distinte ORDER BY data_creazione, time_creazione'));
     $f3->set('STEP', $args['step']);
     $f3->set('STEP', $args['step']);
     $f3->set('PAGEVALUES', $stepValues);
     $f3->set('PAGEVALUES', $stepValues);
 
 

+ 1 - 1
src/SmartESL.php

@@ -85,7 +85,7 @@ class SmartESL
     }
     }
 
 
     /**
     /**
-     * Requet to label(s) its properties
+     * Request to label(s) its properties
      * @return null|object Details
      * @return null|object Details
      */
      */
     public function GetStatus()
     public function GetStatus()

+ 0 - 5
ui/bind.tpl

@@ -16,11 +16,6 @@
             <script>
             <script>
               window.location.href = "{{@BASEURL}}/bind/1";
               window.location.href = "{{@BASEURL}}/bind/1";
             </script>
             </script>
-            {*<script>*}
-            {*setTimeout(function () {*}
-            {*window.location.href = "{{@BASEURL}}/bind/1";*}
-            {*}, 2000);*}
-            {*</script>*}
         </check>
         </check>
     </div>
     </div>
 </div>
 </div>

+ 26 - 36
ui/pick2light.tpl

@@ -1,42 +1,32 @@
-<check if="{{ @STEP > 1 && @STEP < 4 }}">
-    <set PREVPAGE="{{ @BASEURL . '/pick2light/' . (@STEP-1) }}"/>
-</check>
-
 <include href="bars.tpl"/>
 <include href="bars.tpl"/>
 
 
 <div class="row h-100 justify-content-center">
 <div class="row h-100 justify-content-center">
-    <check if="{{ @STEP < 6 }}">
-        <true>
-            <div class="col-md-5 align-self-center">
-                <form class="form" method="post" action="{{@BASEURL}}/pick2light/{{@STEP+1}}">
-                    <input type="submit" hidden id="submitform"/>
-
-                    <select name="consegna" class="form-control form-control-lg bg-secondary mb-3" onchange="javascript:{$('#submitform').click()}">
-                        <option {{isset(@PAGEVALUES.consegna) ? '' : 'selected'}} >Seleziona una distinta</option>
-                        <repeat group="{{ @DISTINTE }}" value="{{ @DISTINTA }}">
-                            <option {{@PAGEVALUES.consegna == @@DISTINTA.consegna ? 'selected' : ''}} value="{{@@DISTINTA.consegna}}">{{@@DISTINTA.consegna}}</option>
-                        </repeat>
-                    </select>
-                    <check if="{{ @STEP > 1}}">
-                        <input type="text" name="labelid" {{ @STEP==2 ? 'autofocus' : ''}} value="{{@PAGEVALUES.labelid}}" class="form-control form-control-lg mb-3" placeholder="Codice etichetta" required autocomplete="false"/>
-                    </check>
-                    <check if="{{ @STEP > 2}}">
-                        <input type="text" name="cartcode" {{ @STEP==3 ? 'autofocus' : ''}} value="{{@PAGEVALUES.cartcode}}" class="mt-3 form-control form-control-lg" placeholder="Codice carrello" required autocomplete="false"/>
-                    </check>
-
-                    <check if="{{ @STEP >= 4}}">
-                        <div class="alert alert-info mt-3" role="alert">
-                            {{@INFOTEXT}}
-                        </div>
-                        <input type="text" name="confirmcartcode" {{ @STEP==4 ? 'autofocus' : ''}} value="" class="form-control form-control-lg" placeholder="Conferma del codice carrello" required autocomplete="false"/>
-                    </check>
+    <check if="{{ @STEP < 4 }}">
+        <div class="col-md-5 align-self-center">
+            <form class="form" method="post" action="{{@BASEURL}}/pick2light/{{@STEP+1}}">
+                <input type="submit" hidden id="submitform"/>
 
 
-                </form>
-
-            </div>
-        </true>
-        <false>
-            <include href="pick2light_picks.tpl"/>
-        </false>
+                <select name="consegna" class="form-control form-control-lg bg-secondary mb-3" onchange="javascript:{$('#submitform').click()}">
+                    <option {{isset(@PAGEVALUES.consegna) ? '' : 'selected'}} >Seleziona una distinta</option>
+                    <repeat group="{{ @DISTINTE }}" value="{{ @DISTINTA }}">
+                        <option {{@PAGEVALUES.consegna == @@DISTINTA.consegna ? 'selected' : ''}} value="{{@@DISTINTA.consegna}}">{{@@DISTINTA.consegna}} - {{@@DISTINTA.time_creazione}} - {{@@DISTINTA.destinazione_merci}}</option>
+                    </repeat>
+                </select>
+                <check if="{{ @STEP > 1}}">
+                    <input type="text" name="labelid" {{ @STEP==2 ? 'autofocus' : ''}} value="{{@PAGEVALUES.labelid}}" class="form-control form-control-lg mb-3" placeholder="Codice etichetta" required autocomplete="false"/>
+                </check>
+                <check if="{{ isset(@INFOTEXT) }}">
+                    <div class="alert alert-info mt-3" role="alert">
+                        {{@INFOTEXT}}
+                    </div>
+                </check>
+            </form>
+        </div>
+    </check>
+    <check if="{{ @STEP == 4 }}">
+        <include href="pick2light_savingproducts.tpl"/>
+    </check>
+    <check if="{{ @STEP == 5 }}">
+        <include href="pick2light_picks.tpl"/>
     </check>
     </check>
 </div>
 </div>

+ 13 - 0
ui/pick2light_savingproducts.tpl

@@ -0,0 +1,13 @@
+<div class="col-md-5 align-self-center">
+    <div class="progress" style="height: 50px">
+        <div class="progress-bar progress-bar-striped progress-bar-animated bg-warning" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%; color: black; font-size: 15pt">
+            Salvataggio prodotti, attendere prego
+        </div>
+    </div>
+    <script>
+        setTimeout(function() {
+            window.location.href = "{{@BASEURL}}/pick2light/5"
+        }, 20000)
+    </script>
+
+</div>