Browse Source

* ADD: quantity on pick2light page
* NEW: changed delete.png icon
* ADD: datetime to echo of FindBoxService.php

Giancarlo Voci 8 years ago
parent
commit
bcf8629441

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

@@ -280,7 +280,7 @@ EOF;
     return <<<EOF
 SELECT `uds`, `barcode`, `descrizione`, SUM(`qta_prelevare`) AS `qta`
 FROM `distinte`
-WHERE deleted=0
+WHERE `deleted`=0
 GROUP BY `barcode`
 ORDER BY `uds`
 EOF;

+ 15 - 10
src/OpenMind/FindBox/FindBoxService.php

@@ -24,6 +24,11 @@ class FindBoxService
     $this->labelToBlink = [];
   }
 
+  private function getStrTime()
+  {
+    return '[' . date("d/m/Y H:i:s") . '] ';
+  }
+
   private function updateServiceStatus()
   {
     $qs = new QueueSystem('FindBoxService_isAlive');
@@ -39,7 +44,7 @@ class FindBoxService
 
   private function getCurrentQueue()
   {
-    //echo "Checking QueueSystem               \n";
+    //echo $this->getStrTime() . "Checking QueueSystem               \n";
     $table = new QueueSystem('FindBoxService');
     while (!$table->check()) {
 
@@ -53,13 +58,13 @@ class FindBoxService
           $this->labelToBlink[$qCommand->id] = $qCommand;
           break;
         case Q_BLINK_OFF:
-          echo "BlinkOff for label {$qCommand->id} requested\n";
+          echo $this->getStrTime() . "BlinkOff for label {$qCommand->id} requested\n";
           $esl = new SmartESL($this->findBoxCore, [$qCommand->id]);
           $esl->BlinkOff();
           unset($this->labelToBlink[$qCommand->id]);
           break;
         case Q_DISPLAY:
-          echo "Change display for label {$qCommand->id} requested\n";
+          echo $this->getStrTime() ."Change display for label {$qCommand->id} requested\n";
           $esl = new SmartESL($this->findBoxCore, [$qCommand->id]);
           $esl->Display($qCommand->params['templateId'], $qCommand->params['barcode']);
           unset($this->labelToBlink[$qCommand->id]);
@@ -67,7 +72,7 @@ class FindBoxService
       }
       $table->erase();
       $table->next();
-      echo "Label {$qCommand->id} readed\n";
+      echo $this->getStrTime() . "Label {$qCommand->id} readed\n";
     }
   }
 
@@ -81,7 +86,7 @@ class FindBoxService
   {
     if ($label->operation == Q_SAVEPRODUCT) {
       $this->findBoxCore->SaveProducts($label->id, $label->description, $label->params['dataFields']);
-      echo "Save product {$label->id}\n";
+      echo $this->getStrTime() . "Save product {$label->id}\n";
       return true;
     }
     return false;
@@ -96,14 +101,14 @@ class FindBoxService
    */
   public function Main($f3)
   {
-    echo "Starting FindBoxService main loop\n";
+    echo $this->getStrTime() . "Starting FindBoxService main loop\n";
     while (true) {
 
       $this->updateServiceStatus();
 
       $this->getCurrentQueue();
 
-      //echo 'Label in cache: ' . count($this->labelToBlink) . "     \n";
+      //echo $this->getStrTime() . 'Label in cache: ' . count($this->labelToBlink) . "     \n";
       foreach($this->labelToBlink as $labelId => $label) {
 
         // Priority 1
@@ -111,7 +116,7 @@ class FindBoxService
         // Force exit and blink off if run time script > MAX_BLINK_TIME_SEC
         $now = time() - $label->tsFirstBlink;
         if ($now > $f3->get('MAX_BLINK_TIME_SEC')) {
-          echo "Stop label {$label->id} for timeout\n";
+          echo $this->getStrTime() . "Stop label {$label->id} for timeout\n";
           $esl = new SmartESL($this->findBoxCore, [$label->id]);
           $esl->BlinkOff();
           unset($this->labelToBlink[$labelId]);
@@ -124,7 +129,7 @@ class FindBoxService
         $blinkEndTime = time() - $label->tsLastLongBlink;
         $calcDuration = $label->getBlinkDuration();
         if ($blinkEndTime > $calcDuration) {
-          echo "Auto restart blinking for label $label->id\n";
+          echo $this->getStrTime() . "Auto restart blinking for label $label->id\n";
 
           $esl = new SmartESL($this->findBoxCore, [$label->id]);
           $ledParams = $label->params;
@@ -134,7 +139,7 @@ class FindBoxService
         }
       }
 
-      //echo "Restart loop                  \n";
+      //echo $this->getStrTime() . "Restart loop                  \n";
       ob_flush();
       flush();
       sleep($f3->get('FINDBOXSERVICE.SLEEPTIME'));

BIN
ui/images/delete.png


+ 3 - 4
ui/pick2light.tpl

@@ -17,13 +17,14 @@
 				<table class="table table-sm table-striped table-light">
 					<thead class="bg-secondary">
 					<tr>
-						<th class="text-center text-uppercase text-white" scope="col">In attesa del completamento delle seguenti ceste</th>
+						<th colspan="2" class="text-center text-uppercase text-white" scope="col">In attesa del completamento delle seguenti ceste</th>
 					</tr>
 					</thead>
 					<tbody>
 					<repeat group="{{ @COMMESSE }}" key="{{@key}}" value="{{ @COMMESSA }}">
 						<tr>
 							<td>{{@COMMESSA.commessa}}</td>
+							<td align="right">Q.ta <b>{{@COMMESSA.qta_prelevare}}</b></td>
 						</tr>
 					</repeat>
 					</tbody>
@@ -41,7 +42,7 @@
 
 		</form>
 	</div>
-	<div class="col-md-8">
+	<div class="col-md-8" style="overflow-y: auto">
 		<div class="rounded table-responsive mt-3" style="background-color: #a0b1cc">
 			<table class="table rounded table-striped table-secondary mb-0" style="font-size: 11pt">
 				<thead style="background-color: #a0b1cc">
@@ -53,7 +54,6 @@
 				<tr style="font-size: 12pt">
 					<th scope="col">UDS</th>
 					<th scope="col">Articoli</th>
-					<th scope="col">Descrizione</th>
 					<th scope="col">Q.ta</th>
 				</tr>
 				</thead>
@@ -62,7 +62,6 @@
 					<tr <check if="{{trim(@SESSION.barcode_mv)==trim(@PRODUCT.barcode)}}">class="blink bg-primary"</check>>
 						<th scope="row">{{@PRODUCT.uds}}</th>
 						<td>{{@PRODUCT.barcode}}</td>
-						<td>{{@PRODUCT.descrizione}}</td>
 						<td>{{@PRODUCT.qta}}</td>
 					</tr>
 				</repeat>