$VAR1 = { 'columnsettings' => 'date,Date, code,Supplier Code, name,Supplier Description, amount,Amount Ex, vat,VAT document,Document, cnote,Credit Note, bcode,Allocation Code, allocation,Allocation Description, ', 'selector' => '2', 'data' => 'SELECT date, su.code, su.name, if(bufc.code,bufc.code,\'STOCK\') bcode, ROUND(SUM(pu.qty*(pu.price - pu.discount)),2) amount, ROUND(SUM(IF(pu.vat > 0, pu.qty*(pu.price - pu.discount)*1.14 - pu.qty*(pu.price - pu.discount), 0)), 2 ) vat, invoice document, IF(cnote, \'Yes\', \'No\') cnote, IF(bufc.id,bufc.name,"STOCK") allocation FROM suppliers su, purchases pu LEFT JOIN bufc ON bufc.id = pu.othertype left join branch_documents bd on bd.id = pu.document_id WHERE bd.current_stage = 2 and su.id = pu.supplier_id and pu.date >= \'[sdate]\' and pu.date <= \'[edate]\' GROUP BY pu.supplier_id, pu.invoice, pu.othertype ORDER BY pu.date;', 'description' => 'SUPPLIER INVOICE DETAILS', 'settings' => 'sdate,date,Start Date edate,date,Edate', 'rollup' => '', 'id' => '2', 'title' => 'INVOICES FOR PERIOD', 'category' => 'PURCHASES', 'code' => '2' };