|
|
@@ -1127,10 +1127,10 @@ class destination_delivery {
|
|
|
$status = common::check_input($_POST['status']);
|
|
|
$notes = common::check_input($_POST['notes']);
|
|
|
$action_user = _getLoginName();
|
|
|
-
|
|
|
+ error_log("review: 1");
|
|
|
//前端按钮 后台权限拦截
|
|
|
common::checkedActionLegal($serial_no,$operate);
|
|
|
-
|
|
|
+ error_log("review: 1.1");
|
|
|
global $db;
|
|
|
$db->StartTrans();
|
|
|
try {
|
|
|
@@ -1163,16 +1163,21 @@ class destination_delivery {
|
|
|
serial_no, action,notes, create_by, created_time, created_zone)
|
|
|
VALUES ('$serial_no', '$status','$notes', '$action_user', now(), ''); ";
|
|
|
|
|
|
+ error_log("review: sql:".$sql);
|
|
|
+
|
|
|
$db->Execute($sql) or ((!$db->ErrorMsg()) or error_log(common::dbLog($db, $sql), 0));
|
|
|
$rs = $db->CompleteTrans();
|
|
|
} catch (Exception $e) {
|
|
|
+ error_log("review:".$e->getMessage());
|
|
|
$db->RollbackTrans();
|
|
|
}
|
|
|
|
|
|
if ($rs === FALSE){
|
|
|
+ error_log("review: 2");
|
|
|
$data = array("msg" => "Update Error");
|
|
|
common::echo_json_encode(200,$data);
|
|
|
} else{
|
|
|
+ error_log("review: 3");
|
|
|
//状态变更时,发送邮件提醒
|
|
|
$data = common::excuteObjectSql("select *,
|
|
|
TO_CHAR(delivery_date, 'Mon-DD-YYYY HH24:MI') as _delivery_date,
|
|
|
@@ -1180,10 +1185,12 @@ class destination_delivery {
|
|
|
TO_CHAR(update_time, 'Mon-DD-YYYY') as _update_time
|
|
|
from public.kln_destination_delivery where serial_no = '$serial_no'");
|
|
|
$shipmentsData = $this->search_shipment_with_booking($data['serial_no'],$data['h_serial_no'],$data['ctnr']);
|
|
|
- $email_sql = common::sendDestinationDeliveryReminder($data,$shipmentsData,$status);
|
|
|
+ $email_sql = common::sendDestinationDeliveryReminder($data,$shipmentsData,$status);
|
|
|
+ error_log("review: email_sql:".$email_sql);
|
|
|
if(!empty($email_sql)){
|
|
|
common::excuteUpdateSql($email_sql);
|
|
|
- }
|
|
|
+ }
|
|
|
+ error_log("review: 4");
|
|
|
$data = array("msg" =>"success");
|
|
|
common::echo_json_encode(200,$data);
|
|
|
}
|
|
|
@@ -1312,7 +1319,7 @@ class destination_delivery {
|
|
|
sum(case when status ='Approve' then 1 else 0 end) as approved_rc
|
|
|
from public.kln_destination_delivery kd
|
|
|
where ".$sqlDeliveryWhere."
|
|
|
- and exists(select 1 from public.kln_ocean oo ". $sqlWhere." and oo.serial_no = any(h_serial_no) limit 1)
|
|
|
+ and exists(select 1 from public.kln_ocean ". $sqlWhere." and kln_ocean.serial_no = any(kd.h_serial_no) limit 1)
|
|
|
group by delivery_date::date order by delivery_date::date desc";
|
|
|
$rs = common::excuteListSql($sql);
|
|
|
error_log("delivery_date_load:".$sql);
|