PDF report of two tables

Hello community, I must create a PURCHASE REPORT (INFORME DE COMPRAS) from 02 tables.
The first is the purchase record TICKET RECORD (REGISTRO DE ENTRADAS), the columns are: INCOME_ID (ID_INGRESOS), DATE (FECHA), NUMBER (NUMERO), MANAGER (ENCARGADO), DOCUMENT (DOCUMENTO), SUPPLIER (PROVEEDOR), NOTES (NOTAS).
The second is the record of the purchased items TICKETS (ENTRADAS): TICKET_ID (ID_ENTRADAS), NUMBER_ID (ID_NUMERO), DESCRIPTION (DESCRIPCION), CODE(CODIGO), QUANTITY (CANTIDAD), UNIT VALUE (VALOR UNITARIO), SUB TOTAL.

The purchase record has no problems, but when trying to create the PDF I cannot do so. It must show the following:
1.- CODE (CODE)
2.- DESCRIPTION (DESCRIPTION)
3.- REPORT DATE (CURRENT DATE)

In the details section, you must have the following:
1.- PURCHASE DATE (DATE)
2.- REGISTRATION NUMBER (NUMBER)
3.- SUPPLIER (SUPPLIER)
4.- QUANTITY (QUANTITY)
5.- UNIT VALUE (UNIT VALUE)
6.- TOTAL VALUE (SUB TOTAL)

The reference is between the [NUMBER] (NUMERO) column of the ENTRANCE REGISTRATION (REGISTRO ENTRADAS) table and [NUMBER_ID] (ID_NUMERO) of the ENTRANCE (ENTRADAS) table. It is worth mentioning that the record in the ENTRANCE (ENTRADAS) table [NUMBER_ID] (ID_NUMERO) is the [INCOME_ID] (ID_INGRESOS) of the ENTRANCE REGISTRATION (REGISTRO ENTRADAS) table.

Could you help me, please. Thank you.

0 8 143
8 REPLIES 8

You have definitely tried to give a detailed overview. Really appreciate that. However certain columns and table names and relations are not clear. So you may want to share the screenshots of the tables and relations between the tables. You may also want to share the current template of the report and where it is lacking by mentioning the expected output.

Table screenshots can be something like below ( example) with relevant comments.

[Customer Name] references the Customers table.

Suvrutt_Gurjar_0-1713309363085.png

Such details will enable the community to suggest in a quicker manner.

 

Friend, thank you for your kind comments. One point that I forgot to mention is that for the PDF result, you must enter the date range and the code to search for. I attach a model of the form that must be completed.

Captura de pantalla 2024-04-17 123535.png

As you can see, you enter the start and end date of the period to search, regardless of the period, the important thing is the code you want to see.

This is the ENTRIES REGISTRATION (REGISTRO ENTRADAS) table.

Captura de pantalla 2024-04-17 124006.png

This is the INPUTS (ENTRADAS) table.

Captura de pantalla 2024-04-17 124158.png

And this is the PURCHASE REPORT (INFORME DE COMPRAS) table, where the data obtained from the two previous tables are stored, considering the DATES (FECHAS) as the first search parameter and the CODE (CODIGO) as the second criterion.
The idea is to show all purchases made with the CODE in a list below.

 


@malfaro_2000 wrote:

The idea is to show all purchases made with the CODE in a list below.


You have not posted the third table details.

Please reconfirm that you wish to create PDF report based on the third table or are you looking to store data in third table by querying first two table?

You have not posted the third table details. Sorry ๐Ÿ˜ช

Here it is

Captura de pantalla 2024-04-17 124353.png

Please reconfirm that you wish to create PDF report based on the third table, yes please.

or are you looking to store data in third table by querying first two table? yes, also, please, for the registration of reports.

thank you

 

Okay , thank you.

I think your third table use is not clear. It sounds that you are using it to set the date range and code as well as store records for the said date range. If so, I believe that is not going to work.

Typically for such user based inputs, you may have a separate Users table if your app is multi user app. Please take a look at the sample app below that filters data based on color selected. 

Slice based on user input - AppSheet

On similar lines, once the data is filtered by the user selected date range and code using a slice, you can use that slice in the template to have a printout of those selected records.

As for adding those filtered multiple records in a third table simultaneously is not a trivial functionality in an AppSheet app. You may want to use actions as described in the following tips or you would use webhooks. 

Add any number of rows from any row within a table - Google Cloud Community

FAQ: add a set of rows - Google Cloud Community

FAQ: add row per value in EnumList - Google Cloud Community

FAQ: Add rows for a date range - Google Cloud Community

Webhook way:

Introduction to webhooks - AppSheet Help

Invoke the API - AppSheet Help

 

 

 

 

 

 

Friend, the idea of the INFORME DE COMPRAS TABLE is to store the record of the report to be issued in PDF, as shown in the image below:

Captura de pantalla 2024-04-18 115612.png

The following syntax, I get the PROVEEDOR, but not the requested CODIGO.

Captura de pantalla 2024-04-18 120131.png

What will I be doing wrong?

Hi ,

I am not sure what is your query. The [ID_NUMERO] seems to be empty in your table.  How are you populating it?

 

 

Captura de pantalla 2024-04-19 084816.png

But it only shows one record, the idea is that it is the list of all purchases made with that CODIGO.

Top Labels in this Space