Skip to content

Commit fffb196

Browse files
committed
fix: 569
Merged PR 169: Report pdf dati modulo commessa Azure/AD view Related work items: #569
1 parent b6dac34 commit fffb196

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/Core/PortaleFatture.BE.Core/Extensions/DocumentExtensions.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,16 @@ public static string GetModuloCommessa(this IEnumerable<DatiModuloCommessaTotale
6666
for (var i = 0; i < ordineCommessa!.Count; i++)
6767
{
6868
var commessa = ordineCommessa!.ToList()[i];
69-
var table = String.Format(_tableModuloCommessa, i == commesse!.Count() - 1 ? "ending" : "details")
70-
.Replace(nameof(commessa.Tipo).GetName<DatiModuloCommessaTotaleDto>(), commessa.Tipo)
71-
.Replace(nameof(commessa.NumeroNotificheNazionali).GetName<DatiModuloCommessaTotaleDto>(), commessa.NumeroNotificheNazionali.ToString())
72-
.Replace(nameof(commessa.NumeroNotificheInternazionali).GetName<DatiModuloCommessaTotaleDto>(), commessa.NumeroNotificheInternazionali.ToString())
73-
.Replace(nameof(commessa.TotaleNotifiche).GetName<DatiModuloCommessaTotaleDto>(), commessa.TotaleNotifiche.ToString())
74-
;
75-
builder.Append(table);
69+
if(commessa!=null)
70+
{
71+
var table = String.Format(_tableModuloCommessa, i == commesse!.Count() - 1 ? "ending" : "details")
72+
.Replace(nameof(commessa.Tipo).GetName<DatiModuloCommessaTotaleDto>(), commessa.Tipo)
73+
.Replace(nameof(commessa.NumeroNotificheNazionali).GetName<DatiModuloCommessaTotaleDto>(), commessa.NumeroNotificheNazionali.ToString())
74+
.Replace(nameof(commessa.NumeroNotificheInternazionali).GetName<DatiModuloCommessaTotaleDto>(), commessa.NumeroNotificheInternazionali.ToString())
75+
.Replace(nameof(commessa.TotaleNotifiche).GetName<DatiModuloCommessaTotaleDto>(), commessa.TotaleNotifiche.ToString())
76+
;
77+
builder.Append(table);
78+
}
7679
}
7780
return builder.ToString();
7881
}
@@ -272,13 +275,13 @@ public static ModuloCommessaDocumentoDto Mapper(this ModuloCommessaAggregateDto
272275
totali.Add(
273276
new DatiModuloCommessaTotaleCostoDto()
274277
{
275-
Totale = totaleDigitale!.TotaleCategoria,
278+
Totale = totaleDigitale == null ? 0 : totaleDigitale.TotaleCategoria,
276279
Descrizione = digitale
277280
});
278281
totali.Add(
279282
new DatiModuloCommessaTotaleCostoDto()
280283
{
281-
Totale = totaleAnalogico!.TotaleCategoria,
284+
Totale = totaleAnalogico == null ? 0 : totaleAnalogico.TotaleCategoria,
282285
Descrizione = analogico
283286
});
284287
totali.Add(

0 commit comments

Comments
 (0)