error messages Notice: Undefined index: dateRange
code:
<?php
namespace App\Reports;
use koolreport\KoolReport;
use koolreport\processes\Group;
use koolreport\processes\TimeBucket;
use koolreport\inputs\Bindable;
use koolreport\inputs\POSTBinding;
class reportdev extends KoolReport
{
protected function defaultParamValues()
{
return array(
"dateRange"=>array(date("Y-m-01 00:00:00"),date("Y-m-t 23:59:59")),
);
}
protected function bindParamsToInputs()
{
return array(
"dateRange"=>"dateRange",
);
}
function settings()
{
$config = new conndata();
return array(
"dataSources"=>array(
"ERPdata"=>$config->conndatabase()
)
);
}
protected function setup()
{
$this->src('ERPdata')
->query("SELECT OMA00,OMA02,OMA15,OMACONF,
(CASE WHEN OMA00 >= 20 THEN -abs(OMA56)ELSE OMA56 END) AS amount
FROM OMA_FILE
WHERE OMACONF='Y' AND orderDate > :start AND orderDate < :end ")
->params(array(
":start"=>$this->params["dateRange"][0],
":end"=>$this->params["dateRange"][1],
))
->pipe(new TimeBucket(array(
"OMA02"=>"date"
)))
->pipe(new Group(array(
"by"=>"OMA02",
"sum"=>"AMOUNT"
)))
->pipe($this->dataStore('MonthAccountsReceivable'));