|
|
@@ -1098,9 +1098,9 @@ class utils {
|
|
|
|
|
|
public static function getDmoeSqlForAi($type){
|
|
|
$data= array();
|
|
|
- $data["Shipments arriving in the next 7 days."] = "select oo.serial_no,h_bol,place_of_receipt_exp,place_of_delivery_exp,description,eta,order_from,cargo_type
|
|
|
+ $data["Shipments arriving in the next 7 days."] = "select serial_no,h_bol,place_of_receipt_exp,place_of_delivery_exp,description,eta,order_from,cargo_type
|
|
|
from (
|
|
|
- SELECT h_bol, place_of_receipt_exp, place_of_delivery_exp,m.description,eta,order_from, o.cargo_type
|
|
|
+ SELECT oo.serial_no,h_bol, place_of_receipt_exp, place_of_delivery_exp,m.description,eta,order_from, o.cargo_type
|
|
|
FROM public.kln_ocean oo
|
|
|
inner join LATERAL (select case when is_hazardous = 't' then 'Dangerous Goods'::text else 'General'::text end as cargo_type
|
|
|
from public.ocean o where o.serial_no = oo.serial_no) o on true
|
|
|
@@ -1130,7 +1130,7 @@ class utils {
|
|
|
and a.update_date > '2025-04-06') po
|
|
|
)t";
|
|
|
$data["What is the current status of my active shipments?"] ="with oo as(
|
|
|
- SELECT h_bol, place_of_receipt_exp, place_of_delivery_exp,serial_no,transport_mode,order_from,oo.serial_no
|
|
|
+ SELECT h_bol, place_of_receipt_exp, place_of_delivery_exp,serial_no,transport_mode,order_from
|
|
|
FROM public.kln_ocean oo
|
|
|
WHERE <{ExtendHand_KLN}> and ((oo.ata is not null and oo.ata >= CURRENT_DATE - INTERVAL '3 months' AND oo.ata < CURRENT_DATE)
|
|
|
or not exists( select 1 from public.ocean_milestone a where a.serial_no = oo.serial_no and a.act_date is not null and a.code = 'IFFDEL')) and oo.transport_mode = 'sea' and order_from = 'public' order by id limit 10
|