1)What is the name of the supplier who sent this invoice?
2. What is the amount and date of this invoice?
3. To what accounts was this invoice distributed?
4. What is the invoice due date and the amount left to be paid on this invoice?
1) SELECT v.vendor_name, v.vendor_id
FROM ap_supliers v, ap_invoices_all i
WHERE i.vendor_site_id = 12
AND i.invoice_num = 'W33578'
AND i.org_id = 204
AND v.vendor_id = i.vendor_id;
2)
SELECT invoice_amount, invoice_date, invoice_id
FROM ap_invoices_all
WHERE vendor_site_id = 12 AND invoice_num = 'W33578' AND org_id = 204;
3)
SELECT c.segment1,
c.segment2,
c.segment3,
c.segment4,
c.segment5
FROM gl_code_combinations c, ap_invoice_distributions_all d
WHERE d.invoice_id = 10916
AND c.chart_of_accounts_id = 101
AND c.code_combination_id = d.dist_code_combination_id
4)
SELECT due_date, amount_remaining
FROM ap_payment_schedules_all
WHERE invoice_id = 10916;