|
@@ -831,6 +831,8 @@ class destination_delivery {
|
|
|
|
|
|
|
|
$delivery_address = common::check_input($_POST['delivery_address']);
|
|
$delivery_address = common::check_input($_POST['delivery_address']);
|
|
|
$special_requirements = common::check_input($_POST['special_requirements']);
|
|
$special_requirements = common::check_input($_POST['special_requirements']);
|
|
|
|
|
+ $delivery_reference = common::check_input($_POST['delivery_reference']);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
//检查不能重复添加booking 这里空运没问题,但是会遇到相同hbol 不同的柜子情况,本质上来说就是一条
|
|
//检查不能重复添加booking 这里空运没问题,但是会遇到相同hbol 不同的柜子情况,本质上来说就是一条
|
|
|
//$sqlWhere = ' where ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
//$sqlWhere = ' where ' . common::searchExtendHand_KLN("ocean", $_SESSION["ONLINE_USER"]);
|
|
@@ -877,6 +879,9 @@ class destination_delivery {
|
|
|
if (!empty($special_requirements)) {
|
|
if (!empty($special_requirements)) {
|
|
|
$updateSqlSet.= ", special_requirements = '$special_requirements' ";
|
|
$updateSqlSet.= ", special_requirements = '$special_requirements' ";
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!empty($delivery_reference)) {
|
|
|
|
|
+ $updateSqlSet.= ", delivery_reference = '$delivery_reference' ";
|
|
|
|
|
+ }
|
|
|
if (!empty($modify_reason)) {
|
|
if (!empty($modify_reason)) {
|
|
|
$updateSqlSet.= ", modify_reason = '$modify_reason' ";
|
|
$updateSqlSet.= ", modify_reason = '$modify_reason' ";
|
|
|
}
|
|
}
|
|
@@ -932,14 +937,14 @@ class destination_delivery {
|
|
|
serial_no, h_serial_no,address_country,
|
|
serial_no, h_serial_no,address_country,
|
|
|
booking_no, h_bol,h_bol_multiple_link,
|
|
booking_no, h_bol,h_bol_multiple_link,
|
|
|
m_bol, ctnr,
|
|
m_bol, ctnr,
|
|
|
- consignee, delivery_date, delivery_mode, status, delivery_address,delivery_address_detail, special_requirements,
|
|
|
|
|
|
|
+ consignee, delivery_date, delivery_mode, status, delivery_address,delivery_address_detail, special_requirements,delivery_reference,
|
|
|
recommended_delivery_window_date_from, recommended_delivery_window_date_to, d_address_change_log,
|
|
recommended_delivery_window_date_from, recommended_delivery_window_date_to, d_address_change_log,
|
|
|
recommended_delivery_from, recommended_delivery_to,kln_pic,
|
|
recommended_delivery_from, recommended_delivery_to,kln_pic,
|
|
|
create_by, created_time, modify_by, update_time)
|
|
create_by, created_time, modify_by, update_time)
|
|
|
VALUES ('$serial_no', ".$tags_sql.",".$country_sql.",
|
|
VALUES ('$serial_no', ".$tags_sql.",".$country_sql.",
|
|
|
'".$sData['booking_no']."', '".utils::implode(',',$sData['h_bol'])."','".common::check_input(json_encode($sData['h_bol_multiple_link']))."',
|
|
'".$sData['booking_no']."', '".utils::implode(',',$sData['h_bol'])."','".common::check_input(json_encode($sData['h_bol_multiple_link']))."',
|
|
|
'".utils::implode(',',$sData['m_bol'])."', '".utils::implode(',',$sData['ctnr'])."',
|
|
'".utils::implode(',',$sData['m_bol'])."', '".utils::implode(',',$sData['ctnr'])."',
|
|
|
- '".$sData['consignee']."', $delivery_date,'$delivery_mode','$status', '$delivery_address','$delivery_address_detail', '$special_requirements',
|
|
|
|
|
|
|
+ '".$sData['consignee']."', $delivery_date,'$delivery_mode','$status', '$delivery_address','$delivery_address_detail', '$special_requirements','$delivery_reference',
|
|
|
$recommended_delivery_window_date_from, $recommended_delivery_window_date_to,'',
|
|
$recommended_delivery_window_date_from, $recommended_delivery_window_date_to,'',
|
|
|
'".$sData['recommended_delivery_from']."', '".$sData['recommended_delivery_to']."','".$sData['kln_pic']."',
|
|
'".$sData['recommended_delivery_from']."', '".$sData['recommended_delivery_to']."','".$sData['kln_pic']."',
|
|
|
'"._getLoginName()."', now(), '"._getLoginName()."', now());";
|
|
'"._getLoginName()."', now(), '"._getLoginName()."', now());";
|
|
@@ -1311,9 +1316,9 @@ class destination_delivery {
|
|
|
on oo.agent = dc.station_code
|
|
on oo.agent = dc.station_code
|
|
|
where 1=1 and
|
|
where 1=1 and
|
|
|
case when dc.booking_window = 'Restrictions_ETD_ATD' and COALESCE(dc.booking_window_date_start,'')<>'' and COALESCE(dc.booking_window_date_end,'')<>''
|
|
case when dc.booking_window = 'Restrictions_ETD_ATD' and COALESCE(dc.booking_window_date_start,'')<>'' and COALESCE(dc.booking_window_date_end,'')<>''
|
|
|
- then COALESCE(atd, etd) >= (NOW() + (dc.booking_window_date_start ||' days')::INTERVAL)::date and COALESCE(atd, etd) <= (NOW() + (dc.booking_window_date_end ||' days')::INTERVAL)::date
|
|
|
|
|
|
|
+ then COALESCE(atd, etd) >= (NOW() - (dc.booking_window_date_start ||' days')::INTERVAL)::date and COALESCE(atd, etd) <= (NOW() + (dc.booking_window_date_end ||' days')::INTERVAL)::date
|
|
|
when dc.booking_window = 'Restrictions_ETA_ATA' and COALESCE(dc.booking_window_date_start,'')<>'' and COALESCE(dc.booking_window_date_end,'')<>''
|
|
when dc.booking_window = 'Restrictions_ETA_ATA' and COALESCE(dc.booking_window_date_start,'')<>'' and COALESCE(dc.booking_window_date_end,'')<>''
|
|
|
- then COALESCE(ata, eta) >= (NOW() + (dc.booking_window_date_start ||' days')::INTERVAL)::date and COALESCE(ata, eta) <= (NOW() + (dc.booking_window_date_end ||' days')::INTERVAL)::date
|
|
|
|
|
|
|
+ then COALESCE(ata, eta) >= (NOW() - (dc.booking_window_date_start ||' days')::INTERVAL)::date and COALESCE(ata, eta) <= (NOW() + (dc.booking_window_date_end ||' days')::INTERVAL)::date
|
|
|
else 1=1 end
|
|
else 1=1 end
|
|
|
),
|
|
),
|
|
|
matched_data as (
|
|
matched_data as (
|
|
@@ -1424,14 +1429,14 @@ class destination_delivery {
|
|
|
select md.*,
|
|
select md.*,
|
|
|
CASE
|
|
CASE
|
|
|
WHEN r.recommended_delivery_from IS NOT NULL AND r.recommended_delivery_to IS NOT NULL THEN
|
|
WHEN r.recommended_delivery_from IS NOT NULL AND r.recommended_delivery_to IS NOT NULL THEN
|
|
|
- to_char((COALESCE(ata, eta) - (r.recommended_delivery_from ||' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
|
|
|
|
|
+ to_char((COALESCE(ata, eta) + (r.recommended_delivery_from ||' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
|
|| '-' ||
|
|
|| '-' ||
|
|
|
to_char((COALESCE(ata, eta) + (r.recommended_delivery_to ||' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
to_char((COALESCE(ata, eta) + (r.recommended_delivery_to ||' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
|
WHEN r.recommended_delivery_from IS NULL AND r.recommended_delivery_to IS NOT NULL THEN
|
|
WHEN r.recommended_delivery_from IS NULL AND r.recommended_delivery_to IS NOT NULL THEN
|
|
|
'-' ||
|
|
'-' ||
|
|
|
to_char((COALESCE(ata, eta) + (r.recommended_delivery_to || ' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
to_char((COALESCE(ata, eta) + (r.recommended_delivery_to || ' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
|
WHEN r.recommended_delivery_from IS NOT NULL AND r.recommended_delivery_to IS NULL THEN
|
|
WHEN r.recommended_delivery_from IS NOT NULL AND r.recommended_delivery_to IS NULL THEN
|
|
|
- to_char((COALESCE(ata, eta) - (r.recommended_delivery_from || ' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
|
|
|
|
|
+ to_char((COALESCE(ata, eta) + (r.recommended_delivery_from || ' days')::INTERVAL)::date, 'YYYY.MM.DD')
|
|
|
|| '-'
|
|
|| '-'
|
|
|
ELSE '' END
|
|
ELSE '' END
|
|
|
AS date_range,
|
|
AS date_range,
|