|
@@ -844,7 +844,8 @@ class destination_delivery {
|
|
|
select regexp_split_to_table('".utils::implode(',',$ctnr)."', ',') as ctnr
|
|
select regexp_split_to_table('".utils::implode(',',$ctnr)."', ',') as ctnr
|
|
|
)
|
|
)
|
|
|
select h_bol,ctnr from public.kln_destination_delivery kde
|
|
select h_bol,ctnr from public.kln_destination_delivery kde
|
|
|
- where exists(select 1 from save_table where save_table.serial_no = any(kde.h_serial_no))
|
|
|
|
|
|
|
+ where status not in ('Cancel','Reject')
|
|
|
|
|
+ and exists(select 1 from save_table where save_table.serial_no = any(kde.h_serial_no))
|
|
|
and (exists(select 1 from save_table_ctnr where save_table_ctnr.ctnr = ANY(regexp_split_to_array(kde.ctnr, ','))
|
|
and (exists(select 1 from save_table_ctnr where save_table_ctnr.ctnr = ANY(regexp_split_to_array(kde.ctnr, ','))
|
|
|
or COALESCE(kde.ctnr,'') = ''))
|
|
or COALESCE(kde.ctnr,'') = ''))
|
|
|
and exists(select 1 from public.kln_ocean oo ". $sqlWhere." and oo.serial_no = any(kde.h_serial_no) limit 1)";
|
|
and exists(select 1 from public.kln_ocean oo ". $sqlWhere." and oo.serial_no = any(kde.h_serial_no) limit 1)";
|