Solved

How to associate an invoice with the inventory transaction history table

  • 31 March 2023
  • 4 replies
  • 103 views

Badge +6

Hello everyone.

Does anyone know? What is the key between the inventory transaction history table and the sales invoice lines. The customer's order_no alone is not enough, because many invoices can be issued to it.

icon

Best answer by Tomas Ruderfelt 26 April 2023, 14:54

View original

4 replies

Userlevel 5
Badge +13

Hi,

What kind of inventory transaction (i.e. Transaction code) are you referring to?. 

Regards,

Pilar

Badge +6

Not a transaction code. How to find inventory transactions (transaction_id) with sales invoice number?

Userlevel 7
Badge +19

There is no direct connection.

You can go via OUTSTANDING_SALES to CUSTOMER_ORDER_DELIVERY.

But to explain more in detail, what is the purpose for doing this? What are you trying to achieve?

Badge +6

There is no direct connection.

You can go via OUTSTANDING_SALES to CUSTOMER_ORDER_DELIVERY.

But to explain more in detail, what is the purpose for doing this? What are you trying to achieve?

Thank you, that was it. I didn't notice the source_ref5 = deliv_no binding. Goal achieved, having the invoice number I can identify warehouse transactions.

 

select * 
from INVENTORY_TRANSACTION_HIST2 ith
left join CUSTOMER_ORDER_DELIVERY cod on source_ref5=cod.deliv_no
left join OUTSTANDING_SALES os on os.deliv_no=cod.deliv_no
left join CUST_ORDER_INV_ITEM_UIV_ALL coi on os.invoice_id=coi.invoice_id and os.item_id=coi.item_id
where coi.invoice_id='358073' and coi.item_id like '%'

Reply