1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-17 20:10:50 +01:00

Aggiunta verifica contenuto ricevuta FE

This commit is contained in:
FabioL 2024-09-17 17:19:05 +02:00
parent 004a0bdd42
commit 5832a79ca3

View File

@ -62,17 +62,21 @@ class Ricevuta
delete($extraction_dir); delete($extraction_dir);
} }
$this->file = $file; if (!file_exists($file)) {
$this->xml = XML::readFile($this->file); throw new \UnexpectedValueException();
} else {
$filename = explode('.', (string) $name)[0]; $this->file = $file;
$pieces = explode('_', $filename); $this->xml = XML::readFile($this->file);
$progressivo_invio = $pieces[1]; $filename = explode('.', (string) $name)[0];
$pieces = explode('_', $filename);
$this->fattura = Fattura::where([
'progressivo_invio' => $progressivo_invio, $progressivo_invio = $pieces[1];
])->first();
$this->fattura = Fattura::where([
'progressivo_invio' => $progressivo_invio,
])->first();
}
if (empty($this->fattura)) { if (empty($this->fattura)) {
throw new \UnexpectedValueException(); throw new \UnexpectedValueException();