Browse Source

* Dimatec RC1

Giancarlo Voci 8 years ago
parent
commit
ac40995af1
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/Modules/Dimatec/MigrationData.php

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

@@ -281,7 +281,7 @@ EOF;
       $descArti = trim($row['descrizione']); // trim($row['commessa']) . ' ' . trim(substr($row['codcliente'], 7)) . ' ' . trim($row['descrizione']);
       $descArti = trim($row['descrizione']); // trim($row['commessa']) . ' ' . trim(substr($row['codcliente'], 7)) . ' ' . trim($row['descrizione']);
 
 
       // List Article
       // List Article
-      $this->soapAddArticle($row['barcode'], $row['qta_prelevare'], $descArti, 1);
+      $this->soapAddArticle($row['barcode'], $row['qta_prelevare'], $descArti, $row['color']);
     }
     }
 
 
     $this->finalXml = <<<EOF
     $this->finalXml = <<<EOF
@@ -331,12 +331,17 @@ EOF;
   {
   {
     global $f3;
     global $f3;
 
 
+    $colors = range(1, 10);
+
     $ret = [];
     $ret = [];
 
 
     $idUtente = $f3->get('USER')->id;
     $idUtente = $f3->get('USER')->id;
 
 
     $cols = array_column($uds, 'item_id');
     $cols = array_column($uds, 'item_id');
+
     foreach($dataRows as $count => $data) {
     foreach($dataRows as $count => $data) {
+      $color = array_shift($colors);
+      array_push($colors, $color);
       $container_id = '';
       $container_id = '';
       $colId = array_search(trim($data['MXARTI']), $cols);
       $colId = array_search(trim($data['MXARTI']), $cols);
       if ($colId !== false)
       if ($colId !== false)
@@ -352,6 +357,7 @@ EOF;
         'descrizione' => trim($data['MXDESC']),
         'descrizione' => trim($data['MXDESC']),
         'qta_prelevare' => $data['QTY'],
         'qta_prelevare' => $data['QTY'],
         'qta_mancante' => 0,
         'qta_mancante' => 0,
+        'color' => $color,
         'uds' => $container_id // posizione UDS
         'uds' => $container_id // posizione UDS
       ];
       ];
     }
     }