本文整理汇总了PHP中Library\Utility\Helper::stripTages方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::stripTages方法的具体用法?PHP Helper::stripTages怎么用?PHP Helper::stripTages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library\Utility\Helper
的用法示例。
在下文中一共展示了Helper::stripTages方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: modifyReservation
//.........这里部分代码省略.........
// set identificator
if ($apartel && isset($otherInfo['identificator'])) {
$daoReservationIdentificator = $this->getServiceLocator()->get('dao_channel_manager_reservation_identificator');
$daoReservationIdentificator->save(['date_from' => $otherInfo['identificator']['dateFrom'], 'date_to' => $otherInfo['identificator']['dateTo'], 'room_id' => $otherInfo['identificator']['roomId'], 'rate_id' => $otherInfo['identificator']['rateId'], 'guest_name' => trim($otherInfo['identificator']['guestName'])], ['reservation_id' => $reservationId]);
}
if ($data['date_from'] != $bookingDomain->getDateFrom() || $data['date_to'] != $bookingDomain->getDateTo()) {
// Rates data parsing
$ratesData = $otherInfo['ratesData'];
$ratesForChangeDate = $this->changeDateForModification($ratesData, $reservationId, false, $apartel, $isOverbooking);
if ($ratesForChangeDate['status'] == 'error') {
return false;
}
}
$remarks = null;
if (isset($data['remarks']) && !empty(trim($data['remarks']))) {
$remarks = trim($data['remarks']);
}
unset($data['remarks']);
if (isset($data['ip_address'])) {
unset($data['ip_address']);
}
// Update reservation
$bookingDao->save($data, ['id' => $reservationId]);
// anyway update channel
$availabilityService = $this->getServiceLocator()->get('service_availability');
$availabilityService->updateChannelByReservationId($reservationId);
// Reservation modified
$reservationModifiedMessage = 'Modification received from Channel Manager and processed successfully';
if ($data['date_from'] != $bookingDomain->getDateFrom() || $data['date_to'] != $bookingDomain->getDateTo()) {
$reservationModifiedMessage .= ' : <br>';
$thereIsAlreadyDateChange = false;
if ($data['date_from'] < $bookingDomain->getDateFrom()) {
$thereIsAlreadyDateChange = true;
$oldDateFromMinusOneDay = date('Y-m-d', strtotime('-1 day', strtotime($bookingDomain->getDateFrom())));
//change range is one day
if ($oldDateFromMinusOneDay == $data['date_from']) {
$reservationModifiedMessage .= 'Dates modified: Added new date ' . $oldDateFromMinusOneDay;
} else {
$reservationModifiedMessage .= 'Modified dates: Added new dates from ' . $data['date_from'] . ' to ' . $oldDateFromMinusOneDay;
}
}
if ($data['date_from'] > $bookingDomain->getDateFrom()) {
if ($thereIsAlreadyDateChange) {
$reservationModifiedMessage .= ' , ';
}
$thereIsAlreadyDateChange = true;
$newDateMinusOneDay = date('Y-m-d', strtotime('-1 day', strtotime($data['date_from'])));
if ($newDateMinusOneDay == $bookingDomain->getDateFrom()) {
$reservationModifiedMessage .= 'Modified dates: Updated with penalty and opened availability for ' . $newDateMinusOneDay;
} else {
$reservationModifiedMessage .= 'Modified dates: Updated with penalty and opened availability from ' . $bookingDomain->getDateFrom() . ' to ' . $newDateMinusOneDay;
}
}
if ($data['date_to'] > $bookingDomain->getDateTo()) {
$realNewDateTo = date('Y-m-d', strtotime('-1 day', strtotime($data['date_to'])));
$realOldDateTo = date('Y-m-d', strtotime('-1 day', strtotime($bookingDomain->getDateTo())));
if ($thereIsAlreadyDateChange) {
$reservationModifiedMessage .= ' , ';
}
$thereIsAlreadyDateChange = true;
$oldDateFromPlusOneDay = date('Y-m-d', strtotime('+1 day', strtotime($realOldDateTo)));
if ($oldDateFromPlusOneDay == $realNewDateTo) {
$reservationModifiedMessage .= 'Modified dates: Added new date ' . $realNewDateTo;
} else {
$reservationModifiedMessage .= 'Modified dates: Added new dates from ' . $oldDateFromPlusOneDay . ' to ' . $realNewDateTo;
}
}
if ($data['date_to'] < $bookingDomain->getDateTo()) {
$realNewDateTo = date('Y-m-d', strtotime('-1 day', strtotime($data['date_to'])));
$realOldDateTo = date('Y-m-d', strtotime('-1 day', strtotime($bookingDomain->getDateTo())));
if ($thereIsAlreadyDateChange) {
$reservationModifiedMessage .= ' , ';
}
$newDatePlusOneDay = date('Y-m-d', strtotime('+1 day', strtotime($realNewDateTo)));
if ($newDatePlusOneDay == $realOldDateTo) {
$reservationModifiedMessage .= 'Modified dates: Updated with penalty and opened availability for ' . $newDatePlusOneDay;
} else {
$reservationModifiedMessage .= 'Modified dates: Updated with penalty and opened availability from ' . $newDatePlusOneDay . ' to ' . $realOldDateTo;
}
}
}
$logger->save(Logger::MODULE_BOOKING, $reservationId, Logger::ACTION_BOOKING_MODIFY, $reservationModifiedMessage);
// create log for remarks
if (!is_null($remarks)) {
$actionLogDao = $this->getServiceLocator()->get('dao_action_logs_action_logs');
$preActionLog = $actionLogDao->fetchOne(['module_id' => Logger::MODULE_BOOKING, 'identity_id' => $reservationId, 'user_id' => UserService::USER_GUEST, 'action_id' => Logger::ACTION_COMMENT]);
if ($preActionLog) {
$actionLogDao->save(['value' => Helper::stripTages($remarks), 'timestamp' => date('Y-m-d H:i:s')], ['id' => $preActionLog['id']]);
} else {
$logger->save(Logger::MODULE_BOOKING, $reservationId, Logger::ACTION_COMMENT, Helper::stripTages($remarks), UserService::USER_GUEST);
}
}
// if missing rate create task
if (isset($otherInfo['rateMissingTask'])) {
$taskService->createAutoTaskForMissingRate($reservationId);
}
$this->sendReservationEmail($reservationId, 'modification', $emailOptions, $apartel);
$this->gr2info("Booking ticket successfully modify", ['cron' => 'ChannelManager', 'apartment_id' => $apartmentId, 'reservation_id' => $reservationId]);
return true;
}
示例2: saveCharge
public function saveCharge($data, $userId = false)
{
/**
* @var \DDD\Dao\Booking\Booking $bookingDao
* @var \Library\Authentication\BackofficeAuthenticationService $authenticationService
* @var \DDD\Dao\Booking\Charge $chargingDao
* @var \DDD\Dao\Booking\ChargeDeleted $chargeDeleteDao
* @var \DDD\Dao\Booking\ReservationNightly $reservationNightlyDao
* @var Logger $logger
*/
$authenticationService = $this->getServiceLocator()->get('library_backoffice_auth');
$chargingDao = $this->getServiceLocator()->get('dao_booking_charge');
$bookingDao = $this->getServiceLocator()->get('dao_booking_booking');
$chargeDeleteDao = $this->getServiceLocator()->get('dao_booking_charge_deleted');
$reservationNightlyDao = $this->getServiceLocator()->get('dao_booking_reservation_nightly');
$logger = $this->getServiceLocator()->get('ActionLogger');
$isBookingExist = $bookingDao->checkRowExist(DbTables::TBL_BOOKINGS, 'res_number', $data['res_number']);
$parkingInventoryDao = $this->getServiceLocator()->get('dao_parking_spot_inventory');
$taskService = $this->getServiceLocator()->get('service_task');
if (!$isBookingExist) {
return false;
}
$rowBooking = $bookingDao->getDataForCharge($data['res_number']);
if ($userId) {
$loggedInUserID = $userId;
} else {
$loggedInUserID = $authenticationService->getIdentity()->id;
}
$reservationId = $rowBooking['id'];
$params = ['reservation_id' => $reservationId, 'date' => date('Y-m-d H:i:s'), 'user_id' => $loggedInUserID, 'comment' => Helper::setLog('commentWithoutData', Helper::stripTages($data['charge_comment'])), 'customer_currency' => Helper::stripTages($data['customerCurrency']), 'acc_currency' => Helper::stripTages($data['accommodationCurrency']), 'apartment_id' => (int) $data['accId'], 'type' => 'n'];
try {
$chargingDao->beginTransaction();
$check = false;
$provideParking = [];
$reverseProvideParking = [];
// reverse charge
if (isset($data['removed'])) {
foreach ($data['removed'] as $row) {
if ((int) $row > 0) {
$removedId = $row;
//see if it's parking, open availability for the spot
$removedChargeInfo = $chargingDao->getChargeById($removedId);
if ($removedChargeInfo->getAddons_type() == BookingAddon::ADDON_TYPE_PARKING && $removedChargeInfo->getReservationNightlyId() > 0 && $removedChargeInfo->getEntityId() > 0) {
$parkingInventoryDao->save(['availability' => 1], ['spot_id' => $removedChargeInfo->getEntityId(), 'date' => $removedChargeInfo->getReservationNightlyDate()]);
}
if ($removedChargeInfo->getAddons_type() == BookingAddon::ADDON_TYPE_EXTRA_PERSON) {
$newOccupancy = $rowBooking['occupancy'] - (int) $removedChargeInfo->getAddons_value();
$bookingDao->save(['occupancy' => $newOccupancy], ['id' => $rowBooking['id']]);
$taskService->changeSubtaskOccupancy($rowBooking['id'], $newOccupancy);
}
$chargingDao->save(['status' => self::CHARGE_STATUS_DELETED], ['id' => $removedId]);
$chargeDeleteDao->save(['reservation_id' => $reservationId, 'reservation_charge_id' => $removedId, 'date' => date('Y-m-d H:i:s'), 'user_id' => $loggedInUserID, 'comment' => Helper::setLog('commentWithoutData', Helper::stripTages($data['charge_comment']))]);
$check = true;
$chargeRowRemoved = $chargingDao->checkChargeTypeIsParking($removedId);
if ($chargeRowRemoved) {
if (!isset($reverseProvideParking[$removedChargeInfo->getRateName()])) {
$reverseProvideParking[$removedChargeInfo->getRateName()] = [];
}
array_push($reverseProvideParking[$removedChargeInfo->getRateName()], $removedChargeInfo->getReservationNightlyDate());
}
}
}
}
// charge
if (isset($data['accommodation_amount'])) {
foreach ($data['accommodation_amount'] as $key => $value) {
if (isset($data['entityId'][$key]) && (int) $data['entityId'][$key] > 0) {
$endDate = end($data['nightDate']);
if (strtotime('now') <= strtotime($endDate)) {
if ((int) $data['addonstype'][$key] == Constants::ADDONS_PARKING) {
$isAvailable = $parkingInventoryDao->getSpotInventoryAvailability($data['entityId'][$key], $data['nightDate'][$key]);
if (!$isAvailable) {
return false;
}
}
}
}
}
foreach ($data['accommodation_amount'] as $key => $row) {
$price = number_format((double) $row, 2, '.', '');
$addonType = (int) $data['addonstype'][$key];
// nightly data
if (isset($data['reservation_nightly_ids'][$key]) && (int) $data['reservation_nightly_ids'][$key] > 0) {
$params['reservation_nightly_id'] = (int) $data['reservation_nightly_ids'][$key];
$params['rate_name'] = $data['rateNames'][$key];
$params['reservation_nightly_date'] = $data['nightDate'][$key];
} else {
$params['reservation_nightly_id'] = 0;
$params['rate_name'] = NUll;
$params['reservation_nightly_date'] = NULL;
}
//entityId is being used for parking now
if (isset($data['entityId'][$key]) && (int) $data['entityId'][$key] > 0) {
$params['entity_id'] = (int) $data['entityId'][$key];
if ((int) $data['addonstype'][$key] == Constants::ADDONS_PARKING) {
//close spot availability
$parkingInventoryDao->save(['availability' => 0], ['spot_id' => $params['entity_id'], 'date' => $params['reservation_nightly_date']]);
}
} else {
$params['entity_id'] = 0;
//.........这里部分代码省略.........
示例3: ajaxBlackListAction
public function ajaxBlackListAction()
{
$request = $this->getRequest();
$result = ['status' => 'success', 'msg' => ''];
try {
if ($request->isXmlHttpRequest()) {
/**
* @var \DDD\Service\Booking $bookingService
*/
$bookingService = $this->getServiceLocator()->get('service_booking');
$num = (int) $request->getPost('num');
$reservationId = Helper::stripTages($request->getPost('reservation_id'));
$response = $bookingService->saveBlackList($reservationId, $num);
if ($response && $response['status'] == 'success') {
$flash = ['success' => $response['msg']];
} else {
$flash = ['error' => $response['msg']];
}
Helper::setFlashMessage($flash);
}
} catch (\Exception $e) {
$result['status'] = 'error';
$result['msg'] = TextConstants::ERROR;
}
return new JsonModel($result);
}
示例4: bookingSave
public function bookingSave($data)
{
/**
* @var \DDD\Domain\Booking\BookingTicket $rowBooking
* @var \Library\Authentication\BackofficeAuthenticationService $authenticationService
* @var \DDD\Service\Booking\BankTransaction $bankTransactionService
* @var ChannelManager $serviceChannelManager
* @var Inventory $serviceInventory
* @var \DDD\Service\Fraud $serviceFraud
* @var \DDD\Service\Partners $partnerService
* @var \DDD\Service\Task $taskService
* @var \DDD\Dao\Task\Task $taskDao
* @var Logger $logger
* @var \DDD\Dao\Booking\Booking $bookingDao
* @var \DDD\Service\Booking\ReservationIssues $reservationIssuesService
*/
$authenticationService = $this->getServiceLocator()->get('library_backoffice_auth');
$cityService = $this->getServiceLocator()->get('service_location');
$serviceInventory = $this->getServiceLocator()->get('service_apartment_inventory');
$serviceFraud = $this->getServiceLocator()->get('service_fraud');
$taskService = $this->getServiceLocator()->get('service_task');
$taskDao = $this->getServiceLocator()->get('dao_task_task');
$logger = $this->getServiceLocator()->get('ActionLogger');
$bookingDao = $this->getServiceLocator()->get('dao_booking_booking');
$reservationIssuesService = $this->getServiceLocator()->get('service_booking_reservation_issues');
$addToBlackList = isset($data['addToBlackList']) ? $data['addToBlackList'] : 0;
unset($data['addToBlackList']);
$bookingDao->setEntity(new \DDD\Domain\Booking\BookingTicket());
$rowBooking = $bookingDao->getBookingTicketData((int) $data['booking_id']);
$cub_status = ['status' => 'success'];
$status = 'success';
$msg = '';
if (!$rowBooking) {
return ['status' => 'error', 'msg' => TextConstants::ERROR_ROW, 'cub_status' => $cub_status];
}
$hasFinanceRole = $authenticationService->hasRole(Roles::ROLE_RESERVATION_FINANCE);
$hasCreditCardView = $authenticationService->hasRole(Roles::ROLE_CREDIT_CARD);
$data['finance_paid_affiliate'] = isset($data['finance_paid_affiliate']) ? (int) $data['finance_paid_affiliate'] : 0;
$params = ['guest_first_name' => Helper::stripTages($data['guest_name']), 'guest_last_name' => Helper::stripTages($data['guest_last_name']), 'guest_email' => Helper::stripTages($data['guest_email']), 'secondary_email' => Helper::stripTages($data['second_guest_email']), 'guest_country_id' => $data['guest_country'] > 0 ? (int) $data['guest_country'] : null, 'guest_city_name' => Helper::stripTages($data['guest_city']), 'guest_address' => Helper::stripTages($data['guest_address']), 'guest_zip_code' => Helper::stripTages($data['guest_zipcode']), 'guest_phone' => Helper::stripTages($data['guest_phone']), 'guest_travel_phone' => Helper::stripTages($data['guest_travel_phone']), 'partner_ref' => Helper::stripTages($data['booking_affiliate_reference']), 'partner_settled' => $data['finance_paid_affiliate'], 'no_collection' => (int) $data['finance_no_collection'], 'apartel_id' => (int) $data['apartel_id'], 'occupancy' => (int) $data['occupancy'], 'ki_viewed' => (int) $data['finance_key_instructions'], 'model' => (int) $data['model']];
if ($params['secondary_email'] == $params['guest_email']) {
$params['secondary_email'] = null;
}
if ((int) $data['overbooking_status'] != $rowBooking->getOverbookingStatus()) {
$changeOverbookingStatus = $this->changeOverbookingStatus((int) $data['booking_id'], (int) $data['overbooking_status']);
if (!$changeOverbookingStatus) {
if ((int) $data['overbooking_status'] != self::OVERBOOKING_STATUS_OVERBOOKED) {
$status = 'error';
$msg .= TextConstants::OVERBOOKING_STATUS_CHANGE_ERROR;
} elseif ((int) $data['overbooking_status'] == self::OVERBOOKING_STATUS_OVERBOOKED) {
$status = 'error';
$msg .= TextConstants::OVERBOOKING_STATUS_CHANGE_NOT_OPEN_DAY;
}
}
unset($data['overbooking_status']);
}
if (!empty($data['booking_arrival_time'])) {
$params['guest_arrival_time'] = Helper::stripTages($data['booking_arrival_time']);
}
// if change partner
if (isset($data['booking_partners']) && $data['booking_partners'] != $rowBooking->getPartnerId()) {
$params['partner_id'] = $data['booking_partners'];
$partnerService = $this->getServiceLocator()->get('service_partners');
$partnerData = $partnerService->getPartnerDataForReservation($params['partner_id'], $rowBooking->getApartmentIdAssigned(), true);
$params['partner_commission'] = $partnerData->getCommission();
$params['partner_name'] = $partnerData->getPartnerName();
}
if (isset($data['finance_booked_state']) && isset($data['finance_booked_state_changed']) && $data['finance_booked_state_changed'] == self::BOOKED_STATE_CHANGED) {
$params['arrival_status'] = (int) $data['finance_booked_state'];
if ($data['finance_booked_state'] > 0) {
$params['ki_viewed'] = 1;
}
$currentDateCity = $cityService->getCurrentDateCity($rowBooking->getApartmentCityId());
switch ($data['finance_booked_state']) {
case 1:
// check in
if (is_null($rowBooking->getActualArrivalDate())) {
$params['arrival_date'] = $currentDateCity;
}
break;
case 2:
// check out
if (is_null($rowBooking->getActualDepartureDate())) {
$params['departure_date'] = $currentDateCity;
// change cleaning task start date
$taskService->changeTaskDate($rowBooking->getId(), $rowBooking->getApartmentIdAssigned(), $currentDateCity, strtotime($rowBooking->getDate_to()), Task::TYPE_CLEANING, Task::TASK_IS_HOUSEKEEPING);
}
break;
case 4:
// no show
$taskService->createNoShowTask((int) $data['booking_id'], $authenticationService->getIdentity(), $rowBooking->getApartmentIdAssigned(), $rowBooking->getDate_from());
break;
}
}
// Action Logging
$this->setGinosiComment($rowBooking, $data, ['fin' => $hasFinanceRole, 'credit' => $hasCreditCardView]);
// Destination status can't be booked or unknown
$weirdStatusList = [BookingService::BOOKING_STATUS_BOOKED, BookingService::BOOKING_STATUS_CANCELLED_PENDING];
// Booking status was changed and assumes Cancellation
if (isset($data['booking_statuses']) && in_array($rowBooking->getStatus(), $weirdStatusList) && !in_array($data['booking_statuses'], $weirdStatusList)) {
// Only if reservation is not canceled-moved to "bad" reservation
//.........这里部分代码省略.........
示例5: saveTransaction
/**
* @param array $data
* @param int $moneyDirection
* @param bool $isFrontier
*
* @return bool|string
*/
public function saveTransaction($data, $moneyDirection = self::TRANSACTION_MONEY_DIRECTION_GINOSI_COLLECT, $isFrontier = false)
{
/**
* @var \DDD\Dao\Booking\ChargeTransaction $bankTransactionDao
* @var \Library\Authentication\BackofficeAuthenticationService $authenticationService
* @var \DDD\Service\Booking\BookingTicket $bookingTicketService
* @var \DDD\Domain\Booking\ForCharge $rowBooking
* @var ForCharge $bookingDao
* @var \DDD\Service\Fraud $serviceFraud
* @var \DDD\Dao\Psp\Psp $pspDao
* @var Logger $logger
*/
$transactionDate = date('Y-m-d H:i:s');
$bankTransactionDao = $this->getServiceLocator()->get('dao_booking_change_transaction');
$pspDao = $this->getServiceLocator()->get('dao_psp_psp');
$transactionType = (int) $data['transaction_type'];
$transactionStatus = isset($data['transaction_status']) ? (int) $data['transaction_status'] : 0;
$errorRespond = ['status' => 'error', 'msg' => TextConstants::ERROR_CHARGED];
$error = '';
$transactionTypesWhichRequireCreditCard = [self::BANK_TRANSACTION_TYPE_COLLECT, self::BANK_TRANSACTION_TYPE_REFUND, self::BANK_TRANSACTION_TYPE_VALIDATION];
if (in_array($transactionType, $transactionTypesWhichRequireCreditCard) && (!isset($data['cardId']) || !(int) $data['cardId'])) {
return ['status' => 'error', 'msg' => TextConstants::ERROR_NO_CARD];
}
$creditCardId = intval($data['cardId']);
/**
* @var \DDD\Dao\Booking\Booking $bookingDao
*/
$bookingDao = $this->getServiceLocator()->get('dao_booking_booking');
$bookingDao->setEntity(new \DDD\Domain\Booking\ForCharge());
$rowBooking = $bookingDao->fetchOne(['res_number' => $data['res_number']], ['id', 'partner_id', 'customer_id']);
if (!$rowBooking) {
return $errorRespond;
}
try {
if (!$isFrontier) {
$bankTransactionDao->beginTransaction();
}
$authenticationService = $this->getServiceLocator()->get('library_backoffice_auth');
$bookingTicketService = $this->getServiceLocator()->get('service_booking_booking_ticket');
$loggedInUserID = $authenticationService->getIdentity()->id;
$transactionApartmentAmount = $data['transaction_acc_amount'];
$accAmount = number_format(doubleval($transactionApartmentAmount), 2, '.', '');
if ($transactionType == self::BANK_TRANSACTION_TYPE_DEDUCTED_SALARY) {
$bankAmount = 0;
$bankRate = 0;
$moneyAccountCurrency = $data['acc_currency'];
$cashUser = (int) $data['userCache_id'];
} else {
$moneyAccountCurrency = $data['transaction_money_account_currency'];
$bankRate = $data['transaction_money_account_currency_rate'];
$bankAmount = number_format($data['transaction_charge_amount'], 2, '.', '');
$cashUser = 0;
}
// Calculate exact bank amount
$bankAmount = $this->applyPercentDeductionByPSP($bankAmount, $data['transaction_psp']);
if ($transactionType == self::BANK_TRANSACTION_TYPE_DEDUCTED_SALARY) {
$moneyAccountId = 0;
} elseif (in_array($transactionType, [self::BANK_TRANSACTION_TYPE_CASH, self::BANK_TRANSACTION_TYPE_CASH_REFUND])) {
$moneyAccountId = (int) $data['personal_account_id'];
} elseif (in_array($transactionType, [self::BANK_TRANSACTION_TYPE_CHARGEBACK_DISPUTE, self::BANK_TRANSACTION_TYPE_CHARGEBACK_FRAUD, self::BANK_TRANSACTION_TYPE_CHARGEBACK_OTHER])) {
$moneyAccountId = (int) $data['transaction_chargeback_bank'];
} elseif ($transactionType == self::BANK_TRANSACTION_TYPE_BANK_DEPOSIT) {
$moneyAccountId = (int) $data['money_account_deposit_id'];
$moneyDirection = (int) $data['money_direction_received'];
} else {
$moneyAccountId = (int) $data['transaction_money_account_id'];
}
if ($transactionType == self::BANK_TRANSACTION_TYPE_BANK_DEPOSIT) {
$moneyDirection = self::TRANSACTION_MONEY_DIRECTION_GINOSI_COLLECT;
}
// All Refunds and Chargebacks
if (in_array($transactionType, [self::BANK_TRANSACTION_TYPE_REFUND, self::BANK_TRANSACTION_TYPE_CHARGEBACK_FRAUD, self::BANK_TRANSACTION_TYPE_CHARGEBACK_DISPUTE, self::BANK_TRANSACTION_TYPE_CHARGEBACK_OTHER, self::BANK_TRANSACTION_TYPE_CASH_REFUND])) {
if ($transactionType != self::BANK_TRANSACTION_TYPE_CASH_REFUND) {
$bankAmount = -$bankAmount;
}
$accAmount = -$accAmount;
}
$params = ['reservation_id' => $data['reservation_id'], 'money_account_id' => $moneyAccountId, 'date' => $transactionDate, 'user_id' => $loggedInUserID, 'bank_amount' => $bankAmount, 'money_account_currency' => $moneyAccountCurrency, 'acc_amount' => $accAmount, 'bank_rate' => $bankRate, 'comment' => Helper::setLog('commentWithoutData', Helper::stripTages($data['transaction_charge_comment'])), 'type' => $transactionType, 'cache_user' => $cashUser, 'apartment_id' => (int) $data['accId'], 'money_direction' => $moneyDirection];
if (in_array($transactionType, [self::BANK_TRANSACTION_TYPE_CASH, self::BANK_TRANSACTION_TYPE_CASH_REFUND, self::BANK_TRANSACTION_TYPE_BANK_DEPOSIT, self::BANK_TRANSACTION_TYPE_DEDUCTED_SALARY])) {
$params['cc_id'] = 0;
} else {
$params['cc_id'] = $creditCardId;
}
if ($transactionType == self::BANK_TRANSACTION_TYPE_COLLECT) {
$cardStatus = $transactionStatus + 1;
/**
* @var CardService $cardService
*/
$cardService = $this->getServiceLocator()->get('service_card');
$cardPartnerBusinessModel = $cardService->getCardPartnerBusinessModel($creditCardId);
// check card partner business model
if ($cardPartnerBusinessModel && $cardPartnerBusinessModel == Partners::BUSINESS_MODEL_GINOSI_COLLECT_PARTNER) {
$params['money_direction'] = self::TRANSACTION_MONEY_DIRECTION_PARTNER_COLLECT;
//.........这里部分代码省略.........