|
@@ -1134,6 +1134,7 @@ class destination_delivery {
|
|
|
$db->StartTrans();
|
|
$db->StartTrans();
|
|
|
try {
|
|
try {
|
|
|
$sql = "";
|
|
$sql = "";
|
|
|
|
|
+ $do_serial_nos = "";
|
|
|
//审核通过时,才取下放当时应用修改的地址
|
|
//审核通过时,才取下放当时应用修改的地址
|
|
|
if ($status == "Approve") {
|
|
if ($status == "Approve") {
|
|
|
$delivery_booking = common::excuteObjectSql("select *,array_to_json(address_country) as address_country,
|
|
$delivery_booking = common::excuteObjectSql("select *,array_to_json(address_country) as address_country,
|
|
@@ -1150,14 +1151,16 @@ class destination_delivery {
|
|
|
$sql .=common::returnDAddressRecord($delivery_booking["address_country"],$onine_address,$delivery_address_detail);
|
|
$sql .=common::returnDAddressRecord($delivery_booking["address_country"],$onine_address,$delivery_address_detail);
|
|
|
|
|
|
|
|
//Booking自動同步到Ksmart WO 的逻辑 保存在do_header和do_details表里
|
|
//Booking自動同步到Ksmart WO 的逻辑 保存在do_header和do_details表里
|
|
|
- $sql .=common::saveWorkOrder($delivery_booking);
|
|
|
|
|
|
|
+ $sqlData =common::saveWorkOrder($delivery_booking);
|
|
|
|
|
+ $sql .= $sqlData['sql'];
|
|
|
|
|
+ $do_serial_nos = utils::implode(';',$sqlData['do_serial_no_arr']);
|
|
|
}
|
|
}
|
|
|
if ($status == "Reject" || $status == "Cancel") {
|
|
if ($status == "Reject" || $status == "Cancel") {
|
|
|
//这种情况,清除当前用户对这一票的修改和添加的信息
|
|
//这种情况,清除当前用户对这一票的修改和添加的信息
|
|
|
$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 .= "update public.kln_destination_delivery set status = '$status', modify_by = '"._getLoginName()."',update_time = now() where serial_no = '$serial_no';";
|
|
|
|
|
|
|
+ $sql .= "update public.kln_destination_delivery set do_serial_no = '$do_serial_nos', status = '$status', modify_by = '"._getLoginName()."',update_time = now() where serial_no = '$serial_no';";
|
|
|
$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(), ''); ";
|