コード例 #1
0
$logger->write("Task 1 (CHECK PACKAGE SENT RECEIVE DATE) - Start");
/////////////////////////////////////
// CHECK PACKAGE SENT RECEIVE DATE //
/////////////////////////////////////
//SP PACKAGES
$counter = 0;
use_class('jng_sp_packages');
$class_jp = new jng_sp_packages();
use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
$packages = $class_jp->retrieveUnreceivedPackages();
foreach ($packages as $pid => $p) {
    $status_check = $p['package_type'] == 'R' ? array('18', '19', '20', '21') : array('8', '9');
    $items = $class_jp->getItems($pid);
    foreach ($items as $item_id) {
        $ih = $class_jo->retrieveItemHistory($item_id);
        foreach ($ih as $h) {
            if (in_array($h['status'], $status_check)) {
                $counter++;
                $class_jp->setReceiveDate($pid, $h['status_date']);
                break 2;
            }
        }
    }
}
$logger->write("- {$counter} SP Items Updated");
//JNG PACKAGES
$counter = 0;
use_class('minierp_packages');
$class_mp = new minierp_packages();
use_class('orders');
コード例 #2
0
<?php

use_class('jng_sp_orders');
$class_jo = new jng_sp_orders();
use_class('products_minierp');
$class_pm = new products_minierp();
$oi_id = tep_db_prepare_input($_GET['oi_id']);
$statusName = $class_jo->statusName();
$item = $class_jo->retrieveItemDetail($oi_id);
$product = $class_pm->retrieveDetail($item['products_id'], 'p');
$order = $class_jo->retrieveDetail($item['jng_sp_orders_id']);
$history = $class_jo->retrieveItemHistory($oi_id);
$history_prod = retrieveProductionHistory('SP', $oi_id);
$htable = array();
$ht = array();
$ht['sort'] = 'No';
$ht['date_add'] = 'Date';
$ht['status'] = 'Status';
//$ht['qty'] = 'Qty';
$ht['login'] = '******';
$htable[] = $ht;
$count = 0;
$total_history = count($history);
$prev_info = array();
foreach ($history as $hk => $h) {
    $count++;
    $timestamp = strtotime($h['status_date']);
    $ht = array();
    $ht['sort'] = $count;
    $ht['date_add'] = date('d.m.y H:i:s', $timestamp);
    $ht['status'] = $statusName[$h['status']];