|
@@ -529,15 +529,15 @@ class ocean_order {
|
|
|
$allBookingColumns = column::getInstance()->tableColumns('Ocean_Search',$allColumn);
|
|
$allBookingColumns = column::getInstance()->tableColumns('Ocean_Search',$allColumn);
|
|
|
}
|
|
}
|
|
|
$tp = ceil($rc / $ps);
|
|
$tp = ceil($rc / $ps);
|
|
|
- $order_by = " etd desc NULLS LAST";
|
|
|
|
|
|
|
+ $order_by = " etd desc";
|
|
|
if (_isCustomerLogin()) {
|
|
if (_isCustomerLogin()) {
|
|
|
- $order_by = " eta desc NULLS LAST";
|
|
|
|
|
|
|
+ $order_by = " eta desc";
|
|
|
}
|
|
}
|
|
|
if ($rc > 0) {
|
|
if ($rc > 0) {
|
|
|
$ocean_ref_sql = " LEFT JOIN LATERAL ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no
|
|
$ocean_ref_sql = " LEFT JOIN LATERAL ( SELECT string_agg(ref_code ||ref_value, ', ') AS other_refenrence_no
|
|
|
- FROM public.ocean_reference temp WHERE temp.serial_no = online_ocean.serial_no) aa ON true ";
|
|
|
|
|
|
|
+ FROM public.ocean_reference temp WHERE temp.serial_no = oo.serial_no) aa ON true ";
|
|
|
|
|
|
|
|
- $sql = "SELECT order_from as _schemas,serial_no as __serial_no, serial_no,
|
|
|
|
|
|
|
+ $sql = "with oo as (SELECT order_from as _schemas,serial_no as __serial_no, serial_no,
|
|
|
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,
|
|
|
CASE
|
|
CASE
|
|
|
WHEN (m_iffcpu is null and m_iffrec is null and m_iffdep is null and m_iffarr is null and m_iffafd 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_iffafd is null) THEN 'Created'::text
|
|
@@ -547,8 +547,10 @@ class ocean_order {
|
|
|
WHEN (m_iffafd is not null) THEN 'Completed'::text
|
|
WHEN (m_iffafd is not null) THEN 'Completed'::text
|
|
|
ELSE 'Created'
|
|
ELSE 'Created'
|
|
|
END AS new_status, ".
|
|
END AS new_status, ".
|
|
|
- column::getInstance()->getSearchSqlForDisplay('Ocean_Search') . " from public.online_ocean $ocean_ref_sql " . $sqlWhere .
|
|
|
|
|
- " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps;
|
|
|
|
|
|
|
+ column::getInstance()->getSearchSqlForDisplay('Ocean_Search') . " from public.online_ocean " . $sqlWhere .
|
|
|
|
|
+ " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps.")
|
|
|
|
|
+ select oo.* ,aa.other_refenrence_no as \"Other refenrence No.\" from oo $ocean_ref_sql";
|
|
|
|
|
+
|
|
|
$rs = common::excuteListSql($sql);
|
|
$rs = common::excuteListSql($sql);
|
|
|
error_log("online_ocean_search_SQL: ".$sql);
|
|
error_log("online_ocean_search_SQL: ".$sql);
|
|
|
|
|
|