|
@@ -21,6 +21,8 @@ class Record extends Component
|
|
|
public $in;
|
|
public $in;
|
|
|
public $out;
|
|
public $out;
|
|
|
public $payments = [];
|
|
public $payments = [];
|
|
|
|
|
+ public $origins = [];
|
|
|
|
|
+ public $destinations = [];
|
|
|
public $fromDate;
|
|
public $fromDate;
|
|
|
public $toDate;
|
|
public $toDate;
|
|
|
public $appliedFromDate;
|
|
public $appliedFromDate;
|
|
@@ -31,6 +33,8 @@ class Record extends Component
|
|
|
public $selectedPeriod = 'OGGI';
|
|
public $selectedPeriod = 'OGGI';
|
|
|
public $filterCausals = null;
|
|
public $filterCausals = null;
|
|
|
public $filterPaymentMethods = null;
|
|
public $filterPaymentMethods = null;
|
|
|
|
|
+ public $filterOrigins = null;
|
|
|
|
|
+ public $filterDestinations = null;
|
|
|
public $filterMember = null;
|
|
public $filterMember = null;
|
|
|
public $isFiltering = false;
|
|
public $isFiltering = false;
|
|
|
public array $recordDatas = [];
|
|
public array $recordDatas = [];
|
|
@@ -91,6 +95,8 @@ class Record extends Component
|
|
|
})->orderBy('last_name')->orderBy('first_name')->get();
|
|
})->orderBy('last_name')->orderBy('first_name')->get();
|
|
|
|
|
|
|
|
$this->payments = \App\Models\PaymentMethod::select('id', 'name', 'type')->where('enabled', true)->where('money', false)->get();
|
|
$this->payments = \App\Models\PaymentMethod::select('id', 'name', 'type')->where('enabled', true)->where('money', false)->get();
|
|
|
|
|
+ $this->origins = \App\Models\Bank::select('id', 'name')->where('enabled', true)->where('visibility', 'OUT')->get();
|
|
|
|
|
+ $this->destinations = \App\Models\Bank::select('id', 'name')->where('enabled', true)->where('visibility', 'IN')->get();
|
|
|
|
|
|
|
|
$this->selectedMonth = date('Y-m');
|
|
$this->selectedMonth = date('Y-m');
|
|
|
$this->selectedDay = date('Y-m-d');
|
|
$this->selectedDay = date('Y-m-d');
|
|
@@ -168,6 +174,16 @@ class Record extends Component
|
|
|
Log::info('generateExportDataAndTotals: Payment method filters applied', ['payment_method_count' => count($this->filterPaymentMethods)]);
|
|
Log::info('generateExportDataAndTotals: Payment method filters applied', ['payment_method_count' => count($this->filterPaymentMethods)]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if ($this->filterOrigins != null && sizeof($this->filterOrigins) > 0) {
|
|
|
|
|
+ $datas->whereIn('origin_id', $this->filterOrigins);
|
|
|
|
|
+ Log::info('generateExportDataAndTotals: Origin filters applied', ['origins_count' => count($this->filterOrigins)]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if ($this->filterDestinations != null && sizeof($this->filterDestinations) > 0) {
|
|
|
|
|
+ $datas->whereIn('destination_id', $this->filterDestinations);
|
|
|
|
|
+ Log::info('generateExportDataAndTotals: Destination filters applied', ['destinations_count' => count($this->filterDestinations)]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
|
$datas->where('member_id', $this->filterMember);
|
|
$datas->where('member_id', $this->filterMember);
|
|
|
Log::info('generateExportDataAndTotals: Member filter applied', ['member_id' => $this->filterMember]);
|
|
Log::info('generateExportDataAndTotals: Member filter applied', ['member_id' => $this->filterMember]);
|
|
@@ -395,6 +411,12 @@ class Record extends Component
|
|
|
if ($this->filterPaymentMethods != null && sizeof($this->filterPaymentMethods) > 0) {
|
|
if ($this->filterPaymentMethods != null && sizeof($this->filterPaymentMethods) > 0) {
|
|
|
$datas->whereIn('payment_method_id', $this->filterPaymentMethods);
|
|
$datas->whereIn('payment_method_id', $this->filterPaymentMethods);
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($this->filterOrigins != null && sizeof($this->filterOrigins) > 0) {
|
|
|
|
|
+ $datas->whereIn('origin_id', $this->filterOrigins);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->filterDestinations != null && sizeof($this->filterDestinations) > 0) {
|
|
|
|
|
+ $datas->whereIn('destination_id', $this->filterDestinations);
|
|
|
|
|
+ }
|
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
|
$datas->where('member_id', $this->filterMember);
|
|
$datas->where('member_id', $this->filterMember);
|
|
|
}
|
|
}
|
|
@@ -437,6 +459,8 @@ class Record extends Component
|
|
|
$this->showDayPicker = false;
|
|
$this->showDayPicker = false;
|
|
|
$this->filterCausals = [];
|
|
$this->filterCausals = [];
|
|
|
$this->filterPaymentMethods = [];
|
|
$this->filterPaymentMethods = [];
|
|
|
|
|
+ $this->filterOrigins = [];
|
|
|
|
|
+ $this->filterDestinations = [];
|
|
|
$this->filterMember = null;
|
|
$this->filterMember = null;
|
|
|
|
|
|
|
|
$today = date("Y-m-d");
|
|
$today = date("Y-m-d");
|
|
@@ -638,6 +662,12 @@ class Record extends Component
|
|
|
if ($this->filterPaymentMethods != null && sizeof($this->filterPaymentMethods) > 0) {
|
|
if ($this->filterPaymentMethods != null && sizeof($this->filterPaymentMethods) > 0) {
|
|
|
$datas->whereIn('payment_method_id', $this->filterPaymentMethods);
|
|
$datas->whereIn('payment_method_id', $this->filterPaymentMethods);
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($this->filterOrigins != null && sizeof($this->filterOrigins) > 0) {
|
|
|
|
|
+ $datas->whereIn('origin_id', $this->filterOrigins);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->filterDestinations != null && sizeof($this->filterDestinations) > 0) {
|
|
|
|
|
+ $datas->whereIn('destination_id', $this->filterDestinations);
|
|
|
|
|
+ }
|
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
|
$datas->where('member_id', $this->filterMember);
|
|
$datas->where('member_id', $this->filterMember);
|
|
|
}
|
|
}
|
|
@@ -1079,6 +1109,12 @@ class Record extends Component
|
|
|
if ($this->filterPaymentMethods != null && sizeof($this->filterPaymentMethods) > 0) {
|
|
if ($this->filterPaymentMethods != null && sizeof($this->filterPaymentMethods) > 0) {
|
|
|
$query->whereIn('payment_method_id', $this->filterPaymentMethods);
|
|
$query->whereIn('payment_method_id', $this->filterPaymentMethods);
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($this->filterOrigins != null && sizeof($this->filterOrigins) > 0) {
|
|
|
|
|
+ $query->whereIn('origin_id', $this->filterOrigins);
|
|
|
|
|
+ }
|
|
|
|
|
+ if ($this->filterDestinations != null && sizeof($this->filterDestinations) > 0) {
|
|
|
|
|
+ $query->whereIn('destination_id', $this->filterDestinations);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
if ($this->filterMember != null && $this->filterMember > 0) {
|
|
|
$query->where('member_id', $this->filterMember);
|
|
$query->where('member_id', $this->filterMember);
|
|
@@ -1113,6 +1149,26 @@ class Record extends Component
|
|
|
return implode(', ', $payment_methods);
|
|
return implode(', ', $payment_methods);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private function getOriginsNames($originIds)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!is_array($originIds)) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $origins = \App\Models\Bank::whereIn('id', $originIds)->pluck('name')->toArray();
|
|
|
|
|
+ return implode(', ', $origins);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private function getDestinationsNames($destinationIds)
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!is_array($destinationIds)) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $destinations = \App\Models\Bank::whereIn('id', $destinationIds)->pluck('name')->toArray();
|
|
|
|
|
+ return implode(', ', $destinations);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function updatedExportFromDate()
|
|
public function updatedExportFromDate()
|
|
|
{
|
|
{
|
|
|
$this->updateEmailSubject();
|
|
$this->updateEmailSubject();
|
|
@@ -1164,6 +1220,8 @@ class Record extends Component
|
|
|
'member' => $this->filterMember ? $this->getMemberName($this->filterMember) : null,
|
|
'member' => $this->filterMember ? $this->getMemberName($this->filterMember) : null,
|
|
|
'causals' => $this->filterCausals ? $this->getCausalsNames($this->filterCausals) : null,
|
|
'causals' => $this->filterCausals ? $this->getCausalsNames($this->filterCausals) : null,
|
|
|
'payment_methods' => $this->filterPaymentMethods ? $this->getPaymentMethodsNames($this->filterPaymentMethods) : null,
|
|
'payment_methods' => $this->filterPaymentMethods ? $this->getPaymentMethodsNames($this->filterPaymentMethods) : null,
|
|
|
|
|
+ 'origins' => $this->filterOrigins ? $this->getOriginsNames($this->filterOrigins) : null,
|
|
|
|
|
+ 'destinations' => $this->filterDestinations ? $this->getDestinationsNames($this->filterDestinations) : null,
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
$paymentsArray = $this->payments->map(function ($payment) {
|
|
$paymentsArray = $this->payments->map(function ($payment) {
|