|
@@ -35,7 +35,7 @@ EOF;
|
|
|
$dataset = $this->dbHandle->exec($sql);
|
|
$dataset = $this->dbHandle->exec($sql);
|
|
|
$idutente = $this->userId;
|
|
$idutente = $this->userId;
|
|
|
|
|
|
|
|
- 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);
|
|
@@ -48,13 +48,13 @@ EOF;
|
|
|
* @param string $maxArticles the LIMIT mysql query parameter
|
|
* @param string $maxArticles the LIMIT mysql query parameter
|
|
|
* @param bool $blink true if need to blink
|
|
* @param bool $blink true if need to blink
|
|
|
*/
|
|
*/
|
|
|
- public function SaveProductsToFindBox(string $maxArticles, bool $blink)
|
|
|
|
|
|
|
+ public function SaveProductsToFindBox(string $maxArticles, bool $blink, int $iterations = 20)
|
|
|
{
|
|
{
|
|
|
$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));
|
|
|
|
|
|
|
|
$datiDistinta = $this->getDistinta($maxArticles);
|
|
$datiDistinta = $this->getDistinta($maxArticles);
|
|
|
- foreach ($datiDistinta as $row) {
|
|
|
|
|
|
|
+ foreach($datiDistinta as $row) {
|
|
|
|
|
|
|
|
$labelId = $this->GetLabelIdFromBarcode($row['barcode']);
|
|
$labelId = $this->GetLabelIdFromBarcode($row['barcode']);
|
|
|
if ($labelId != null) {
|
|
if ($labelId != null) {
|
|
@@ -68,11 +68,12 @@ EOF;
|
|
|
$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);
|
|
|
|
|
|
|
|
- if ($blink)
|
|
|
|
|
- $label->BlinkSpecial(0, 1, 1000, 20, 1);
|
|
|
|
|
|
|
|
|
|
$findBoxCore->SaveProducts($row['barcode'], $row['descrizione'], $dataFields);
|
|
$findBoxCore->SaveProducts($row['barcode'], $row['descrizione'], $dataFields);
|
|
|
$label->Display($tplId[0]['template_id'], $row['barcode']);
|
|
$label->Display($tplId[0]['template_id'], $row['barcode']);
|
|
|
|
|
+ if ($blink) {
|
|
|
|
|
+ $label->BlinkSpecial(0, 1, 1000, $iterations, 0);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -107,7 +108,7 @@ EOF;
|
|
|
|
|
|
|
|
public function GetArticleCount(string $barcode): int
|
|
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}'";
|
|
|
|
|
|
|
+ $sql = "SELECT qta_prelevare from distinta_esplosa d JOIN label_bindings b ON d.barcode = b.barcode WHERE idutente={$this->userId} AND b.barcode='{$barcode}'";
|
|
|
$record = $this->dbHandle->exec($sql);
|
|
$record = $this->dbHandle->exec($sql);
|
|
|
return $record[0]['qta_prelevare'];
|
|
return $record[0]['qta_prelevare'];
|
|
|
}
|
|
}
|
|
@@ -132,25 +133,29 @@ EOF;
|
|
|
* @param string $labelId
|
|
* @param string $labelId
|
|
|
* @param string $barcode
|
|
* @param string $barcode
|
|
|
* @param string $consegna
|
|
* @param string $consegna
|
|
|
|
|
+ * @return bool true if successfull
|
|
|
*/
|
|
*/
|
|
|
- public function SaveLabelCarrello(string $labelId, string $barcode, string $consegna)
|
|
|
|
|
|
|
+ public function SaveLabelCarrello(string $labelId, string $barcode, string $consegna): bool
|
|
|
{
|
|
{
|
|
|
$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));
|
|
|
|
|
|
|
|
$sqlCommesse = "SELECT DISTINCT origine, commessa, ordine_produzione, data_creazione, time_creazione, destinazione_merci FROM `distinte` WHERE consegna = '{$consegna}'";
|
|
$sqlCommesse = "SELECT DISTINCT origine, commessa, ordine_produzione, data_creazione, time_creazione, destinazione_merci FROM `distinte` WHERE consegna = '{$consegna}'";
|
|
|
$dataFields = $this->dbHandle->exec($sqlCommesse);
|
|
$dataFields = $this->dbHandle->exec($sqlCommesse);
|
|
|
|
|
+ if (count($dataFields)==0) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
$dataFields = array_shift($dataFields);
|
|
$dataFields = array_shift($dataFields);
|
|
|
|
|
|
|
|
$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;
|
|
|
}
|
|
}
|
|
@@ -163,9 +168,10 @@ EOF;
|
|
|
$devType = 79;
|
|
$devType = 79;
|
|
|
$dt = \F3::get("LABELS.TEMPLATES.DT{$devType}");
|
|
$dt = \F3::get("LABELS.TEMPLATES.DT{$devType}");
|
|
|
|
|
|
|
|
- $label->BlinkSpecial(0, 1, 1000, 2, 0);
|
|
|
|
|
$err = $findBoxCore->SaveProducts($barcode, $consegna, $dataFields);
|
|
$err = $findBoxCore->SaveProducts($barcode, $consegna, $dataFields);
|
|
|
$label->Display($dt[1], $barcode);
|
|
$label->Display($dt[1], $barcode);
|
|
|
|
|
+ $label->BlinkSpecial(0, 1, 1000, 2, 0);
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function SaveProductsForLabel7(string $barcode, string $consegna)
|
|
public function SaveProductsForLabel7(string $barcode, string $consegna)
|
|
@@ -181,18 +187,18 @@ 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 <= 22; $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;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$dataFields = array_merge($dataFields, $elenco);
|
|
$dataFields = array_merge($dataFields, $elenco);
|
|
|
$dataFields['end_operations'] = $consegna;
|
|
$dataFields['end_operations'] = $consegna;
|
|
|
- $err = $findBoxCore->SaveProducts($barcode, $consegna, $dataFields);
|
|
|
|
|
|
|
+ return $findBoxCore->SaveProducts($barcode, $barcode, $dataFields);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function ResetDistintaLabels(string $commessa, string $label7Id)
|
|
public function ResetDistintaLabels(string $commessa, string $label7Id)
|
|
@@ -203,7 +209,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'];
|