예제 #1
0
    $stock_available = $stock_database - $stock_on_and_bookedmanually;
    $stock_on_total = $stock_database + $stock_on_and_bookedbyrealorder;
    $matexp = $row['material_expenses'];
    $matexp_tot = $stock_on_total * $matexp;
    if ($row['bin_code'] != '') {
        $total_bins++;
    } else {
        $total_bins_unknown++;
    }
    $total_qty_stock += $stock_available;
    $total_qty_booked_m += $stock_on_and_bookedmanually;
    $total_qty_booked_r += $stock_on_and_bookedbyrealorder;
    $total_qty_total += $stock_on_total;
    $total_matexp_tot += $matexp_tot;
    $st = array();
    $st['bin'] = $class_bins->getCleanBinCode($row['bin_code']);
    $st['cat'] = $row['categories_name'];
    $st['ean'] = $row['products_ean'];
    $st['idl'] = $row['products_id'] . ($row['length'] > 0 ? ' (' . textLength($row['length'], false) . ')' : '');
    $st['mxs'] = displayCurrency('EUR', $matexp);
    $st['mxt'] = displayCurrency('EUR', $matexp_tot);
    $st['qty'] = number_format($stock_available);
    $st['bok 1'] = number_format($stock_on_and_bookedmanually);
    $st['bok 2'] = number_format($stock_on_and_bookedbyrealorder);
    $st['tot'] = number_format($stock_on_total);
    $st['act'] = ' ';
    $stocks_table[] = $st;
}
$total_products = count($products);
$total_articles = count($articles);
$title = 'Stock List of ' . $segment['name'];
예제 #2
0
 $total_clear = tep_db_num_rows($dbq);
 $clean_lists = '<fieldset id="clearance-lists" style="background:#fff;padding:20px 30px 30px 30px; width:600px;" class="ui-corner-all">';
 $clean_lists .= '<legend style="font-size:16px;font-weight:bold;">Results of "' . ($clearance_period == 30 ? 'Monthly' : ($clearance_period == 60 ? 'Monthly' : ($clearance_period == 90 ? 'Trimonthly' : 'Weekly'))) . ' Sold = 0" Clearance (' . $total_clear . ' articles)</legend>';
 $clean_lists .= '<h2 class="blue">Please do clearance on box and confirm actual stock below !</h2>';
 $clean_lists .= '<div style="margin:10px 0 10px 0;float:left;">';
 $table = array();
 $clean_picklists = array();
 $clean_picklists['d'] = 'Box Location';
 $clean_picklists['a'] = 'Product Info';
 $clean_picklists['s'] = 'Stock';
 $clean_picklists['q'] = 'Actual';
 $table[] = $clean_picklists;
 $total_qty_clear = 0;
 while ($row = tep_db_fetch_array($dbq)) {
     $ean = $class_ean->getEAN($row['products_id'], $row['articles_id']);
     $clean_picklists['d'] = '<a href="?open=bin-info&amp;id=' . $row['bins_id'] . '&amp;hidemenu=true" class="view_webpage" title="View Box">' . $class_bins->getCleanBinCode($row['code']) . '</a>';
     $pimg = webImage($row['products_image'], '80', '80', $label_text, 'img-border');
     $main_image = webImageSource($row['products_image'], '500');
     if ($main_image != '') {
         $pimg = '<a href="' . $main_image . '" class="view_image" title="' . $label_text . '">' . $pimg . '</a>';
     }
     $clean_picklists['a'] = $pimg . '<br/>' . '<a title="View Product Detail" href="?open=product-detail&amp;products_id=' . $row['products_id'] . '" target="_blank">' . $row['products_id'] . ' / ' . $row['products_model'] . '</a>';
     $clean_picklists['s'] = $row['stock'];
     $clean_picklists['q'] = '<input type="hidden" value="' . $row['bins_id'] . '" class="hidden-bins-id" />';
     $clean_picklists['q'] .= '<input type="hidden" class="qty-stock" value="' . $row['stock'] . '" />';
     $clean_picklists['q'] .= '<input id="qty-actual-' . $ean . '" class="qty-actual" type="text" maxlength="3" onfocus="$(this).select();" style="width:50px;text-align:center;" value="' . $row['stock'] . '" />';
     $total_qty_clear += $row['stock'];
     $table[] = $clean_picklists;
 }
 $clean_lists .= tep_draw_table('spo', $table);
 $clean_lists .= '<input id="btn-clear-confirm" type="button" value="Confirm" style="margin-top:10px;" class="button"/>';
 $firstorder = true;
 foreach ($clean_picklists as $bin_code => $data) {
     if ($ypos >= 260 || $order_counter >= $order_counter_max) {
         $pdf->AddPage();
         $ypos = $margin;
         $order_counter = 0;
     } else {
         if (!$firstorder) {
             $pdf->SetDrawColor(200, 200, 200);
             $pdf->Line($margin - 5, $ypos - 5, 210 - $margin, $ypos - 5);
         }
     }
     $order_counter++;
     $pdf->setXY($margin, $ypos);
     $pdf->setFont('Arial', 'B', '14');
     $pdf->cell($counter_size, 5, $class_bin->getCleanBinCode($data['code']), 0, 0, 'C');
     if ($data['products_ean'] != '') {
         $pdf->EANBarcode($data['products_ean'], $barcode_start, $ypos, $barcode_width);
     }
     $pdf->setFont('Arial', 'B', '12');
     //$pdf->cell($barcode_start+20, 40, $data['products_ean'], 0, 0, 'C');
     $pdf->setXY($cellstart, $ypos);
     $pdf->setFont('Arial', 'B', '10');
     $pdf->Cell($cell1size, $cell_height, 'PRODUCT ID');
     $pdf->Cell($cell1size, $cell_height, 'ARTICLE ID');
     $pdf->Cell($counter_size + 10, $cell_height, 'QTY');
     $pdf->Cell($counter_size, $cell_height, 'QTY ACTUAL', 0, 1);
     $pdf->setFont('Arial', '', '10');
     $pdf->setX($cellstart);
     $pdf->Cell($cell1size, $cell_height + 10, $data['products_id']);
     $pdf->Cell($cell1size, $cell_height + 10, $data['articles_id']);
 $fgl['pri'] = 'Lengths';
 $fgl['pri2'] = 'Stock<br />Available';
 $fgl['info'] = 'Bins';
 $fgl['info2'] = 'Selling Last<br />30 Days';
 $fglist[] = $fgl;
 foreach ($products as $pid => $p) {
     $info = "<div><strong>{$pid} / {$p['products_model']}</strong></div>";
     $info .= "<div>{$p['products_name']}</div>";
     $idhid = '<input type="hidden" name="products_id" value="' . $pid . '" />';
     $p_length = array();
     $p_stocks = array();
     $p_bins = array();
     foreach ($articles[$pid] as $aid => $a) {
         $length = $a['length'] > 0 ? textLength($a['length']) : '<span class="notice">None</span>';
         $stocks = $a['stock'] > 0 ? $a['stock'] : '<span class="notice">0</span>';
         $bins = $a['bin_code'] != '' ? $class_bin->getCleanBinCode($a['bin_code']) : '<span class="notice">-</span>';
         if ($aid == 0 && $a['length'] > 0) {
             $length = '<span class="bold">' . $length . ' [def]</span>';
             $stocks = '<span class="bold">' . $stocks . '</span>';
             $bins = '<span class="bold">' . $bins . '</span>';
         }
         $p_length[] = $length;
         $p_stocks[] = $stocks;
         $p_bins[] = '<a href="?open=bin-info&amp;id=' . $a['bins_id'] . '&amp;hidemenu=true" class="view_webpage">' . $bins . '</a>';
     }
     $fgl = array();
     $fgl['img'] = webImageWithDetailLinkStars($p['products_image'], IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1, "Product {$pid}", "", "", IMAGE_SIZE_BIG_1, IMAGE_SIZE_BIG_1, $p['stars'], '3', '', '', $p['products_brand_id']);
     $fgl['name'] = $idhid . $info;
     $fgl['pri'] = implode('<br />', $p_length);
     $fgl['pri2'] = implode('<br />', $p_stocks);
     $fgl['info'] = implode('<br />', $p_bins);