|
|
|
@ -72,9 +72,9 @@ class Order_finance extends CI_Controller {
|
|
|
|
|
$report_order['childnumber'] = 0;
|
|
|
|
|
$report_order['babynumber'] = 0;
|
|
|
|
|
$report_order['ordernumber'] = $order_info->ordernumber;
|
|
|
|
|
$report_order['TuanName'] = $order_info->TuanName;
|
|
|
|
|
$report_order['TuanName'] = mb_substr($order_info->TuanName, 0, 50);
|
|
|
|
|
$report_order['operater'] = $order_info->operater;
|
|
|
|
|
$report_order['Agenter'] = $order_info->Agenter;
|
|
|
|
|
$report_order['Agenter'] = mb_substr($order_info->Agenter,0,10);
|
|
|
|
|
$report_order['ChinaName'] = $order_info->ChinaName;
|
|
|
|
|
$report_order['country'] = $order_info->country;
|
|
|
|
|
$report_order['reservedate'] = $order_info->reservedate;
|
|
|
|
@ -118,13 +118,12 @@ class Order_finance extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/** 保存图兰朵包价线路产品的成本到report_tour */
|
|
|
|
|
// TODO
|
|
|
|
|
// pvt
|
|
|
|
|
$report_tour_pvt = array();
|
|
|
|
|
if ( ! empty($ret->pvt)) {
|
|
|
|
|
$report_tour_pvt['ordernumber'] = $ret->pvt->coli_id;
|
|
|
|
|
$report_tour_pvt['tourCode'] = $ret->pvt->PAG_Code;
|
|
|
|
|
$report_tour_pvt['tourname'] = $ret->pvt->pag_name;
|
|
|
|
|
$report_tour_pvt['tourCode'] = mb_substr($ret->pvt->PAG_Code, 0, 50);
|
|
|
|
|
$report_tour_pvt['tourname'] = mb_substr($ret->pvt->pag_name, 0, 200);
|
|
|
|
|
$report_tour_pvt['tourtime'] = $ret->pvt->startdate;
|
|
|
|
|
$report_tour_pvt['tourRSd'] = $ret->pvt->adult_num;
|
|
|
|
|
$report_tour_pvt['tourRSx'] = $ret->pvt->child_num;
|
|
|
|
@ -133,8 +132,8 @@ class Order_finance extends CI_Controller {
|
|
|
|
|
$report_tour_pvt['tourcost'] = $ret->pvt->cost_sum;
|
|
|
|
|
$report_tour_pvt['tourPrice'] = $this->OrderFinance_model->convert_to_RMB($ret->pvt->totalPrice);
|
|
|
|
|
$report_tour_pvt['tourProfit'] = ($report_tour_pvt['tourPrice']>0) ? bcsub($report_tour_pvt['tourPrice'], $report_tour_pvt['tourcost']) : 0;
|
|
|
|
|
$report_tour_pvt['tourProvide'] = $ret->pvt->vendor_name;
|
|
|
|
|
$report_tour_pvt['tourBZ'] = $ret->pvt->comment;
|
|
|
|
|
$report_tour_pvt['tourProvide'] = mb_substr($ret->pvt->vendor_name, 0, 50);
|
|
|
|
|
$report_tour_pvt['tourBZ'] = mb_substr($ret->pvt->comment, 0, 150);
|
|
|
|
|
$report_tour_pvt['orderstats'] = 0;
|
|
|
|
|
// 成本详情
|
|
|
|
|
$report_tour_pvt['RPT_Car'] = $ret->pvt->cost_category['touristCarOperations'];
|
|
|
|
@ -155,8 +154,8 @@ class Order_finance extends CI_Controller {
|
|
|
|
|
foreach ($ret->combine_cost as $kcc => $cost) {
|
|
|
|
|
$cost_c = array();
|
|
|
|
|
$cost_c['ordernumber'] = $cost->coli_id;
|
|
|
|
|
$cost_c['tourCode'] = implode(',', array_unique(array_map(function($ele){ return $ele->real_code; }, $cost->order_cost)));
|
|
|
|
|
$cost_c['tourname'] = $cost->pag_name;
|
|
|
|
|
$cost_c['tourCode'] = mb_substr(implode(',', array_unique(array_map(function($ele){ return $ele->real_code; }, $cost->order_cost))), 0, 50);
|
|
|
|
|
$cost_c['tourname'] = mb_substr($cost->pag_name, 0, 200) ;
|
|
|
|
|
$cost_c['tourtime'] = $cost->startdate;
|
|
|
|
|
$cost_c['tourRSd'] = $cost->order_cost[0]->adult_num;
|
|
|
|
|
$cost_c['tourRSx'] = $cost->order_cost[0]->child_num;
|
|
|
|
@ -171,8 +170,8 @@ class Order_finance extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
$cost_c['tourPrice'] = $this->OrderFinance_model->convert_to_RMB($cost_c_price);
|
|
|
|
|
$cost_c['tourProfit'] = ($cost_c['tourPrice']>0) ? bcsub($cost_c['tourPrice'], $cost_c['tourcost']) : 0;
|
|
|
|
|
$cost_c['tourProvide'] = $cost->vendor_name;
|
|
|
|
|
$cost_c['tourBZ'] = $cost->comment;
|
|
|
|
|
$cost_c['tourProvide'] = mb_substr($cost->vendor_name, 0, 50);
|
|
|
|
|
$cost_c['tourBZ'] = mb_substr($cost->comment, 0, 150);
|
|
|
|
|
$cost_c['orderstats'] = 0;
|
|
|
|
|
// 成本详情
|
|
|
|
|
$cost_c['RPT_Car'] = $cost->cost_category['touristCarOperations'];
|
|
|
|
@ -343,8 +342,8 @@ class Order_finance extends CI_Controller {
|
|
|
|
|
}
|
|
|
|
|
$this_order_real_pag_sns = array_map(function($ele) {return $ele->real_pag_sn;}, $ret->order_cost);
|
|
|
|
|
$pags_info = $this->OrderFinance_model->get_pag_info(implode(',', array_unique(array_filter($this_order_real_pag_sns)))); // $pag_sns
|
|
|
|
|
$ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; // 50
|
|
|
|
|
$ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; // TODO 限制200 用mb_substr('UTF-8')
|
|
|
|
|
$ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ;
|
|
|
|
|
$ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ;
|
|
|
|
|
$ret->PAG_Code = implode(",", $ret->combine_pags);
|
|
|
|
|
$ret->comment = "拼团" . $combineNo . ", 按" . $ret->person_num . "人等";
|
|
|
|
|
$combine_cost = $this->OrderFinance_model->get_combine_sumMoney($combineNo);
|
|
|
|
@ -394,9 +393,9 @@ class Order_finance extends CI_Controller {
|
|
|
|
|
$ret->comment = "PVT,共" . $ret->person_num . "人次";// 150
|
|
|
|
|
$pag_sns = array_values(array_unique(array_map(function($ele) {return $ele->COLD_ServiceSN;}, $all_orders)));
|
|
|
|
|
$pags_info = $this->OrderFinance_model->get_pag_info(implode(',', $pag_sns));
|
|
|
|
|
$ret->PAG_Code = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->PAG_Code;}, $pags_info)))); // TODO 限制50
|
|
|
|
|
$ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ; // 50
|
|
|
|
|
$ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ; // TODO 限制200 用mb_substr('UTF-8')
|
|
|
|
|
$ret->PAG_Code = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->PAG_Code;}, $pags_info))));
|
|
|
|
|
$ret->vendor_name = implode(",", array_values(array_unique(array_map(function($ele) {return $ele->VEI2_CompanyBN;}, $pags_info)))) ;
|
|
|
|
|
$ret->pag_name = implode(";\r\n", array_map(function($ele) {return $ele->PAG_Title;}, $pags_info)) ;
|
|
|
|
|
// $ret->tour[0] = $tour_s;
|
|
|
|
|
// $ret->order_cost = array_sum(array_map(function($ele) {return $ele->cost_sum;}, $ret->tour));
|
|
|
|
|
return $ret;
|
|
|
|
|