<?php

$head = array(lang('sort_num'), array('text' => lang('sku'), 'sort_key' => 'sku', 'id' => 'purchase_list'), lang('image_url'), array('text' => lang('market_model'), 'sort_key' => 'market_model'), array('text' => lang('chinese_name'), 'sort_key' => 'name_cn'), array('text' => lang('7-days_sales_amounts'), 'sort_key' => 'sale_in_7_days'), array('text' => lang('30-days_sales_amounts'), 'sort_key' => 'sale_in_30_days'), array('text' => lang('60-days_sales_amounts'), 'sort_key' => 'sale_in_60_days'), array('text' => lang('dueout'), 'sort_key' => 'dueout_count'), array('text' => lang('stock_count'), 'sort_key' => 'stock_count'), array('text' => lang('storage_warning'), 'sort_key' => 'min_stock_number'), array('text' => lang('in_transit'), 'sort_key' => 'on_way_count'));
$data = array();
$index = 0;
foreach ($purchase_list as $purchase) {
    $data[] = array($index + 1, block_center(get_status_image($purchase['sku']) . $purchase['sku']), block_center(block_image($purchase['image_url'], array(40, 40))), block_center($purchase['market_model']), block_center($purchase['name_cn']), block_center($purchase['sale_in_7_days'] ? $purchase['sale_in_7_days'] : 0), block_center($purchase['sale_in_30_days'] ? $purchase['sale_in_30_days'] : 0), block_center($purchase['sale_in_60_days'] ? $purchase['sale_in_60_days'] : 0), block_center('<strong>' . $purchase['dueout_count'] . '</strong>'), block_center('<strong>' . $purchase['stock_count'] . '</strong>'), block_center($purchase['min_stock_number']), block_center($purchase['on_way_count']));
    $index++;
}
$filters = array(NULL, array('type' => 'input', 'field' => 'sku'), NULL, array('type' => 'input', 'field' => 'market_model'), array('type' => 'input', 'field' => 'name_cn'), array('type' => 'input', 'field' => 'sale_in_7_days'), array('type' => 'input', 'field' => 'sale_in_30_days'), array('type' => 'input', 'field' => 'sale_in_60_days'), array('type' => 'input', 'field' => 'dueout_count'), array('type' => 'input', 'field' => 'stock_count'));
$config = array('filters' => $filters);
$title = lang('wait_for_qt_check_product');
echo block_header($title);
echo $this->block->generate_pagination('purchase_list');
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'shipping_subarea_group');
echo form_close();
echo $this->block->generate_pagination('purchase_list');
예제 #2
0
$head = array(array('text' => lang('item_no'), 'sort_key' => 'o_item_no', 'id' => 'pending_order'), '', array('text' => lang('provider'), 'sort_key' => 'pp_name'), array('text' => lang('payment_type'), 'sort_key' => 's_status_name'), array('text' => lang('purchaser'), 'sort_key' => 'u_name'), lang('options'));
$data = array();
foreach ($pending_orders as $pending_order) {
    $pending_url = site_url('purchase/order/review_order', array('purchase_order_id' => $pending_order->o_id));
    $pending_button = anchor($pending_url, form_button('name', lang('review')));
    $reject_url = site_url('purchase/order/reject_order', array('purchase_order_id' => $pending_order->o_id));
    $reject_button = anchor($reject_url, form_button('name', lang('reject')));
    $url = $pending_button . ' <br/><br/> ' . $reject_button;
    $add_url = site_url('purchase/order/add_order_sku', array('purchase_order_id' => $pending_order->o_id));
    $skus_head = array(lang('picture'), lang('sku'), lang('chinese_name'), lang('sales_amounts_day'), lang('price'), lang('purchase_quantity'), lang('purchase_cost'), lang('options'));
    $pending_skus = $this->purchase_order_model->fetch_skus($pending_order->o_id);
    $skus_data = array();
    $sku_url = site_url('purchase/order/update_purchase_sku');
    foreach ($pending_skus as $pending_sku) {
        $drop_button = $this->block->generate_drop_icon('purchase/order/drop_sku', "{id: {$pending_sku->s_id}}", TRUE);
        $skus_data[] = array("<img src='{$pending_sku->m_image_url}' width=40 height=30 />", get_status_image($pending_sku->s_sku) . $pending_sku->s_sku, $pending_sku->b_name_cn, "{$pending_sku->sale_in_7_days} / {$pending_sku->sale_in_30_days} / {$pending_sku->sale_in_60_days}", $this->block->generate_div("sku_price_{$pending_sku->s_id}", isset($pending_sku) ? $pending_sku->s_sku_price : '[0]'), $this->block->generate_div("sku_quantity_{$pending_sku->s_id}", isset($pending_sku) ? $pending_sku->s_quantity : '[0]'), price($pending_sku->s_sku_price * $pending_sku->s_quantity), $drop_button);
        echo $this->block->generate_editor("sku_quantity_{$pending_sku->s_id}", 'sku_form', $sku_url, "{id: {$pending_sku->s_id}, type: 'sku_quantity'}");
        echo $this->block->generate_editor("sku_price_{$pending_sku->s_id}", 'sku_form', $sku_url, "{id: {$pending_sku->s_id}, type: 'sku_price'}");
    }
    $skus_table = $this->block->generate_table($skus_head, $skus_data);
    $data[] = array($pending_order->o_item_no, $skus_table, $pending_order->pp_name, lang($pending_order->s_status_name), $pending_order->u_name, $url);
}
$title = lang('pending_order_review');
$director_url = site_url('purchase/order/director_to_review');
$director_pending = anchor($director_url, form_button('director_to_review', lang('director_to_review')));
$general_manager_url = site_url('purchase/order/general_manager_to_review');
$general_manager_pending = anchor($general_manager_url, form_button('general_manager_to_review', lang('general_manager_to_review')));
$manager_url = site_url('purchase/order/manager_to_review');
$manager_pending = anchor($manager_url, form_button('manager_to_review', lang('manager_to_review')));
echo block_header($title);
$account = $this->account->get_account();
예제 #3
0
function list_to_be_review()
{
    $CI =& get_instance();
    $CI->load->model('purchase_order_model');
    $url = site_url('purchase/order/pending_order');
    $pending_orders = $CI->purchase_order_model->fetch_all_pending_order($limit = TRUE);
    $head = array(lang('item_no'), '', lang('provider'), lang('payment_type'), lang('purchaser') . anchor($url, lang('add_more'), array('style' => 'float:right;')));
    $data = array();
    foreach ($pending_orders as $pending_order) {
        $skus_head = array(lang('sku'), lang('picture'), lang('chinese_name'), lang('price'), lang('purchase_quantity'), lang('purchase_cost'));
        $pending_skus = $CI->purchase_order_model->fetch_skus($pending_order->o_id);
        $skus_data = array();
        $sku_url = site_url('purchase/order/update_purchase_sku');
        foreach ($pending_skus as $pending_sku) {
            $skus_data[] = array(get_status_image($pending_sku->s_sku) . $pending_sku->s_sku, "<img src='{$pending_sku->m_image_url}' width=40 height=30 />", $pending_sku->b_name_cn, $CI->block->generate_div("sku_price_{$pending_sku->s_id}", isset($pending_sku) ? $pending_sku->s_sku_price : '[0]'), $CI->block->generate_div("sku_quantity_{$pending_sku->s_id}", isset($pending_sku) ? $pending_sku->s_quantity : '[0]'), price($pending_sku->s_sku_price * $pending_sku->s_quantity));
        }
        $skus_table = $CI->block->generate_table($skus_head, $skus_data);
        $data[] = array($pending_order->o_item_no, $skus_table, $pending_order->pp_name, lang($pending_order->s_status_name), $pending_order->u_name);
    }
    return array($head, $data);
}
예제 #4
0
    $apply_id = $product->apply_id;
    $config = array('name' => 'approve_' . $apply_id, 'id' => 'approve_' . $apply_id, 'value' => lang('approve_it'), 'type' => 'button', 'style' => 'margin: 10px;', 'onclick' => "verify_apply_instock(this, '{$verify_url}', {$apply_id}, 1, {$last_index});");
    $options = block_button($config);
    $config = array('name' => 'reject_' . $apply_id, 'id' => 'reject_' . $apply_id, 'value' => lang('reject_it'), 'type' => 'button', 'style' => 'margin: 10px;', 'onclick' => "verify_apply_instock(this, '{$verify_url}', {$apply_id}, -1, {$last_index});");
    $options .= block_button($config);
    $user_name = fetch_user_name_by_id($product->user_id);
    $shelf_code_str = $product->shelf_code;
    $shelf_code_div_id = 'shelf_code_' . $apply_id;
    if (!empty($product->new_shelf_code)) {
        $shelf_code_str .= ' -> ' . block_div($shelf_code_div_id, $product->new_shelf_code);
        echo block_editor($shelf_code_div_id, 'name_form', $update_instock_url, "{id: {$apply_id}, type: 'shelf_code'}");
    } else {
        $shelf_code_str = block_div($shelf_code_div_id, $product->shelf_code);
        echo block_editor($shelf_code_div_id, 'name_form', $update_instock_url, "{id: {$apply_id}, type: 'old_shelf_code', sku: '{$product->sku}'}");
    }
    $item = array($this->block->generate_select_checkbox($apply_id), get_status_image($product->sku) . $product->sku, $shelf_code_str, $this->block->generate_image($product->image_url), $product->name_cn . '<br/>' . $product->name_en, $product->u_name, $product->stock_count);
    if (isset($product->order_sku_id)) {
        $apply_user = fetch_user_name_by_id($product->user_id);
        $item[] = $apply_user;
    } else {
        $item[] = '';
    }
    $change_count_div_id = 'change_count_' . $apply_id;
    $item[] = block_div($change_count_div_id, $product->change_count);
    echo block_editor($change_count_div_id, 'name_form', $update_instock_url, "{id: {$apply_id}, type: 'change_count'}");
    $item[] = $product->updated_time;
    $item[] = $options;
    $data[] = $item;
}
$options = array();
$options[''] = lang('all');
예제 #5
0
    $product = $this->product_model->fetch_product_by_sku($sku, $select, FALSE);
    if ($i % 2 == 1) {
        $sku_str = get_status_image($sku) . $sku;
        $html .= <<<HTML
<tr align="center">
    <td width="33">{$i}</td>
    <td width="68">{$sku_str}</td>
    <td width="148">{$product->name}</td>
    <td width="68">采购员</td>
    <td width="28">{$product->stock_count}</td>
    <td width="33">{$qty}</td>
    <td width="26"></td>
    <td width="33">{$product->stock_code}<br/>{$product->shelf_code}</td>
HTML;
    } else {
        $sku_str = get_status_image($sku) . $sku;
        $html .= <<<HTML
    <td width="33">{$i}</td>
    <td width="68">{$sku_str}</td>
    <td width="148">{$product->name}</td>
    <td width="68">采购员</td>
    <td width="28">{$product->stock_count}</td>
    <td width="33">{$qty}</td>
    <td width="26"></td>
    <td width="33">{$product->stock_code}<br/>{$product->shelf_code}</td>
</tr>
HTML;
    }
}
if ($i % 2 == 1) {
    $html .= <<<HTML
예제 #6
0
}
$options = array();
foreach ($outstock_types as $outstock_type) {
    $options[$outstock_type->type] = $outstock_type->type;
}
foreach ($products as $product) {
    $pid = $product->pid;
    $product_basic = $this->product_model->fetch_product_basic($pid, 'image_url, shelf_code, stock_count');
    $shelf_code = $product_basic ? $product_basic->shelf_code : '';
    if ($stock_type == 'in') {
        $config = array('name' => 'shelf_code_' . $pid, 'id' => 'shelf_code_' . $pid, 'value' => $shelf_code, 'size' => 6);
        $shelf_code = form_input($config);
    }
    $config = array('name' => 'stock_count_' . $pid, 'id' => 'stock_count_' . $pid, 'value' => 0, 'size' => 6);
    $stock_count = form_input($config);
    $item = array($this->block->generate_select_checkbox($pid), get_status_image($product->sku) . $product->sku, $shelf_code, $product_basic ? $this->block->generate_image($product_basic->image_url) : '', $product->name_cn . '<br/>' . $product->name_en, $product_basic ? $product_basic->stock_count : '', $stock_count);
    if ($stock_type != 'out') {
        $item[] = $this->product_model->fetch_product_instock_apply_num($pid, 0);
    }
    if ($stock_type == 'out') {
        $config = array('name' => 'type_extra_' . $pid, 'id' => 'type_extra_' . $pid, 'rows' => '2', 'cols' => '14');
        $item[] = form_dropdown('type_' . $pid, $options, NULL, "id='type_{$pid}'") . '<br/>' . form_textarea($config);
    }
    $data[] = $item;
}
if ($stock_type == 'out') {
    echo block_header(lang('product_outstock'));
} else {
    echo block_header(lang('product_instock_apply'));
}
echo $this->block->generate_pagination('product');
예제 #7
0
<?php

$head = array(array('text' => lang('net_name'), 'sort_key' => 'net_name', 'id' => 'product_net_name'), array('text' => lang('sku'), 'sort_key' => 'sku'), array('text' => lang('shipping_code'), 'sort_key' => 'shipping_code'), array('text' => lang('editor'), 'sort_key' => 'u_name'), array('text' => lang('update_date'), 'sort_key' => 'update_date'), lang('options'));
$data = array();
foreach ($netnames as $netname) {
    if ($action == 'edit') {
        $drop_button = $this->block->generate_drop_icon('sale/netname/drop_netname', "{id: {$netname->id}}", TRUE);
        $edit_button = $this->block->generate_edit_link(site_url('sale/netname/add_edit', array($netname->id)), '_blank');
        $url = $drop_button . $edit_button;
    } else {
        //        $url = $this->block->generate_view_link(site_url('sale/netname/view', array($netname->id)));
    }
    $user_names = $this->user_model->get_user_name_by_id($netname->user_id);
    $data[] = array($netname->net_name, $netname->sku ? get_status_image($netname->sku) . $netname->sku : '', $netname->shipping_code, $user_names, $netname->update_date, $url);
}
$shipping_codes = array('' => lang('please_select'));
foreach ($ship_codes as $ship_code) {
    $shipping_codes[$ship_code->code] = $ship_code->code;
}
$filters = array(array('type' => 'input', 'field' => 'net_name'), array('type' => 'input', 'field' => 'sku'), array('type' => 'dropdown', 'field' => 'shipping_code', 'options' => $shipping_codes, 'method' => '='), array('type' => 'input', 'field' => 'u.name'), array('type' => 'input', 'field' => 'update_date'));
echo block_header(lang('product_net_name_manage'));
echo $this->block->generate_pagination('product_net_name');
$config = array('filters' => $filters);
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'product_net_name');
echo form_close();
echo $this->block->generate_pagination('product_net_name');
     $sku_url = site_url('purchase/order/update_fcommitqty');
     $clue = lang('qty_is_big');
     $config_save = array('name' => 'save_provider_name', 'value' => lang('save'), 'type' => 'button', 'onclick' => "update_qty('{$sku_url}', {$review_sku->s_id}, '{$id}', {$review_sku->s_quantity}, {$review_sku->s_arrival_quantity},'{$clue}');");
     $url = $drop_button;
     if (isset($on_way_counts[$review_sku->s_sku])) {
         $on_way_count = $on_way_counts[$review_sku->s_sku];
     } else {
         $on_way_count = $CI->product_model->fetch_product_on_way_count_by_sku($review_sku->s_sku);
         $on_way_counts[$review_sku->s_sku] = $on_way_count;
     }
     $on_way_count_url = site_url('purchase/order/on_way_count_by_sku_list', array($review_sku->s_sku));
     $arrival_quantity_html = $review_sku->s_arrival_quantity;
     if (!(isset($tag) && $tag)) {
         $arrival_quantity_html .= "+<br/>" . form_input($config_input) . form_input($config_save);
     }
     $skus_row = array("<img src='{$review_sku->m_image_url}' width=40 height=30 />", get_status_image($review_sku->s_sku) . $review_sku->s_sku, $review_sku->b_name_cn, "{$review_sku->sale_in_7_days} / {$review_sku->sale_in_30_days} / {$review_sku->sale_in_60_days}", price($review_sku->s_sku_price), $review_sku->s_quantity, price($review_sku->s_sku_price * $review_sku->s_quantity), $arrival_quantity_html, $on_way_count > 0 ? anchor($on_way_count_url, $on_way_count, 'target="_blank"') : $on_way_count);
     //        if($review_order->o_review_state < 2 || $priority > 1)
     if ($review_order->o_review_state < 3 || $priority > 1) {
         if (!(isset($tag) && $tag)) {
             $skus_row[] = $url;
         }
     }
     $skus_data[] = $skus_row;
 }
 $skus_table = $this->block->generate_table($skus_head, $skus_data);
 $str = lang('provider') . ': ' . $review_order->pp_name . '<br/><br/>';
 $str .= lang('payment_type') . ': ' . lang($review_order->s_status_name) . '<br><br/>';
 $str .= lang('arrival_date') . ': ' . $review_order->o_arrival_date . '<br><br/>';
 $drop_button = $this->block->generate_drop_icon('purchase/order/drop_order', "{id: {$review_order->o_id}}", TRUE);
 $states = '';
 if ($review_order->o_reject == 1) {
<?php

$data = array('1' => '1', '2' => '2', '3' => '3');
$collection = to_js_array($data);
$url = site_url('purchase/provider/add_provider_sku', array('provider_id' => $provider_id));
$add_button = $this->block->generate_add_icon($url);
$head = array(lang('sku'), lang('picture'), lang('1_to_9_price'), lang('10_to_99_price'), lang('100_to_999_price'), lang('1000_price'), lang('provider_sequence'), lang('separating_shipping_cost'), lang('options') . $add_button);
$sku_url = site_url('purchase/provider/update_provider_sku', array('provider_id' => $provider_id));
$data = array();
foreach ($skus as $sku) {
    $drop_button = $this->block->generate_drop_icon('purchase/provider/drop_provider_sku', "{id: {$sku->m_id}}", TRUE);
    $data[] = array(get_status_image($sku->p_sku) . $this->block->generate_div("sku_{$sku->m_id}", isset($sku->p_sku) ? $sku->p_sku : '[edit]'), $this->block->generate_div("image_url_{$sku->m_id}", "<img width='80' height='80' src='{$sku->pm_image_url}' />"), $this->block->generate_div("price1to9_{$sku->m_id}", $sku->m_price1to9), $this->block->generate_div("price10to99_{$sku->m_id}", $sku->m_price10to99), $this->block->generate_div("price100to999_{$sku->m_id}", $sku->m_price100to999), $this->block->generate_div("price1000_{$sku->m_id}", $sku->m_price1000), $this->block->generate_div("provide_level_{$sku->m_id}", $sku->m_provide_level), $this->block->generate_div("separating_shipping_cost_{$sku->m_id}", $sku->m_separating_shipping_cost), $drop_button);
    echo $this->block->generate_editor("sku_{$sku->m_id}", 'sku_form', $sku_url, "{id: {$sku->m_id}, type: 'sku'}");
    echo $this->block->generate_editor("price1to9_{$sku->m_id}", 'price1to9_form', $sku_url, "{id: {$sku->m_id}, type: 'price1to9'}");
    echo $this->block->generate_editor("price10to99_{$sku->m_id}", 'price10to99_form', $sku_url, "{id: {$sku->m_id}, type: 'price10to99'}");
    echo $this->block->generate_editor("price100to999_{$sku->m_id}", 'price100to999_form', $sku_url, "{id: {$sku->m_id}, type: 'price100to999'}");
    echo $this->block->generate_editor("price1000_{$sku->m_id}", 'price1000_form', $sku_url, "{id: {$sku->m_id}, type: 'price1000'}");
    echo $this->block->generate_editor("provide_level_{$sku->m_id}", 'provide_level_form', $sku_url, "{id: {$sku->m_id}, type: 'provide_level'}", "{$collection}");
    echo $this->block->generate_editor("separating_shipping_cost_{$sku->m_id}", 'separating_shipping_cost_form', $sku_url, "{id: {$sku->m_id}, type: 'separating_shipping_cost'}");
}
echo $this->block->generate_pagination('provider_sku', array($provider_id));
$filters = array(array('type' => 'input', 'field' => 'sku'), array('type' => 'input', 'field' => 'image_url'), array('type' => 'input', 'field' => 'price1to9'), array('type' => 'input', 'field' => 'price10to99'), array('type' => 'input', 'field' => 'price100to999'), array('type' => 'input', 'field' => 'price1000'), array('type' => 'input', 'field' => 'provide_level'));
$config = array('filters' => $filters, 'url' => site_url('purchase/provider/provider_sku_manage', array($provider_id)));
echo $this->block->generate_back_icon(site_url('purchase/provider/edit', array($provider_id)));
echo form_open();
echo $this->block->generate_reset_search($config, array('provider_id' => $provider_id));
echo $this->block->generate_table($head, $data, $filters, 'purchase_sku');
echo $this->block->generate_back_icon(site_url('purchase/provider/edit', array($provider_id)));
echo $this->block->generate_pagination('provider_sku', array($provider_id));
echo form_close();
예제 #10
0
                $min_stock_number_html .= $purchase['au_min_stock_number'] == '' ? '' : '<font color=blue>' . $purchase['au_min_stock_number'] . '</font>' . ' (AU) <br/>';
                $purchase_suggestion_html .= $purchase['au_purchase_suggestion'] <= 0 ? '' : '<font color=blue>' . $purchase['au_purchase_suggestion'] . '</font>' . ' (AU) <br/>';
            }
            if ($code->stock_code == 'YB') {
                $dueout_count_html .= $purchase['yb_dueout_count'] == '' ? '' : '<font color=blue>' . $purchase['yb_dueout_count'] . '</font>' . ' (YB) <br/>';
                $stock_count_html .= $purchase['yb_stock_count'] == '' ? '' : '<font color=blue>' . $purchase['yb_stock_count'] . '</font>' . ' (YB) <br/>';
                $on_way_count_html .= $purchase['yb_on_way_count'] == '' ? '' : '<font color=blue>' . $purchase['yb_on_way_count'] . '</font>' . ' (YB) <br/>';
                $min_stock_number_html .= $purchase['yb_min_stock_number'] == '' ? '' : '<font color=blue>' . $purchase['yb_min_stock_number'] . '</font>' . ' (YB) <br/>';
                $purchase_suggestion_html .= $purchase['yb_purchase_suggestion'] <= 0 ? '' : '<font color=blue>' . $purchase['yb_purchase_suggestion'] . '</font>' . ' (AU) <br/>';
            }
        }
    } else {
        $dueout_count_html .= $purchase['dueout_count'] == '' ? '' : '<font color=blue>' . $purchase['dueout_count'] . '</font>' . '<br/>';
        $stock_count_html .= $purchase['stock_count'] == '' ? '' : '<font color=blue>' . $purchase['stock_count'] . '</font>' . '<br/>';
        $on_way_count_html .= $purchase['on_way_count'] == '' ? '' : '<font color=blue>' . $purchase['on_way_count'] . '</font>' . '<br/>';
        $min_stock_number_html .= $purchase['min_stock_number'] == '' ? '' : '<font color=blue>' . $purchase['min_stock_number'] . '</font>' . '<br/>';
        $purchase_suggestion_html .= $purchase['purchase_suggestion'] <= 0 ? '' : '<font color=blue>' . $purchase['purchase_suggestion'] . '</font>' . '<br/>';
        //        $purchase_suggestion = $purchase['purchase_suggestion'] <= 0 ? 0 : $purchase['purchase_suggestion'];
    }
    $data[] = array(form_checkbox($select_data), block_center(block_image($purchase['image_url'], array(40, 40))), get_status_image($purchase['sku']) . anchor(site_url('pi/product/add_edit', array($purchase['id'])), block_center($purchase['sku']), array('target' => '_blank')), block_center($purchase['market_model']), block_center($purchase['name_cn']), block_center($purchase['7_days_sale_amount'] ? $purchase['7_days_sale_amount'] : 0), block_center($purchase['30_days_sale_amount'] ? $purchase['30_days_sale_amount'] : 0), block_center($purchase['60_days_sale_amount'] ? $purchase['60_days_sale_amount'] : 0), block_center('<strong>' . "{$dueout_count_html}" . '</strong>'), block_center('<strong>' . $stock_count_html . '</strong>'), block_center($min_stock_number_html), block_center($on_way_count_html), block_center($purchase_suggestion_html), '', block_center($purchase['purchaser']), $purchase['providers']);
    $index++;
}
$batch_purchase = site_url('purchase/order/batch_purchase_sku');
echo form_open($batch_purchase);
echo block_js_sortable_table($head, $data, array(NULL, 'default', NULL, 'default', 'default', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', NULL, 'default'), "width: 100%;border-collapse: collapse;");
echo form_hidden('item_count', $index);
$print_label = '<span style="float:right;">';
$print_label .= form_submit('batch_purchase', lang('batch_purchase'));
$print_label .= '</span>';
echo block_check_all() . $print_label;
echo form_close();
예제 #11
0
        $payment_state = lang('paid_zero');
        $url = '';
    } elseif ($pending_order->s_status_name == 'paid_part') {
        $payment_state = lang('paid_part');
        $url = '';
    } else {
        $payment_state = lang('paid_all');
        $url = '';
    }
    $add_url = site_url('purchase/order/add_order_sku', array('purchase_order_id' => $pending_order->o_id));
    $print_url = site_url('purchase/order/fetch_contract_info', array('purchase_order_id' => $pending_order->o_id));
    $skus_head = array(lang('sku'), lang('picture'), lang('chinese_name'), lang('price'), lang('purchase_quantity'), lang('purchase_cost'));
    $pending_skus = $this->purchase_order_model->fetch_skus($pending_order->o_id);
    $skus_data = array();
    foreach ($pending_skus as $pending_sku) {
        $skus_data[] = array(get_status_image($pending_sku->s_sku) . $pending_sku->s_sku, "<img src='{$pending_sku->m_image_url}' width=40 height=30 />", $pending_sku->b_name_cn, isset($pending_sku) ? $pending_sku->s_sku_price : '0', isset($pending_sku) ? $pending_sku->s_quantity : '0', price($pending_sku->s_sku_price * $pending_sku->s_quantity));
    }
    $skus_table = $this->block->generate_table($skus_head, $skus_data);
    $payment_type = $this->purchase_finance_model->fetch_payment_type($pending_order->o_id);
    $purchase_payment = $this->purchase_finance_model->fetch_payment_cost($pending_order->o_id);
    $payment_cost = isset($purchase_payment->payment_cost) ? $purchase_payment->payment_cost : '0';
    $owe = price($pending_order->o_item_cost - $payment_cost);
    if ($owe > 0) {
        $payment_owe = '<br/>' . lang('owe') . ':' . $owe;
    } else {
        $payment_owe = '';
    }
    $data[] = array($this->block->generate_select_checkbox($pending_order->o_id), anchor($print_url, $pending_order->o_item_no, array('target' => '_blank')), $pending_order->pp_name . '<br>' . $pending_order->pp_open_bank . '<br>' . $pending_order->pp_bank_account . '<br>' . $pending_order->pp_bank_title, lang($payment_type->s_name), $pending_order->o_purchase_note, $skus_table, $this->block->generate_div("item_cost_{$pending_order->o_id}", $pending_order->o_item_cost), $payment_cost . "+" . $this->block->generate_div("payment_cost_{$pending_order->o_id}", '[0]') . $payment_owe, $payment_state, element($pending_order->o_review_name, $review_state['options'], ''), $pending_order->u_name, $url);
    echo $this->block->generate_editor("payment_cost_{$pending_order->o_id}", 'purchase_payment_form', $payment_percent_url, "{id:{$pending_order->o_id}, type: 'payment_cost'}");
    echo $this->block->generate_editor("item_cost_{$pending_order->o_id}", 'item_cost_form', $item_cost_url, "{id:{$pending_order->o_id}, type: 'item_cost'}");
}
예제 #12
0
$head = array(lang('select'), lang('sku'), lang('product_image'), lang('product_name'), lang('provider'), lang('shelf_code'), lang('stock_count'), lang('how_way'), lang('qualified_number'), $stock_type == 'out' ? lang('outstock_num') : lang('instock_num'));
if ($stock_type != 'out') {
    $head[] = lang('apply_instock_num');
}
$head[] = lang('purchaser');
$data = array();
foreach ($products as $product) {
    $pid = $this->product_model->fetch_product_id($product->h_sku);
    $name = $this->product_model->fetch_product_name($product->h_sku);
    $product_basic = $this->product_model->fetch_product_basic($pid, 'image_url, shelf_code, stock_count');
    $config = array('name' => 'stock_count_' . $product->h_id, 'id' => 'stock_count_' . $product->h_id, 'value' => $product->h_qualified_number - $product->h_stock_count, 'size' => 6);
    $provider = $this->purchase_model->fetch_provider($product->provider_id);
    $sku = '';
    $sku .= lang('sku') . ': <b>' . $product->h_sku . '</b><br/>' . lang('item_no') . ':' . $product->item_no;
    $item = array($this->block->generate_select_checkbox($product->h_id), get_status_image($sku) . $sku, $product_basic ? $this->block->generate_image($product_basic->image_url) : '', $name, isset($provider->name) ? $provider->name : '', $product_basic ? $product_basic->shelf_code : '', $product_basic ? $product_basic->stock_count : '', $product->h_how_way . '%', $product->h_qualified_number - $product->h_stock_count, form_input($config));
    if ($stock_type != 'out') {
        $item[] = $this->product_model->fetch_product_instock_apply_num($pid, 0);
    }
    $item[] = $product->u_name;
    $data[] = $item;
}
$purchase_users = $this->user_model->fetch_all_purchase_users();
$options[''] = lang('all');
foreach ($purchase_users as $purchase_user) {
    $options[$purchase_user->u_id] = $purchase_user->u_name;
}
echo block_header(lang('purchase_instock_apply'));
echo $this->block->generate_pagination('product');
$filters = array(NULL, array('type' => 'input', 'field' => 'purchase_how.sku|purchase_order.item_no', 'method' => '='), NULL, NULL, NULL, array('type' => 'input', 'field' => 'shelf_code'), array('type' => 'input', 'field' => 'product_basic.stock_count', 'size' => 6), NULL, NULL, NULL, NULL, array('type' => 'dropdown', 'field' => 'user.id', 'options' => $options, 'method' => '='));
$config = array('filters' => $filters);
    $select_purchaser = form_dropdown('select_purchaser', $options, $purchaser_id, $js);
}
?>
<table width="100%" border="0" align="center">
    <tr>
        <td><?php 
echo lang('deadline_of_order_confirmation');
?>
 : <?php 
echo $fetch_dueout_update_time;
?>
</td>
        <td style="float: right;"><?php 
echo $select_purchaser;
?>
</td>
    </tr>
</table>

<?php 
$head = array(lang('sort_num'), lang('sku'), lang('image_url'), lang('market_model'), lang('chinese_name'), lang('7-days_sales_amounts'), lang('30-days_sales_amounts'), lang('60-days_sales_amounts'), lang('dueout'), lang('stock_count'), lang('storage_warning'), lang('in_transit'), lang('purchasing_suggested'), lang('purchasing_actually'), lang('purchaser'), lang('price') . ' / ' . lang('provider'));
$data = array();
$index = 0;
foreach ($purchase_list as $purchase) {
    $data[] = array($index + 1, get_status_image($purchase['sku']) . anchor(site_url('pi/product/add_edit', array($purchase['id'])), block_center($purchase['sku']), array('target' => '_blank')), block_center(block_image($purchase['image_url'], array(40, 40))), block_center($purchase['market_model']), block_center($purchase['name_cn']), block_center($purchase['7_days_sale_amount'] ? $purchase['7_days_sale_amount'] : 0), block_center($purchase['30_days_sale_amount'] ? $purchase['30_days_sale_amount'] : 0), block_center($purchase['60_days_sale_amount'] ? $purchase['60_days_sale_amount'] : 0), block_center('<strong>' . $purchase['dueout_count'] . '</strong>'), block_center('<strong>' . $purchase['stock_count'] . '</strong>'), block_center($purchase['min_stock_number']), block_center($purchase['on_way_count']), block_center($purchase['purchase_suggestion']), '', block_center($purchase['purchaser']), $purchase['providers']);
    $index++;
}
$batch_purchase = site_url('purchase/order/batch_purchase_sku');
echo form_open($batch_purchase);
echo block_js_sortable_table($head, $data, array(NULL, 'default', NULL, 'default', 'default', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', 'integer', NULL, 'default'), "width: 100%;border-collapse: collapse;");
echo form_close();
예제 #14
0
 $qtys = explode(',', $order->qty_str);
 $item_ids = explode(',', $order->item_id_str);
 $count = count($skus);
 for ($i = 0; $i < $count; $i++) {
     if (!in_array($skus[$i], $product_skus)) {
         $product = $this->purchase_order_model->fetch_product_by_sku($skus[$i]);
         $product_skus[$skus[$i]] = $product;
     } else {
         $product = $product_skus[$skus[$i]];
     }
     $purchaser = get_purchaser_name_by_sku($skus[$i]);
     $sku_html .= '<div style="margin-top: 5px;">';
     if ($product->dueout_count + $product->min_stock_number - ($product->stock_count + on_way_count($skus[$i])) > 0) {
         $sku_html .= lang('sku') . ': <font color = red >' . get_status_image($skus[$i]) . $skus[$i] . '</font>';
     } else {
         $sku_html .= lang('sku') . ': ' . get_status_image($skus[$i]) . $skus[$i];
     }
     $sku_html .= ' ' . lang('qty_str') . ':' . $qtys[$i] . ' ' . $product->name_cn . ' ';
     if ($product->stock_count + on_way_count($skus[$i]) < $product->dueout_count + $product->min_stock_number) {
         $sku_html .= '<font color = red >' . $purchaser . '</font>';
     } else {
         $sku_html .= $purchaser;
     }
     $sku_html .= ' ' . lang('storage_warning') . ': ' . $product->min_stock_number;
     $sku_html .= ' ' . lang('7-days_sales_amounts') . ': ' . $product->sale_in_7_days;
     $sku_html .= ' ' . lang('30-days_sales_amounts') . ': ' . $product->sale_in_30_days;
     $sku_html .= ' ' . lang('60-days_sales_amounts') . ': ' . $product->sale_in_60_days;
     $sku_html .= '</div>';
 }
 $sku_html .= '</div>';
 $data[] = array($delay_time['days'] . lang('day') . '<br>' . $delay_time['hours'] . lang('hour'), $item_html, $sku_html, "<abbr title='{$order->descript}'>" . word_limiter($order->descript, 6) . "</abbr>", $order->input_user);
예제 #15
0
<?php

$head = array(array('text' => lang('sku'), 'sort_key' => 'sku', 'id' => 'instock'), lang('product_image'), array('text' => lang('product_name'), 'sort_key' => 'name_cn'), array('text' => lang('shelf_code'), 'sort_key' => 'shelf_code'), array('text' => lang('stock_code'), 'sort_key' => 'stock_code'), array('text' => lang('stock_count'), 'sort_key' => 'stock_count'), array('text' => lang('instock_num'), 'sort_key' => 'change_count'), array('text' => lang('before_change_count'), 'sort_key' => 'before_change_count'), array('text' => lang('after_change_count'), 'sort_key' => 'after_change_count'), array('text' => lang('instock_apply_username'), 'sort_key' => 'user.name'), array('text' => lang('apply_instock_time'), 'sort_key' => 'updated_time'), array('text' => lang('verifyer'), 'sort_key' => 'verifyer_name'), array('text' => lang('verify_date'), 'sort_key' => 'verify_date'), array('text' => lang('remark'), 'sort_key' => 'type_extra'));
$data = array();
foreach ($products as $product) {
    $data[] = array(get_status_image($product->sku) . $product->sku, $this->block->generate_image($product->image_url), $product->name_cn . '<br/>' . $product->name_en, $product->shelf_code, $product->stock_code, $product->stock_count, $product->change_count, $product->before_change_count, $product->after_change_count, $product->user_name, $product->updated_time, $product->verifyer_name, $product->verify_date, isset($product->type) ? lang($product->type) . '<br/>' . $product->type_extra : '');
}
$filters = array(array('type' => 'input', 'field' => 'sku', 'method' => '='), NULL, array('type' => 'input', 'field' => 'product_basic.name_cn|product_basic.name_en'), array('type' => 'input', 'field' => 'shelf_code'), array('type' => 'input', 'field' => 'stock_code'), array('type' => 'input', 'field' => 'product_basic.stock_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'before_change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'after_change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'user.name'), array('type' => 'date', 'field' => 'updated_time', 'method' => 'from_to'), array('type' => 'input', 'field' => 'verifyer.name'), array('type' => 'date', 'field' => 'verify_date', 'method' => 'from_to'), array('type' => 'input', 'field' => 'type_extra'));
$config = array('filters' => $filters);
echo block_header(lang('instock_record'));
echo $this->block->generate_pagination('instock');
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'instock');
echo form_close();
echo $this->block->generate_pagination('instock');
예제 #16
0
<?php

$head = array(array('text' => lang('sku'), 'sort_key' => 'sku', 'id' => 'outstock'), lang('product_image'), array('text' => lang('product_name'), 'sort_key' => 'name_cn'), array('text' => lang('shelf_code'), 'sort_key' => 'shelf_code'), array('text' => lang('stock_count'), 'sort_key' => 'stock_count'), array('text' => lang('outstock_username'), 'sort_key' => 'user.name'), array('text' => lang('outstock_num'), 'sort_key' => 'change_count'), array('text' => lang('before_change_count'), 'sort_key' => 'before_change_count'), array('text' => lang('after_change_count'), 'sort_key' => 'after_change_count'), array('text' => lang('outstock_time'), 'sort_key' => 'updated_time'), array('text' => lang('remark'), 'sort_key' => 'type_extra'));
$data = array();
foreach ($products as $product) {
    if ($product->type == 'order_outstock') {
        $product_type = isset($product->type) ? lang($product->type) . '<br/>' . $product->type_extra : '';
    } else {
        $product_type = isset($product->type) ? $product->type . '<br/>' . $product->type_extra : '';
    }
    $data[] = array(get_status_image($product->sku) . $product->sku, $this->block->generate_image($product->image_url), $product->name_cn . '<br/>' . $product->name_en, $product->shelf_code, $product->stock_count, $product->user_name, $product->change_count, $product->before_change_count, $product->after_change_count, $product->updated_time, $product_type);
}
$filters = array(array('type' => 'input', 'field' => 'sku', 'method' => '='), NULL, array('type' => 'input', 'field' => 'product_basic.name_cn|product_basic.name_en'), array('type' => 'input', 'field' => 'shelf_code'), array('type' => 'input', 'field' => 'stock_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'user.name'), array('type' => 'input', 'field' => 'change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'before_change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'before_change_count', 'size' => 6, 'method' => '>='), array('type' => 'date', 'field' => 'updated_time', 'method' => 'from_to'), array('type' => 'input', 'field' => 'type_extra'));
$config = array('filters' => $filters);
echo block_header(lang('outstock_record'));
echo $this->block->generate_pagination('outstock');
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'outstock');
echo form_close();
echo $this->block->generate_pagination('outstock');
예제 #17
0
    $skus_head = array(lang('picture'), lang('sku'), lang('chinese_name'), lang('purchase_cost'), lang('purchase_quantity'), lang('fcommitqty'), lang('how_way'), lang('qualified_number'), lang('options'));
    $review_skus = $this->purchase_order_model->fetch_how_skus($review_order->o_id);
    $skus_data = array();
    $sku_url = site_url('purchase/order/update_how_number');
    foreach ($review_skus as $review_sku) {
        $reset_url = site_url('purchase/order/cancel_how', array('sku_id' => $review_sku->s_id));
        $reset_button = anchor($reset_url, form_button('name', lang('reject')));
        $hows = $this->purchase_order_model->fetch_purchase_how($review_sku->s_id);
        if (isset($hows->qualified_number) && $hows->qualified_number > 0) {
            $qualified_number = $hows->qualified_number;
            $how_number = $qualified_number . '+';
        } else {
            $how_number = '';
        }
        $how_way = $this->purchase_order_model->fetch_how_way($review_sku->s_id);
        $skus_data[] = array("<img src='{$review_sku->m_image_url}' width=40 height=30 />", get_status_image($review_sku->s_sku) . $review_sku->s_sku, $review_sku->b_name_cn, price($review_sku->s_sku_price * $review_sku->s_quantity), $review_sku->s_quantity, $review_sku->s_arrival_quantity, $this->block->generate_div("how_way_{$review_sku->s_id}", isset($how_way->how_way) ? $how_way->how_way . '%' : '100%'), $how_number . $this->block->generate_div("qualified_number_{$review_sku->s_id}", '[0]'), '<div style="float:right;margin:5px;" >' . $reset_button . '</div>');
        echo $this->block->generate_editor("how_way_{$review_sku->s_id}", 'product_how_form', $sku_url, "{id: {$review_sku->s_id}, type: 'how_way'}", "{$collection}");
        echo $this->block->generate_editor("qualified_number_{$review_sku->s_id}", 'product_how_form', $sku_url, "{id: {$review_sku->s_id}, type: 'qualified_number'}");
    }
    $skus_table = $this->block->generate_table($skus_head, $skus_data);
    $drop_button = $this->block->generate_drop_icon('purchase/order/drop_order', "{id: {$review_order->o_id}}", TRUE);
    $data[] = array($review_order->o_item_no, $review_order->pp_name, $skus_table, $review_order->u_name);
}
$title = lang('how_table_of_orders');
echo block_header($title);
$options[''] = lang('all');
foreach ($purchase_users as $purchase_user) {
    $options[$purchase_user->u_id] = $purchase_user->u_name;
}
$filters = array(array('type' => 'input', 'field' => 'purchase_order.item_no'), array('type' => 'input', 'field' => 'purchase_provider.name'), array('type' => 'input', 'field' => 'purchase_order_sku.sku'), array('type' => 'dropdown', 'field' => 'user.id', 'options' => $options, 'method' => '='));
echo $this->block->generate_pagination('purchase_how');
예제 #18
0
<?php

$head = array(array('text' => lang('type'), 'sort_key' => 'stock_type', 'id' => 'inout_stock'), array('text' => lang('sku'), 'sort_key' => 'sku'), lang('product_image'), array('text' => lang('product_name'), 'sort_key' => 'name_cn'), array('text' => lang('shelf_code'), 'sort_key' => 'shelf_code'), array('text' => lang('stock_code'), 'sort_key' => 'stock_code'), array('text' => lang('stock_count'), 'sort_key' => 'stock_count'), array('text' => lang('before_change_count'), 'sort_key' => 'before_change_count'), array('text' => lang('change_count'), 'sort_key' => 'change_count'), array('text' => lang('after_change_count'), 'sort_key' => 'after_change_count'), array('text' => lang('operator'), 'sort_key' => 'user.name'), array('text' => lang('operate_time'), 'sort_key' => 'updated_time'), array('text' => lang('verifyer'), 'sort_key' => 'verifyer_name'), array('text' => lang('verify_date'), 'sort_key' => 'verify_date'), array('text' => lang('remark'), 'sort_key' => 'type_extra'));
$data = array();
$type_options = array('' => lang('all'), 'product_instock' => lang('product_instock'), 'product_outstock' => lang('product_outstock'), 'product_check_count' => lang('product_check_count'));
if ($products) {
    foreach ($products as $product) {
        if ($product->stock_type == 'product_outstock' && $product->type !== 'order_outstock') {
            $product_type = isset($product->type) ? $product->type . '<br/>' . $product->type_extra : '';
        } else {
            $product_type = isset($product->type) ? lang($product->type) . '<br/>' . $product->type_extra : '';
        }
        $data[] = array(lang($product->stock_type), get_status_image($product->sku) . $product->sku, $this->block->generate_image($product->image_url), $product->name_cn . '<br/>' . $product->name_en, $product->shelf_code, $product->stock_code, 'SZ:' . $product->stock_count . '<br/>DE:' . $product->de_stock_count . '<br/>UK:' . $product->uk_stock_count . '<br/>AU:' . $product->au_stock_count . '<br/>YB:' . $product->yb_stock_count, $product->before_change_count, $product->change_count, $product->after_change_count, $product->user_name, $product->updated_time, $product->verifyer_name, $product->verify_date, $product_type);
    }
}
$filters = array(array('type' => 'dropdown', 'field' => 'stock_type', 'options' => $type_options, 'method' => '='), array('type' => 'input', 'field' => 'sku', 'method' => '='), NULL, array('type' => 'input', 'field' => 'product_basic.name_cn|product_basic.name_en'), array('type' => 'input', 'field' => 'shelf_code'), array('type' => 'input', 'field' => 'stock_code'), array('type' => 'input', 'field' => 'product_basic.stock_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'before_change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'after_change_count', 'size' => 6, 'method' => '>='), array('type' => 'input', 'field' => 'user.name'), array('type' => 'date', 'field' => 'updated_time', 'method' => 'from_to'), array('type' => 'input', 'field' => 'verifyer.name'), array('type' => 'date', 'field' => 'verify_date', 'method' => 'from_to'), array('type' => 'input', 'field' => 'type_extra'));
$config = array('filters' => $filters);
echo block_header(lang('inout_stock_record'));
echo $this->block->generate_pagination('inout_stock');
echo form_open();
echo $this->block->generate_reset_search($config);
echo $this->block->generate_table($head, $data, $filters, 'inout_stock');
echo form_close();
echo $this->block->generate_pagination('inout_stock');