|
@@ -1127,10 +1127,9 @@ class destination_delivery {
|
|
|
$status = common::check_input($_POST['status']);
|
|
$status = common::check_input($_POST['status']);
|
|
|
$notes = common::check_input($_POST['notes']);
|
|
$notes = common::check_input($_POST['notes']);
|
|
|
$action_user = _getLoginName();
|
|
$action_user = _getLoginName();
|
|
|
- error_log("review: 1");
|
|
|
|
|
|
|
+
|
|
|
//前端按钮 后台权限拦截
|
|
//前端按钮 后台权限拦截
|
|
|
common::checkedActionLegal($serial_no,$operate);
|
|
common::checkedActionLegal($serial_no,$operate);
|
|
|
- error_log("review: 1.1");
|
|
|
|
|
global $db;
|
|
global $db;
|
|
|
$db->StartTrans();
|
|
$db->StartTrans();
|
|
|
try {
|
|
try {
|
|
@@ -1146,15 +1145,12 @@ class destination_delivery {
|
|
|
$delivery_address_detail = json_decode($delivery_booking["delivery_address_detail"],true);
|
|
$delivery_address_detail = json_decode($delivery_booking["delivery_address_detail"],true);
|
|
|
$onine_address = common::excuteListSql("select * from public.contacts_address_online
|
|
$onine_address = common::excuteListSql("select * from public.contacts_address_online
|
|
|
where (delivery_serial_no = '$serial_no' or sync_key = '".$delivery_address_detail['sync_key']."')");
|
|
where (delivery_serial_no = '$serial_no' or sync_key = '".$delivery_address_detail['sync_key']."')");
|
|
|
- error_log("review: 1.2");
|
|
|
|
|
|
|
+
|
|
|
//$sql .= "delete from public.contacts_address_online where delivery_serial_no = '$serial_no';";
|
|
//$sql .= "delete from public.contacts_address_online where delivery_serial_no = '$serial_no';";
|
|
|
$sql .=common::returnDAddressRecord($delivery_booking["address_country"],$onine_address,$delivery_address_detail);
|
|
$sql .=common::returnDAddressRecord($delivery_booking["address_country"],$onine_address,$delivery_address_detail);
|
|
|
- error_log("review: 1.3");
|
|
|
|
|
|
|
|
|
|
//Booking自動同步到Ksmart WO 的逻辑 保存在do_header和do_details表里
|
|
//Booking自動同步到Ksmart WO 的逻辑 保存在do_header和do_details表里
|
|
|
- error_log("review: 1.4");
|
|
|
|
|
$sql .=common::saveWorkOrder($delivery_booking);
|
|
$sql .=common::saveWorkOrder($delivery_booking);
|
|
|
- error_log("review: 1.5");
|
|
|
|
|
}
|
|
}
|
|
|
if ($status == "Reject" || $status == "Cancel") {
|
|
if ($status == "Reject" || $status == "Cancel") {
|
|
|
//这种情况,清除当前用户对这一票的修改和添加的信息
|
|
//这种情况,清除当前用户对这一票的修改和添加的信息
|
|
@@ -1165,9 +1161,7 @@ class destination_delivery {
|
|
|
$sql .= "INSERT INTO public.kln_destination_delivery_operation_log(
|
|
$sql .= "INSERT INTO public.kln_destination_delivery_operation_log(
|
|
|
serial_no, action,notes, create_by, created_time, created_zone)
|
|
serial_no, action,notes, create_by, created_time, created_zone)
|
|
|
VALUES ('$serial_no', '$status','$notes', '$action_user', now(), ''); ";
|
|
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));
|
|
$db->Execute($sql) or ((!$db->ErrorMsg()) or error_log(common::dbLog($db, $sql), 0));
|
|
|
$rs = $db->CompleteTrans();
|
|
$rs = $db->CompleteTrans();
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
@@ -1176,11 +1170,9 @@ class destination_delivery {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if ($rs === FALSE){
|
|
if ($rs === FALSE){
|
|
|
- error_log("review: 2");
|
|
|
|
|
$data = array("msg" => "Update Error");
|
|
$data = array("msg" => "Update Error");
|
|
|
common::echo_json_encode(200,$data);
|
|
common::echo_json_encode(200,$data);
|
|
|
} else{
|
|
} else{
|
|
|
- error_log("review: 3");
|
|
|
|
|
//状态变更时,发送邮件提醒
|
|
//状态变更时,发送邮件提醒
|
|
|
$data = common::excuteObjectSql("select *,
|
|
$data = common::excuteObjectSql("select *,
|
|
|
TO_CHAR(delivery_date, 'Mon-DD-YYYY HH24:MI') as _delivery_date,
|
|
TO_CHAR(delivery_date, 'Mon-DD-YYYY HH24:MI') as _delivery_date,
|
|
@@ -1188,12 +1180,10 @@ class destination_delivery {
|
|
|
TO_CHAR(update_time, 'Mon-DD-YYYY') as _update_time
|
|
TO_CHAR(update_time, 'Mon-DD-YYYY') as _update_time
|
|
|
from public.kln_destination_delivery where serial_no = '$serial_no'");
|
|
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']);
|
|
$shipmentsData = $this->search_shipment_with_booking($data['serial_no'],$data['h_serial_no'],$data['ctnr']);
|
|
|
- $email_sql = common::sendDestinationDeliveryReminder($data,$shipmentsData,$status);
|
|
|
|
|
- error_log("review: email_sql:".$email_sql);
|
|
|
|
|
|
|
+ $email_sql = common::sendDestinationDeliveryReminder($data,$shipmentsData,$status);
|
|
|
if(!empty($email_sql)){
|
|
if(!empty($email_sql)){
|
|
|
common::excuteUpdateSql($email_sql);
|
|
common::excuteUpdateSql($email_sql);
|
|
|
- }
|
|
|
|
|
- error_log("review: 4");
|
|
|
|
|
|
|
+ }
|
|
|
$data = array("msg" =>"success");
|
|
$data = array("msg" =>"success");
|
|
|
common::echo_json_encode(200,$data);
|
|
common::echo_json_encode(200,$data);
|
|
|
}
|
|
}
|