FabioFratini пре 8 месеци
родитељ
комит
f8785c36ec

+ 10 - 2
app/Http/Livewire/RecordOUT.php

@@ -123,7 +123,7 @@ class RecordOUT extends Component
         $this->payment_method_id = null;
         $this->date = date("Y-m-d");
         $this->data_pagamento = date("Y-m-d");
-
+        //$this->attachment = null;
         //$this->month = date("n");
         //$this->year = date("Y");
         $this->type = 'OUT';
@@ -377,6 +377,12 @@ class RecordOUT extends Component
     public function store()
     {
         $this->emit('refresh');
+/*
+        if ($this->attachment) {
+            Log::info("Attachment: " . json_encode($this->attachment));
+            $name = md5($this->attachment . microtime()) . '.' . $this->attachment->extension();
+            $this->attachment->storeAs('public', $name);
+        } */
 
         $this->validate();
         try {
@@ -390,6 +396,7 @@ class RecordOUT extends Component
                 //'month' => $this->month,
                 //'year' => $this->year,
                 //'note' => $this->note,
+                //'attachment' => $this->attachment,
                 'type' => $this->type,
                 'amount' => $this->currencyToDouble($this->amount),
                 'commercial' => $this->commercial,
@@ -452,6 +459,7 @@ class RecordOUT extends Component
                 //$this->year = $record->year;
                 //$this->note = $record->note;
                 $this->type = $record->type;
+                //$attachment = $record->attachment;
                 //$this->amount = formatPrice($record->amount);
                 $this->commercial = $record->commercial;
                 $this->dataId = $record->id;
@@ -493,7 +501,6 @@ class RecordOUT extends Component
     {
         $this->emit('refresh');
         $this->validate();
-        Log::info("Rows: pipo");
 
         try {
             \App\Models\Record::whereId($this->dataId)->update([
@@ -504,6 +511,7 @@ class RecordOUT extends Component
                 'data_pagamento' => $this->data_pagamento,
                 'type' => $this->type,
                 'commercial' => $this->commercial,
+                //'attachment' => $this->attachment,
             ]);
 
             $tot = 0;

+ 1 - 1
app/Models/Record.php

@@ -26,7 +26,7 @@ class Record extends Model
         'financial_movement',
         'amount',
         'numero_fattura',
-        'attachment'
+        //'attachment'
     ];
 
     public function member()

+ 2 - 2
resources/views/livewire/records_out.blade.php

@@ -277,12 +277,12 @@
                             </div>
 
 
-                            <div class="col-md-6">
+{{--                             <div class="col-md-6">
                                 <span class="title-form d-block w-100">Allegato</span>
                                 <div class="input-group mb-3">
                                     <input type="file" class="form-control form-control-lg" wire:model="attachment">
                                 </div>
-                            </div>
+                            </div> --}}
 
                             <div class="col-12">
                                 <span class="title-form d-block w-100">Fornitore</span>