From ab061d6f7e9bbddc602b40d90638362629fa732c Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Mon, 25 Mar 2024 17:12:26 +0100 Subject: [PATCH] Fix problema precedenza uso dei traits --- modules/fatture/src/Fattura.php | 2 +- plugins/receiptFE/src/Ricevuta.php | 2 +- src/Traits/Components/UploadTrait.php | 2 +- src/Traits/RecordTrait.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/fatture/src/Fattura.php b/modules/fatture/src/Fattura.php index 881a1374d..08c1f6f69 100755 --- a/modules/fatture/src/Fattura.php +++ b/modules/fatture/src/Fattura.php @@ -517,7 +517,7 @@ class Fattura extends Document } return $this->getModule() - ->uploads($this->id) + ->files($this->id) ->where('id', $this->id_ricevuta_principale) ->first(); } diff --git a/plugins/receiptFE/src/Ricevuta.php b/plugins/receiptFE/src/Ricevuta.php index 255adeacd..fde2adbae 100755 --- a/plugins/receiptFE/src/Ricevuta.php +++ b/plugins/receiptFE/src/Ricevuta.php @@ -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)) { diff --git a/src/Traits/Components/UploadTrait.php b/src/Traits/Components/UploadTrait.php index 52de7138b..f648072ea 100755 --- a/src/Traits/Components/UploadTrait.php +++ b/src/Traits/Components/UploadTrait.php @@ -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(); } diff --git a/src/Traits/RecordTrait.php b/src/Traits/RecordTrait.php index 16e2e020b..26998ac69 100755 --- a/src/Traits/RecordTrait.php +++ b/src/Traits/RecordTrait.php @@ -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();