Simple Invoices logo
    • CommentAuthordudeuh
    • CommentTimeFeb 2nd 2008 edited
     permalink
    Does anyone have any sample sql statements that will give a report of customer name, invoice date, products, quantity, total, and whether it has been paid? I cannot seem to get any of my sql to work right.
    • CommentAuthorjustin
    • CommentTimeFeb 3rd 2008 edited
     permalink
    Hey Dudeuh,

    i don't have such a query for you - but if you have a snoop around the sql statements that are used to generate the reports you might find some usefull information you can base your query off

    post the query if you do figure it out

    Cheers

    Justin
    • CommentAuthordudeuh
    • CommentTimeFeb 4th 2008 edited
     permalink
    Here is what I have. It does not seem to be working right though. I am using custom field 3 for mileage.

    SELECT si_invoices.date, si_customers.name, si_customers.custom_field3, si_invoice_items.quantity, si_invoice_items.unit_price, si_invoice_items.total, si_invoice_items.product_id, si_account_payments.ac_payment_type, si_account_payments.ac_amount
    FROM ((si_account_payments INNER JOIN si_customers ON si_account_payments.id = si_customers.id) INNER JOIN si_invoice_items ON si_account_payments.id = si_invoice_items.id) INNER JOIN si_invoices ON si_account_payments.id = si_invoices.id
    ORDER BY si_invoices.date;
    • CommentAuthorjustin
    • CommentTimeFeb 8th 2008 edited
     permalink
    Hey Dudeuh,

    if i get a chance on the weekend i'll take a quick look at your query - see if we can get it sorted out

    Cheers

    Justin