|
|
@@ -9,6 +9,7 @@ use DateTime;
|
|
|
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
|
|
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
|
|
|
|
|
+use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
class Record extends Component
|
|
|
{
|
|
|
@@ -30,6 +31,9 @@ class Record extends Component
|
|
|
|
|
|
public array $causals = [];
|
|
|
public $members = array();
|
|
|
+ public $filterSupplier = null;
|
|
|
+
|
|
|
+ public $suppliers = array();
|
|
|
|
|
|
public function hydrate()
|
|
|
{
|
|
|
@@ -44,7 +48,8 @@ class Record extends Component
|
|
|
|
|
|
|
|
|
$this->getCausals(\App\Models\Causal::select('id', 'name')->where('parent_id', null)->get(), 0);
|
|
|
-
|
|
|
+ $this->suppliers = \App\Models\Supplier::select(['id', 'name'])->orderBy('name')->get();
|
|
|
+ Log::info($this->suppliers);
|
|
|
$this->members = \App\Models\Member::select(['id', 'first_name', 'last_name', 'fiscal_code'])->orderBy('last_name')->orderBy('first_name')->get();
|
|
|
|
|
|
$this->payments = \App\Models\PaymentMethod::select('id', 'name','type')->where('enabled', true)->where('money', false)->get();
|
|
|
@@ -171,6 +176,10 @@ class Record extends Component
|
|
|
{
|
|
|
$datas->where('member_id', $this->filterMember);
|
|
|
}
|
|
|
+ if ($this->filterSupplier != null && $this->filterSupplier > 0)
|
|
|
+ {
|
|
|
+ $datas->where('supplier_id', $this->filterSupplier);
|
|
|
+ }
|
|
|
$datas = $datas->orderBy('date', 'ASC')->orderBy('records.created_at', 'ASC')
|
|
|
->get();
|
|
|
|