fix: directory importazione fatture di acquisto

This commit is contained in:
valentina 2024-10-25 13:20:52 +02:00
parent e7097bef9b
commit bfc5b5642e
1 changed files with 6 additions and 7 deletions

View File

@ -82,17 +82,16 @@ class FatturaElettronica
public static function getImportDirectory()
{
if (!isset(self::$directory)) {
$module = Module::where('name', 'Fatture di vendita')->first();
$module = Module::where('name', 'Fatture di acquisto')->first();
$plugins = $module->plugins;
if (!empty($plugins)) {
$plugin = $plugins->first(fn ($value, $key) => $value->getTranslation('title') == 'Fatturazione Elettronica');
$plugins = $module->plugins;
if (!empty($plugins)) {
$plugin = $plugins->first(fn ($value, $key) => $value->getTranslation('title') == 'Fatturazione Elettronica');
self::$directory = base_dir().'/'.$plugin->upload_directory;
}
self::$directory = base_dir().'/'.$plugin->upload_directory;
}
return self::$directory;
}