Example #1
0
 $i = 0;
 $var = true;
 if ($num == 0) {
     print '<tr><td colspan="4">' . $langs->trans("NoMatchFound") . '</td></tr>';
 }
 while ($i < $num) {
     $objp = $db->fetch_object($resql);
     if ($objp->rowid != $id) {
         // check if a product is not already a parent product of this one
         $prod_arbo = new Product($db);
         $prod_arbo->id = $objp->rowid;
         if ($prod_arbo->type == Product::TYPE_ASSEMBLYKIT || $prod_arbo->type == Product::TYPE_STOCKKIT) {
             $is_pere = 0;
             $prod_arbo->get_sousproduits_arbo();
             // associations sousproduits
             $prods_arbo = $prod_arbo->get_arbo_each_prod();
             if (count($prods_arbo) > 0) {
                 foreach ($prods_arbo as $key => $value) {
                     if ($value[1] == $id) {
                         $is_pere = 1;
                     }
                 }
             }
             if ($is_pere == 1) {
                 $i++;
                 continue;
             }
         }
         $var = !$var;
         print "\n<tr " . $bc[$var] . ">";
         $productstatic->id = $objp->rowid;
Example #2
0
                     if ($stock < $quantityToBeDelivered) {
                         print ' ' . img_warning($langs->trans("StockTooLow"));
                         // Stock too low for this $warehouse_id but you can change warehouse
                     }
                 }
             }
         } else {
             print $langs->trans("Service");
         }
         print '</td>';
     }
     print "</tr>\n";
     // Show subproducts of product
     if (!empty($conf->global->PRODUIT_SOUSPRODUITS) && $line->fk_product > 0) {
         $product->get_sousproduits_arbo();
         $prods_arbo = $product->get_arbo_each_prod($qtyProdCom);
         if (count($prods_arbo) > 0) {
             foreach ($prods_arbo as $key => $value) {
                 //print $value[0];
                 $img = '';
                 if ($value['stock'] < $value['stock_alert']) {
                     $img = img_warning($langs->trans("StockTooLow"));
                 }
                 print "<tr " . $bc[$var] . "><td>&nbsp; &nbsp; &nbsp; ->\n\t\t\t\t\t\t\t\t\t\t<a href=\"" . DOL_URL_ROOT . "/product/card.php?id=" . $value['id'] . "\">" . $value['fullpath'] . "\n\t\t\t\t\t\t\t\t\t\t</a> (" . $value['nb'] . ")</td><td align=\"center\"> " . $value['nb_total'] . "</td><td>&nbsp</td><td>&nbsp</td>\n\t\t\t\t\t\t\t\t\t\t<td align=\"center\">" . $value['stock'] . " " . $img . "</td></tr>";
             }
         }
     }
 } else {
     print '<td></td><td></td></tr>';
     // end line and start a new one for lot/serial
     $staticwarehouse = new Entrepot($db);