Example #1
0
            */
            //Display 1 line All Quantity
            $pdf->total_ean_lines++;
            $pdf->setX($cellstart);
            $pdf->Cell($cell1size, $cell_height, $oi['products_ean']);
            $pdf->Cell($cell2size, $cell_height, $qty);
            $pdf->Cell($cell3size, $cell_height, $tbins_location, 0, 1);
        }
        $products_height = ($pdf->total_ean_lines + 1) * $cell_height;
        $pdf->ean_ypos += $products_height > 20 ? $products_height + 10 : 30;
        $firstorder = false;
    }
    global $class_jo, $class_o;
}
if ($atds) {
    use_class('production_target');
    $pt = new production_target();
    $timestamp = date('Y-m-d H:i:s');
    if ($total_products_picked > 0) {
        $pt->addDataToField($timestamp, 'log_products_picked_from_bin', $total_products_picked);
    }
    if (count($oi_printed_sp) > 0) {
        $class_jo->printCountAdd($oi_printed_sp);
    }
    if (count($oi_printed_jg) > 0) {
        $class_o->printCountAdd($oi_printed_jg);
    }
}
$filename = 'HH-Picklist-' . date('YmdHi');
$pdf->Output($filename . '.pdf', 'D');
tep_db_close();
Example #2
0
<?php

use_class('production_target');
$class_pt = new production_target();
$data = $class_pt->queryLatest();
$orders_in = $data[1];
$orders_out = $data[2];
$target_percent = number_format($data[3], 1) . '%';
$result = array();
$result['target_percent'] = $target_percent;
$result['orders_in'] = $orders_in;
$result['orders_out'] = $orders_out;
require_once(DIR_WS_FUNCTIONS.'html_output.php');
tep_db_connect();

$order_id = trim(tep_db_prepare_input($_GET['order_id']));
$sp_type =  trim(tep_db_prepare_input($_GET['sp_type']));
*
*/
//Initial Required Classes and Service Objects
use_class('Order');
use_class('Product');
use_class('bins');
use_class('depot_orders');
use_class('production_target');
$class_bin = new bins();
$class_do = new depot_orders();
$pt = new production_target();
//CONFIGURATION
//only depot orders in this status will be considered for closing
//outsourcing orders can also be accepted from Outsourced (sahat - 12.09.2014)
if (!SERVER_IS_LOCAL) {
    $REQUIRED_STATUS = '7';
} else {
    $REQUIRED_STATUS = '2';
}
//DATA SUBMITTED BY MC
//barcode entry (ean / outsourcing order barcode)
$ean = tep_db_prepare_input($_POST['ean']);
//total qty (MC always send 1, but will be override later for outsourcing order)
$quantity = tep_db_prepare_input($_POST['quantity']);
//segments id for stock update and depot orders search
$segments_id = tep_db_prepare_input($_POST['segments_id']);
 function createPDF($ignoreStockStatusDepot = false, $output = 'D', $add_to_daily_statistic = false, $print_per_orders = true)
 {
     /*
         OUTPUT : D -> WILL PRODUCE ONE PDF FOR ALL ORDERS WITH ITEMS IN IT
         OUTPUT : F -> WILL PRODUCE MULTI PDF PER ORDER ITEMS
     */
     global $class_jo, $class_o, $class_do;
     $pi_printed_jg = array();
     $pi_printed_sp = array();
     $pi_printed_dp = array();
     if ($output == 'D') {
         //PRODUCE SINGLE PDF FILE
         $pdf = new PDF('P', 'mm', 'A4');
         $pdf->setTitle('Production Instruction');
         $pdf->SetAuthor('JULIE GRACE / Bonofactum');
         $pdf->SetCreator('k-Auto Generated PDF');
         $pdf->SetDisplayMode('real');
         $pdf->SetAutoPageBreak(false);
         $pdf->AliasNbPages();
         $pdf->SetFillColor(191, 191, 191);
     }
     $item_printed = 0;
     $oiid_last_printed = '';
     /* Moved this on function constructPIContent and replace using below $print_per_orders, 
      * so eventhough we use $output='F' we still could create pi which consists of collection of orders */
     //foreach($this->orders as $order) {
     //    $o = $order['detail'];
     //    foreach($order['items'] as $oiid=>$i) {
     //        if($i['status']<8) $this->pi_printed[strtolower($o['type'])][] = $oiid;
     //        //if($i['status']<8) ${'pi_printed_'.strtolower($o['type'])}[] = $oiid;
     //        $this->constructPIContent($pdf, $output, $order, $oiid, $ignoreStockStatusDepot, $print_per_orders);
     //        $item_printed++;
     //        $oiid_last_printed = $oiid;
     //    }
     //}
     if ($print_per_orders) {
         foreach ($this->orders as $order) {
             $this->constructPIContent($pdf, $output, $order, $ignoreStockStatusDepot, true);
             $item_printed++;
         }
     } else {
         $this->constructPIContent($pdf, $output, $this->orders, $ignoreStockStatusDepot, false);
     }
     #PI Print Counter
     if (count($this->pi_printed['sp']) > 0) {
         $class_jo->printCountAdd($this->pi_printed['sp']);
     }
     if (count($this->pi_printed['jg']) > 0) {
         $class_o->printCountAdd($this->pi_printed['jg']);
     }
     if (count($this->pi_printed['dp']) > 0) {
         $class_do->printCountAdd($this->pi_printed['dp']);
     }
     /* D: Download; F: Save File on Server */
     if ($output == 'D') {
         $infix = '';
         //$infix = count($this->orders)>1 ? '' : strtoupper($o['type']).'O'.$o['id'].'-';
         //if($item_printed==1) $infix = strtoupper($o['type']).'-'.$oiid_last_printed.'-';
         if ($item_printed == 1) {
             $infix = array_keys($this->orders);
             $infix = $infix[0] . '-';
         }
         $filename = 'PI-' . $infix . date('YmdHi');
         $pdf->Output($filename . '.pdf', $output);
         //$pdf->Output($filename.'.pdf','D');
     }
     if ($add_to_daily_statistic) {
         $pt = new production_target();
         $timestamp = date('Y-m-d H:i:s');
         if ($this->qty_total_first_printed > 0) {
             $pt->addDataToField($timestamp, 'start', $this->qty_total_first_printed);
         }
     }
 }
Example #5
0
 function productionTargetOut($timestamp, $item)
 {
     if (!is_null($item['prod_target_in']) && is_null($item['prod_target_out'])) {
         if (strtotime($timestamp) < strtotime($item['prod_target_in'])) {
             $timestamp = $item['prod_target_in'];
         }
         tep_db_query("UPDATE orders_products SET prod_target_out=DATE('{$timestamp}') WHERE orders_products_id={$item['orders_products_id']}");
         use_class('production_target');
         $class_pt = new production_target();
         $class_pt->addOut($item['prod_target_in'], $timestamp, $item['products_quantity']);
     }
 }