Customer Statements will not print-Issue with 1 old invoice

Customer Statement will not print - problem with Invoice - ERP 10 - Epicor User Help Forum (epiusers.help)

I’m having the same issue as the above thread. Suddenly, I am unable to print customer statements. It is throwing an error based on one old invoice from 2020, randomly.

Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask:
System.Exception: The error related to invoice 676708 ---> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseDecimal(String value, NumberStyles options, NumberFormatInfo numfmt)
   at Erp.Internal.Lib.StringExtensions.Str2Dec(String str) in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\Lib\Extensions\StringExtensions.cs:line 16
   at Erp.Internal.AR.CustomerStatement.AgeInvoice(AgingRptFmt ipAgingRptFmt, InvcHead ipInvcHead, String ipAgeBy, Nullable`1 ipBeginDate) in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1631
   at Erp.Internal.AR.CustomerStatement.DoCustomerCalculations(AgingRptFmt ipAgingRptFmt, String ipAgeBy, Nullable`1 ipBeginDate, Int32 ipCustNum) in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1939
   --- End of inner exception stack trace ---
   at Erp.Internal.AR.CustomerStatement.DoCustomerCalculations(AgingRptFmt ipAgingRptFmt, String ipAgeBy, Nullable`1 ipBeginDate, Int32 ipCustNum) in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 1943
   at Erp.Internal.AR.CustomerStatement.InternalRunProcess() in C:\_Releases\ERP\RL10.2.600.0\Source\Server\Internal\AR\CustomerStatement\CustomerStatement.cs:line 812
   at Ice.Core.TaskBase`1.StartProcess(Int64 instanceTaskNum, String outputFileName) in C:\_Releases\ICE\UD10.2.600.10FW\Source\Server\Internal\Lib\TaskLib\TaskBase\TaskBase.cs:line 83
   at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:\_Releases\ICE\UD10.2.600.10FW\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 117
   at Ice.Hosting.TaskCaller.ExecuteTask() in C:\_Releases\ICE\UD10.2.600.10FW\Source\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 59
   at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:\_Releases\ICE\UD10.2.600.10FW\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 63
   at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:\_Releases\ICE\UD10.2.600.10FW\Source\Server\Services\Lib\RunTask\RunTask.cs:line 452

I tried running the report in a different environment with an old copy of the database and it threw the same error. I haven’t refreshed that data in probably a year.
Both apps are running on the same application server.

I really don’t want to go down a rabbit hole with Epicor and orphaned records (already tried looking for orphaned records, but nothing jumped out).

Any ideas?

Edit: I was able to generate customer statements if I chose the “Age By Invoice Date” option, but it fails if I choose the Due Date option…

The code has a few decimal to string conversions and viceversa, it might be an issue with the customer/users language culture.

Can’t really tell by just looking but maybe the decimal is converted to string using a comma as separator and then tried to be converted to decimal by using a dot. This is usually why this error happens.

Also, is it a credit memo?

It looks like it is 2 credit memos that are causing it. Interesting that it would be both credit memos…I noticed both CMs had no due date too

Do you see anything odd in table InvcSched for these CMs?

There are no values in that table with those invoice numbers…guessing because they had null due dates, there was no record created in InvcSched, but that’s a wild guess

I think that is the issue, the list of payments is taken from InvcSched to a string, and then converted to a decimal later when using Age By Due Date, but we don’t expect a null value so we don’t check.

1 Like

I’ll test that out in a test environment tomorrow to see if I can “fix” it by creating those records. Thanks for the responses

I remember when the payment schedule was moved from a single column containing a concatenated string into its own table InvcSched, a conversion program was created to generate the records for all invoices.

It is possible that because these invoices had no DueDate that the conversion did not create the schedule records, now that you assigned the Due Date it might be possible to just run the conversion. Although I can’t remember if it was rerunnable and user runable.

2 Likes

It’s always good to understand the history to understand the “why”. Appreciate it!