mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-22 22:37:37 +01:00
Introduzione numero rata in Rate contrattuali
This commit is contained in:
parent
62e4e9f29c
commit
577bf0d555
@ -65,6 +65,17 @@ class Pianificazione extends Document
|
||||
return $this->belongsTo(Fattura::class, 'iddocumento');
|
||||
}
|
||||
|
||||
public function getNumeroPianificazione()
|
||||
{
|
||||
$pianificazioni = $this->contratto->pianificazioni;
|
||||
|
||||
$p = $this;
|
||||
|
||||
return $pianificazioni->search(function ($item) use ($p) {
|
||||
return $item->id == $p->id;
|
||||
}) + 1;
|
||||
}
|
||||
|
||||
public function getRighe()
|
||||
{
|
||||
$righe = $this->contratto->getRighe();
|
||||
|
@ -54,6 +54,7 @@ foreach ($raggruppamenti as $mese => $raggruppamento) {
|
||||
foreach ($pianificazioni as $pianificazione) {
|
||||
$contratto = $pianificazione->contratto;
|
||||
$anagrafica = $contratto->anagrafica;
|
||||
$numero_pianificazioni = $contratto->pianificazioni()->count();
|
||||
|
||||
if (strtolower($pianificazione->data_scadenza->formatLocalized('%B %Y')) == strtolower($mese)) {
|
||||
echo '
|
||||
@ -69,10 +70,11 @@ foreach ($raggruppamenti as $mese => $raggruppamento) {
|
||||
|
||||
<td>
|
||||
'.moneyFormat($pianificazione->totale).'<br>
|
||||
<small>'.tr('_TOT_ / _NUM_ rate', [
|
||||
'_TOT_' => moneyFormat($contratto->totale),
|
||||
'_NUM_' => numberFormat($contratto->pianificazioni()->count(), 0),
|
||||
]).'</small>
|
||||
<small>'.tr('Rata _IND_/_NUM_ (totale: _TOT_)', [
|
||||
'_IND_' => numberFormat($pianificazione->getNumeroPianificazione(), 0),
|
||||
'_NUM_' => numberFormat($numero_pianificazioni, 0),
|
||||
'_TOT_' => moneyFormat($contratto->totale),
|
||||
]).'</small>
|
||||
</td>';
|
||||
|
||||
// Pulsanti
|
||||
|
Loading…
x
Reference in New Issue
Block a user