当前位置: 首页>>代码示例>>PHP>>正文


PHP TTDate::getYearQuarter方法代码示例

本文整理汇总了PHP中TTDate::getYearQuarter方法的典型用法代码示例。如果您正苦于以下问题:PHP TTDate::getYearQuarter方法的具体用法?PHP TTDate::getYearQuarter怎么用?PHP TTDate::getYearQuarter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TTDate的用法示例。


在下文中一共展示了TTDate::getYearQuarter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getReportDates


//.........这里部分代码省略.........
             case 'pay_period_end_date':
             case 'pay_period_transaction_date':
                 $retval = TTDate::getDate('DATE', $epoch);
                 break;
             case 'date_stamp':
                 $epoch = is_numeric($epoch) ? $epoch : strtotime($epoch);
                 $retval = TTDate::getDate('DATE', $epoch);
                 break;
             case 'time_stamp':
                 $retval = TTDate::getDate('TIME', is_numeric($epoch) ? $epoch : strtotime($epoch));
                 break;
             case 'date_time_stamp':
                 $retval = TTDate::getDate('DATE+TIME', is_numeric($epoch) ? $epoch : strtotime($epoch));
                 break;
             case 'date_dow':
                 $retval = TTDate::getDayOfWeekName($epoch);
                 break;
             case 'date_dow_week':
                 $retval = TTDate::getDayOfWeekName($split_epoch[1]) . ' ' . $split_epoch[0];
                 break;
             case 'date_dow_month':
                 $retval = TTDate::getDayOfWeekName($split_epoch[1]) . '-' . TTDate::getMonthName($split_epoch[0]);
                 break;
             case 'date_dow_month_year':
                 $retval = TTDate::getDayOfWeekName($split_epoch[2]) . '-' . TTDate::getMonthName($split_epoch[1]) . '-' . $split_epoch[0];
                 break;
             case 'date_dow_dom_month_year':
                 $retval = TTDate::getDayOfWeekName($split_epoch[2]) . ' ' . $split_epoch[1] . '-' . TTDate::getMonthName($split_epoch[1]) . '-' . $split_epoch[0];
                 break;
             case 'date_week':
                 $retval = $epoch;
                 break;
             case 'date_week_month':
                 $retval = $split_epoch[1] . ' ' . TTDate::getMonthName($split_epoch[0]);
                 break;
             case 'date_week_month_year':
                 $retval = $split_epoch[2] . ' ' . TTDate::getMonthName($split_epoch[1]) . '-' . $split_epoch[0];
                 break;
             case 'date_dom':
                 $retval = $epoch;
                 break;
             case 'date_dom_month':
                 $retval = $split_epoch[1] . '-' . TTDate::getMonthName($split_epoch[0]);
                 break;
             case 'date_dom_month_year':
                 $retval = $split_epoch[2] . '-' . TTDate::getMonthName($split_epoch[1], TRUE) . '-' . $split_epoch[0];
                 break;
             case 'date_month':
                 $retval = TTDate::getMonthName($epoch);
                 break;
             case 'date_month_year':
                 $retval = TTDate::getMonthName($split_epoch[1]) . '-' . $split_epoch[0];
                 break;
             case 'date_quarter':
                 $retval = $epoch;
                 break;
             case 'date_quarter_year':
                 $retval = $split_epoch[1] . '-' . $split_epoch[0];
                 break;
             case 'date_year':
                 $retval = $epoch;
                 break;
             case 'pay_period':
                 $retval = $params;
                 break;
             default:
                 Debug::text('Date Column does not match!: ' . $column, __FILE__, __LINE__, __METHOD__, 10);
                 break;
         }
         //Debug::text('Column: '. $column .' Input: '. $epoch .' Retval: '. $retval, __FILE__, __LINE__, __METHOD__,10);
     } else {
         //Return data for *all* columns at once.
         if ($epoch == NULL or $epoch == '' or !is_numeric($epoch)) {
             //Epoch must be numeric
             $epoch = self::getTime();
         }
         $column_prefix = NULL;
         if ($column != '') {
             $column_prefix = $column . '-';
         }
         $retval = array($column_prefix . 'date_stamp' => date('Y-m-d', $epoch), $column_prefix . 'time_stamp' => $epoch, $column_prefix . 'date_time_stamp' => $epoch, $column_prefix . 'date_dow' => date('w', $epoch), $column_prefix . 'date_dow_week' => date('W-w', $epoch), $column_prefix . 'date_dow_month' => date('m-w', $epoch), $column_prefix . 'date_dow_month_year' => date('Y-m-w', $epoch), $column_prefix . 'date_dow_dom_month_year' => date('Y-m-w-W', $epoch), $column_prefix . 'date_week' => self::getWeek($epoch, $start_week_day), $column_prefix . 'date_week_month' => date('m-W', $epoch), $column_prefix . 'date_week_month_year' => date('Y-m-W', $epoch), $column_prefix . 'date_dom' => date('d', $epoch), $column_prefix . 'date_dom_month' => date('m-d', $epoch), $column_prefix . 'date_dom_month_year' => date('Y-m-d', $epoch), $column_prefix . 'date_month' => date('m', $epoch), $column_prefix . 'date_month_year' => date('Y-m', $epoch), $column_prefix . 'date_quarter' => TTDate::getYearQuarter($epoch), $column_prefix . 'date_quarter_year' => date('Y', $epoch) . '-' . TTDate::getYearQuarter($epoch), $column_prefix . 'date_year' => TTDate::getYear($epoch));
         //Only display these dates if they are passed in separately in the $param array.
         if (isset($params['pay_period_start_date']) and $params['pay_period_start_date'] != '' and isset($params['pay_period_end_date']) and $params['pay_period_end_date'] != '') {
             $retval[$column_prefix . 'pay_period'] = array('sort' => $params['pay_period_start_date'], 'display' => TTDate::getDate('DATE', $params['pay_period_start_date']) . ' -> ' . TTDate::getDate('DATE', $params['pay_period_end_date']));
         }
         if (isset($params['pay_period_start_date']) and $params['pay_period_start_date'] != '') {
             $retval[$column_prefix . 'pay_period_start_date'] = $params['pay_period_start_date'];
         }
         if (isset($params['pay_period_end_date']) and $params['pay_period_end_date'] != '') {
             $retval[$column_prefix . 'pay_period_end_date'] = $params['pay_period_end_date'];
         }
         if (isset($params['pay_period_transaction_date']) and $params['pay_period_transaction_date'] != '') {
             $retval[$column_prefix . 'pay_period_transaction_date'] = $params['pay_period_transaction_date'];
         }
     }
     if (isset($retval)) {
         return $retval;
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:TTDate.class.php

示例2: _outputPDFForm

 function _outputPDFForm($format = NULL)
 {
     $show_background = TRUE;
     if ($format == 'pdf_form_print') {
         $show_background = FALSE;
     }
     Debug::Text('Generating Form... Format: ' . $format, __FILE__, __LINE__, __METHOD__, 10);
     $setup_data = $this->getFormConfig();
     $filter_data = $this->getFilterConfig();
     //Debug::Arr($filter_data, 'Filter Data: ', __FILE__, __LINE__, __METHOD__,10);
     $current_company = $this->getUserObject()->getCompanyObject();
     if (!is_object($current_company)) {
         Debug::Text('Invalid company object...', __FILE__, __LINE__, __METHOD__, 10);
         return FALSE;
     }
     if ($format == 'efile_xml') {
         $return941 = $this->getRETURN941Object();
         $return941->TaxPeriodEndDate = TTDate::getDate('Y-m-d', TTDate::getEndDayEpoch($filter_data['end_date']));
         $return941->ReturnType = '';
         $return941->ein = (isset($setup_data['ein']) and $setup_data['ein'] != '') ? $setup_data['ein'] : $current_company->getBusinessNumber();
         $return941->BusinessName1 = '';
         $return941->BusinessNameControl = '';
         $return941->AddressLine = (isset($setup_data['address1']) and $setup_data['address1'] != '') ? $setup_data['address1'] : $current_company->getAddress1() . ' ' . $current_company->getAddress2();
         $return941->City = (isset($setup_data['city']) and $setup_data['city'] != '') ? $setup_data['city'] : $current_company->getCity();
         $return941->State = (isset($setup_data['province']) and ($setup_data['province'] != '' and $setup_data['province'] != 0)) ? $setup_data['province'] : $current_company->getProvince();
         $return941->ZIPCode = (isset($setup_data['postal_code']) and $setup_data['postal_code'] != '') ? $setup_data['postal_code'] : $current_company->getPostalCode();
         $this->getFormObject()->addForm($return941);
     }
     $f941 = $this->getF941Object();
     $f941->setDebug(FALSE);
     $f941->setShowBackground($show_background);
     $f941->year = TTDate::getYear($filter_data['end_date']);
     //Add support for the user to manually set this data in the setup_data. That way they can use multiple tax IDs for different employees, all beit manually.
     $f941->ein = (isset($setup_data['ein']) and $setup_data['ein'] != '') ? $setup_data['ein'] : $current_company->getBusinessNumber();
     $f941->name = (isset($setup_data['name']) and $setup_data['name'] != '') ? $setup_data['name'] : $this->getUserObject()->getFullName();
     $f941->trade_name = (isset($setup_data['company_name']) and $setup_data['company_name'] != '') ? $setup_data['company_name'] : $current_company->getName();
     $f941->address = (isset($setup_data['address1']) and $setup_data['address1'] != '') ? $setup_data['address1'] : $current_company->getAddress1() . ' ' . $current_company->getAddress2();
     $f941->city = (isset($setup_data['city']) and $setup_data['city'] != '') ? $setup_data['city'] : $current_company->getCity();
     $f941->state = (isset($setup_data['province']) and ($setup_data['province'] != '' and $setup_data['province'] != 0)) ? $setup_data['province'] : $current_company->getProvince();
     $f941->zip_code = (isset($setup_data['postal_code']) and $setup_data['postal_code'] != '') ? $setup_data['postal_code'] : $current_company->getPostalCode();
     $f941->quarter = TTDate::getYearQuarter($filter_data['end_date']);
     //Debug::Arr($this->form_data, 'Final Data for Form: ', __FILE__, __LINE__, __METHOD__,10);
     if (isset($this->form_data) and count($this->form_data) == 3) {
         $f941->l1 = count($this->user_ids);
         $f941->l2 = $this->form_data['total']['l2'];
         $f941->l3 = $this->form_data['total']['l3'];
         $f941->l5a = $this->form_data['total']['l5a'];
         $f941->l5b = $this->form_data['total']['l5b'];
         $f941->l5c = $this->form_data['total']['l5c'];
         $f941->l5d = $this->form_data['total']['l5d'];
         if (isset($setup_data['quarter_deposit']) and $setup_data['quarter_deposit'] != '') {
             $f941->l11 = Misc::MoneyFormat($setup_data['quarter_deposit'], FALSE);
         }
         //Debug::Text('L11: '. $f941->l11 .' L6: '. $f941->calcL6() .' - '. $this->form_data['total']['l10'] , __FILE__, __LINE__, __METHOD__,10);
         $f941->l15b = TRUE;
         if (isset($setup_data['deposit_schedule']) and $setup_data['deposit_schedule'] == 10) {
             if (isset($this->form_data['quarter'][1]['l10'])) {
                 $f941->l16_month1 = $this->form_data['quarter'][1]['l10'];
             }
             if (isset($this->form_data['quarter'][2]['l10'])) {
                 $f941->l16_month2 = $this->form_data['quarter'][2]['l10'];
             }
             if (isset($this->form_data['quarter'][3]['l10'])) {
                 $f941->l16_month3 = $this->form_data['quarter'][3]['l10'];
             }
         } elseif (isset($setup_data['deposit_schedule']) and $setup_data['deposit_schedule'] == 20) {
             $f941sb = $this->getFormObject()->getFormObject('941sb', 'US');
             $f941sb->setShowBackground($show_background);
             $f941sb->year = $f941->year;
             $f941sb->ein = $f941->ein;
             $f941sb->name = $f941->name;
             $f941sb->quarter = $f941->quarter;
             for ($i = 1; $i <= 3; $i++) {
                 if (isset($this->form_data['pay_period'][$i])) {
                     foreach ($this->form_data['pay_period'][$i] as $pay_period_epoch => $data) {
                         //Debug::Text('SB: Month: '. $i .' Pay Period Date: '. TTDate::getDate('DATE', $pay_period_epoch) .' DOM: '. TTDate::getDayOfMonth($pay_period_epoch) .' Amount: '. $data['l10'], __FILE__, __LINE__, __METHOD__,10);
                         $f941sb_data[$i][TTDate::getDayOfMonth($pay_period_epoch)] = $data['l10'];
                         //Don't round this as it can cause mismatches in the totals.
                     }
                 }
             }
             if (isset($f941sb_data[1])) {
                 $f941sb->month1 = $f941sb_data[1];
             }
             if (isset($f941sb_data[2])) {
                 $f941sb->month2 = $f941sb_data[2];
             }
             if (isset($f941sb_data[3])) {
                 $f941sb->month3 = $f941sb_data[3];
             }
             unset($i, $d, $f941sb_data);
         }
     } else {
         Debug::Arr($this->data, 'Invalid Form Data: ', __FILE__, __LINE__, __METHOD__, 10);
     }
     $this->getFormObject()->addForm($f941);
     if (isset($f941sb) and is_object($f941sb)) {
         $this->getFormObject()->addForm($f941sb);
     }
     if ($format == 'efile_xml') {
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:Form941Report.class.php


注:本文中的TTDate::getYearQuarter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。