|
@@ -1197,13 +1197,13 @@ class login {
|
|
|
mport_of_discharge_un,
|
|
mport_of_discharge_un,
|
|
|
place_of_receipt_un,
|
|
place_of_receipt_un,
|
|
|
place_of_delivery_un,
|
|
place_of_delivery_un,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.fport_of_loading_un limit 1) as pol_uncity,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.mport_of_discharge_un limit 1) as mpod_uncity,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.place_of_receipt_un limit 1) as por_uncity,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.place_of_delivery_un limit 1) as pod_uncity,
|
|
|
po_no as _po_no,
|
|
po_no as _po_no,
|
|
|
CASE
|
|
CASE
|
|
@@ -1238,7 +1238,7 @@ class login {
|
|
|
address_4 as aa_address_4,
|
|
address_4 as aa_address_4,
|
|
|
city as aa_city, state as aa_state, zipcode as aa_zipcode, country as aa_country,
|
|
city as aa_city, state as aa_state, zipcode as aa_zipcode, country as aa_country,
|
|
|
phone_1 as aa_phone,
|
|
phone_1 as aa_phone,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as aa_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as aa_timezone
|
|
|
FROM ocean.contacts c WHERE o.origin_station::text = c.contact_id::text) aa ON true
|
|
FROM ocean.contacts c WHERE o.origin_station::text = c.contact_id::text) aa ON true
|
|
|
LEFT JOIN LATERAL ( SELECT company as dd_company,
|
|
LEFT JOIN LATERAL ( SELECT company as dd_company,
|
|
|
address_1 as dd_address_1,
|
|
address_1 as dd_address_1,
|
|
@@ -1247,11 +1247,11 @@ class login {
|
|
|
address_4 as dd_address_4,
|
|
address_4 as dd_address_4,
|
|
|
city as dd_city, state as dd_state, zipcode as dd_zipcode, country as dd_country,
|
|
city as dd_city, state as dd_state, zipcode as dd_zipcode, country as dd_country,
|
|
|
phone_1 as dd_phone,
|
|
phone_1 as dd_phone,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as dd_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as dd_timezone
|
|
|
FROM ocean.contacts c WHERE o.destination_station::text = c.contact_id::text) dd ON true
|
|
FROM ocean.contacts c WHERE o.destination_station::text = c.contact_id::text) dd ON true
|
|
|
LEFT JOIN LATERAL ( SELECT
|
|
LEFT JOIN LATERAL ( SELECT
|
|
|
city as fd_city,
|
|
city as fd_city,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as fd_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as fd_timezone
|
|
|
FROM ocean.contacts c WHERE o.final_desination::text = c.contact_id::text) fd ON true";
|
|
FROM ocean.contacts c WHERE o.final_desination::text = c.contact_id::text) fd ON true";
|
|
|
$ocean_arr = common::excuteListSql($sql);
|
|
$ocean_arr = common::excuteListSql($sql);
|
|
|
|
|
|
|
@@ -1355,7 +1355,7 @@ class login {
|
|
|
to_char(to_timestamp(s.event_time, 'HH24MI'), 'HH24:MI') as eventtime,
|
|
to_char(to_timestamp(s.event_time, 'HH24MI'), 'HH24:MI') as eventtime,
|
|
|
e.description,s.event_type as eventtype,
|
|
e.description,s.event_type as eventtype,
|
|
|
s.event_code as eventcode, s.event_city as eventcity,
|
|
s.event_code as eventcode, s.event_city as eventcity,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = s.event_code) as timezone,
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = s.event_code) as timezone,
|
|
|
(select uncity from public.ports where uncode = s.event_code) as uncity,
|
|
(select uncity from public.ports where uncode = s.event_code) as uncity,
|
|
|
case when event ='I' then 'IFFREC'::text
|
|
case when event ='I' then 'IFFREC'::text
|
|
|
when event ='AE' then 'IFFONB'::text
|
|
when event ='AE' then 'IFFONB'::text
|
|
@@ -1427,13 +1427,13 @@ class login {
|
|
|
mport_of_discharge_un,
|
|
mport_of_discharge_un,
|
|
|
place_of_receipt_un,
|
|
place_of_receipt_un,
|
|
|
place_of_delivery_un,
|
|
place_of_delivery_un,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.fport_of_loading_un limit 1) as pol_uncity,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.mport_of_discharge_un limit 1) as mpod_uncity,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.place_of_receipt_un limit 1) as por_uncity,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = 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 public.ports where uncode = oo.place_of_delivery_un limit 1) as pod_uncity,
|
|
|
po_no as _po_no,
|
|
po_no as _po_no,
|
|
|
CASE
|
|
CASE
|
|
@@ -1468,7 +1468,7 @@ class login {
|
|
|
address_4 as aa_address_4,
|
|
address_4 as aa_address_4,
|
|
|
city as aa_city, state as aa_state, zipcode as aa_zipcode, country as aa_country,
|
|
city as aa_city, state as aa_state, zipcode as aa_zipcode, country as aa_country,
|
|
|
phone_1 as aa_phone,
|
|
phone_1 as aa_phone,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as aa_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as aa_timezone
|
|
|
FROM sfs.contacts c WHERE o.origin_station::text = c.contact_id::text) aa ON true
|
|
FROM sfs.contacts c WHERE o.origin_station::text = c.contact_id::text) aa ON true
|
|
|
LEFT JOIN LATERAL ( SELECT company as dd_company,
|
|
LEFT JOIN LATERAL ( SELECT company as dd_company,
|
|
|
address_1 as dd_address_1,
|
|
address_1 as dd_address_1,
|
|
@@ -1477,11 +1477,11 @@ class login {
|
|
|
address_4 as dd_address_4,
|
|
address_4 as dd_address_4,
|
|
|
city as dd_city, state as dd_state, zipcode as dd_zipcode, country as dd_country,
|
|
city as dd_city, state as dd_state, zipcode as dd_zipcode, country as dd_country,
|
|
|
phone_1 as dd_phone,
|
|
phone_1 as dd_phone,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as dd_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as dd_timezone
|
|
|
FROM sfs.contacts c WHERE o.destination_station::text = c.contact_id::text) dd ON true
|
|
FROM sfs.contacts c WHERE o.destination_station::text = c.contact_id::text) dd ON true
|
|
|
LEFT JOIN LATERAL ( SELECT
|
|
LEFT JOIN LATERAL ( SELECT
|
|
|
city as fd_city,
|
|
city as fd_city,
|
|
|
- (select timezonecode from public.city_ports where ctrycitycode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as fd_timezone
|
|
|
|
|
|
|
+ (select time_zone from public.city_timezone where uncode = LEFT(country, 2) || COALESCE(city_code,'') limit 1) as fd_timezone
|
|
|
FROM sfs.contacts c WHERE o.final_desination::text = c.contact_id::text) fd ON true";
|
|
FROM sfs.contacts c WHERE o.final_desination::text = c.contact_id::text) fd ON true";
|
|
|
return $sql;
|
|
return $sql;
|
|
|
}
|
|
}
|