|
@@ -1100,9 +1100,19 @@ class ocean_order {
|
|
|
. $sqlWhere . " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps.")
|
|
. $sqlWhere . " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps.")
|
|
|
select oo.* ,
|
|
select oo.* ,
|
|
|
case when oo.transport_mode ='sea' and oo._schemas ='public'
|
|
case when oo.transport_mode ='sea' and oo._schemas ='public'
|
|
|
- then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp WHERE temp.serial_no = oo.serial_no)
|
|
|
|
|
|
|
+ then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp
|
|
|
|
|
+ WHERE temp.ref_code <> 'PO'
|
|
|
|
|
+ AND COALESCE(temp.ref_value,'')<>''
|
|
|
|
|
+ AND temp.ref_value IS NOT NULL
|
|
|
|
|
+ AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0
|
|
|
|
|
+ AND temp.serial_no = oo.serial_no)
|
|
|
when oo.transport_mode ='sea' and oo._schemas ='sfs'
|
|
when oo.transport_mode ='sea' and oo._schemas ='sfs'
|
|
|
- then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp WHERE temp.serial_no = oo.serial_no)
|
|
|
|
|
|
|
+ then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp
|
|
|
|
|
+ WHERE temp.ref_code <> 'PO'
|
|
|
|
|
+ AND COALESCE(temp.ref_value,'')<>''
|
|
|
|
|
+ AND temp.ref_value IS NOT NULL
|
|
|
|
|
+ AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0
|
|
|
|
|
+ AND temp.serial_no = oo.serial_no)
|
|
|
when oo.transport_mode ='air'
|
|
when oo.transport_mode ='air'
|
|
|
then ''
|
|
then ''
|
|
|
else ''
|
|
else ''
|
|
@@ -1129,10 +1139,20 @@ class ocean_order {
|
|
|
FROM public.kln_ocean_extend oe WHERE oe.serial_no::text = kln_ocean.serial_no::text and oe.order_from::text = kln_ocean.order_from::text) oe ON true "
|
|
FROM public.kln_ocean_extend oe WHERE oe.serial_no::text = kln_ocean.serial_no::text and oe.order_from::text = kln_ocean.order_from::text) oe ON true "
|
|
|
. $sqlWhere . " order by $order_by)
|
|
. $sqlWhere . " order by $order_by)
|
|
|
select oo.* ,
|
|
select oo.* ,
|
|
|
- case when oo.transport_mode ='sea' and oo._schemas ='public'
|
|
|
|
|
- then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp WHERE temp.serial_no = oo.serial_no)
|
|
|
|
|
|
|
+ case when oo.transport_mode ='sea' and oo._schemas ='public'
|
|
|
|
|
+ then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM public.ocean_reference temp
|
|
|
|
|
+ WHERE temp.ref_code <> 'PO'
|
|
|
|
|
+ AND COALESCE(temp.ref_value,'')<>''
|
|
|
|
|
+ AND temp.ref_value IS NOT NULL
|
|
|
|
|
+ AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0
|
|
|
|
|
+ AND temp.serial_no = oo.serial_no)
|
|
|
when oo.transport_mode ='sea' and oo._schemas ='sfs'
|
|
when oo.transport_mode ='sea' and oo._schemas ='sfs'
|
|
|
- then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp WHERE temp.serial_no = oo.serial_no)
|
|
|
|
|
|
|
+ then ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no FROM sfs.ocean_reference temp
|
|
|
|
|
+ WHERE temp.ref_code <> 'PO'
|
|
|
|
|
+ AND COALESCE(temp.ref_value,'')<>''
|
|
|
|
|
+ AND temp.ref_value IS NOT NULL
|
|
|
|
|
+ AND LENGTH(TRIM(BOTH FROM temp.ref_value)) > 0
|
|
|
|
|
+ AND temp.serial_no = oo.serial_no)
|
|
|
when oo.transport_mode ='air'
|
|
when oo.transport_mode ='air'
|
|
|
then ''
|
|
then ''
|
|
|
else ''
|
|
else ''
|