Withholding tax on invoice without customer breaks summary tab

When an invoice is created without a customer and the “Deduct withholding tax” box is checked. This breaks the withholding tax account in the summary tab.

Edit screen of invoice

Error message when drilling down to Withholding tax receivable on Summary tab:

 Internal Error
Manager 21.3.75
System.NullReferenceException: Object reference not set to an instance of an object.
   at ManagerServer.HttpHandlers.Businesses.Business.Summary.GeneralLedgerAccountView.<>c.b__27_32(<>f__AnonymousType34`3 x) in C:\projects\manager\ManagerServer\HttpHandlers\Businesses\Business\Summary\GeneralLedgerAccountView.cs:line 218
   at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.ComputeMap(TElement[] elements, Int32 count)
   at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.OrderedEnumerable`1.GetEnumerator()+MoveNext()
   at ManagerServer.HttpHandlers.Businesses.Business.Summary.GeneralLedgerAccountView.GetRows() in C:\projects\manager\ManagerServer\HttpHandlers\Businesses\Business\Summary\GeneralLedgerAccountView.cs:line 218
   at ManagerServer.HttpHandlers.Businesses.Business.Table.InnerGet2() in C:\projects\manager\ManagerServer\HttpHandlers\Businesses\Business\Table.cs:line 107
   at ManagerServer.HttpHandlers.Businesses.Business.BusinessTemplate.InnerGet() in C:\projects\manager\ManagerServer\HttpHandlers\Businesses\Business\BusinessTemplate.cs:line 372
   at ManagerServer.HttpHandlers.Template.Get() in C:\projects\manager\ManagerServer\HttpHandlers\Template.cs:line 299
   at ManagerServer.HttpHandlers.HttpHandler.ProcessRequest() in C:\projects\manager\ManagerServer\HttpHandlers\HttpHandler.cs:line 100
   at ManagerServer.Startup.<>c.<b__1_1>d.MoveNext() in C:\projects\manager\ManagerServer\Startup.cs:line 108
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpContext context, Task task)
Go back

This occurs because the Withholding tax receivable is supposed to be broken down by customer but it breaks when it couldn’t find the customer.


Possible alternatives

  1. Display a default category (e.g. Customer not set) in the withholding tax receivable screen to summarize all invoices without customers.

  2. Keep the withholding tax portion in suspense together with its related receivable.

Fixed in the latest version (21.4.20)

1 Like