ShuanghongS 1 сар өмнө
parent
commit
d40a8404e4

+ 4 - 0
include.ini.php

@@ -206,6 +206,10 @@ function _customerFilerSearchHandNew($tableName,$user, $schemas = "public", $p =
         $sqlWhere1 .= " and lower($p) " . common::getInNotInSql($user['customer_destination']);
     }
 
+    if (!empty($user['customer_destination_country'])) {
+        $sqlWhere1 .= " and ( transport_mode = 'air' or LOWER(SUBSTRING(place_of_delivery_un, 1, 2))  " . common::getInNotInSql($user['customer_destination']).")";
+    }
+
     if (!empty($user['customer_discharge']) && !empty($d)) {
         $sqlWhere1 .= " and lower($d) " . common::getInNotInSql($user['customer_discharge']);
     }

+ 3 - 0
service/ajax.class.php

@@ -92,6 +92,7 @@ class ajax {
                 "Notify Party" =>"notify_party as code",
                 "Bill to" =>"billto as code",
                 "Destination Operator"=>"dest_op as code",
+                "Controlling Customer"=>"customer_name as code",
                 "Sales"=>"sales_rep as code",
                 "Voyage/Flight_booking"=>"f_voyage as code,m_voyage as code_2",
                 "Vessel_booking"=>"f_vessel as code,m_vessel as code_2",
@@ -105,6 +106,7 @@ class ajax {
                 "Notify Party" =>"group by notify_party",
                 "Bill to" =>"group by billto",
                 "Destination Operator"=>"group by dest_op",
+                "Controlling Customer"=>"group by customer_name",
                 "Sales"=>"group by sales_rep",
                 "Voyage/Flight_booking"=>"group by f_voyage,m_voyage",
                 "Vessel_booking"=>"group by f_vessel,m_vessel",
@@ -118,6 +120,7 @@ class ajax {
                 "Notify Party"=>" and (notify_party ilike '%" . common::check_input($term) . "%')",
                 "Bill to"=>" and (billto ilike '%" . common::check_input($term) . "%')",
                 "Destination Operator"=>" and (dest_op ilike '%" . common::check_input($term) . "%')",
+                "Controlling Customer"=>" and (customer_name ilike '%" . common::check_input($term) . "%')",
                 "Sales"=>" and (sales_rep ilike '%" . common::check_input($term) . "%')",
                 "Voyage/Flight_booking"=>" and (f_voyage ilike '%" . common::check_input($term) . "%' or m_voyage ilike '%" . common::check_input($term) . "%')",
                 "Vessel_booking"=>" and (f_vessel ilike '%" . common::check_input($term) . "%' or m_vessel ilike '%" . common::check_input($term) . "%')",

+ 5 - 3
service/login.class.php

@@ -31,7 +31,7 @@ class login {
         customer_search_type, customer_destination, can_add_ams, can_add_isf, air_station, air_sales, ocean_station, ocean_sales,ocean_following_sales,ocean_following_sales_or,air_following_sales,air_following_sales_or, trucking_station, ocean_dest_op, can_see_password, can_add_opsales_code, ocean_station_or, ocean_agent_or, ocean_sales_or, ocean_dest_op_or, air_station_or, air_sales_or, trucking_station_or, 
         can_add_user, can_add_employee, can_add_contact, company_name, ams_email, isf_email, customer_discharge, online_active, is_super, ocean_agent,active, can_send_email, view_file_format as docdownload, container_status, consolidated_cbsa_code, can_add_aci, 
         air_customers, air_customer_search_type,trucking_customers,trucking_customer_search_type, upload_document, view_file_format, event_type, belong_schemas, main_schemas, error_login_count, EXTRACT(EPOCH FROM (now()-COALESCE(error_login_time, now()))) as second, po_status, view_air_file_format, 
-        special_customer_event, can_edi_vgm, isf_aci_ams_station,login_version,is_kerry_shipment,can_visit_delivery,currency_group,revenue_active,is_desensitization_kln from public.ra_online_user u where md5(lower(user_login)) = ?";
+        special_customer_event, can_edi_vgm, isf_aci_ams_station,login_version,is_kerry_shipment,can_visit_delivery,currency_group,revenue_active,is_desensitization_kln,customer_destination_country from public.ra_online_user u where md5(lower(user_login)) = ?";
     }
 
     public function do_login() {
@@ -449,7 +449,8 @@ class login {
                         $ttdd = common::excuteObjectSql("select contact_id_user, employee_id, contact_id, user_type, email, user_webtype_id, active, is_online, station, allow_login_remote, can_see_amslog,can_view_eccn, can_see_isflog, can_see_isflog_withaddress, 
                         customer_search_type, customer_destination, can_add_ams, can_add_isf, air_station, air_sales, ocean_station, ocean_sales,ocean_following_sales,ocean_following_sales_or,air_following_sales,air_following_sales_or, trucking_station, ocean_dest_op, can_see_password, can_add_opsales_code, ocean_station_or, ocean_agent_or, ocean_sales_or, ocean_dest_op_or, air_station_or, air_sales_or, trucking_station_or, 
                         can_add_user, can_add_employee, can_add_contact, company_name, ams_email, isf_email, customer_discharge, online_active, is_super, ocean_agent,active, can_send_email, view_file_format as docdownload, container_status, consolidated_cbsa_code, can_add_aci,
-                        air_customers, air_customer_search_type,trucking_customers,trucking_customer_search_type, upload_document, view_file_format, event_type, po_status, view_air_file_format, special_customer_event, can_edi_vgm, isf_aci_ams_station, is_kerry_shipment from " . $sv['schemas_name'] . ".ra_online_user where lower(user_login) = '" . strtolower($uname) . "'");
+                        air_customers, air_customer_search_type,trucking_customers,trucking_customer_search_type, upload_document, view_file_format, event_type, po_status, view_air_file_format, special_customer_event, can_edi_vgm, isf_aci_ams_station, is_kerry_shipment,
+                        can_visit_delivery,currency_group,revenue_active,is_desensitization_kln,customer_destination_country from " . $sv['schemas_name'] . ".ra_online_user where lower(user_login) = '" . strtolower($uname) . "'");
                         if (empty($ttdd)) {
                             unset($schemas_list[$sk]);
                             continue;
@@ -1089,7 +1090,8 @@ class login {
                         $ttdd = common::excuteObjectSql("select contact_id_user, employee_id, contact_id, user_type, email, user_webtype_id, active, is_online, station, allow_login_remote, can_see_amslog,can_view_eccn, can_see_isflog, can_see_isflog_withaddress, 
                         customer_search_type, customer_destination, can_add_ams, can_add_isf, air_station, air_sales, ocean_station, ocean_sales,ocean_following_sales,ocean_following_sales_or,air_following_sales,air_following_sales_or, trucking_station, ocean_dest_op, can_see_password, can_add_opsales_code, ocean_station_or, ocean_agent_or, ocean_sales_or, ocean_dest_op_or, air_station_or, air_sales_or, trucking_station_or, 
                         can_add_user, can_add_employee, can_add_contact, company_name, ams_email, isf_email, customer_discharge, online_active, is_super, ocean_agent,active, can_send_email, view_file_format as docdownload, container_status, consolidated_cbsa_code, can_add_aci,
-                        air_customers, air_customer_search_type,trucking_customers,trucking_customer_search_type, upload_document, view_file_format, event_type, po_status, view_air_file_format, special_customer_event, can_edi_vgm, isf_aci_ams_station, is_kerry_shipment from " . $sv['schemas_name'] . ".ra_online_user where lower(user_login) = '" . strtolower($uname) . "'");
+                        air_customers, air_customer_search_type,trucking_customers,trucking_customer_search_type, upload_document, view_file_format, event_type, po_status, view_air_file_format, special_customer_event, can_edi_vgm, isf_aci_ams_station, is_kerry_shipment,
+                        can_visit_delivery,currency_group,revenue_active,is_desensitization_kln,customer_destination_country from " . $sv['schemas_name'] . ".ra_online_user where lower(user_login) = '" . strtolower($uname) . "'");
                         if (empty($ttdd)) {
                             unset($schemas_list[$sk]);
                             continue;