Jump to content

Edit History

lordignus

lordignus

SELECT
    oi.total_paid_tax_excl AS 'Total EX',
    oi.total_paid_tax_incl AS 'Total Inc',
    oi.date_add AS 'Inv Date',
    o.invoice_number AS 'Inv No',
    o.id_order AS 'Order ID',
    o.payment AS 'Payment Type',
    osl.name AS 'Order Status',
    c.company AS 'Company',
    c.firstname AS 'Customer First',
    c.lastname AS 'Customer Last',
    cl.name AS 'Country'
FROM pr_order_invoice oi
LEFT JOIN pr_orders o
ON oi.id_order = o.id_order
LEFT JOIN pr_order_state_lang osl
ON o.current_state = osl.id_order_state AND osl.id_lang = 1
LEFT JOIN pr_customer c
ON c.id_customer = o.id_customer
LEFT JOIN pr_address a
ON o.id_address_delivery = a.id_address
LEFT JOIN pr_country_lang cl
ON a.id_country = cl.id_country AND cl.id_lang = 1
ORDER BY oi.id_order DESC

 

Depending on your language you might need to change the id_lang on lines 17 and 24 :)

lordignus

lordignus

SELECT
    oi.total_paid_tax_excl AS 'Total EX',
    oi.total_paid_tax_incl AS 'Total Inc',
    oi.date_add AS 'Inv Date',
    o.invoice_number AS 'Inv No',
    o.id_order AS 'Order ID',
    o.payment AS 'Payment Type',
    osl.name AS 'Order Status',
    c.company AS 'Company',
    c.firstname AS 'Customer First',
    c.lastname AS 'Customer Last',
    cl.name AS 'Country'
FROM ps_order_invoice oi
LEFT JOIN ps_orders o
ON oi.id_order = o.id_order
LEFT JOIN ps_order_state_lang osl
ON o.current_state = osl.id_order_state AND osl.id_lang = 1
LEFT JOIN ps_customer c
ON c.id_customer = o.id_customer
LEFT JOIN ps_address a
ON o.id_address_delivery = a.id_address
LEFT JOIN ps_country_lang cl
ON a.id_country = cl.id_country AND cl.id_lang = 1
ORDER BY oi.id_order DESC

 

Depending on your language you might need to change the id_lang on lines 17 and 24 :)

×
×
  • Create New...