# Getting "Missing table" error during invoice generation

## Problem Description

When generating manual invoice, the UI is showing "Missing table: cdr\_reportdetailyyyymmdd"

![](/files/-MYlJAg7Dt9xdm6XGfUS)

Class 4 Fusion generates invoices based off on the pre-generated reports.  If you attempt to generate invoices for dates that have no report data, it will give you that error.&#x20;

You can check when you have report data in DB:

```bash
psql -U postgres
softswitch4v5=# \d+;

```

```
 public | cdr_report_detail                                    | table    | postgres    | 8192 bytes | é¢„ç»Ÿè®¡
 public | cdr_report_detail20200608                            | table    | class4_user | 8192 bytes | 
 public | cdr_report_detail20200609                            | table    | class4_user | 8192 bytes | 
 public | cdr_report_detail20200610                            | table    | class4_user | 8192 bytes | 
 public | cdr_report_detail20200611                            | table    | class4_user | 8192 bytes | 
 public | cdr_report_detail20200612                            | table    | class4_user | 8192 bytes | 
```

{% hint style="info" %}
&#x20;Normally, this report data is not archived because it does not utilize much space.   Your system admin can drop those old cdr *report* detailyyyymmdd tables or you can use auto archiving facility in Class 4 switch to auto archive it after some times.
{% endhint %}

This cdr\_report table is also used for populating the statistics reports in the Class 4 Fusion UI.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://v5cookbook.denovolab.com/troubleshoot/getting-missing-table-error-during-invoice-generation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
