function processXMLFile($xml_file)
{
    global $timestamp, $logger;
    $xmlt = new xml_tools();
    $xml = $xmlt->loadFile($xml_file);
    $order_date = $timestamp;
    $segments_id = (int) $xml->LOCAL_INFO->SEGMENT_ID;
    $group_name = (string) $xml->LOCAL_INFO->GROUP_NAME;
    $refill_orders = $xml->REFILL_ORDERS->ORDER;
    $counter = 0;
    foreach ($refill_orders as $ro) {
        $products_id = (int) $ro->PRODUCTS_ID;
        $articles_id = (int) $ro->ARTICLES_ID;
        $products_ean = $ro->PRODUCTS_EAN;
        $quantity = (int) $ro->QUANTITY;
        $trans_type = (string) (strtoupper($ro->TRANS_TYPE) == 'NULL' ? '' : $ro->TRANS_TYPE);
        $trans_id = (int) $ro->TRANS_ID;
        //CREATE DEPOT ORDERS
        $q_check = "SELECT depot_orders_id FROM depot_orders " . " WHERE segments_id = {$segments_id}" . " AND trans_type = '' AND trans_id = {$trans_id}";
        $r_check = tep_db_query($q_check);
        //ONLY CREATE ORDER WHICH NOT IMPORTED
        if (tep_db_num_rows($r_check) == 0) {
            $class_do = new depot_orders();
            $class_do->newOrder($segments_id, $products_id, $articles_id, $products_ean, $quantity, $order_date, $trans_type, $trans_id, $group_name);
            $counter++;
        }
    }
    $logger->write("{$counter} orders imported");
    unlink($xml_file);
    $logger->write("xml deleted");
    return $counter;
}
<?php

use_class('Product');
use_class('bins');
use_class('depot_orders');
use_class('styles');
Product::loadDIOHsettings();
$class_bins = new bins();
$class_do = new depot_orders();
$class_s = new styles();
$segments_id = SEGMENT_ID_DEFAULT;
$whid_depot = WAREHOUSE_ID_FOR_HANDLING_ORDERS;
$min_status_orders = '8';
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SEARCHFILTER') {
        //var_dump($_POST);
        set_time_limit(0);
        $maxproducts = 100;
        $filter_diohge = null;
        $filter_diohle = null;
        $filter_dioh2ge = null;
        $filter_dioh2le = null;
        $filter_refill = null;
        $filter_missing = null;
        $filter_stockhealth = null;
        $filter_stockrefillhealth = null;
        $filter_missing_al = null;
        $filter_overstocking_al_ge = null;
        $filter_overstocking_al_le = null;
        $filter_stock_vs_stal = null;
        $filter_stockrefill_vs_stal = null;
<?php

/**
 * Automatically order depot refill for products offered (active) in Zalando
 *
 * @author IT TEAM BONOFACTUM
 * @created Jul 19, 2013 4:54:57 PM
 */
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('depot_orders');
$class_do = new depot_orders();
$class_do->queryZalandoNeedRefill(true);
echo 'Done!';
tep_db_close();
Exemplo n.º 4
0
set_time_limit(0);
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
tep_db_connect();
use_class('logger');
$logger = new logger('cron', 'depot-refill');
//$logger->write('SIMULATION');
//Include Required Classes (and create object when necessary)
use_class('Product');
use_class('products_minierp');
use_class('depot_orders');
use_class('styles');
$class_pm = new products_minierp();
$class_do = new depot_orders();
$class_s = new styles();
$whid = WAREHOUSE_ID_FOR_HANDLING_ORDERS;
$segment_id = SEGMENT_ID_DEFAULT;
//Grab all data that can be retrieved collectively for the whole products
//stock from below function already exclude active booking
$products_stock = $class_pm->stockRetrieveAll($whid, '', true);
//Grab all required Settings
Product::loadDIOHsettings();
//For now we can not run auto cancel in Manobo Local due to the
//sync issues of Depot Orders with Manobo Central
if (!SERVER_IS_LOCAL) {
    //query all auto refill orders currently open
    //and can still be canceled(grouped by article)
    $logger->write('1) AUTO CANCEL');
    $logger->write('Query orders which can still be canceled:');
 * List for excel needed of Levelling Orders generated via Products Analysis
 * @author IT TEAM BONOFACTUM
 * @created Jul 21, 2014 11:53:29 AM 
 */
set_time_limit(0);
ini_set('memory_limit', '512M');
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('depot_orders');
use_class('forecasting');
use_class('Product');
$class_do = new depot_orders();
$segments_id = tep_db_prepare_input($_POST['segmentid']);
$keywords = tep_db_prepare_input($_POST['pids']);
$fc_year = date('Y');
$current_month = date('m');
$fc = new forecasting($fc_year);
$fc->calcForecastLevelling();
$target_is_overlap = $fc->isLevellingTargetOverlap();
$list = $class_do->recommendationList($segments_id, $keywords);
$header = array();
$header['a'] = 'No';
$header['b'] = 'Image';
$header['c'] = 'Info';
$header['d'] = 'Size';
$header['e'] = 'EAN';
$header['f'] = 'L30D Sold No Promo';
<?php

use_class('Product');
use_class('depot_orders');
use_class('products_ean');
use_class('elements_suppliers');
$class_do = new depot_orders();
$class_ean = new products_ean();
//PAGE OPTIONS
//if (isset($_POST['segments_id']))
//SUBMIT ACTION
if (isset($_POST['me_action']) && $_POST['me_action'] != '') {
    if ($_POST['me_action'] == 'LOADOUTSOURCELATESTPRICES') {
        $products_id = tep_db_prepare_input($_POST['products_id']);
        $articles_id = tep_db_prepare_input($_POST['articles_id']);
        $price = $class_do->getOutsourceLatestPrice($products_id, $articles_id);
        ajaxReturn($price);
        exit;
    } elseif ($_POST['me_action'] == "CREATEOUTSOURCINGORDER") {
        $segments_id = tep_db_prepare_input($_POST['segments_id']);
        $products_id = tep_db_prepare_input($_POST['params']['pid']);
        $articles_id = tep_db_prepare_input($_POST['params']['aid']);
        $products_ean = tep_db_prepare_input($_POST['params']['ean']);
        $qty_full = tep_db_prepare_input($_POST['params']['qty_full']);
        $qty_batch = tep_db_prepare_input($_POST['params']['qty_batch']);
        $suppliers_id = tep_db_prepare_input($_POST['params']['suppliers_id']);
        $price = tep_db_prepare_input($_POST['params']['price']);
        //handle when user use comma as decimal separator in price
        $price = str_replace(',', '.', $price);
        $price_cur = tep_db_prepare_input($_POST['params']['price_cur']);
        $total_qty_ordered = 0;
Exemplo n.º 7
0
 /**
  * Get total refill quantity of an article which currently still open
  * @param Int $articles_id
  * @return Int
  */
 public function getRefillQuantity($articles_id)
 {
     use_class('depot_orders');
     $class_do = new depot_orders();
     return $class_do->refillOpenOrdersQuantity(SEGMENT_ID_DEFAULT, $this->id, $articles_id);
 }
Exemplo n.º 8
0
 $type = $r['type'];
 $oid = $r['orders_id'];
 $oiid = $r['items_id'];
 $sp_id = $r['sp_id'];
 $is_prioritized = $r['priority'] == 1 || checkCustomerIsVIP($type, $oid) || in_array($sp_id, $sp_using_red_paper) || in_array($brand_id, $brand_using_red_paper);
 $key = "{$type}|{$oiid}";
 $ok_print = false;
 if ($type == 'SP' || $type == 'JG') {
     /*Disabled this, since all orders that goes to ready will directly printed
       //ignore printing pdf for this order if there item that still on cancel request. 
       $ok_print = (!orderItemHaveStatus($oid, 10, $type));
        */
     $ok_print = true;
 } elseif ($type == 'DP') {
     use_class('depot_orders');
     $class_do = new depot_orders();
     $do = $class_do->retrieveDetail($oid);
     if ($do['trans_type'] == 'SP') {
         use_class('jng_sp_orders');
         $class_jo = new jng_sp_orders();
         $oiid = $do['trans_id'];
         $i = $class_jo->retrieveItemDetail($oiid);
         $oid = $i['jng_sp_orders_id'];
         $o = $class_jo->retrieveDetail($oid);
         $sp_id = "{$o['jng_sp_id']}";
     } elseif ($do['trans_type'] == 'JG') {
         $sp_id = '0';
     }
     $is_prioritized = $do['trans_type'] == 'AR' && $do['trans_id'] == depot_orders::AUTO_REFILL_ID_ZALANDO || $is_prioritized || in_array($sp_id, $sp_using_red_paper);
     $ok_print = true;
 }
Exemplo n.º 9
0
     $order_id = tep_db_prepare_input($_POST['op_id']);
     $update_status = tep_db_prepare_input($_POST['update_status']);
     if ($update_status === 'ISSUE') {
         $issue_text = tep_db_prepare_input($_POST['text']);
     }
     $sda = array();
     $sda['status'] = $order_late_status;
     if ($update_status === 'ISSUE') {
         $sda['issue'] = $issue_text;
     }
     tep_db_perform('orders_late', $sda, 'update', "order_items_id={$order_id}");
     exit;
 } elseif ($_POST['me_action'] == 'LOADORDERSLATE') {
     $reloadlist = true;
     use_class('depot_orders');
     $class_do = new depot_orders();
     $orders_late_status = array();
     $orders_late_status['U'] = 'Unhandled';
     $orders_late_status['H'] = 'Handled';
     $orders_late_status['O'] = 'OK';
     $orders_late_status['1'] = 'Closed';
     $orders_late_status_filter = array();
     $orders_late_status_filter['S'] = 'Show All';
     $orders_late_status_filter['U'] = 'Unhandled';
     $orders_late_status_filter['H'] = 'Handled';
     $orders_late_status_filter['O'] = 'OK';
     //$orders_late_status_filter['1'] = 'Closed';
     $filter_date = tep_db_prepare_input($_POST['filter_date']);
     $filter_status = tep_db_prepare_input($_POST['filter_status']);
     $date_id_userformat = $filter_date;
     if ($filter_date == '') {
Exemplo n.º 10
0
 public function setAsConfirmed()
 {
     //WE DISABLE THE ELEMENTS SOURCING INTEGRATION HERE AND WILL BE IMPLEMENT IN A NEW MODULE TO DIRECTLY CREATE A PO
     global $session_userinfo;
     use_class('stock_booking');
     use_class('depot_orders');
     use_class('products_minierp');
     use_class('elements_preorder');
     $class_pm = new products_minierp();
     $class_do = new depot_orders();
     $depot_orders_id = array();
     $booking = new stock_booking();
     $booking->create('Preorder: ' . $this->name);
     foreach ($this->items as $i) {
         $stock = $class_pm->stockRetrieveDetail(WAREHOUSE_ID_PRODUCTS_HAMBURG, $i['products_id'], $i['articles_id']);
         $booking->addItem($stock['products_stock_id'], $i['qty_booked']);
         for ($q = 1; $q <= $i['qty_preproduce']; $q++) {
             $depot_orders_id[] = $class_do->newOrder(SEGMENT_ID_HAMBURG, $i['products_id'], $i['articles_id'], $i['products_ean'], 1);
         }
     }
     $elements_sourcing = $this->getElementsNeededForOnDemand();
     //        foreach($elements_sourcing as $eid=>$qty) {
     //            $epo = new elements_preorder($eid);
     //            $epo->addOrder($qty, null, 'Preorder '.$this->id);
     //        }
     $this->updateConnection($booking->id, $depot_orders_id, $elements_sourcing);
     $this->updateStatus($this->status, 2, $session_userinfo['username']);
 }
<?php

use_class('Product');
use_class('depot_orders');
$class_do = new depot_orders();
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADOVERVIEW') {
        $pids = explode(',', $_POST['pids']);
        $year = date('Y');
        $month_now = date('n');
        $months = array();
        for ($m = 1; $m <= 12; $m++) {
            $mp = str_pad($m, 2, '0', STR_PAD_LEFT);
            $months[$mp] = date('M-y', strtotime("{$year}-{$mp}-01"));
        }
        $fc = new forecasting($year);
        $fc->calcForecastLevelling();
        $sales_real = array();
        $sales_forecast = array();
        $levelling_split = array();
        $levelling_orders_real = array();
        $levelling_orders_real_out = array();
        $levelling_orders_real_ptb = array();
        $levelling_orders_real_out_open = array();
        $levelling_orders_forecast = array();
        $levelling_target_forecast = array();
        $no_values = '<span class="notice">-</span>';
        //set default value per month
        foreach ($months as $mp => $mtext) {
            $mp_value = intval($mp);
            $sales_real[$mp] = 0;
<?php

use_class('Order');
use_class('orders');
use_class('jng_sp_orders');
use_class('depot_orders');
use_class('products_minierp');
use_class('products_articles');
use_class('products_ean');
$class_o = new orders();
$class_do = new depot_orders();
$class_jo = new jng_sp_orders();
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_ean = new products_ean();
$source = strtoupper(tep_db_prepare_input($_GET['source']));
$order_id = tep_db_prepare_input($_GET['id']);
if (!isset($_GET['id']) && isset($_GET['item_id']) && $_GET['item_id'] != '') {
    $item_id = tep_db_prepare_input($_GET['item_id']);
    if ($source == Order::ORDER_TYPE_JULIE_GRACE) {
        $item = $class_o->retrieveProductDetail($item_id);
        $order_id = $item['orders_id'];
    } elseif ($source == Order::ORDER_TYPE_SALES_PARTNER) {
        $item = $class_jo->retrieveItemDetail($item_id);
        $order_id = $item['jng_sp_orders_id'];
    }
}
if ($order_id == '' || $order_id == 'undefined') {
    $content .= '<h2 class="red">Manobo can not find related order for this customer</h2>';
    $title .= 'No Order';
} else {
Exemplo n.º 13
0
<?php

use_class('depot_orders');
use_class('products_minierp');
use_class('products_articles');
use_class('minierp_customers');
use_class('products_ean');
use_class('jng_sp_orders');
use_class('jng_sp_customers');
use_class('jng_sp');
use_class('orders');
$class_do = new depot_orders();
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_mc = new minierp_customers();
$class_jo = new jng_sp_orders();
$class_jc = new jng_sp_customers();
$class_sp = new jng_sp();
$class_o = new orders();
$sp_list_raw = $class_sp->retrieveList();
$sp_list = array();
foreach ($sp_list_raw as $sp) {
    $sp_list[$sp['jng_sp_id']] = $sp;
}
function getTotalOrderAmount($type, $order_id, $currency = 'EUR')
{
    $type = strtoupper($type);
    if ($type == 'J') {
        global $class_o;
        $orders_total = $class_o->retrieveTotals($order_id);
        $total_price = $orders_total['ot_total']['value'];
Exemplo n.º 14
0
 public function renderRow($order_type, $orders_items_id, $template_row = self::ROW_TEMPLATE_DEFAULT, $is_order_first_row = false)
 {
     use_class('Product');
     $order_item_data = $this->retrieveOrdersItemsDetail($order_type, $orders_items_id);
     $row_data = array();
     //SET GENERAL VARS VALUES
     $products_id = $order_item_data['products_id'];
     $articles_id = $order_item_data['products_articles_id'];
     $obj_product = new Product($products_id);
     $product_image = $obj_product->displayImage(80, 80);
     $product_image_thumbid = "{$products_id}-{$articles_id}";
     $article_no_link = '?open=product-detail&amp;products_id=' . $products_id;
     switch ($this->filters_status) {
         case '1':
             $is_sp = $order_type == self::ORDER_TYPE_SP;
             $is_prepayment = strtoupper($order_item_data['payment_method']) == strtoupper(PAYMENT_METHOD_BANK_TRANSFER) || strtoupper($order_item_data['payment_method']) == strtoupper(PAYMENT_METHOD_PREPAYMENT);
             $is_unpaid_prepayment = $is_prepayment && !conditionPrepaymentIsPaid($order_item_data, $is_sp);
             break;
     }
     if ($order_type == self::ORDER_TYPE_SP) {
         use_class('products_minierp');
         $class_pm = new products_minierp();
         //self::ROW_DATA_LEADTIME_OR_DATE
         $order_date = $order_item_data['order_date'];
         //self::ROW_DATA_CYCLETIME DATA
         $previous_status_date = $this->filters_status == 4 ? $order_item_data['status_date_prod'] : $order_item_data['status_date'];
         //self::ROW_DATA_CUSTOMER_OR_ORDER_NO DATA
         $order_id = $order_item_data['order_id'];
         $orders_number = $order_item_data['order_id'];
         $order_no_link = '?open=customer-care-order-detail&amp;source=SP&amp;id=' . $order_item_data['jng_sp_orders_id'] . '&amp;hidemenu=true';
         $customer_name = $order_item_data['customer_name'];
         $cust_link = '?open=sp-customer&amp;id=' . $order_item_data['jng_sp_customers_id'] . '&amp;hidemenu=true';
         $cust_name = '<a href="' . $cust_link . '" class="view_webpage" >' . $customer_name . '</a>';
         //self::ROW_DATA_ORDER_ID DATA
         $source_name = $order_item_data['package_prefix'];
         $barcode_id = strtoupper(self::ORDER_TYPE_SP) . '-' . $order_item_data['jng_sp_orders_items_id'];
         $barcode_id_link = '?open=sp-order-history&amp;oi_id=' . $order_item_data['jng_sp_orders_items_id'] . '&amp;hidemenu=true';
         $crown_link = '?open=sp-customers-special-detail&amp;id=' . $order_item_data['jng_sp_customers_id'] . '&amp;hidemenu=true';
         //self::ROW_DATA_ARTICLE_NO DATA
         $product_image_thumbid .= "-{$order_item_data['jng_sp_id']}";
         $article_no = $order_item_data['article_number'];
         //self::ROW_DATA_PRICE DATA
         $products_price = $order_item_data['price'];
         //self::ROW_DATA_QUANTITY DATA
         $order_quantity = $order_item_data['order_quantity'];
         //self::ROW_DATA_MARGIN DATA
         $mat_exp = $order_item_data['material_expenses'] > 0 ? $order_item_data['material_expenses'] : $order_item_data['current_mat_exp'];
         $product_margin = number_format($class_pm->calculateMargin($order_item_data['price'], $mat_exp), 1) . '%';
         $product_margin = '<span class="' . ($class_pm->priceMargindIsGood($order_item_data['price'], $product_margin) ? 'green' : 'red') . '">' . $product_margin . '</span>';
         //self::ROW_DATA_ACTION DATA
         //Tab Unpaid Prepayment
         if ($this->filters_status == 1 && $this->filters_sub_status == '0') {
             if ($order_item_data['jng_sp_id'] == '8') {
                 $action = '<span class="green">Waiting Payment Status</span>';
             } else {
                 if ($order_item_data['last_sent_date'] == '') {
                     $action = '<span class="green">Reminder Not Sent</span>';
                 } else {
                     $overtime = strtotime($order_item_data['last_sent_date']) < strtotime('-' . PAYMENT_METHOD_BANK_TRANSFER_OVERDUE);
                     if ($order_item_data['sent_count'] > 1) {
                         $action = '<span class="red">Cancel Notification Sent</span>';
                     } else {
                         $action = '<span class="blue">Reminder Sent</span>';
                     }
                 }
             }
         }
     } elseif ($order_type == self::ORDER_TYPE_JG) {
         //self::ROW_DATA_LEADTIME_OR_DATE
         $order_date = $order_item_data['date_purchased'];
         //self::ROW_DATA_CYCLETIME DATA
         $previous_status_date = $this->filters_status == 4 ? $order_item_data['status_date_prod'] : $order_item_data['status_date'];
         //self::ROW_DATA_CUSTOMER_OR_ORDER_NO DATA
         $order_id = $order_item_data['orders_no'];
         $orders_number = $order_item_data['orders_no'];
         $order_no_link = '?open=customer-care-order-detail&amp;source=JG&amp;id=' . $order_item_data['orders_id'] . '&amp;hidemenu=true';
         $customer_name = $order_item_data['customers_name'];
         $cust_link = '?open=customer&amp;id=' . $order_item_data['customers_id'] . '&amp;hidemenu=true';
         $cust_name = '<a href="' . $cust_link . '" class="view_webpage" >' . $customer_name . '</a>';
         //self::ROW_DATA_ORDER_ID DATA
         $source_name = 'J&G';
         $barcode_id = strtoupper(self::ORDER_TYPE_JG) . '-' . $order_item_data['orders_products_id'];
         $barcode_id_link = '?open=sp-order-history&amp;opid=' . $order_item_data['orders_products_id'] . '&amp;hidemenu=true';
         $crown_link = '?open=customers-special-detail&amp;id=' . $order_item_data['customers_id'] . '&amp;hidemenu=true';
         //self::ROW_DATA_ARTICLE_NO DATA
         $article_no = $order_item_data['products_model'] . ($order_item_data['products_length'] > 0 ? '_' . textLength($order_item_data['products_length'], false) : '');
         //self::ROW_DATA_PRICE DATA
         $products_price = $order_item_data['final_price'];
         //self::ROW_DATA_QUANTITY DATA
         $order_quantity = $order_item_data['products_quantity'];
         //self::ROW_DATA_MARGIN DATA
         $product_margin = '';
         //self::ROW_DATA_ACTION DATA
         //Tab Unpaid Prepayment
         if ($this->filters_status == 1 && $this->filters_sub_status == '0') {
             if ($order_item_data['last_sent_date'] == '') {
                 $action = '<span class="green">Reminder Not Sent</span>';
             } else {
                 $overtime = strtotime($order_item_data['last_sent_date']) < strtotime('-' . PAYMENT_METHOD_BANK_TRANSFER_OVERDUE);
                 if ($order_item_data['sent_count'] > 1) {
                     $action = '<span class="red">Cancel Notification Sent</span>';
                 } else {
                     $action = '<span class="blue">Reminder Sent</span>';
                 }
             }
         }
     } else {
         use_class('depot_orders');
         $class_do = new depot_orders();
         //self::ROW_DATA_LEADTIME_OR_DATE
         $order_date = $order_item_data['order_date'];
         //self::ROW_DATA_CYCLETIME DATA
         $previous_status_date = $this->filters_status == 4 ? $order_item_data['status_date_prod'] : $order_item_data['update_time'];
         //self::ROW_DATA_CUSTOMER_OR_ORDER_NO DATA
         $order_id = '';
         $customer_name = $order_item_data['customer_name'];
         $depot_orders_info = $class_do->translateOrderSource($order_item_data['trans_type'], $order_item_data['trans_id'], true, null, $products_id);
         $cust_name = $customer_name;
         if ($depot_orders_info != '') {
             $cust_name = $cust_name . ($cust_name != '' ? " <br/>{$depot_orders_info}" : $depot_orders_info);
             if ($order_item_data['group_name'] != '') {
                 $cust_name .= ': ' . $order_item_data['group_name'];
             }
         }
         //self::ROW_DATA_ORDER_ID DATA
         $source_name = 'DP';
         $barcode_id = strtoupper(self::ORDER_TYPE_DP) . '-' . $order_item_data['depot_orders_id'];
         $barcode_id_link = '?open=depot-order&amp;id=' . $order_item_data['depot_orders_id'] . '&amp;hidemenu=true';
         //self::ROW_DATA_ARTICLE_NO DATA
         $article_no = $order_item_data['article_number'];
         //self::ROW_DATA_PRICE DATA
         $products_price = $order_item_data['price'];
         //self::ROW_DATA_QUANTITY DATA
         $order_quantity = $order_item_data['quantity'];
         //self::ROW_DATA_MARGIN DATA
         $product_margin = '';
     }
     //FIRST ROW OF ORDER
     if ($is_order_first_row) {
         $crown_img_col = array('V' => 'vip', 'B' => 'black');
         if ($order_item_data['list_type'] != '' && array_key_exists($order_item_data['list_type'], $crown_img_col)) {
             $crown_img_title = array('V' => 'VIP Customer', 'B' => 'Blacklist Customer');
             $crown_img = '<a href="' . $crown_link . '" class="view_webpage">';
             $crown_img .= '<img src="images/list-' . $crown_img_col[$order_item_data['list_type']] . '.gif" title="' . $crown_img_title[$order_item_data['list_type']] . '" />';
             $crown_img .= '</a> ';
             $cust_crown = $crown_img;
         } else {
             $cust_crown = '';
         }
         $cust_order_count = ' <sup>' . $order_item_data['customers_order_count'] . '</sup>';
         if ($orders_number == '' || is_null($orders_number)) {
             $order_no = '';
         } else {
             $order_no = '<br /><small>order no:</small>&nbsp;&nbsp;<a href="' . $order_no_link . '" class="view_webpage">' . $order_id . '</a>';
         }
         $row_data[self::ROW_DATA_CUSTOMER_OR_ORDER_NO] = $cust_crown . $cust_name . $cust_order_count . $order_no;
         $row_data[self::ROW_DATA_SOURCE] = strtoupper($source_name);
     }
     $row_data[self::ROW_DATA_LEADTIME_OR_DATE] = $is_unpaid_prepayment || $this->filters_status > 9 ? date('d-M-y', strtotime($order_date)) : displayLeadTime($order_item_data['leadtime_start_date'], strtotime($order_item_data['leadtime_start_date']));
     if ($this->filters_status == 1 && $order_item_data['update_time'] == '') {
         $order_item_data['update_time'] = $order_item_data['leadtime_start_date'];
     }
     $row_data[self::ROW_DATA_CYCLETIME] = displayCycleTime($previous_status_date);
     $row_data[self::ROW_DATA_ORDER_ID] = '<a href="' . $barcode_id_link . '" class="view_webpage">' . $barcode_id . '</a>' . ($order_item_data['order_item_total'] > 1 ? ' <sup>' . $order_item_data['order_item_count'] . '/' . $order_item_data['order_item_total'] . '</sup>' : '');
     $row_data[self::ROW_DATA_ARTICLE_NO] = '<div class="thumb" thumbid="' . $product_image_thumbid . '">' . '<span>' . $product_image . '</span></div>' . '<div><a href="' . $article_no_link . '" target="_blank&amp;hidemenu=true" title="View Product Detail" ' . 'class="view_webpage">' . $article_no . '</a></div>';
     $row_data[self::ROW_DATA_PRICE] = number_format($products_price, 2);
     $order_quantity = intval($order_quantity);
     $row_data[self::ROW_DATA_QUANTITY] = $order_quantity;
     $row_data[self::ROW_DATA_MARGIN] = $product_margin;
     $el_link = '<a href="?open=products-elements-stock&amp;products_id=' . $products_id . '&amp;paid=' . $articles_id . '&amp;qty=' . $order_quantity . '&amp;status=' . $order_item_data['stock_status'] . '&amp;hidemenu=true" class="view_webpage"></a>';
     $pr_link = '<a href="javascript:void();" onclick="alert(\'Please use Finish Good Stock\');"></a>';
     $dp_link = '<a href="javascript:void();" onclick="alert(\'Please use Depot Stock\');"></a>';
     if ($this->filters_show_stock_status) {
         switch ($order_item_data['stock_status']) {
             case '0':
                 $stock_status = '<strong class="red">!</strong>';
                 if ($this->filters_status == 8 && ($order_type == self::ORDER_TYPE_SP || $order_type == self::ORDER_TYPE_JG)) {
                     $do_status = $order_item_data['depot_orders_status'] == '4' && isset($order_item_data['depot_orders_prod_status']) && $order_item_data['depot_orders_prod_status'] != '' ? statusNameProduction($order_item_data['depot_orders_prod_status'], false, true) : statusNameShort($order_item_data['depot_orders_status']);
                     if (!is_array($do_status)) {
                         $stock_status = '<a href="?open=depot-order&amp;id=' . $order_item_data['depot_orders_id'] . '&amp;hidemenu=true" ' . 'title="MMO product, current status is ' . $do_status . '" class="red view_webpage">' . $do_status . '</a>';
                     }
                 }
                 break;
             case 'R':
                 $stock_status = $el_link . '<abbr title="Element Stock OK, Ready for Production" class="green">OK</abbr>';
                 break;
             case 'S':
                 $stock_status = $el_link . '<abbr title="Element Stock Need Sourcing" class="red">NS</abbr>';
                 break;
             case 'P':
                 $stock_status = $pr_link . '<abbr title="Use Finished Goods Stock" class="green">FG</abbr>';
                 break;
             case 'D':
                 if (is_null($order_item_data['depot_orders_id'])) {
                     $stock_status = $dp_link . '<abbr title="Use Depot Stock" class="green">DS</abbr>';
                 } else {
                     $stock_status = '<a href="?open=depot-order&amp;id=' . $order_item_data['depot_orders_id'] . '&amp;hidemenu=true" class="green view_webpage">DS</a>';
                 }
                 break;
             case 'W':
                 $stock_status = $el_link . '<abbr title="Product is using Wholesale Element" class="red">WP</abbr>';
                 break;
             default:
                 $stock_status = '<strong class="red">?</strong>';
         }
         $row_data[self::ROW_DATA_STOCK] = $stock_status;
     }
     if ($this->filters_status == 3) {
         $row_data[self::ROW_DATA_PRINTED] = $order_item_data['print_count'] > 0 ? '<img title="Printed ' . $order_item_data['print_count'] . ' time(s)" src="images/icon-tick.png">' : '<img title="Not yet printed" src="images/icon-tick-dis.png">';
         $row_data[self::ROW_DATA_SCANNED] = $order_item_data['print_confirmed'] > 0 ? '<img title="Scanned ' . $order_item_data['print_confirmed'] . ' time(s)" src="images/icon-tick.png">' : '<img title="Not yet scanned" src="images/icon-tick-dis.png">';
     }
     //TODO: DEFINE ACTION BUTTON BASED ON SELECTED TAB
     $row_data[self::ROW_DATA_ACTION] = $action;
     if ($this->filters_status == 4 && in_array($this->filters_sub_status[0], $this->PROD_SUBSTATUS_USE_LINE)) {
         $row_data[self::ROW_DATA_STATUS] = strtoupper(statusNameProduction($order_item_data['prod_status'], true));
     }
     //FILL DATA INTO ROW TEMPLATE
     $row = $this->getRowTemplate($template_row, false, $row_data);
     $result = '';
     if (count($row) > 0) {
         foreach ($row as $c => $r) {
             $result .= '<td class="' . $c . '">' . $r . '</td>';
         }
     }
     return $result;
 }
<?php

/**
 * Description of outsourcingoverview
 *
 * @author IT TEAM BONOFACTUM
 * @created Oct 7, 2013 10:35:36 PM
 */
use_class('depot_orders');
use_class('products_minierp');
$class_do = new depot_orders();
$class_pm = new products_minierp();
$jng_sp_id = '5';
$whid = WAREHOUSE_ID_PRODUCTS_HAMBURG;
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'LOADOVERVIEW') {
        $shipping_window_range_start = generateMysqlDateFromGerman($_POST['shipwin_rs']);
        $shipping_window_range_end = generateMysqlDateFromGerman($_POST['shipwin_re']);
        $show_only_nostock = $_POST['nostock_filter'] == 'NOSTOCK';
        $show_only_nostock2 = $_POST['nostock_filter'] == 'NOSTOCK2';
        $q = "SELECT joi.products_ean, joi.products_id, joi.products_articles_id AS articles_id";
        $q .= ", joi.status, joi.stock_status, SUM(joi.order_quantity) AS total_qty";
        $q .= ", p.products_image, p.stars, p.products_model";
        $q .= ", IFNULL(pa.length, pnc.products_length) AS length";
        $q .= " FROM jng_sp_orders jo";
        $q .= " INNER JOIN jng_sp_orders_items joi ON joi.jng_sp_orders_id=jo.jng_sp_orders_id AND joi.status NOT IN (10,12)";
        $q .= " INNER JOIN products p ON p.products_id=joi.products_id AND p.is_outsourced=1";
        $q .= " LEFT JOIN products_non_configurator pnc ON pnc.products_id=joi.products_id";
        $q .= " INNER JOIN products_stock ps ON ps.jng_warehouses_id={$whid} AND ps.products_id=joi.products_id AND ps.articles_id=joi.products_articles_id";
        $q .= " LEFT JOIN products_articles pa ON pa.products_articles_id=joi.products_articles_id";
        $q .= " WHERE jo.jng_sp_id={$jng_sp_id} AND (";
Exemplo n.º 16
0
<?php

//AJAX ACTION
use_class('orders');
use_class('depot_orders');
use_class('jng_sp');
use_class('jng_sp_orders');
use_class('jng_sp_packages');
use_class('minierp_packages');
use_class('products_ean');
use_class('bins');
$class_o = new orders();
$class_do = new depot_orders();
$class_sp = new jng_sp();
$class_jo = new jng_sp_orders();
$class_jp = new jng_sp_packages();
$class_mp = new minierp_packages();
$class_ean = new products_ean();
$class_bins = new bins();
$item_status = statusName();
define('EAN_MISMATCH_ERROR', 'EANMISMATCH');
$waiting_box_name = 'Waiting Box';
$packing_box_name = 'Packing Box';
$finish_box_name = 'Finish Box';
$order_show_sp_info = array('9');
//am.fr
function printPackageTip($type, $no, $info = '', $spname = '', $spclass = '')
{
    global $waiting_box_name, $packing_box_name;
    if ($type == EAN_MISMATCH_ERROR) {
        $result = '<div class="package-tip red-bright">';
Exemplo n.º 17
0
 //Set Refill OFF/ON based on current backlog and "Min Backlog to Skip Refill"
 $refill_requirement = $backlog < $backlog_limit_refill;
 $duration_hold_not_zalando_orders = intval($open_orders_config['stock-delay-non-zalando']);
 //in minutes
 $duration_hold_not_zalando_orders = $duration_hold_not_zalando_orders * 60;
 //change to seconds
 use_class('orders');
 use_class('depot_orders');
 use_class('jng_sp_orders');
 use_class('products_minierp');
 use_class('elements_stock');
 use_class('products_ean');
 use_class('element');
 use_class('stock_booking');
 $class_o = new orders();
 $class_do = new depot_orders();
 $class_jo = new jng_sp_orders();
 $class_pm = new products_minierp();
 $class_es = new elements_stock();
 $class_ean = new products_ean();
 $elements_collection = array();
 $temp_order_date = array();
 $temp_jng_sp_id = array();
 $temp_import_timestamp = array();
 $otto_prepayment = strtoupper(PAYMENT_METHOD_PREPAYMENT);
 $oi_status_to_reset_stock_status = array('1', '2');
 //CLEAR IDLE BINS
 use_class('bins');
 $class_bin = new bins();
 $class_bin->clearIdleBins();
 //INIT FULL ORDERS VARIABLE
Exemplo n.º 18
0
<?php

use_class('payone_invoice');
use_class('Order');
use_class('orders');
use_class('depot_orders');
use_class('minierp_customers');
use_class('customers_special_list');
$class_o = new orders();
$class_do = new depot_orders();
$class_mc = new minierp_customers();
$class_csl = new customers_special_list();
$default_order_status_comment = 'Comment for new status';
$order_language = 2;
function drawOrderTotalBox($order_id, $order_total = null)
{
    global $class_o;
    $order = $class_o->retrieveDetail($order_id);
    if (is_null($order_total)) {
        $order_total = $class_o->retrieveTotals($order_id);
    }
    //ORDER TOTAL
    $ot_box = '<div class="draw-table">';
    $ot_box .= '<table class="order-total" cellpadding="0" cellspacing="0">';
    $ot_box .= '<tr>';
    $ot_box .= '<th colspan="2">ORDER TOTAL</th>';
    $ot_box .= '</tr>';
    $ot_box .= '<tr>';
    $ot_box .= '<td class="text">' . $order_total['ot_subtotal']['title'] . '</td>';
    $ot_box .= '<td class="price">' . $order_total['ot_subtotal']['text'] . '</td>';
    $ot_box .= '</tr>';
Exemplo n.º 19
0
<?php

use_class('depot_orders');
use_class('bins');
$class_do = new depot_orders();
$class_bin = new bins();
$id = tep_db_prepare_input($_GET['id']);
$package = $class_do->packageDetail($id);
if (is_null($package)) {
    $package_code = '';
    $content .= '<h3 class="red">Package Not Found</h3>';
} else {
    $package_code = $package['package_code'];
    $sent_date = is_null($package['sent_date']) ? '<span class="notice">UNSET</span>' : date('d F Y', strtotime($package['sent_date']));
    $received_date = is_null($package['received_date']) ? '<span class="notice">UNSET</span>' : date('d F Y', strtotime($package['received_date']));
    $segment = $class_bin->retrieveSegmentDetail($package['segments_id']);
    $contents = $class_do->packageGetContents($id);
    $contents_table = array();
    $ct = array();
    $ct['d'] = 'Date';
    $ct['o'] = 'Order ID';
    $ct['e'] = 'Order Source';
    $ct['a'] = 'Article No';
    $ct['a2'] = 'EAN';
    $ct['q'] = 'Quantity';
    $ct['d2'] = 'Time Added';
    $contents_table[] = $ct;
    $counter_orders = 0;
    $counter_products = 0;
    foreach ($contents as $do) {
        $counter_orders++;
Exemplo n.º 20
0
                $htable[] = $htp;
                unset($history_prod[$hpk]);
            }
        }
    }
}
//$content .= '<h2>Order '.$order['order_id'].' &sdot; '.$item['order_item_count'].'/'.$item['order_item_total'].' &sdot; '.$item['article_number'].' &sdot; '.$item['billing_text'].'</h2>';
//$content .= '<h2 style="margin:0;">Order '.$order['order_id'].' &sdot; '.$item['order_item_count'].'/'.$item['order_item_total'].' &sdot; '.$item['article_number'].'</h2>';
$content .= '<div style="float:left;">';
$content .= webImage($product['p']['products_image'], '80', '80', $item['products_id'], 'img-padding img-border');
$content .= '</div>';
$content .= '<div style="padding:3px 0 20px 100px;">';
$content .= '<h2 style="margin:0;">Order ' . $order['order_id'] . '</h2>';
$content .= '<h2 style="margin:0;">Product ' . $item['order_item_count'] . '/' . $item['order_item_total'] . '</h2>';
$content .= '<h2 style="margin:0;">' . $item['article_number'] . '</h2>';
$content .= '<h2 style="margin:0">' . $item['billing_text'] . '</h2>';
$content .= '</div>';
$content .= tep_draw_table('', $htable);
//DEPOT ORDER EXISTS
use_class('depot_orders');
$class_do = new depot_orders();
$do = $class_do->retrieveDetailTransmigran('SP', $oi_id);
if (!is_null($do)) {
    $content .= '<div style="margin-top:30px;">';
    $content .= '<h2>Depot Order ' . $do['depot_orders_id'] . '</h2>';
    $_GET['id'] = $do['depot_orders_id'];
    include 'depot-order.php';
    $content .= '</div>';
}
$title = 'Status History of SP-' . $oi_id;
//$title = 'Status History of '.$item['article_number'].' ('.$item['billing_text'].')';
<?php

/**
 * Description of anlysisdepotstock
 *
 * @author IT TEAM BONOFACTUM
 * @created Mar 3, 2014 3:43:11 PM
 */
require_once 'confy_open.php';
use_class('php-ofc-library/open-flash-chart');
use_class('product');
use_class('depot_orders');
$class_do = new depot_orders();
//PREPARE MAIN DATA
$psid = tep_db_prepare_input($_GET['psid']);
$ps = $class_pm->stockRetrieveDetailByPSID($psid);
$whid = $ps['jng_warehouses_id'];
$pid = $ps['products_id'];
$aid = $ps['articles_id'];
$period = '120 days';
//tep_db_prepare_input($_POST['period']);
$start_date = "-{$period}";
$chart_start_ts = strtotime($start_date);
$chart_start_ymd = date('Y-m-d', $chart_start_ts);
$chart_start_dmy = date('d.m.Y', $chart_start_ts);
$chart_end_ymd = date('Y-m-d');
$chart_end_dmy = date('d.m.Y');
//RETRIEVE STOCK DATA INFORMATION
$cs = $ps['stock'];
$dates = getDatesBetween($chart_start_ymd, $chart_end_ymd);
$euh_asc = $class_pm->stockRetrieveHistoryDaily($whid, $pid, $aid, $chart_start_ymd);
         $class_o = new orders();
         $item = $class_o->retrieveProductDetail($oiid);
         if ($counter_on || is_null($item['ean_printed']) || $item['ean_printed'] == '') {
             $class_o->printConfirmAdd($oiid);
             $class_o->eanPrintedSet($order['orders_id']);
         }
         $pid = $item['products_id'];
         $aid = $item['products_articles_id'];
         $ean = $class_ean->getEAN($pid, $aid);
         $qty = $item['products_quantity'];
         $ean_printed = $item['ean_printed'];
         $barcode_id = "JG-{$oiid}";
         break;
     case 'DP':
         use_class('depot_orders');
         $class_do = new depot_orders();
         $item = $class_do->retrieveDetail($oiid);
         if ($counter_on || is_null($item['ean_printed']) || $item['ean_printed'] == '') {
             $class_do->printConfirmAdd($oiid);
             $class_do->eanPrintedSet($oiid);
         }
         $pid = $item['products_id'];
         $aid = $item['articles_id'];
         $ean = $item['products_ean'];
         $qty = $item['quantity'];
         $ean_printed = $item['ean_printed'];
         $barcode_id = "DP-{$oiid}";
         break;
 }
 if (statusIsCancelled($item['status'])) {
     $cancel = true;
Exemplo n.º 23
0
<?php

use_class('depot_orders');
$class_do = new depot_orders();
//DEPOT FILTERS
if (isset($_SESSION['vars']['dpo_option'])) {
    $dpo_option = $_SESSION['vars']['dpo_option'];
}
if (isset($_POST['dpo_option'])) {
    $dpo_option = tep_db_prepare_input($_POST['dpo_option']);
}
if (!isset($dpo_option)) {
    $dpo_option = 'ALL';
}
if (isset($_SESSION['vars']['dpo_group'])) {
    $dpo_group = $_SESSION['vars']['dpo_group'];
}
if (isset($_POST['dpo_group'])) {
    $dpo_group = tep_db_prepare_input($_POST['dpo_group']);
}
if (!isset($dpo_group)) {
    $dpo_group = '';
}
$_SESSION['vars']['dpo_option'] = $dpo_option;
$_SESSION['vars']['dpo_group'] = $dpo_group;
//SET FILTER BRAND ID
if (isset($_SESSION['vars']['brand_id'])) {
    $brand_id = $_SESSION['vars']['brand_id'];
}
if (isset($_POST['brand_id'])) {
    $brand_id = tep_db_prepare_input($_POST['brand_id']);
Exemplo n.º 24
0
use_class('products_brand');
use_class('styles');
use_class('minierp_users');
use_class('production_instruction_manual');
use_class('jng_sp_catalog');
use_class('jng_sp_catalog_params');
use_class('depot_orders');
use_class('elements_stock');
$class_pm = new products_minierp();
$class_pa = new products_articles();
$class_pb = new products_brand();
$class_s = new styles();
$class_mu = new minierp_users();
$class_jc = new jng_sp_catalog();
$class_jcp = new jng_sp_catalog_params();
$class_do = new depot_orders();
$class_es = new elements_stock();
$ebay_name_max_chars = 80;
$ebay_language_id = '2';
function delete_extra_image($pei_id, $pei_name = '')
{
    global $uploaddir;
    $deletion = false;
    $del_image_query = tep_db_query("SELECT * FROM products_extra_images WHERE products_extra_images_id = {$pei_id}");
    $del_image = tep_db_fetch_array($del_image_query);
    $check_double_query = tep_db_query("SELECT * FROM products_extra_images WHERE products_extra_image = '{$del_image['products_extra_image']}'");
    if (tep_db_num_rows($check_double_query) <= 1) {
        if ($pei_name != $del_image['products_extra_image']) {
            $delete_file = $uploaddir . $del_image['products_extra_image'];
            if (file_exists($delete_file)) {
                $deletion = unlink($delete_file);
Exemplo n.º 25
0
$order_type = tep_db_prepare_input($_POST['order_type']);
$item_id = tep_db_prepare_input($_POST['item_id']);
$status_current = tep_db_prepare_input($_POST['status_current']);
$status_new = tep_db_prepare_input($_POST['status_new']);
$user_name = tep_db_prepare_input($_POST['user_name']);
$at_machine = tep_db_prepare_input($_POST['at_machine']);
//$order_type = tep_db_prepare_input($_GET['order_type']);
//$item_id = tep_db_prepare_input($_GET['item_id']);
//$status_current = tep_db_prepare_input($_GET['status_current']);
//$status_new = tep_db_prepare_input($_GET['status_new']);
//$user_name = tep_db_prepare_input($_GET['user_name']);
//$at_machine = tep_db_prepare_input($_GET['at_machine']);
use_class('depot_orders');
use_class('jng_sp_orders');
use_class('orders');
$class_do = new depot_orders();
$class_jo = new jng_sp_orders();
$class_o = new orders();
$status_name = statusNameShort();
$order_types = array('SP', 'JG', 'DP');
function oiErrorStatus($item_status)
{
    //STATUS MISMATCH HANDLER
    global $order_type, $item_id, $status_current, $status_new, $user_name, $class_do, $class_jo, $class_o, $status_name;
    $result = '';
    $add_info = '';
    if ($item_status == 'OUTSOURCING-2-PRODUCTION') {
        $result = 'ERROR: Outsourcing Orders, can not set to Production!';
    } else {
        //error when set to production
        if ($item_status == 4 || $status_current == 3 && $status_new == 4 || !is_numeric($status_new)) {
Exemplo n.º 26
0
<?php

use_class('Product');
use_class('depot_orders');
use_class('products_ean');
use_class('elements_suppliers');
$class_do = new depot_orders();
$class_ean = new products_ean();
$forecasting_conf = load_config('forecasting');
//PAGE OPTIONS
//if (isset($_POST['segments_id']))
$special_mode = '';
if (isset($_GET['mode'])) {
    $special_mode = tep_db_prepare_input($_GET['mode']);
}
//SUBMIT ACTION
if (isset($_POST['me_action']) && $_POST['me_action'] != '') {
    if ($_POST['me_action'] == 'LOADOUTSOURCELATESTPRICES') {
        $products_id = tep_db_prepare_input($_POST['products_id']);
        $articles_id = tep_db_prepare_input($_POST['articles_id']);
        $price = $class_do->getOutsourceLatestPrice($products_id, $articles_id);
        ajaxReturn($price);
        exit;
    } elseif ($_POST['me_action'] == "CREATEOUTSOURCINGORDER") {
        $segments_id = tep_db_prepare_input($_POST['segments_id']);
        $products_id = tep_db_prepare_input($_POST['params']['pid']);
        $articles_id = tep_db_prepare_input($_POST['params']['aid']);
        $products_ean = tep_db_prepare_input($_POST['params']['ean']);
        $qty_full = tep_db_prepare_input($_POST['params']['qty_full']);
        $qty_batch = tep_db_prepare_input($_POST['params']['qty_batch']);
        $suppliers_id = tep_db_prepare_input($_POST['params']['suppliers_id']);
                 }
             }
         } elseif ($type == 'J') {
             use_class('minierp_packages');
             $class_mp = new minierp_packages();
             use_class('orders');
             $class_o = new orders();
             foreach ($pack as $p) {
                 $items = $class_mp->sendPackage($p['packages_id']);
                 foreach ($items as $items_id) {
                     $class_o->updateProductStatus($items_id, '7', $session_userinfo['username']);
                 }
             }
         } else {
             use_class('depot_orders');
             $class_do = new depot_orders();
             foreach ($pack as $p) {
                 $class_do->packageSetSent($p['packages_id'], $session_userinfo['username']);
             }
         }
     }
     echo utf8_encode($logistic_id);
 } elseif ($_POST['me_action'] == 'SAVELOG') {
     use_class('products_minierp');
     $class_pm = new products_minierp();
     $bgst = $class_pm->retrieveBestGoodSettings();
     $logistic_id = tep_db_prepare_input($_POST['lid']);
     $logpart = tep_db_prepare_input($_POST['lpart']);
     $ldate = explode('.', tep_db_prepare_input($_POST['ldate']));
     $logistic_date = date('Y-m-d', strtotime($ldate[2] . '-' . $ldate[1] . '-' . $ldate[0]));
     $logistic_code = strtolower($logpart) == 'dhl' ? 'DHL' . date('ymd', strtotime($logistic_date)) : tep_db_prepare_input($_POST['lcode']);
Exemplo n.º 28
0
                $htp['status'] = 'Production: ' . statusNameProduction($hp['status']);
                $htp['login'] = $hp['update_by'];
                $htable[] = $htp;
                unset($history_prod[$hpk]);
            }
        }
    }
}
$content .= '<div style="float:left;">';
$content .= webImage($product['p']['products_image'], '80', '80', $item['products_id'], 'img-padding img-border');
$content .= '</div>';
$content .= '<div style="padding:3px 0 20px 100px;">';
$content .= '<h2 style="margin:0;">Order ' . $order['orders_no'] . '</h2>';
$content .= '<h2 style="margin:0;">Product ' . $item['order_item_count'] . '/' . $item['order_item_total'] . '</h2>';
$content .= '<h2 style="margin:0;">' . $item['products_model'] . '</h2>';
$content .= '<h2 style="margin:0">' . $item['products_name'] . '</h2>';
$content .= '</div>';
$content .= tep_draw_table('', $htable);
//DEPOT ORDER EXISTS
use_class('depot_orders');
$class_do = new depot_orders();
$do = $class_do->retrieveDetailTransmigran('JG', $opid);
if (!is_null($do)) {
    $content .= '<div style="margin-top:30px;">';
    $content .= '<h2>Depot Order ' . $do['depot_orders_id'] . '</h2>';
    $_GET['id'] = $do['depot_orders_id'];
    include 'depot-order.php';
    $content .= '</div>';
}
$title = 'Status History of JG-' . $opid;
//$title = 'Status History of '.$product['products_model'].' ('.$product['products_name'].')';
Exemplo n.º 29
0
/**
 * Get vip status of customer from an order
 * @param String $type
 * @param Int $orders_id
 * @return Boolean
 */
function checkCustomerIsVIP($type, $orders_id)
{
    $type = strtoupper($type);
    $is_vip = false;
    if ($type == 'SP') {
        use_class('jng_sp_orders');
        use_class('jng_sp_customers');
        use_class('jng_sp_customers_special');
        $class_jo = new jng_sp_orders();
        $class_jc = new jng_sp_customers();
        $class_jcs = new jng_sp_customers_special();
        $o = $class_jo->retrieveDetail($orders_id);
        //GET CUSTOMER DETAIL VIP OR NOT
        $cust_data = $class_jc->retrieveDetail(null, $o['jng_sp_id'], $o['customer_billing_id']);
        if (is_array($cust_data) && $cust_data['jng_sp_customers_id'] > 0) {
            $cust_detail = $class_jcs->getCustomerDetail($cust_data['jng_sp_customers_id']);
        }
        $is_vip = $cust_detail['list_type'] == 'V';
    } elseif ($type == 'JG') {
        use_class('orders');
        use_class('customers_special_list');
        $class_o = new orders();
        $class_csl = new customers_special_list();
        $o = $class_o->retrieveDetail($orders_id);
        //GET CUSTOMER DETAIL VIP OR NOT
        $cust_detail = $class_csl->getCustomerDetail($o['customers_id']);
        $is_vip = $cust_detail['list_type'] == 'V';
    } elseif ($type == 'DP') {
        use_class('depot_orders');
        $class_do = new depot_orders();
        $do = $class_do->retrieveDetail($orders_id);
        if ($do['trans_type'] == 'SP' || $do['trans_type'] == 'JG') {
            if ($do['trans_type'] == 'SP') {
                use_class('jng_sp_orders');
                $class_jo = new jng_sp_orders();
                $it = $class_jo->retrieveItemDetail($do['trans_id']);
                $orders_id = $it['jng_sp_orders_id'];
            } elseif ($do['trans_type'] == 'JG') {
                use_class('orders');
                $class_o = new orders();
                $it = $class_o->retrieveProductDetail($do['trans_id']);
                $orders_id = $it['orders_id'];
            }
            $is_vip = checkCustomerIsVIP($do['trans_type'], $orders_id);
        }
    }
    return $is_vip;
}
Exemplo n.º 30
0
error_reporting(E_ALL);
ini_set("display_errors", 1);
set_time_limit(0);
ini_set('memory_limit', '512M');
global $db;
require_once '../confy.php';
require_once '../functions.php';
require_once '../functions-2.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('PHPExcel/PHPExcel');
use_class('Order');
use_class('Product');
use_class('depot_orders');
$class_do = new depot_orders();
$oids_raw = tep_db_prepare_input($_POST['oids']);
$filter_date = tep_db_prepare_input($_POST['late_date']);
$filter_status = tep_db_prepare_input($_POST['status_late']);
$oids = explode(',', $oids_raw);
$oids_total = count($oids);
if ($oids_raw == '' || $oids_total == 0) {
    echo 'NO PRODUCTS SELECTED!';
    exit;
}
function mergeArticleRowsToProduct($start, $end)
{
    global $obj_ws, $pi_rowheight;
    //UPDATE STYLE OF PREVIOS PRODUCT (merge rows, etc.)
    $obj_ws->mergeCells('A' . $start . ':A' . $end);
    $obj_ws->mergeCells('B' . $start . ':B' . $end);