本文整理汇总了PHP中Prefs::getAfe方法的典型用法代码示例。如果您正苦于以下问题:PHP Prefs::getAfe方法的具体用法?PHP Prefs::getAfe怎么用?PHP Prefs::getAfe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prefs
的用法示例。
在下文中一共展示了Prefs::getAfe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndex
public function getIndex()
{
$this->heads = array(array('Period', array('search' => true, 'sort' => true, 'style' => 'min-width:90px;', 'daterange' => true)), array('Date', array('search' => true, 'sort' => true, 'style' => 'min-width:100px;', 'daterange' => true)), array('JV Ref', array('search' => true, 'sort' => true, 'style' => 'min-width:120px;')), array('Account', array('search' => true, 'style' => 'min-width:100px;', 'sort' => true)), array('Account Description', array('search' => true, 'style' => 'min-width:125px;', 'sort' => true)), array('Reference Doc.', array('search' => true, 'sort' => true)), array('Orig. Currency', array('search' => true, 'sort' => true)), array('Orig. Amount', array('search' => true, 'sort' => true)), array('Conversion Rate', array('search' => true, 'sort' => true)), array('Base Amount', array('search' => true, 'sort' => true)), array('Transaction Description', array('search' => true, 'sort' => true)));
//print $this->model->where('docFormat','picture')->get()->toJSON();
$this->title = 'AFE Report - Lvl 3';
$this->place_action = 'none';
$this->show_select = false;
Breadcrumbs::addCrumb('Cost Report', URL::to(strtolower($this->controller_name)));
$this->additional_filter = View::make(strtolower($this->controller_name) . '.addfilter')->with('submit_url', 'afelvlthree')->render();
$db = Config::get('lundin.main_db');
$company = Input::get('acc-company');
$period_from = Input::get('acc-period-from');
$period_to = Input::get('acc-period-to');
if ($period_from == '' || is_null($period_from)) {
$period_from = date('Y0m', time());
}
if ($period_to == '' || is_null($period_to)) {
$period_to = date('Y0m', time());
}
$company = strtolower($company);
if ($company == '') {
$company = Config::get('lundin.default_company');
}
$afe = Input::get('acc-afe');
if ($afe == '' || is_null($afe)) {
$afes = Prefs::getAfe($company)->AfeToArray();
$afe = $afes[0]->ANL_CODE;
}
$company = strtolower($company);
$this->def_order_by = 'TRANS_DATETIME';
$this->def_order_dir = 'DESC';
$this->place_action = 'none';
$this->show_select = false;
$this->sql_key = 'TRANS_DATETIME';
$this->sql_table_name = $company . '_a_salfldg';
$this->sql_connection = 'mysql2';
/* Start custom queries */
$model = DB::connection($this->sql_connection)->table($this->sql_table_name);
$tables = array();
//print_r($mresult);
$actualresult = $model->select(DB::raw($company . '_a_salfldg.ACCNT_CODE,' . $company . '_acnt.DESCR AS ADESCR,' . 'SUM(' . $company . '_a_salfldg.AMOUNT) as AMT'))->where($company . '_a_salfldg.ACCNT_CODE', 'like', '2%')->where($company . '_a_salfldg.ANAL_T1', '=', $afe)->where($company . '_a_salfldg.PERIOD', '>=', $period_from)->where($company . '_a_salfldg.PERIOD', '<=', $period_to)->leftJoin($company . '_acnt', $company . '_a_salfldg.ACCNT_CODE', '=', $company . '_acnt.ACNT_CODE')->groupBy($company . '_a_salfldg.ACCNT_CODE')->get();
$model = DB::connection($this->sql_connection)->table($company . '_a_salfldg');
$prioritdresult = $model->select(DB::raw($company . '_a_salfldg.ACCNT_CODE,' . $company . '_acnt.DESCR AS ADESCR,' . 'SUM(' . $company . '_a_salfldg.AMOUNT) as AMT'))->where($company . '_a_salfldg.ACCNT_CODE', 'like', '2%')->where($company . '_a_salfldg.ANAL_T1', '=', $afe)->where($company . '_a_salfldg.PERIOD', '<', $period_from)->leftJoin($company . '_acnt', $company . '_a_salfldg.ACCNT_CODE', '=', $company . '_acnt.ACNT_CODE')->groupBy($company . '_a_salfldg.ACCNT_CODE')->get();
$model = DB::connection($this->sql_connection)->table($company . '_a_salfldg');
$currentitdresult = $model->select(DB::raw($company . '_a_salfldg.ACCNT_CODE,' . $company . '_acnt.DESCR AS ADESCR,' . 'SUM(' . $company . '_a_salfldg.AMOUNT) as AMT'))->where($company . '_a_salfldg.ACCNT_CODE', 'like', '2%')->where($company . '_a_salfldg.ANAL_T1', '=', $afe)->where($company . '_a_salfldg.PERIOD', '<=', $period_to)->leftJoin($company . '_acnt', $company . '_a_salfldg.ACCNT_CODE', '=', $company . '_acnt.ACNT_CODE')->groupBy($company . '_a_salfldg.ACCNT_CODE')->get();
$model = DB::connection($this->sql_connection)->table($company . '_b_salfldg');
$budgetresult = $model->select(DB::raw($company . '_b_salfldg.ACCNT_CODE,' . $company . '_acnt.DESCR AS ADESCR,' . 'SUM(' . $company . '_b_salfldg.AMOUNT) as AMT'))->where($company . '_b_salfldg.ACCNT_CODE', 'like', '2%')->where($company . '_b_salfldg.ANAL_T1', '=', $afe)->where($company . '_b_salfldg.PERIOD', '>=', $period_from)->where($company . '_b_salfldg.PERIOD', '<=', $period_to)->leftJoin($company . '_acnt', $company . '_b_salfldg.ACCNT_CODE', '=', $company . '_acnt.ACNT_CODE')->groupBy($company . '_b_salfldg.ACCNT_CODE')->get();
$model = DB::connection($this->sql_connection)->table($company . '_d_salfldg');
$revbudgetresult = $model->select(DB::raw($company . '_d_salfldg.ACCNT_CODE,' . $company . '_acnt.DESCR AS ADESCR,' . 'SUM(' . $company . '_d_salfldg.AMOUNT) as AMT'))->where($company . '_d_salfldg.ACCNT_CODE', 'like', '2%')->where($company . '_d_salfldg.ANAL_T1', '=', $afe)->where($company . '_d_salfldg.PERIOD', '>=', $period_from)->where($company . '_d_salfldg.PERIOD', '<=', $period_to)->leftJoin($company . '_acnt', $company . '_d_salfldg.ACCNT_CODE', '=', $company . '_acnt.ACNT_CODE')->groupBy($company . '_d_salfldg.ACCNT_CODE')->get();
$tabdata = array();
foreach ($actualresult as $a) {
$tabdata[$a->ACCNT_CODE] = $a;
$tabdata[$a->ACCNT_CODE]->BAMT = 0;
$tabdata[$a->ACCNT_CODE]->DAMT = 0;
$tabdata[$a->ACCNT_CODE]->PITDAMT = 0;
$tabdata[$a->ACCNT_CODE]->CITDAMT = 0;
}
foreach ($prioritdresult as $p) {
if (isset($tabdata[$p->ACCNT_CODE])) {
$tabdata[$p->ACCNT_CODE]->PITDAMT = $p->AMT;
}
}
foreach ($currentitdresult as $c) {
if (isset($tabdata[$c->ACCNT_CODE])) {
$tabdata[$c->ACCNT_CODE]->CITDAMT = $c->AMT;
}
}
foreach ($budgetresult as $b) {
if (isset($tabdata[$b->ACCNT_CODE])) {
$tabdata[$b->ACCNT_CODE]->BAMT = $b->AMT;
} else {
$tabdata[$b->ACCNT_CODE] = $b;
$tabdata[$b->ACCNT_CODE]->BAMT = $b->AMT;
$tabdata[$b->ACCNT_CODE]->AMT = 0;
$tabdata[$b->ACCNT_CODE]->DAMT = 0;
$tabdata[$b->ACCNT_CODE]->PITDAMT = 0;
$tabdata[$b->ACCNT_CODE]->CITDAMT = 0;
}
}
foreach ($revbudgetresult as $d) {
if (isset($tabdata[$d->ACCNT_CODE])) {
$tabdata[$d->ACCNT_CODE]->DAMT = $d->AMT;
} else {
$tabdata[$d->ACCNT_CODE] = $d;
$tabdata[$d->ACCNT_CODE]->DAMT = $d->AMT;
$tabdata[$d->ACCNT_CODE]->AMT = 0;
$tabdata[$d->ACCNT_CODE]->BAMT = 0;
$tabdata[$d->ACCNT_CODE]->PITDAMT = 0;
$tabdata[$d->ACCNT_CODE]->CITDAMT = 0;
}
}
ksort($tabdata);
$tattrs = array('width' => '100%', 'class' => 'table table-bordered');
$thead = array();
$tdataclr = array();
$tdataexp = array();
$thead[] = array(array('value' => '#', 'attr' => 'rowspan=2'), array('value' => 'Account', 'attr' => 'colspan=2 rowspan=2 class="center"'), array('value' => 'Budget', 'attr' => 'colspan=2'), array('value' => 'Actual', 'attr' => 'colspan=3'), array('value' => 'Variance', 'attr' => 'colspan=2'));
$thead[] = array(array('value' => 'Original'), array('value' => 'Revised'), array('value' => 'Prior ITD'), array('value' => 'Current Month'), array('value' => 'Current Month ITD'), array('value' => '$'), array('value' => '%'));
$seq = 1;
$sumexp = new stdClass();
//.........这里部分代码省略.........
示例2: getIndex
public function getIndex()
{
$this->heads = array(array('Period', array('search' => true, 'sort' => true, 'style' => 'min-width:90px;', 'daterange' => true)), array('Date', array('search' => true, 'sort' => true, 'style' => 'min-width:100px;', 'daterange' => true)), array('JV Ref', array('search' => true, 'sort' => true, 'style' => 'min-width:120px;')), array('Account', array('search' => true, 'style' => 'min-width:100px;', 'sort' => true)), array('Account Description', array('search' => true, 'style' => 'min-width:125px;', 'sort' => true)), array('Reference Doc.', array('search' => true, 'sort' => true)), array('Orig. Currency', array('search' => true, 'sort' => true)), array('Orig. Amount', array('search' => true, 'sort' => true)), array('Conversion Rate', array('search' => true, 'sort' => true)), array('Base Amount', array('search' => true, 'sort' => true)), array('Transaction Description', array('search' => true, 'sort' => true)));
//print $this->model->where('docFormat','picture')->get()->toJSON();
$this->title = 'Statement of Operation Account Balance';
$this->place_action = 'none';
$this->can_add = false;
$this->show_select = false;
Breadcrumbs::addCrumb('Cost Report', URL::to(strtolower($this->controller_name)));
$db = Config::get('lundin.main_db');
$company = Input::get('acc-company');
//print $prior_year;
$company = strtolower($company);
if ($company == '') {
$company = Config::get('lundin.default_company');
}
$companylist = Prefs::getCompany(array('key' => 'DB_CODE', 'sign' => '=', 'value' => $company))->CompanyToArray()->toArray();
if (count($companylist) > 0) {
$companyname = $companylist[0]['DESCR'];
} else {
$companyname = '';
}
$afe = Input::get('acc-afe');
if ($afe == '' || is_null($afe)) {
$afes = Prefs::getAfe($company)->AfeToArray();
$afe = $afes[0]->ANL_CODE;
}
$company = strtolower($company);
$maxperiod = Prefs::latestPeriod($company . '_a_salfldg');
$period_from = Input::get('acc-period-from');
$period_to = Input::get('acc-period-to');
if ($period_from == '' || is_null($period_from)) {
$period_from = $maxperiod;
}
// test value
//$period_from = '2015001';
if ($period_to == '' || is_null($period_to)) {
$period_to = date('Y0m', time());
}
$prior_year = substr($period_from, 0, 4);
$prior_year = $prior_year - 1;
$prior_year .= '012';
$this->additional_filter = View::make(strtolower($this->controller_name) . '.addfilter')->with('maxperiod', $period_from)->with('submit_url', 'jvsoab')->render();
$this->def_order_by = 'TRANS_DATETIME';
$this->def_order_dir = 'DESC';
$this->place_action = 'none';
$this->show_select = false;
$this->sql_key = 'TRANS_DATETIME';
$this->sql_table_name = $company . '_a_salfldg';
$this->sql_connection = 'mysql2';
/* Start custom queries */
$model = DB::connection($this->sql_connection)->table($this->sql_table_name);
$tables = array();
//current month
$currentmonthset = array();
$titlekeys = array();
$sectiontitle = array();
foreach (Config::get('accgroup.jvsoab') as $sec => $data) {
$sectiontitle[$data['key']] = $sec;
$section = $data['key'];
foreach ($data['data'] as $h => $v) {
if ($v['is_head']) {
} else {
$titlekeys[$section][$v['key']] = $h;
}
}
foreach ($data['data'] as $h => $v) {
if ($v['is_head']) {
} else {
$model = DB::connection($this->sql_connection)->table($this->sql_table_name);
$model = $model->select(DB::raw($company . '_a_salfldg.ACCNT_CODE,' . $company . '_acnt.DESCR AS ADESCR,' . 'SUM(' . $company . '_a_salfldg.AMOUNT) as AMT'));
if ($v['sql'] == 'in') {
$model = $model->whereIn($company . '_a_salfldg.ACCNT_CODE', explode(',', $v['val']));
} elseif ($v['sql'] == 'like') {
if (is_array($v['val'])) {
$vals = $v['val'];
$model = $model->where(function ($q) use($vals, $company) {
foreach ($vals as $nval) {
$q = $q->whereOr($company . '_a_salfldg.ACCNT_CODE', 'like', $nval);
}
});
} else {
$model = $model->where($company . '_a_salfldg.ACCNT_CODE', 'like', $v['val']);
}
}
$res = $model->where($company . '_a_salfldg.PERIOD', '=', $period_from)->leftJoin($company . '_acnt', $company . '_a_salfldg.ACCNT_CODE', '=', $company . '_acnt.ACNT_CODE')->groupBy($company . '_a_salfldg.ACCNT_CODE')->get();
$currentmonthset[$section][$v['key']] = $res;
}
}
//priormonth ITD
$priormonthset = array();
foreach ($data['data'] as $h => $v) {
if ($v['is_head']) {
} else {
$model = DB::connection($this->sql_connection)->table($this->sql_table_name);
$model = $model->select(DB::raw($company . '_a_salfldg.ACCNT_CODE,' . $company . '_acnt.DESCR AS ADESCR,' . 'SUM(' . $company . '_a_salfldg.AMOUNT) as AMT'));
if ($v['sql'] == 'in') {
$model = $model->whereIn($company . '_a_salfldg.ACCNT_CODE', explode(',', $v['val']));
} elseif ($v['sql'] == 'like') {
if (is_array($v['val'])) {
//.........这里部分代码省略.........