Question

How to know to which delivery note is related an Invoce

  • 20 May 2022
  • 1 reply
  • 87 views

Badge +3

I need to create a quick report to show the invoice number and all the delivery note that are related to it. 

I cannot find any information on  the invoice and neither on the delivery note. 
Can someone tell me how to retrieve this information? 


1 reply

Badge +1

Hi, you need to connect customer_order_delivery and invoice_item. 

Here is one example: 

 

select distinct(a.delnote_no)
 from customer_order_delivery a, invoice_item b, invoice c
where b.invoice_id = c.invoice_id
and c.invoice_no= '&INVOICE' 
and b.c1 = a.order_no
and a.order_no =  c.creators_reference  

 

Reply