|
@@ -2171,7 +2171,7 @@ class ocean_order {
|
|
|
$_schemas = "ocean";
|
|
$_schemas = "ocean";
|
|
|
}
|
|
}
|
|
|
$sql = "with o as(
|
|
$sql = "with o as(
|
|
|
- SELECT o.* from ocean o where serial_no = '" . $serial_no . "'
|
|
|
|
|
|
|
+ SELECT o.* from $order_from.ocean o where serial_no = '" . $serial_no . "'
|
|
|
)
|
|
)
|
|
|
SELECT m_eta as _m_eta, h_bol as _h_bol, m_bol as _m_bol,job_no as _job_bol,
|
|
SELECT m_eta as _m_eta, h_bol as _h_bol, m_bol as _m_bol,job_no as _job_bol,
|
|
|
o.* ,sh.*, cn.* ,aa.*,dd.*,fd.*,oo.*,koe.loadterm
|
|
o.* ,sh.*, cn.* ,aa.*,dd.*,fd.*,oo.*,koe.loadterm
|
|
@@ -2338,10 +2338,74 @@ class ocean_order {
|
|
|
$ocean['shippr_uncode'] = $ocean['place_of_receipt_un'];
|
|
$ocean['shippr_uncode'] = $ocean['place_of_receipt_un'];
|
|
|
$ocean['consignee_uncode'] = $ocean['place_of_delivery_un'];
|
|
$ocean['consignee_uncode'] = $ocean['place_of_delivery_un'];
|
|
|
|
|
|
|
|
|
|
+ //delivery
|
|
|
|
|
+ $order_from = $_REQUEST['_schemas'];
|
|
|
|
|
+ $deliverySql = "with aa as (SELECT o.serial_no, o.master_base_number from $order_from.ocean o WHERE o.serial_no='".$ocean["serial_no"]."'),
|
|
|
|
|
+ bb as (select o.serial_no from $order_from.ocean o
|
|
|
|
|
+ where exists(select 1 from aa where aa.master_base_number= o.master_base_number)
|
|
|
|
|
+ and o.bol_type = 'CONSOL' and o.status::text <> 'Cancelled'::text),
|
|
|
|
|
+ cc as (select serial_no from aa
|
|
|
|
|
+ union all
|
|
|
|
|
+ select serial_no from bb
|
|
|
|
|
+ ),
|
|
|
|
|
+ h as (select * from station_data.do_header h where h.serial_no = (select serial_no from cc) and from_station = '".$ocean["from_station"]."')
|
|
|
|
|
+
|
|
|
|
|
+ select h.est_delivery_date,h.est_delivery_time,
|
|
|
|
|
+ h.consignee_country_code,h.consignee_city_code,
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = CONCAT(h.consignee_country_code, h.consignee_city_code) limit 1) as timezone,
|
|
|
|
|
+ d.ctnr
|
|
|
|
|
+ from h left join station_data.do_detail d on h.id = d.do_header_id order by h.est_delivery_date";
|
|
|
|
|
+ // $deliverySql = "with aa as (SELECT o.serial_no, o.master_base_number from $order_from.ocean o WHERE o.serial_no='".$ocean["serial_no"]."'),
|
|
|
|
|
+ // bb as (select o.serial_no from $order_from.ocean o
|
|
|
|
|
+ // where exists(select 1 from aa where aa.master_base_number= o.master_base_number)
|
|
|
|
|
+ // and o.bol_type = 'CONSOL' and o.status::text <> 'Cancelled'::text),
|
|
|
|
|
+ // cc as (select serial_no from aa
|
|
|
|
|
+ // union all
|
|
|
|
|
+ // select serial_no from bb
|
|
|
|
|
+ // ),
|
|
|
|
|
+ // h as (select * from do_header h where h.serial_no = (select serial_no from cc))
|
|
|
|
|
+
|
|
|
|
|
+ // select h.est_delivery_date,h.est_delivery_time,
|
|
|
|
|
+ // h.consignee_country_code,h.consignee_city_code,
|
|
|
|
|
+ // (select time_zone from public.city_timezone where uncode = CONCAT(h.consignee_country_code, h.consignee_city_code) limit 1) as timezone,
|
|
|
|
|
+ // d.ctnr
|
|
|
|
|
+ // from h left join do_detail d on h.do_serial_no = d.do_serial_no order by h.est_delivery_date";
|
|
|
|
|
+
|
|
|
|
|
+ $delivery = common::excuteListSql($deliverySql);
|
|
|
|
|
+
|
|
|
/* Container Status */
|
|
/* Container Status */
|
|
|
//Container_Status 新版只显示几个状态, CTNR# EE I AE VD VA
|
|
//Container_Status 新版只显示几个状态, CTNR# EE I AE VD VA
|
|
|
//记录所有的信息 EDI315TimeAndLocation
|
|
//记录所有的信息 EDI315TimeAndLocation
|
|
|
$EDIDate = common::getEDI315StatusForDetail($ocean["serial_no"]);
|
|
$EDIDate = common::getEDI315StatusForDetail($ocean["serial_no"]);
|
|
|
|
|
+ $deliveredData = array();
|
|
|
|
|
+ $deliveredChildrenDate = "";
|
|
|
|
|
+ if(!empty($delivery)){
|
|
|
|
|
+ foreach($delivery as $_delivery){
|
|
|
|
|
+ //添加containerStatusData的delivery
|
|
|
|
|
+ $est_delivery_date = $_delivery["est_delivery_date"];
|
|
|
|
|
+ if (!empty($_delivery["est_delivery_time"])) {
|
|
|
|
|
+ $est_delivery_date.= " " . $_delivery["est_delivery_time"];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $location_code = $_delivery["consignee_country_code"]."".$_delivery["consignee_city_code"];
|
|
|
|
|
+
|
|
|
|
|
+ foreach($EDIDate['containerStatusData'] as $cskey => $csval){
|
|
|
|
|
+ if($csval['ctnr_label'] == $_delivery['ctnr']){
|
|
|
|
|
+ $contentTemp = array("title" =>"Last Mile Delivery",
|
|
|
|
|
+ "date"=>$est_delivery_date,
|
|
|
|
|
+ "country"=>$location_code,
|
|
|
|
|
+ "timezone"=>$_delivery['timezone']);
|
|
|
|
|
+
|
|
|
|
|
+ $EDIDate['containerStatusData'][$cskey]['content'][] = $contentTemp;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ //添加simplexData的delivery
|
|
|
|
|
+ $deliveredData[] = array("label" =>"Delivered","date"=>$est_delivery_date,"location"=>$location_code,
|
|
|
|
|
+ "container"=>$_delivery['ctnr'],'timezone'=>$_delivery['timezone']);
|
|
|
|
|
+ $deliveredChildrenDate = $_delivery["est_delivery_date"];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$data['containerStatusData'] = $EDIDate['containerStatusData'];
|
|
$data['containerStatusData'] = $EDIDate['containerStatusData'];
|
|
|
$data['EDI315TimeAndLocation'] = $EDIDate['EDI315TimeAndLocation'];
|
|
$data['EDI315TimeAndLocation'] = $EDIDate['EDI315TimeAndLocation'];
|
|
|
$VD = $EDIDate['VD'];
|
|
$VD = $EDIDate['VD'];
|
|
@@ -2442,6 +2506,10 @@ class ocean_order {
|
|
|
$children[] = array("label" =>"Cargo handover/Delivered","date" =>$ocean_milestone_status_code['IFFDEL']['act_date']);
|
|
$children[] = array("label" =>"Cargo handover/Delivered","date" =>$ocean_milestone_status_code['IFFDEL']['act_date']);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ $children[] = array("label" =>"Delivered","date" =>$deliveredChildrenDate);
|
|
|
|
|
+
|
|
|
|
|
+ $place_of_Delivery_status["children"] = $children;
|
|
|
|
|
+ $place_of_Delivery_status["deliveredData"] = $deliveredData;
|
|
|
$simplexData[] = $place_of_Delivery_status;
|
|
$simplexData[] = $place_of_Delivery_status;
|
|
|
$data['shipmentData'] = $simplexData;
|
|
$data['shipmentData'] = $simplexData;
|
|
|
|
|
|