We can't tell: we have no idea what
totalAmort
or
totalpenalty
are, or even why type they are. And I'm not convinced you do either, given code like this:
if (totalamort == decimal.Parse("0.00") && totalpenalty == decimal.Parse("0.00"))
If they are
decimal
values, why not use the decimal value literal indicator:
Floating-point numeric types - C# reference | Microsoft Learn[
^]
if (totalamort == 0.00m && totalpenalty == 0.00m)
Is a whole load more readable ...
Use the debugger to find out exactly what is actually going on, and what values your variables actually contain.