|
- OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?> |
+ brand_name))."-color"; ?>">brand_name; ?>
+ OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?> |
OPN_payerEmail;
diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php
index 85bde232..924398b9 100644
--- a/webht/third_party/paypal/controllers/index.php
+++ b/webht/third_party/paypal/controllers/index.php
@@ -1003,8 +1003,6 @@ class Index extends CI_Controller {
/*!
* 退款处理
* @date 2019-05-05
- * TODO:
- * * 退款的记录增加发送财务的状态
*/
public function send_refund($item, $handpick, $old_ssje=NULL)
{
@@ -1136,7 +1134,11 @@ class Index extends CI_Controller {
}
//添加邮件发送记录 end
// 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录
- if ($this->Paypal_model->if_finance_exists($advisor_info->COLI_GRI_SN)===true) {
+ // 更新是否需要发送财务
+ $refund_finance_day = 20;
+ $now_day = date('d');
+ $late_entry_date_set = $now_day<$refund_finance_day ? date('Y-m-01', strtotime("-1 month")) : date('Y-m-01');
+ if ($this->Paypal_model->if_finance_done($advisor_info->COLI_GRI_SN, $late_entry_date_set) === true) {
$this->Note_model->update_send($item->pn_txn_id, 'send-to-finance', $item->pn_sn);
}
return ;
diff --git a/webht/third_party/paypal/models/paypal_model.php b/webht/third_party/paypal/models/paypal_model.php
index 50625797..65b49d4a 100644
--- a/webht/third_party/paypal/models/paypal_model.php
+++ b/webht/third_party/paypal/models/paypal_model.php
@@ -687,4 +687,22 @@ class Paypal_model extends CI_Model {
and cgi.CGI_GRI_SN=? ";
return $this->HT->query($sql, $gri_sn)->num_rows() > 0;
}
+ public function if_finance_done($gri_sn, $late_date)
+ {
+ $sql = "SELECT top 1 1
+ from groupinfo gri
+ where GRI_SN=?
+ and GRI_EntranceDate < ?
+ ";
+ // 商务订单没有生成团信息
+ if ($this->HT->query($sql, array($gri_sn,$late_date))->num_rows() === 0) {
+ $sql = "SELECT top 1 1
+ from BIZ_ConfirmLineInfo coli
+ inner join BIZ_ConfirmLineDetail cold on COLD_COLI_SN=COLI_SN and isnull(cold.DeleteFlag,0)=0
+ where COLI_GRI_SN=?
+ and COLD_StartDate";
+ return $this->HT->query($sql, array($gri_sn,$late_date))->num_rows() > 0;
+ }
+ return false;
+ }
}
diff --git a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php
index dc30bcc4..562b5f6f 100644
--- a/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php
+++ b/webht/third_party/trippestOrderSync/controllers/TulanduoApi.php
@@ -471,6 +471,8 @@ class TulanduoApi extends CI_Controller
$cold_update_column["COLD_ServiceSN2"] = $pag_info->pag_sub;
$cold_update_column["COLD_ServiceCity"] = $pag_info->serviceinfo->PAG_CII_SN;
$cold_update_column["COLD_PlanVEI_SN"] = $vei_SN;
+ $cold_update_column["COLD_StartDate"] = $detail_jsonResp->orderDetail->travelDate;
+ $cold_update_column["COLD_EndDate"] = $detail_jsonResp->orderDetail->leaveDate;
}
$this->Order_update->cold_where_update = " COLD_SN=" . $cold_sn;
$this->Order_update->biz_confirmlinedetail_update($cold_update_column);
diff --git a/webht/third_party/trippestOrderSync/controllers/order_finance.php b/webht/third_party/trippestOrderSync/controllers/order_finance.php
index ef30746f..d880d350 100644
--- a/webht/third_party/trippestOrderSync/controllers/order_finance.php
+++ b/webht/third_party/trippestOrderSync/controllers/order_finance.php
@@ -90,7 +90,7 @@ class Order_finance extends CI_Controller {
$report_order['qtMoney'] = 0;
$report_order['orderstats'] = 1;
$report_order['ordernumber'] = $order_info->ordernumber;
- $report_order['TuanName'] = mb_substr($order_info->TuanName, 0, 50);
+ $report_order['TuanName'] = mb_convert_encoding(substr($order_info->TuanName, 0, 50), 'UTF-8');
$report_order['operater'] = $order_info->operater;
$report_order['Agenter'] = mb_substr($order_info->Agenter,0,10);
$report_order['ChinaName'] = $order_info->ChinaName;
diff --git a/webht/third_party/vendorPlanSync/helpers/array_helper.php b/webht/third_party/vendorPlanSync/helpers/array_helper.php
index 2f6ec50f..7ec980a7 100644
--- a/webht/third_party/vendorPlanSync/helpers/array_helper.php
+++ b/webht/third_party/vendorPlanSync/helpers/array_helper.php
@@ -169,7 +169,7 @@ function real_phone_number($phone, $nation_code)
function calc_age($birthday)
{
$now = new DateTime();
- $birth = new DateTime(strstr($birthday, " ", TRUE));
+ $birth = new DateTime($birthday);
$date_d = $now->diff($birth);
$d_t = ($date_d->format("%y"));
return $d_t;
@@ -181,7 +181,7 @@ function calc_age_type($birthday)
return 1;
}
$age = calc_age($birthday);
- if ($age < 18) {
+ if ($age > 0 && $age < 18) {
return 2;
}
return 1;
diff --git a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php
index 33e91b1b..595c65db 100644
--- a/webht/third_party/vendorPlanSync/libraries/Tulanduo.php
+++ b/webht/third_party/vendorPlanSync/libraries/Tulanduo.php
@@ -246,7 +246,7 @@ class Tulanduo
$this_otherinfo .= "; " . $vg->Gender;
}
if (strval($vg->BirthDay) !== '') {
- $this_otherinfo .= "; 生日:". $vg->BirthDay;
+ $this_otherinfo .= "; 生日:". $vg->BirthDay . "; " . calc_age($vg->BirthDay) . "岁";
}
if (strval($vg->PassportValidDate) !== '') {
$this_otherinfo .= "; 护照有效期:" . $vg->PassportValidDate;
@@ -315,6 +315,7 @@ class Tulanduo
}
// 查询是否变更 deprecated at 2019-05
$sync_orderstate = 10;
+ $set_update = false;
$this->ci->tldOrderBuilder->clearModifyLogInfo();
$resp = $this->excute_curl($this->neworder_url, $this->ci->tldOrderBuilder);
$response = json_decode($resp);
@@ -364,6 +365,9 @@ class Tulanduo
if (intval($pag->PAG_DEI_SN)===1 && ! empty($pag->PAG_Code)) {
$pag->PAG_Code = $this->ci->trippest->ch_code_transfer( mb_strtoupper($pag->PAG_Code));
$pag->PAG_ExtendType = $this->tulanduo_trippest_pag[$pag->PAG_Code]->PAG_ExtendType;
+ } else if (false !== stripos($pag->GRD_Landscape, 'trippest')) {
+ $apart["com"]['details'][$pag->PAG_Code][] = $pag;
+ continue;
}
if (empty($pag->PAG_Code)) // 已在grd查询中增加是否目的地产品的判断
{
@@ -374,7 +378,7 @@ class Tulanduo
$pag->PAG_Title = $this->tulanduo_trippest_pag[$pag->PAG_Code]->PAG_Title;
}
// 合作的产品
- if ($this->ci->trippest->if_tour_pvt(array($pag))===1) {
+ if ($this->ci->trippest->if_tour_pvt(array($pag))===1 || isset($pag->is_biz)) {
$apart["pvt"]['details'][] = $pag;
} else {
$apart["com"]['details'][$pag->PAG_Code][] = $pag;
@@ -394,6 +398,9 @@ class Tulanduo
if ($vi !== $vp) {
unset($apart_com[$vi]);
}
+ if (empty($apart_com[$vp]['details'])) {
+ $apart_com[$vp]['details'] = array();
+ }
// $apart_com[$vp]['details'][] = $apart['com']['details'][$vi];
$apart_com[$vp]['details'] = array_merge($apart_com[$vp]['details'], $apart['com']['details'][$vi]);
$apart_com[$vp]['PAG_Code'] = $vp;
diff --git a/webht/third_party/vendorPlanSync/models/Group_model.php b/webht/third_party/vendorPlanSync/models/Group_model.php
index 40ed0810..5dfecc4d 100644
--- a/webht/third_party/vendorPlanSync/models/Group_model.php
+++ b/webht/third_party/vendorPlanSync/models/Group_model.php
@@ -20,10 +20,11 @@ class Group_model extends CI_Model {
from VendorArrangeState vas
inner join Eva_ObjectInfo eoi on EOI_GRI_SN=VAS_GRI_SN and EOI_Type=1 and EOI_ObjSN=VAS_VEI_SN
inner join GRoupInfo gri on GRI_SN=VAS_GRI_SN
- where 1=1 AND VAS_VEI_SN in ($vendor_str) ";
- $sql .= $gri_sn!==0 ? $gri_sql : "
+ where 1=1 AND VAS_VEI_SN in ($vendor_str)
AND isnull(VAS_IsCancel,0)=0 AND isnull(VAS_Delete,0)=0 AND isnull(vas.DeleteFlag,0)=0
- AND VAS_IsSendSucceed=1 AND isnull(VAS_IsReceive,0)=0
+ AND VAS_IsSendSucceed=1 ";
+ $sql .= $gri_sn!==0 ? $gri_sql : "
+ AND isnull(VAS_IsReceive,0)=0
-- AND EOI_GetDate between '$start_date' AND '$end_date'
AND EOI_GetDate > CONVERT(date, GETDATE())
AND isnull(VAS_IsConfirm,0)=0 AND VAS_ConfirmSN IS NULL
@@ -102,9 +103,10 @@ class Group_model extends CI_Model {
$vgrd->ACI_PersonNum = intval($vcold->COLD_PersonNum);
$vgrd->ACI_ChildNum = intval($vcold->COLD_ChildNum);
$vgrd->ACI_BabyNum = intval($vcold->COLD_BabyNum);
- $vgrd->PAG_DEI_SN = $vcold->PAG_DEI_SN;
+ $vgrd->PAG_DEI_SN = $vcold->PAG_DEI_SN ? $vcold->PAG_DEI_SN : 0;
$vgrd->PAG_sub_sn = intval($vcold->COLD_ServiceSN2);
$vgrd->vendor_memo = trim($vcold->COLD_vendorMemo);
+ $vgrd->is_biz = 1;
if ( strval($vcold->COLD_ServiceType)==='D') {
$vgrd->PAG_Code = mb_strtoupper($vcold->PAG_Code);
$vgrd->PAG_ExtendType = mb_strtoupper($vcold->PAG_ExtendType);
@@ -147,7 +149,7 @@ class Group_model extends CI_Model {
*
from ArrangeConfirmInfo aci
left join BIZ_PackageInfo on PAG_SN=ACI_ServiceSN
- and ACI_ServiceType='D' and PAG_DefaultVEI_SN=ACI_VEI_SN
+ and ACI_ServiceType='D' --and PAG_DefaultVEI_SN=ACI_VEI_SN
-- 增加是否目的地产品的判断
and SUBSTRING(CONVERT(varchar(10), PAG_SourceType) ,1,3)='132'
where 1=1
@@ -199,12 +201,16 @@ class Group_model extends CI_Model {
return $this->HT->query($sql, array($gri_sn))->result();
}
- public function get_sync_info($vas, $tour_code="")
+ public function get_sync_info($vas, $external_id=null, $tour_code="")
{
$sql = "SELECT *
from VendorPlanSendout
where VPS_VAS_SN=? ";
$param_arr = array($vas);
+ if ($external_id !== null) {
+ $sql .= " AND VPS_externalId=? ";
+ $param_arr[] = $external_id;
+ }
if ($tour_code !== "") {
$sql .= " AND VPS_tourCode=? ";
$param_arr[] = $tour_code;
|