The users requested 2 kinds of reports and I thought of using subreports to fulfill the request.
I have 3 tables in my database.
sales_invoice
- invoice_no
- customer_code
- invoice_date
- currency_code
- exchange_rate
- grand_total_amount
- auto_id
- tax_type
sales_invoice_detail
- invoice_no
- detail_id
- item_code
- item_description
- quantity
- unit_price
- amount
- tax_type_id
- tax_rate
- tax_amount
size
- id
- size_id
- size_name
- description
Example of Sizes:
XS, S, M, L, XL, XXL etc
Green, Red, Blue etc
(Up to user to add in all kinds of sizes, unlimited entries)
SalesInvoice is a one-to-many relationship to SalesInvoiceDetail table (linking field is ‘invoice_id’ column in both tables).
SalesInvoiceDetail has a column named ‘article_size’ which is a one-to-many relationship to size table (linking field is ‘size_id’ column in both tables.
Basically, the subreport is showing the different sizes and it varies depending whatever data user input into the database.
So how do I achieve the above 2 reports?