mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
update code on export booking analytic data for Hybrid payment method
This commit is contained in:
@@ -65,6 +65,18 @@ class ExportsAnalyticBookingTransactions implements FromQuery, WithHeadings, Wit
|
||||
$companyType[companyType::PERSONAL_BUSINESS] = 'PERSONAL_BUSINESS';
|
||||
|
||||
$payments = $booking->transactions()->where('type', 1)->whereIn('status', [2, 3]);
|
||||
|
||||
$paymentmethondArray = PaymentMethodType::PAYMENT_METHODS_ID;
|
||||
$paymentmethondArray[0] = 'Hybrid';
|
||||
$paymentMethod = '';
|
||||
foreach ($payments->get() as $payment) {
|
||||
if ( $paymentMethod == '' ) {
|
||||
$paymentMethod = $payment->payment_method;
|
||||
} else if ( $payment->payment_method != $paymentMethod ) {
|
||||
$paymentMethod = 0; // set it to Hybrid
|
||||
}
|
||||
}
|
||||
$paymentMethod === '' ? '' : $paymentMethod = $paymentmethondArray[$paymentMethod];
|
||||
|
||||
$firstPayment = $payments->first();
|
||||
|
||||
@@ -74,23 +86,6 @@ class ExportsAnalyticBookingTransactions implements FromQuery, WithHeadings, Wit
|
||||
|
||||
$lastPayment = $booking->transactions()->where('type', 1)->whereIn('status', [2, 3])->orderBy('id', 'desc')->first();
|
||||
|
||||
$paymentMethod = '';
|
||||
foreach ($payments->get() as $payment) {
|
||||
|
||||
if ( $paymentMethod == '' ) {
|
||||
$paymentMethod = $payment->payment_method;
|
||||
} else {
|
||||
if ( $payment->payment_method != $paymentMethod ) {
|
||||
$paymentMethod = 0; // set it to Hybrid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$paymentmethondArray = PaymentMethodType::PAYMENT_METHODS_ID;
|
||||
$paymentmethondArray[0] = 'Hybrid';
|
||||
|
||||
$paymentMethod == '' ? '' : $paymentMethod = $paymentmethondArray[$paymentMethod];
|
||||
|
||||
return [
|
||||
$booking->id,
|
||||
$booking->company_id,
|
||||
|
||||
Reference in New Issue
Block a user