|
@@ -951,6 +951,8 @@ class ocean_order {
|
|
|
|
|
|
|
|
$sql = "with oo as (SELECT order_from as _schemas,serial_no as __serial_no, serial_no,transport_mode,
|
|
$sql = "with oo as (SELECT order_from as _schemas,serial_no as __serial_no, serial_no,transport_mode,
|
|
|
h_bol as _hbol, isf_bol as _isfbol, consignee_city as _consignee_city,
|
|
h_bol as _hbol, isf_bol as _isfbol, consignee_city as _consignee_city,
|
|
|
|
|
+ (select user_login from kln_user_subscribed us
|
|
|
|
|
+ where lower(us.user_login) = '".strtolower(_getLoginName())."' and us.subscribed_serial_no = kln_ocean.serial_no) as is_subscribe,
|
|
|
CASE
|
|
CASE
|
|
|
WHEN (m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
WHEN (m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
|
WHEN ((m_iffcpu is not null or m_iffrec is not null) and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Cargo Received'::text
|
|
WHEN ((m_iffcpu is not null or m_iffrec is not null) and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Cargo Received'::text
|
|
@@ -972,6 +974,8 @@ class ocean_order {
|
|
|
|
|
|
|
|
$tmp_search_without_limit = "with oo as (SELECT order_from as _schemas,serial_no as __serial_no, serial_no,transport_mode,
|
|
$tmp_search_without_limit = "with oo as (SELECT order_from as _schemas,serial_no as __serial_no, serial_no,transport_mode,
|
|
|
h_bol as _hbol, isf_bol as _isfbol, consignee_city as _consignee_city,
|
|
h_bol as _hbol, isf_bol as _isfbol, consignee_city as _consignee_city,
|
|
|
|
|
+ (select user_login from kln_user_subscribed us
|
|
|
|
|
+ where lower(us.user_login) = '".strtolower(_getLoginName())."' and us.subscribed_serial_no = kln_ocean.serial_no) as is_subscribe,
|
|
|
CASE
|
|
CASE
|
|
|
WHEN (m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
WHEN (m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
|
WHEN ((m_iffcpu is not null or m_iffrec is not null) and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Cargo Received'::text
|
|
WHEN ((m_iffcpu is not null or m_iffrec is not null) and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Cargo Received'::text
|
|
@@ -1002,6 +1006,13 @@ class ocean_order {
|
|
|
$rs[$index]["Mode"] = $val['transport_mode'] == 'sea' ? "Ocean Freight" : ($val['transport_mode'] == 'air' ? "Air Freight": "");
|
|
$rs[$index]["Mode"] = $val['transport_mode'] == 'sea' ? "Ocean Freight" : ($val['transport_mode'] == 'air' ? "Air Freight": "");
|
|
|
//status 改为ocean_milestone里的信息
|
|
//status 改为ocean_milestone里的信息
|
|
|
$rs[$index]["Status"] = $rs[$index]["new_status"];
|
|
$rs[$index]["Status"] = $rs[$index]["new_status"];
|
|
|
|
|
+ //订阅的参数
|
|
|
|
|
+ if(empty($rs[$index]["is_subscribe"])){
|
|
|
|
|
+ $rs[$index]['is_subscribe'] = false;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ $rs[$index]['is_subscribe'] = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ $rs[$index]["a"] = common::deCode($val['__serial_no'], 'E');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
$arrTmp = array('searchData' => $rs,
|
|
$arrTmp = array('searchData' => $rs,
|
|
@@ -1258,6 +1269,8 @@ class ocean_order {
|
|
|
'_schemas' =>$_schemas,
|
|
'_schemas' =>$_schemas,
|
|
|
'uncode' =>$uncode,
|
|
'uncode' =>$uncode,
|
|
|
'serial_no' =>$serial_no,
|
|
'serial_no' =>$serial_no,
|
|
|
|
|
+ 'is_subscribe' =>common::checkedSubscribe($serial_no),
|
|
|
|
|
+ 'a' =>common::deCode($serial_no, 'E'),
|
|
|
'can_upload_doc' => strtolower($_SESSION['ONLINE_USER']['can_upload_doc']) == 't' || strtolower($_SESSION['ONLINE_USER']['can_view_doc']) == 't',
|
|
'can_upload_doc' => strtolower($_SESSION['ONLINE_USER']['can_upload_doc']) == 't' || strtolower($_SESSION['ONLINE_USER']['can_view_doc']) == 't',
|
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
|
'canViewAMSLog'=>_canViewAMSLog(),
|
|
'canViewAMSLog'=>_canViewAMSLog(),
|
|
@@ -1415,6 +1428,8 @@ class ocean_order {
|
|
|
'uncode' =>"",
|
|
'uncode' =>"",
|
|
|
'transport_mode' =>"air",
|
|
'transport_mode' =>"air",
|
|
|
'serial_no' =>$serial_no,
|
|
'serial_no' =>$serial_no,
|
|
|
|
|
+ 'is_subscribe' =>common::checkedSubscribe($serial_no),
|
|
|
|
|
+ 'a' =>common::deCode($serial_no, 'E'),
|
|
|
'can_upload_doc' => strtolower($_SESSION['ONLINE_USER']['can_upload_doc']) == 't' || strtolower($_SESSION['ONLINE_USER']['can_view_doc']) == 't',
|
|
'can_upload_doc' => strtolower($_SESSION['ONLINE_USER']['can_upload_doc']) == 't' || strtolower($_SESSION['ONLINE_USER']['can_view_doc']) == 't',
|
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
'canEdiVgm' => _canEdiVgm(),
|
|
|
'canViewAMSLog'=>_canViewAMSLog(),
|
|
'canViewAMSLog'=>_canViewAMSLog(),
|
|
@@ -1825,7 +1840,7 @@ class ocean_order {
|
|
|
)
|
|
)
|
|
|
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.*,
|
|
o.* ,sh.*, cn.* ,aa.*,dd.*,fd.*,oo.*,
|
|
|
- (select uncode from ports where code = o.port_of_transshipment) as port_of_transshipment_un
|
|
|
|
|
|
|
+ (select uncode from $order_from.ports where code = o.port_of_transshipment) as port_of_transshipment_un
|
|
|
from o
|
|
from o
|
|
|
LEFT JOIN LATERAL ( SELECT tracking_no as _tracking_no,shippr_uncode,shipper_city,
|
|
LEFT JOIN LATERAL ( SELECT tracking_no as _tracking_no,shippr_uncode,shipper_city,
|
|
|
consignee_uncode,consignee_city,incoterms,
|
|
consignee_uncode,consignee_city,incoterms,
|
|
@@ -1834,15 +1849,15 @@ class ocean_order {
|
|
|
place_of_receipt_un,
|
|
place_of_receipt_un,
|
|
|
place_of_delivery_un,
|
|
place_of_delivery_un,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.fport_of_loading_un limit 1) as pol_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.fport_of_loading_un limit 1) as pol_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.fport_of_loading_un limit 1) as pol_uncity,
|
|
|
|
|
|
|
+ (select uncity from $order_from.ports where uncode = oo.fport_of_loading_un limit 1) as pol_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.mport_of_discharge_un limit 1) as mpod_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.mport_of_discharge_un limit 1) as mpod_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.mport_of_discharge_un limit 1) as mpod_uncity,
|
|
|
|
|
|
|
+ (select uncity from $order_from.ports where uncode = oo.mport_of_discharge_un limit 1) as mpod_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_receipt_un limit 1) as por_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_receipt_un limit 1) as por_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.place_of_receipt_un limit 1) as por_uncity,
|
|
|
|
|
|
|
+ (select uncity from $order_from.ports where uncode = oo.place_of_receipt_un limit 1) as por_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_delivery_un limit 1) as pod_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_delivery_un limit 1) as pod_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.place_of_delivery_un limit 1) as pod_uncity,
|
|
|
|
|
|
|
+ (select uncity from $order_from.ports where uncode = oo.place_of_delivery_un limit 1) as pod_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.final_desination_uncode limit 1) as _fd_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.final_desination_uncode limit 1) as _fd_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.final_desination_uncode limit 1) as _pd_uncity,
|
|
|
|
|
|
|
+ (select uncity from $order_from.ports where uncode = oo.final_desination_uncode limit 1) as _pd_uncity,
|
|
|
po_no as _po_no,
|
|
po_no as _po_no,
|
|
|
CASE
|
|
CASE
|
|
|
WHEN ((m_iffbcf is not null or m_iffbcf is null) and m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
WHEN ((m_iffbcf is not null or m_iffbcf is null) and m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
@@ -1904,15 +1919,15 @@ class ocean_order {
|
|
|
$sql = "with o as(
|
|
$sql = "with o as(
|
|
|
SELECT oo.*,m_bol as _m_bol, h_bol as _h_bol,
|
|
SELECT oo.*,m_bol as _m_bol, h_bol as _h_bol,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.fport_of_loading_un limit 1) as pol_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.fport_of_loading_un limit 1) as pol_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.fport_of_loading_un limit 1) as pol_uncity,
|
|
|
|
|
|
|
+ (select city from sfs.airport where coalesce(airport.country_abb,'')||airport.airport_code = oo.fport_of_loading_un limit 1) as pol_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.mport_of_discharge_un limit 1) as mpod_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.mport_of_discharge_un limit 1) as mpod_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.mport_of_discharge_un limit 1) as mpod_uncity,
|
|
|
|
|
|
|
+ (select city from sfs.airport where coalesce(airport.country_abb,'')||airport.airport_code = oo.mport_of_discharge_un limit 1) as mpod_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_receipt_un limit 1) as por_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_receipt_un limit 1) as por_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.place_of_receipt_un limit 1) as por_uncity,
|
|
|
|
|
|
|
+ (select city from sfs.airport where coalesce(airport.country_abb,'')||airport.airport_code = oo.place_of_receipt_un limit 1) as por_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_delivery_un limit 1) as pod_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.place_of_delivery_un limit 1) as pod_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.place_of_delivery_un limit 1) as pod_uncity,
|
|
|
|
|
|
|
+ (select city from sfs.airport where coalesce(airport.country_abb,'')||airport.airport_code = oo.place_of_delivery_un limit 1) as pod_uncity,
|
|
|
(select time_zone from public.city_timezone where uncode = oo.final_desination_uncode limit 1) as _fd_timezone,
|
|
(select time_zone from public.city_timezone where uncode = oo.final_desination_uncode limit 1) as _fd_timezone,
|
|
|
- (select uncity from public.ports where uncode = oo.final_desination_uncode limit 1) as _pd_uncity,
|
|
|
|
|
|
|
+ (select city from sfs.airport where coalesce(airport.country_abb,'')||airport.airport_code = oo.final_desination_uncode limit 1) as _pd_uncity,
|
|
|
CASE
|
|
CASE
|
|
|
WHEN ((m_iffbcf is not null or m_iffbcf is null) and m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
WHEN ((m_iffbcf is not null or m_iffbcf is null) and m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Created'::text
|
|
|
WHEN ((m_iffcpu is not null or m_iffrec is not null) and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Cargo Received'::text
|
|
WHEN ((m_iffcpu is not null or m_iffrec is not null) and m_iffdep is null and m_iffarr is null and m_iffdel is null) THEN 'Cargo Received'::text
|