|
|
@@ -299,11 +299,9 @@ class RecordOUT extends Component
|
|
|
if ($this->filterTo != '') {
|
|
|
$datas = $datas->where('date', '<=', $this->filterTo);
|
|
|
}
|
|
|
- //$this->records = $datas->orderBy('date', 'DESC')->get();
|
|
|
|
|
|
$this->records = $datas->get();
|
|
|
|
|
|
- //$this->total = $this->records->sum('amount');
|
|
|
|
|
|
$this->total = 0;
|
|
|
foreach ($this->records as $r) {
|
|
|
@@ -341,17 +339,6 @@ class RecordOUT extends Component
|
|
|
$r->payment = $r->payment_method ? $r->payment_method->name : '';
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- /*if ($this->sortField != '')
|
|
|
- {
|
|
|
- if ($this->sortAsc)
|
|
|
- $this->records = $this->records->sortBy($this->sortField);
|
|
|
- else
|
|
|
- $this->records = $this->records->sortByDesc($this->sortField);
|
|
|
- }
|
|
|
- else
|
|
|
- $this->records = $this->records->sortByDesc('id');*/
|
|
|
-
|
|
|
return view('livewire.records_out');
|
|
|
}
|
|
|
|
|
|
@@ -616,65 +603,6 @@ class RecordOUT extends Component
|
|
|
$this->multipleAction = '';
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- public function createReceipt()
|
|
|
- {
|
|
|
-
|
|
|
- $receipt = \App\Models\Receipt::where('record_id', $this->dataId)->first();
|
|
|
- if ($receipt != null)
|
|
|
- {
|
|
|
- $receipt->update([
|
|
|
- 'member_id' => $this->member_id,
|
|
|
- 'supplier_id' => $this->supplier_id,
|
|
|
- 'causal_id' => $this->causal_id,
|
|
|
- 'payment_method_id' => $this->payment_method_id,
|
|
|
- 'date' => date("Y-m-d", strtotime($this->date)),
|
|
|
- 'month' => $this->month,
|
|
|
- 'year' => $this->year,
|
|
|
- 'type' => $this->type,
|
|
|
- 'amount' => $this->currencyToDouble($this->amount),
|
|
|
- 'commercial' => $this->commercial,
|
|
|
- 'status' => 1,
|
|
|
-
|
|
|
- ]);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- $number = 1;
|
|
|
- $exist = \App\Models\Receipt::where('year', $this->year)->orderBy('number', 'DESC')->first();
|
|
|
- if ($exist != null)
|
|
|
- $number = $exist->number + 1;
|
|
|
-
|
|
|
- $receipt = \App\Models\Receipt::create([
|
|
|
- 'record_id' => $this->dataId,
|
|
|
- 'member_id' => $this->member_id,
|
|
|
- 'supplier_id' => $this->supplier_id,
|
|
|
- 'causal_id' => $this->causal_id,
|
|
|
- 'payment_method_id' => $this->payment_method_id,
|
|
|
- 'number' => $number,
|
|
|
- 'date' => $this->date,
|
|
|
- 'month' => $this->month,
|
|
|
- 'year' => $this->year,
|
|
|
- 'type' => $this->type,
|
|
|
- 'amount' => $this->currencyToDouble($this->amount),
|
|
|
- 'commercial' => $this->commercial,
|
|
|
- 'status' => 1,
|
|
|
- ]);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- public function removeReceipt()
|
|
|
- {
|
|
|
- $receipt = \App\Models\Receipt::findOrFail($this->currentReceip->id);
|
|
|
- $receipt->status = 99;
|
|
|
- $receipt->save();
|
|
|
- $this->currentReceip = $receipt;
|
|
|
- }
|
|
|
-
|
|
|
- */
|
|
|
-
|
|
|
function currencyToDouble($val)
|
|
|
{
|
|
|
$x = str_replace("€", "", $val);
|