1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-02 08:56:48 +01:00

Fix fatture scadute

This commit is contained in:
valentina 2024-09-26 16:38:19 +02:00
parent 959fbe8774
commit 97ebf7867b
3 changed files with 6 additions and 6 deletions

View File

@ -315,7 +315,7 @@ switch ($op) {
// Elenco fatture in stato Bozza per il cliente
case 'fatture_bozza':
$id_anagrafica = post('id_anagrafica');
$stato = Stato::where('name', 'Bozza')->first()->id;
$stato = Stato::where('name', 'Bozza')->first();
$fatture = Fattura::vendita()
->where('idanagrafica', $id_anagrafica)
@ -334,12 +334,12 @@ switch ($op) {
// Elenco fatture Scadute per il cliente
case 'fatture_scadute':
$id_anagrafica = post('id_anagrafica');
$stato1 = Stato::where('name', 'Emessa')->first()->id;
$stato2 = Stato::where('name', 'Parzialmente pagato')->first()->id;
$stato1 = Stato::where('name', 'Emessa')->first();
$stato2 = Stato::where('name', 'Parzialmente pagato')->first();
$fatture = Fattura::vendita()
->select('*', 'co_documenti.id AS id', 'co_documenti.data AS data')
->where('co_documenti.idanagrafica', $id_anagrafica)
->where('co_documenti.idanagrafica', "=", $id_anagrafica)
->whereIn('idstatodocumento', [$stato1->id, $stato2->id])
->join('co_scadenziario', 'co_documenti.id', '=', 'co_scadenziario.iddocumento')
->join('co_tipidocumento', 'co_tipidocumento.id', '=', 'co_documenti.idtipodocumento')

View File

@ -895,7 +895,7 @@ class Fattura extends Document
public function getReferenceName()
{
return $this->tipo->getTranslation('title');
return $this->tipo;
}
public function getReferenceNumber()

View File

@ -32,7 +32,7 @@ trait ReferenceTrait
public function getReference($show_ragione_sociale = null)
{
// Informazioni disponibili
$name = $this->getReferenceName();
$name = $this->getReferenceName()->name ?? $this->getReferenceName();
$number = $this->getReferenceNumber();
$date = $this->getReferenceDate();