|
|
<?php
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
class Vendor_money extends CI_Controller {
|
|
|
|
|
|
public function __construct(){
|
|
|
parent::__construct();
|
|
|
$this->load->library('trippest');
|
|
|
$this->load->helper('array');
|
|
|
$this->load->model('Vendor_money_model', 'money_model');
|
|
|
mb_regex_encoding("UTF-8");
|
|
|
bcscale(2);
|
|
|
}
|
|
|
|
|
|
public function settlement()
|
|
|
{
|
|
|
$data['default_date1'] = date('Y-m-01', strtotime("last month"));
|
|
|
$data['default_date2'] = date('Y-m-d H:i:s', mktime(0,0,0,date('m'),1,date('Y'))-1);
|
|
|
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
|
|
|
$data['default_vendor'] = array_keys($vendor_sourcetype);
|
|
|
$this->load->view('vendor_money_sum', $data);
|
|
|
}
|
|
|
|
|
|
public function index($download_vendor=null)
|
|
|
{
|
|
|
$this->permission->is_admin(true);
|
|
|
$date_range = $this->input->post("date_range");
|
|
|
preg_match_all('/\d{4}\-\d{2}\-\d{2}/', $date_range, $date_range_arr);
|
|
|
if (empty($date_range_arr[0])) {
|
|
|
return $this->settlement();
|
|
|
}
|
|
|
$start_date = $date_range_arr[0][0];
|
|
|
$end_date =$date_range_arr[0][1] . " 23:59:59";
|
|
|
if ($end_date == null) {
|
|
|
$end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1);
|
|
|
}
|
|
|
$vendors = $this->input->post("vendors");
|
|
|
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
|
|
|
if ($download_vendor !== null) {
|
|
|
$vendors = array($download_vendor);
|
|
|
$sourcetype = $vendor_sourcetype[strval($download_vendor)]["sourcetype"];
|
|
|
$vendor_name = $vendor_sourcetype[strval($download_vendor)]["vendor_name"];
|
|
|
$vendor_data = $this->money_model->group_detail_list($download_vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors));
|
|
|
$file_name = str_replace(" ", "_", $date_range) . "_" . $vendor_name;
|
|
|
return $this->download_output($vendor_data, $file_name);
|
|
|
}
|
|
|
$result = array(
|
|
|
"default_date1" => $start_date
|
|
|
,"default_date2" => $end_date
|
|
|
,"default_vendor" => $vendors
|
|
|
,"trippest_order_vendor_money" => array()
|
|
|
,"trippest_order_multi_city" => array()
|
|
|
,"trippest_order_cost_debug" => array()
|
|
|
,"transfer_sum" => 0
|
|
|
/** 列总计 */
|
|
|
,"col_sum" => array(
|
|
|
"trippest" => array(
|
|
|
"sum_trippest_cost" => 0
|
|
|
,"sum_vendor_cost" => 0
|
|
|
,"sum_trippest_sum" => 0
|
|
|
,"sum_vendor_sum" => 0
|
|
|
,"sum_profit" => 0
|
|
|
,"sum_trippest_profit" => 0
|
|
|
,"sum_vendor_profit" => 0
|
|
|
,"sum_payout" => 0
|
|
|
,"sum_other" => 0
|
|
|
),
|
|
|
"vendor" => array(
|
|
|
"sum_trippest_cost" => 0
|
|
|
,"sum_vendor_cost" => 0
|
|
|
,"sum_trippest_sum" => 0
|
|
|
,"sum_vendor_sum" => 0
|
|
|
,"sum_profit" => 0
|
|
|
,"sum_trippest_profit" => 0
|
|
|
,"sum_vendor_profit" => 0
|
|
|
,"sum_payout" => 0
|
|
|
,"sum_other" => 0
|
|
|
)
|
|
|
)
|
|
|
);
|
|
|
$result['trippest_order_multi_city'] = array_merge($result['trippest_order_multi_city'], $this->money_model->trippest_order_multi_city($start_date, $end_date, implode(',', $vendors)));
|
|
|
$result['trippest_order_cost_debug'] = $this->money_model->cost_debug_detail($start_date, $end_date, implode(',', $vendors));
|
|
|
/** 团款 */
|
|
|
foreach ($vendors as $key => $vendor) {
|
|
|
$sourcetype = $vendor_sourcetype[strval($vendor)]["sourcetype"];
|
|
|
$opi_summoney = $this->money_model->checked_group_list($vendor, $sourcetype, $start_date, $end_date, implode(',', $vendors));
|
|
|
$ret = array(
|
|
|
"trippest" =>
|
|
|
array(
|
|
|
"trippest_sum" => 0,
|
|
|
"vendor_sum" => 0,
|
|
|
"other_sum_cost" => 0,
|
|
|
"other_sum" => 0,
|
|
|
"other_vendor_sum" => 0
|
|
|
),
|
|
|
"vendor" =>
|
|
|
array(
|
|
|
"trippest_sum" => 0,
|
|
|
"vendor_sum" => 0,
|
|
|
"transfer_sum" => 0,
|
|
|
"other_sum_cost" => 0,
|
|
|
"other_sum" => 0,
|
|
|
"other_vendor_sum" => 0
|
|
|
)
|
|
|
);
|
|
|
// 按照海纳的算法
|
|
|
foreach ($opi_summoney as $key => $opi_money) {
|
|
|
if (floatval($opi_money['vendor_sum']) > 0) {
|
|
|
$ret["trippest"]['vendor_sum'] = bcadd(floatval($ret["trippest"]['vendor_sum']), floatval($opi_money['vendor_sum'])) ;
|
|
|
}
|
|
|
if (floatval($opi_money['trippest_sum']) > 0) {
|
|
|
$ret["trippest"]['trippest_sum'] = bcadd(floatval($ret["trippest"]['trippest_sum']), floatval($opi_money['trippest_sum'])) ;
|
|
|
}
|
|
|
$ret['trippest']['other_sum'] = bcadd($ret['trippest']['other_sum'], $opi_money['other_price_sum']);
|
|
|
$ret['trippest']['other_sum_cost'] = bcadd($ret['trippest']['other_sum_cost'], $opi_money['other_cost_sum']);
|
|
|
$ret["trippest"]['trippest_sum'] = bcsub($ret["trippest"]['trippest_sum'], $opi_money['other_price_sum']);
|
|
|
$ret['trippest']['other_vendor_sum'] = bcadd($ret['trippest']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']);
|
|
|
}
|
|
|
// 按照图兰朵算法: Trippest自营订单的代收算在海纳收款
|
|
|
foreach ($opi_summoney as $kv => $opi_money_v) {
|
|
|
if (strval($opi_money_v['COLI_OPI_ID']) === '435') {
|
|
|
$ret["vendor"]['vendor_sum'] = bcadd(floatval($ret["vendor"]['vendor_sum']), floatval($opi_money_v['vendor_sum'])) ;
|
|
|
} else {
|
|
|
$ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['trippest_sum'])) ;
|
|
|
$ret["vendor"]['trippest_sum'] = bcadd(floatval($ret["vendor"]['trippest_sum']), floatval($opi_money_v['vendor_sum'])) ;
|
|
|
}
|
|
|
$ret['vendor']['other_sum'] = bcadd($ret['vendor']['other_sum'], $opi_money_v['other_price_sum']);
|
|
|
$ret['vendor']['other_sum_cost'] = bcadd($ret['vendor']['other_sum_cost'], $opi_money_v['other_cost_sum']);
|
|
|
$ret["vendor"]['trippest_sum'] = bcsub($ret["vendor"]['trippest_sum'], $opi_money_v['other_price_sum']);
|
|
|
$ret['vendor']['other_vendor_sum'] = bcadd($ret['vendor']['other_vendor_sum'], $opi_money['other_vendorprice_RMB_sum']);
|
|
|
}
|
|
|
$ret["vendor"]["transfer_sum"] = bcsub($ret["vendor"]['vendor_sum'], $ret["trippest"]['vendor_sum']);
|
|
|
if ($ret["vendor"]["transfer_sum"] != 0) {
|
|
|
$result['transfer_sum'] = bcadd($result['transfer_sum'], $ret["vendor"]["transfer_sum"]);
|
|
|
$result['trippest_order_vendor_money'] = array_merge($result['trippest_order_vendor_money'], $this->money_model->trippest_order_with_vendormoney($vendor, $sourcetype, $start_date, $end_date));
|
|
|
}
|
|
|
|
|
|
$result["money"][strval($vendor)] = $ret;
|
|
|
$result["money"][strval($vendor)]["vendor_code"] = $vendor;
|
|
|
$result["money"][strval($vendor)]["vendor_name"] = $vendor_sourcetype[strval($vendor)]["vendor_name"];
|
|
|
/** 团款合计 */
|
|
|
$result['col_sum']['trippest']['sum_trippest_sum'] = bcadd(
|
|
|
bcadd($result['col_sum']['trippest']['sum_trippest_sum'], $ret["trippest"]['trippest_sum'])
|
|
|
,$ret['trippest']['other_sum']);
|
|
|
$result['col_sum']['trippest']['sum_vendor_sum'] = bcadd($result['col_sum']['trippest']['sum_vendor_sum'], $ret["trippest"]['vendor_sum']);
|
|
|
$result['col_sum']['trippest']['sum_other'] = bcadd($result['col_sum']['trippest']['sum_other'], $ret['trippest']['other_sum']);
|
|
|
|
|
|
$result['col_sum']['vendor']['sum_trippest_sum'] = bcadd(
|
|
|
bcadd($result['col_sum']['vendor']['sum_trippest_sum'], $ret["vendor"]['trippest_sum'])
|
|
|
,$ret['vendor']['other_sum']);
|
|
|
$result['col_sum']['vendor']['sum_vendor_sum'] = bcadd($result['col_sum']['vendor']['sum_vendor_sum'], $ret["vendor"]['vendor_sum']);
|
|
|
$result['col_sum']['vendor']['sum_other'] = bcadd($result['col_sum']['vendor']['sum_other'], $ret['vendor']['other_sum']);
|
|
|
}
|
|
|
/** 成本 */
|
|
|
$vendors_cost = $this->money_model->vendor_cost(implode(',', $vendors), $start_date, $end_date);
|
|
|
foreach ($result['money'] as $km => &$vm) {
|
|
|
$vm['vendor_cost'] = $vm['trippest_cost'] = 0;
|
|
|
foreach ($vendors_cost as $kvc => $vvc) {
|
|
|
if (strval($vm['vendor_code']) === strval($vvc['vendor_code'])) {
|
|
|
$vm['vendor_cost'] = $vvc['vendor_cost'];
|
|
|
}
|
|
|
}
|
|
|
// 成本总计
|
|
|
$result['col_sum']['trippest']['sum_trippest_cost'] = $result['col_sum']['vendor']['sum_trippest_cost'] = bcadd($result['col_sum']['trippest']['sum_trippest_cost'], $vm['trippest_cost']);
|
|
|
$result['col_sum']['trippest']['sum_vendor_cost'] = $result['col_sum']['vendor']['sum_vendor_cost'] = bcadd(
|
|
|
bcadd($result['col_sum']['trippest']['sum_vendor_cost'], $vm['vendor_cost'])
|
|
|
,$vm['trippest']['other_sum_cost']);
|
|
|
}
|
|
|
foreach ($result['money'] as $kmi => &$vmi) {
|
|
|
/** 利润 */
|
|
|
$vmi['trippest']['total_profit'] = bcsub(
|
|
|
bcadd(bcadd($vmi['trippest']['trippest_sum'], $vmi['trippest']['vendor_sum']),$vmi['trippest']['other_sum']),
|
|
|
bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['trippest']['other_sum_cost']));
|
|
|
$vmi['vendor']['total_profit'] = bcsub(
|
|
|
bcadd(bcadd($vmi['vendor']['trippest_sum'], $vmi['vendor']['vendor_sum']),$vmi['vendor']['other_sum']),
|
|
|
bcadd(bcadd($vmi['trippest_cost'], $vmi['vendor_cost']),$vmi['vendor']['other_sum_cost']));
|
|
|
/** 利润分成 */
|
|
|
$vmi['trippest']['vendor_profit'] = bcmul($vmi['trippest']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]);
|
|
|
$vmi['trippest']['trippest_profit'] = bcmul($vmi['trippest']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) );
|
|
|
$vmi['vendor']['vendor_profit'] = bcmul($vmi['vendor']['total_profit'], $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]);
|
|
|
$vmi['vendor']['trippest_profit'] = bcmul($vmi['vendor']['total_profit'], bcsub(1, $vendor_sourcetype[strval($vmi['vendor_code'])]["profit_rate"]) );
|
|
|
/** Trippest应付地接 */
|
|
|
$vmi['trippest']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['trippest']['vendor_profit'] ), $vmi['trippest']['vendor_sum']);
|
|
|
$vmi['vendor']['payout'] = bcsub(bcadd($vmi['vendor_cost'], $vmi['vendor']['vendor_profit'] ), $vmi['vendor']['vendor_sum']);
|
|
|
|
|
|
/** 利润总计 */
|
|
|
$result['col_sum']['trippest']['sum_profit'] = bcadd($result['col_sum']['trippest']['sum_profit'], $vmi['trippest']['total_profit']);
|
|
|
$result['col_sum']['trippest']['sum_trippest_profit'] = bcadd($result['col_sum']['trippest']['sum_trippest_profit'], $vmi['trippest']['trippest_profit']);
|
|
|
$result['col_sum']['trippest']['sum_vendor_profit'] = bcadd($result['col_sum']['trippest']['sum_vendor_profit'], $vmi['trippest']['vendor_profit']);
|
|
|
|
|
|
$result['col_sum']['vendor']['sum_profit'] = bcadd($result['col_sum']['vendor']['sum_profit'], $vmi['vendor']['total_profit']);
|
|
|
$result['col_sum']['vendor']['sum_trippest_profit'] = bcadd($result['col_sum']['vendor']['sum_trippest_profit'], $vmi['vendor']['trippest_profit']);
|
|
|
$result['col_sum']['vendor']['sum_vendor_profit'] = bcadd($result['col_sum']['vendor']['sum_vendor_profit'], $vmi['vendor']['vendor_profit']);
|
|
|
/** 应付总计 */
|
|
|
$result['col_sum']['trippest']['sum_payout'] = bcadd($result['col_sum']['trippest']['sum_payout'], $vmi['trippest']['payout']);
|
|
|
$result['col_sum']['vendor']['sum_payout'] = bcadd($result['col_sum']['vendor']['sum_payout'], $vmi['vendor']['payout']);
|
|
|
}
|
|
|
$this->load->view('vendor_money_sum', $result);
|
|
|
return ;
|
|
|
}
|
|
|
|
|
|
public function download_output($export_list, $file_name)
|
|
|
{
|
|
|
if (empty($export_list)) {
|
|
|
return false;
|
|
|
}
|
|
|
$this->load->library('PHPExcel');
|
|
|
$objPHPExcel = new PHPExcel();
|
|
|
$objPHPExcel->setActiveSheetIndex(0);
|
|
|
//set width
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(5);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(30);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(15);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(20);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(20);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(20);
|
|
|
$objPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(20);
|
|
|
// 对齐
|
|
|
$objPHPExcel->getActiveSheet()->getStyle('B')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
|
|
|
$objPHPExcel->getActiveSheet()->getStyle('C')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
$objPHPExcel->getActiveSheet()->getStyle('D')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
|
|
|
// 表标题行
|
|
|
$objPHPExcel->getActiveSheet()
|
|
|
->SetCellValue('A1', '#')
|
|
|
->SetCellValue('B1', '团号')
|
|
|
->SetCellValue('C1', '①海纳代收')
|
|
|
->SetCellValue('D1', '②地接代收')
|
|
|
->SetCellValue('E1', '③海纳成本')
|
|
|
->SetCellValue('F1', '④地接成本')
|
|
|
->SetCellValue('G1', '⑤利润');
|
|
|
bcscale(2);
|
|
|
$rowCount = 2;
|
|
|
foreach ($export_list as $key => $row) {
|
|
|
$objPHPExcel->getActiveSheet()
|
|
|
->SetCellValue('A'.$rowCount, ($rowCount-1))
|
|
|
// ->SetCellValue('A'.$rowCount, $row->pn_sn)
|
|
|
->setCellValueExplicit('B'.$rowCount, $row['GRI_No'],PHPExcel_Cell_DataType::TYPE_STRING)
|
|
|
->setCellValue('C'.$rowCount, number_format($row['haina_income'], 2, ".", ""))
|
|
|
->setCellValue('D'.$rowCount, number_format($row['vendor_income'], 2, ".", ""))
|
|
|
->SetCellValue('E'.$rowCount, 0)
|
|
|
->SetCellValue('F'.$rowCount, $row['group_vendor_cost'])
|
|
|
->setCellValue('G'.$rowCount, bcsub(bcadd($row['vendor_income'],$row['haina_income']),$row['group_vendor_cost']))
|
|
|
;
|
|
|
$rowCount++;
|
|
|
}
|
|
|
$rowCount++; // 隔一行
|
|
|
$filename = $file_name . "_" . date('Y-m-d');
|
|
|
header('Content-Type: application/vnd.ms-excel');
|
|
|
header('Content-Disposition: attachment;filename="' . $filename . '.xls"');
|
|
|
header('Cache-Control: max-age=0');
|
|
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
|
|
|
$objWriter->save('php://output');
|
|
|
}
|
|
|
|
|
|
public function report_precheck()
|
|
|
{
|
|
|
$data = array();
|
|
|
$data['default_date1'] = date('Y-m-01', strtotime("last month"));
|
|
|
$data['default_date2'] = date('Y-m-d H:i:s', mktime(0,0,0,date('m'),1,date('Y'))-1);
|
|
|
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
|
|
|
$data['default_vendor'] = array_keys($vendor_sourcetype);
|
|
|
$this->load->view('order_report_precheck', $data);
|
|
|
}
|
|
|
|
|
|
public function precheck()
|
|
|
{
|
|
|
$this->permission->is_admin(true);
|
|
|
$ret = array();
|
|
|
$date_range = $this->input->post("date_range");
|
|
|
preg_match_all('/\d{4}\-\d{2}\-\d{2}/', $date_range, $date_range_arr);
|
|
|
if (empty($date_range_arr[0])) {
|
|
|
return $this->settlement();
|
|
|
}
|
|
|
$start_date = $date_range_arr[0][0];
|
|
|
$end_date =$date_range_arr[0][1] . " 23:59:59";
|
|
|
if ($end_date == null) {
|
|
|
$end_date = date("Y-m-d H:i:s", strtotime("+1 month", strtotime($start_date))-1);
|
|
|
}
|
|
|
$ret['default_date1'] = $start_date;
|
|
|
$ret['default_date2'] = $end_date;
|
|
|
$vendors = $this->input->post("vendors");
|
|
|
$ret['default_vendor'] = $vendors;
|
|
|
$vendor_sourcetype = $this->trippest->vendor_sourcetype();
|
|
|
// price [Trippest receipts & agency receipts]
|
|
|
$ret['price_error'] = $this->money_model->get_precheck_price_error($start_date, $end_date, implode(',' ,$vendors));
|
|
|
// cost
|
|
|
$HT_combine_cost = $this->money_model->get_combine_cost($start_date, $end_date, implode(',' ,$vendors));
|
|
|
$cost_error = array();
|
|
|
$ht_no_match = array();
|
|
|
$xls_no_match = array();
|
|
|
// $config['upload_path'] = FCPATH.'download_statement\temp_files';
|
|
|
$config['upload_path'] = 'download_statement/temp_files';
|
|
|
// $config['file_name'] = "1.xls";
|
|
|
$config['encrypt_name'] = true;
|
|
|
if ( ! is_dir($config['upload_path'])) {
|
|
|
mkdir($config['upload_path'], 0777, true);
|
|
|
}
|
|
|
$config['allowed_types'] = 'xls|xlsx';
|
|
|
$config['max_size'] = 0;
|
|
|
$this->load->library('upload', $config);
|
|
|
if ( ! $this->upload->do_upload('upload_cost'))
|
|
|
{
|
|
|
$ret['error_msg'] = $this->upload->display_errors();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
$upload_data = array('upload_data' => $this->upload->data());
|
|
|
$read_path = $upload_data['upload_data']['full_path'];
|
|
|
$xls_data=array();
|
|
|
$this->load->library('PHPExcel');
|
|
|
$PHPExcel = new PHPExcel();
|
|
|
/**默认用excel2007读取excel,若格式不对,则用之前的版本进行读取*/
|
|
|
$PHPReader = new PHPExcel_Reader_Excel2007();
|
|
|
if(!$PHPReader->canRead($read_path)){
|
|
|
$PHPReader = new PHPExcel_Reader_Excel5();
|
|
|
if(!$PHPReader->canRead($read_path)){
|
|
|
echo 'no Excel';
|
|
|
return ;
|
|
|
}
|
|
|
}
|
|
|
$PHPExcel = $PHPReader->load($read_path);
|
|
|
/**读取excel文件中的第一个工作表*/
|
|
|
$currentSheet = $PHPExcel->getSheet(0);
|
|
|
/**取得最大的列号*/
|
|
|
// $allColumn = $currentSheet->getHighestColumn();
|
|
|
$allColumn = 'B';
|
|
|
/**取得一共有多少行*/
|
|
|
$allRow = $currentSheet->getHighestRow();
|
|
|
$col_titles = array('A' => 'group_name', 'B' => 'group_cost');
|
|
|
/**从第3行开始输出,因为excel表中第一行为列名*/
|
|
|
for($currentRow = 3;$currentRow <= $allRow;$currentRow++){
|
|
|
$row_tmp = array();
|
|
|
/**从第A列开始输出*/
|
|
|
for($currentColumn= 'A';$currentColumn<= $allColumn; $currentColumn++){
|
|
|
/**ord()将字符转为十进制数*/
|
|
|
$val = $currentSheet->getCellByColumnAndRow(ord($currentColumn) - 65,$currentRow)->getValue();
|
|
|
$col_mean = $col_titles[$currentColumn];
|
|
|
$row_tmp[$col_mean] = $val;
|
|
|
}
|
|
|
if (isset($row_tmp['group_name']) && !empty($row_tmp['group_name'])) {
|
|
|
$xls_data[] = $row_tmp;
|
|
|
}
|
|
|
}
|
|
|
$all_xls_group_name = array_column($xls_data, 'group_name');
|
|
|
$all_ht_group_no = array_column($HT_combine_cost, 'GCI_combineNo');
|
|
|
$not_in_ht = array_diff($all_xls_group_name, $all_ht_group_no);
|
|
|
$not_in_xls = array_diff($all_ht_group_no, $all_xls_group_name);
|
|
|
foreach ($HT_combine_cost as $kht => $ht_cost) {
|
|
|
if (in_array($ht_cost['GCI_combineNo'], $not_in_xls)
|
|
|
&& !in_array(strtolower($ht_cost['GCI_combineNo']),array('cancel', 'forbidden'))
|
|
|
) {
|
|
|
$ht_no_match[] = $ht_cost;
|
|
|
}
|
|
|
foreach ($xls_data as $kxls => $xls_cost) {
|
|
|
if ($xls_cost['group_name'] == $ht_cost['GCI_combineNo']
|
|
|
&& strval($ht_cost['cost']) != strval($xls_cost['group_cost'])
|
|
|
) {
|
|
|
$cost_error[] = array_merge($ht_cost, $xls_cost);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
foreach ($xls_data as $kxls => $xls_cost) {
|
|
|
if (in_array($xls_cost['group_name'], $not_in_ht)) {
|
|
|
$xls_no_match[] = $xls_cost;
|
|
|
}
|
|
|
}
|
|
|
unlink($upload_data['upload_data']['full_path']);
|
|
|
}
|
|
|
$ret['cost_error'] = $cost_error;
|
|
|
$ret['ht_no_match'] = $ht_no_match;
|
|
|
$ret['xls_no_match'] = $xls_no_match;
|
|
|
return $this->load->view('order_report_precheck', $ret);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/* End of file vendor_money.php */
|
|
|
/* Location: ./third_party/trippestOrderSync/controllers/vendor_money.php */
|