diff --git a/modules/fatture/bulk.php b/modules/fatture/bulk.php index 1a7cfabc1..483403506 100644 --- a/modules/fatture/bulk.php +++ b/modules/fatture/bulk.php @@ -134,7 +134,7 @@ switch (post('op')) { $dst = $src; } else { $src = basename($fattura->uploads()->where('name', 'Fattura Elettronica')->first()->filepath); - $dst = basename($fattura->uploads()->where('name', 'Fattura Elettronica')->first()->original); + $dst = basename($fattura->uploads()->where('name', 'Fattura Elettronica')->first()->original_name); } $file = slashes($module->upload_directory.'/'.$src); diff --git a/src/Models/Upload.php b/src/Models/Upload.php index c2a536d38..4e33c2b55 100644 --- a/src/Models/Upload.php +++ b/src/Models/Upload.php @@ -31,7 +31,7 @@ class Upload extends Model $model = parent::build(); // Informazioni di base - $model->attributes['original'] = $original_name; // Fix per original di Eloquent + $model->original_name = $original_name; // Fix per original di Eloquent $model->size = $source['size']; $model->name = !empty($name) ? $name : $original_name; @@ -103,6 +103,19 @@ class Upload extends Model return $this->directory.'/'.$this->filename; } + /** + * @return string + */ + public function getOriginalNameAttribute() + { + return $this->attributes['original']; + } + + public function setOriginalNameAttribute($value) + { + $this->attributes['original'] = $value; + } + /** * @return bool */ diff --git a/view.php b/view.php index fac484cb6..0b6b1d828 100644 --- a/view.php +++ b/view.php @@ -18,7 +18,7 @@ if ($file->isFatturaElettronica()) { // Individuazione stylesheet $default_stylesheet = 'asso-invoice'; - $name = basename($file->original); + $name = basename($file->original_name); $filename = explode('.', $name)[0]; $pieces = explode('_', $filename); $stylesheet = $pieces[2];