mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-03 09:17:37 +01:00
Aggiunto alert data intervento/fattura
This commit is contained in:
parent
aef69c3ed0
commit
815ba25bb0
@ -39,6 +39,7 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
|||||||
- Nuovo filtro in attività per mostrare al tecnico solo le attività assegnate.
|
- Nuovo filtro in attività per mostrare al tecnico solo le attività assegnate.
|
||||||
- Nuovo filtro in contratti per mostrare al cliente solo i contratti collegati.
|
- Nuovo filtro in contratti per mostrare al cliente solo i contratti collegati.
|
||||||
- Nuovo pulsante **Duplica Template** per copiare un template già esistente.
|
- Nuovo pulsante **Duplica Template** per copiare un template già esistente.
|
||||||
|
- Aggiunto controllo nelle fatture di vendita per segnalare l'eventuale fatturazione di un'attività con la data di una sessione futura rispetto alla data della fattura.
|
||||||
|
|
||||||
## 2.4.22
|
## 2.4.22
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
use Modules\Anagrafiche\Anagrafica;
|
use Modules\Anagrafiche\Anagrafica;
|
||||||
use Modules\Fatture\Gestori\Bollo;
|
use Modules\Fatture\Gestori\Bollo;
|
||||||
use Modules\Iva\Aliquota;
|
use Modules\Iva\Aliquota;
|
||||||
|
use Modules\Interventi\Intervento;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
@ -89,6 +91,26 @@ if ($dir == 'entrata') {
|
|||||||
]).'.</b>
|
]).'.</b>
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verifica la data dell'intervento rispetto alla data della fattura
|
||||||
|
$righe_interventi = $fattura->getRighe()->where('idintervento', '!=', NULL);
|
||||||
|
if (!empty($righe_interventi)) {
|
||||||
|
foreach($righe_interventi as $riga_intervento){
|
||||||
|
$intervento = Intervento::find($riga_intervento->idintervento);
|
||||||
|
|
||||||
|
if((new Carbon($intervento->fine))->diffInDays(new Carbon($fattura->data), false) < 0){
|
||||||
|
$fatturazione_futura = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($fatturazione_futura){
|
||||||
|
echo '
|
||||||
|
<div class="alert alert-warning">
|
||||||
|
<i class="fa fa-warning"></i> '.tr("Stai fatturando un'attività futura rispetto alla data di fatturazione.").'</b>
|
||||||
|
</div>';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<form action="" method="post" id="edit-form">
|
<form action="" method="post" id="edit-form">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user