public function payment_received_date(){
$date_start = $this->input->post('in', TRUE); $date_end = $this->input->post('out', TRUE); $crud = new grocery_CRUD(); $crud->set_theme('bootstrap-v4'); $crud->set_model('custom_query_model'); $crud->set_table('e_invoice'); $crud->basic_model->set_query_str(" SELECT a.ide_invoice, a.assigned_folio as Factura, CONCAT('$', format(a.mount,0,'de_DE')) as Valor, CASE WHEN NAME= 'EF' THEN CONCAT('$', format(SUM(b.mount),0,'de_DE')) ELSE 0 END EF, CASE WHEN NAME= 'CH' THEN CONCAT('$', format(SUM(b.mount),0,'de_DE')) ELSE 0 END CH, CASE WHEN NAME= 'CR' THEN CONCAT('$', format(SUM(b.mount),0,'de_DE')) ELSE 0 END CR, CASE WHEN NAME= 'TC' THEN CONCAT('$', format(SUM(b.mount),0,'de_DE')) ELSE 0 END TC, CASE WHEN NAME= 'NT' THEN CONCAT('$', format(SUM(b.mount),0,'de_DE')) ELSE 0 END NT, a.date FROM e_invoice a, e_invoice_traking b, e_payment_methods c WHERE b.assigned_folio = a.assigned_folio AND b.ide_payment_methods = c.ide_payment_methods AND a.ide_company = 1 AND DATE_FORMAT(a.date,'%Y-%m-%d') BETWEEN '$date_start' AND '$date_end' GROUP BY a.ide_invoice, name UNION ALL SELECT tmp.ide_invoice, 'TOTAL', CONCAT('$', format(sum(tmp.monto),0,'de_DE')), CONCAT('$', format(sum(tmp.EF),0,'de_DE')), CONCAT('$', format(sum(tmp.CH),0,'de_DE')), CONCAT('$', format(sum(tmp.CR),0,'de_DE')), CONCAT('$', format(sum(tmp.TC),0,'de_DE')), CONCAT('$', format(sum(tmp.NT),0,'de_DE')), tmp.date FROM ( SELECT a.ide_invoice, a.assigned_folio, a.mount monto, CASE WHEN NAME= 'EF' THEN SUM(b.mount) ELSE 0 END EF, CASE WHEN NAME= 'CH' THEN SUM(b.mount) ELSE 0 END CH, CASE WHEN NAME= 'CR' THEN SUM(b.mount) ELSE 0 END CR, CASE WHEN NAME= 'TC' THEN SUM(b.mount) ELSE 0 END TC, CASE WHEN NAME= 'NT' THEN SUM(b.mount) ELSE 0 END NT, a.date FROM e_invoice a, e_invoice_traking b, e_payment_methods c WHERE b.assigned_folio = a.assigned_folio AND b.ide_payment_methods = c.ide_payment_methods AND a.ide_company = '1' AND DATE_FORMAT(a.date,'%Y-%m-%d') BETWEEN '$date_start' AND '$date_end' GROUP BY a.ide_invoice, name ) tmp "); $crud->set_subject('Reporte de pagos recibidos'); $crud->display_as('assigned_folio','Factura'); $crud->display_as('date','Fecha'); $crud->columns('Factura','Valor','EF','CH','CR','TC','NT'); $crud->unset_add(); $crud->unset_delete(); $crud->unset_edit(); $crud->unset_read(); $output = $crud->render(); $this->_appservice_output($output); }
Display perfect but no export nothing... only i see a white page