Fix problema precedenza uso dei traits

This commit is contained in:
Pek5892 2024-03-25 17:12:26 +01:00
parent dd8c2ef464
commit ab061d6f7e
4 changed files with 5 additions and 5 deletions

View File

@ -517,7 +517,7 @@ class Fattura extends Document
}
return $this->getModule()
->uploads($this->id)
->files($this->id)
->where('id', $this->id_ricevuta_principale)
->first();
}

View File

@ -155,7 +155,7 @@ class Ricevuta
// Controllo sulla presenza della stessa ricevuta
$module = $fattura->getModule();
$upload_esistente = $module
->uploads($fattura->id)
->files($fattura->id)
->where('original_name', $filename)
->first();
if (!empty($upload_esistente)) {

View File

@ -40,7 +40,7 @@ trait UploadTrait
return $result;
}
public function uploadsNumber($id_record)
public function files($id_record)
{
return $this->hasMany(Upload::class, $this->component_identifier)->where('id_record', $id_record)->get();
}

View File

@ -58,11 +58,11 @@ trait RecordTrait
$plugin = $this->getPlugin();
if (!empty($module)) {
return $module->uploads($this->id);
return $module->files($this->id);
}
if (!empty($plugin)) {
return $plugin->uploads($this->id);
return $plugin->files($this->id);
}
return collect();