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


PHP Misc::ArrayAssocSum方法代码示例

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


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

示例1: _outputPDFForm


//.........这里部分代码省略.........
                 Debug::Text('User ID not set!', __FILE__, __LINE__, __METHOD__, 10);
                 continue;
             }
             $ulf = TTnew('UserListFactory');
             $ulf->getById((int) $row['user_id']);
             if ($ulf->getRecordCount() == 1) {
                 $user_obj = $ulf->getCurrent();
                 $ee_data = array('first_name' => $user_obj->getFirstName(), 'middle_name' => $user_obj->getMiddleName(), 'last_name' => $user_obj->getLastName(), 'address1' => $user_obj->getAddress1(), 'address2' => $user_obj->getAddress2(), 'city' => $user_obj->getCity(), 'province' => $user_obj->getProvince(), 'employment_province' => $user_obj->getProvince(), 'postal_code' => $user_obj->getPostalCode(), 'sin' => $user_obj->getSIN(), 'employee_number' => $user_obj->getEmployeeNumber(), 'l14' => $row['income'], 'l22' => $row['tax'], 'l16' => $row['employee_cpp'], 'l24' => $row['ei_earnings'], 'l26' => $row['cpp_earnings'], 'l18' => $row['employee_ei'], 'l44' => $row['union_dues'], 'l20' => $row['rpp'], 'l46' => $row['charity'], 'l52' => $row['pension_adjustment'], 'l50' => $setup_data['rpp_number'], 'cpp_exempt' => FALSE, 'ei_exempt' => FALSE, 'other_box_0_code' => NULL, 'other_box_0' => NULL, 'other_box_1_code' => NULL, 'other_box_1' => NULL, 'other_box_2_code' => NULL, 'other_box_2' => NULL, 'other_box_3_code' => NULL, 'other_box_3' => NULL, 'other_box_4_code' => NULL, 'other_box_4' => NULL, 'other_box_5_code' => NULL, 'other_box_5' => NULL);
                 //Get User Tax / Deductions by Pay Stub Account.
                 $udlf = TTnew('UserDeductionListFactory');
                 if (isset($setup_data['employee_cpp']['include_pay_stub_entry_account'])) {
                     $udlf->getByUserIdAndPayStubEntryAccountID($user_obj->getId(), $setup_data['employee_cpp']['include_pay_stub_entry_account']);
                     //FIXME: What if they were CPP exempt because of age, so no CPP was taken off, but they are assigned to the Tax/Deduction?
                     //Don't think there is much we can do about this for now.
                     if ($setup_data['employee_cpp']['include_pay_stub_entry_account'] != 0 and $udlf->getRecordCount() == 0 and $row['employee_cpp'] == 0) {
                         //Debug::Text('CPP Exempt!', __FILE__, __LINE__, __METHOD__,10);
                         $ee_data['cpp_exempt'] = TRUE;
                     }
                 }
                 if (isset($setup_data['employee_ei']['include_pay_stub_entry_account'])) {
                     $udlf->getByUserIdAndPayStubEntryAccountID($user_obj->getId(), $setup_data['employee_ei']['include_pay_stub_entry_account']);
                     if ($setup_data['employee_ei']['include_pay_stub_entry_account'] != 0 and $udlf->getRecordCount() == 0 and $row['employee_ei'] == 0) {
                         //Debug::Text('EI Exempt!', __FILE__, __LINE__, __METHOD__,10);
                         $ee_data['ei_exempt'] = TRUE;
                     }
                 }
                 if ($row['other_box_0'] > 0 and isset($setup_data['other_box'][0]['box']) and $setup_data['other_box'][0]['box'] != '') {
                     $ee_data['other_box_0_code'] = $setup_data['other_box'][0]['box'];
                     $ee_data['other_box_0'] = $row['other_box_0'];
                 }
                 if ($row['other_box_1'] > 0 and isset($setup_data['other_box'][1]['box']) and $setup_data['other_box'][1]['box'] != '') {
                     $ee_data['other_box_1_code'] = $setup_data['other_box'][1]['box'];
                     $ee_data['other_box_1'] = $row['other_box_1'];
                 }
                 if ($row['other_box_2'] > 0 and isset($setup_data['other_box'][2]['box']) and $setup_data['other_box'][2]['box'] != '') {
                     $ee_data['other_box_2_code'] = $setup_data['other_box'][2]['box'];
                     $ee_data['other_box_2'] = $row['other_box_2'];
                 }
                 if ($row['other_box_3'] > 0 and isset($setup_data['other_box'][3]['box']) and $setup_data['other_box'][3]['box'] != '') {
                     $ee_data['other_box_3_code'] = $setup_data['other_box'][3]['box'];
                     $ee_data['other_box_3'] = $row['other_box_3'];
                 }
                 if ($row['other_box_4'] > 0 and isset($setup_data['other_box'][4]['box']) and $setup_data['other_box'][4]['box'] != '') {
                     $ee_data['other_box_4_code'] = $setup_data['other_box'][4]['box'];
                     $ee_data['other_box_4'] = $row['other_box_4'];
                 }
                 if ($row['other_box_5'] > 0 and isset($setup_data['other_box'][5]['box']) and $setup_data['other_box'][5]['box'] != '') {
                     $ee_data['other_box_5_code'] = $setup_data['other_box'][5]['box'];
                     $ee_data['other_box_5'] = $row['other_box_5'];
                 }
                 $t4->addRecord($ee_data);
                 unset($ee_data);
                 $i++;
             }
         }
         $this->getFormObject()->addForm($t4);
     }
     //Handle T4Summary
     $t4s = $this->getT4SumObject();
     $t4s->setStatus($setup_data['status_id']);
     $t4s->year = $t4->year;
     $t4s->payroll_account_number = $t4->payroll_account_number;
     $t4s->company_name = $t4->company_name;
     $t4s->company_address1 = (isset($setup_data['address1']) and $setup_data['address1'] != '') ? $setup_data['address1'] : $current_company->getAddress1();
     $t4s->company_address2 = (isset($setup_data['address2']) and $setup_data['address2'] != '') ? $setup_data['address2'] : $current_company->getAddress2();
     $t4s->company_city = (isset($setup_data['city']) and $setup_data['city'] != '') ? $setup_data['city'] : $current_company->getCity();
     $t4s->company_province = (isset($setup_data['province']) and ($setup_data['province'] != '' and $setup_data['province'] != 0)) ? $setup_data['province'] : $current_company->getProvince();
     $t4s->company_postal_code = (isset($setup_data['postal_code']) and $setup_data['postal_code'] != '') ? $setup_data['postal_code'] : $current_company->getPostalCode();
     $t4s->l76 = $this->getUserObject()->getFullName();
     //Contact name.
     $t4s->l78 = $current_company->getWorkPhone();
     $total_row = Misc::ArrayAssocSum($this->form_data);
     $t4s->l88 = count($this->form_data);
     $t4s->l14 = $total_row['income'];
     $t4s->l22 = $total_row['tax'];
     $t4s->l16 = $total_row['employee_cpp'];
     $t4s->l18 = $total_row['employee_ei'];
     $t4s->l27 = $total_row['employer_cpp'];
     $t4s->l19 = $total_row['employer_ei'];
     $t4s->l20 = $total_row['rpp'];
     $t4s->l52 = $total_row['pension_adjustment'];
     $total_deductions = Misc::MoneyFormat(Misc::sumMultipleColumns($total_row, array('tax', 'employee_cpp', 'employee_ei', 'employer_cpp', 'employer_ei')), FALSE);
     $t4s->l82 = $total_deductions;
     $this->getFormObject()->addForm($t4s);
     if ($format == 'efile_xml') {
         $output_format = 'XML';
         $file_name = 't4_efile_' . date('Y_m_d') . '.xml';
         $mime_type = 'applications/octet-stream';
         //Force file to download.
     } else {
         $output_format = 'PDF';
         $file_name = $this->file_name . '.pdf';
         $mime_type = $this->file_mime_type;
     }
     $output = $this->getFormObject()->output($output_format);
     if (!is_array($output)) {
         return array('file_name' => $file_name, 'mime_type' => $mime_type, 'data' => $output);
     }
     return $output;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:T4SummaryReport.class.php

示例2: bcmul

                     }
                 }
             }
             $lines_arr[$quarter_id]['p1_3'] = $lines_arr[$quarter_id]['p1_1'] - $lines_arr[$quarter_id]['p1_2'] - $lines_arr[$quarter_id]['p3_under_cutoff'];
             $lines_arr[$quarter_id]['p1_4'] = $lines_arr[$quarter_id]['p1_2'] + $lines_arr[$quarter_id]['p1_3'];
             $lines_arr[$quarter_id]['p1_5'] = $lines_arr[$quarter_id]['p1_1'] - $lines_arr[$quarter_id]['p1_4'];
             $lines_arr[$quarter_id]['p1_6'] = bcmul($lines_arr[$quarter_id]['p1_5'], 0.008);
         }
         unset($user_id);
         //var_dump($user_ps_entries);
     }
     unset($pay_period_ids, $ps_entries);
 }
 //Calc Part 1, Line 3 here.
 if (isset($lines_arr)) {
     $lines_arr['total'] = Misc::ArrayAssocSum($lines_arr, NULL, 6);
     Debug::Arr($lines_arr, 'Lines Array: ', __FILE__, __LINE__, __METHOD__, 10);
     //Line 8
     $p1_line8 = $lines_arr['total']['p1_6'] - 0;
 }
 $border = 0;
 $pdf = new fpdi();
 //Import original Gov't supplied PDF.
 if ($show_background == TRUE) {
     $pagecount = $pdf->setSourceFile(Environment::getBasePath() . 'interface' . DIRECTORY_SEPARATOR . 'forms' . DIRECTORY_SEPARATOR . 'us' . DIRECTORY_SEPARATOR . 'tax' . DIRECTORY_SEPARATOR . 'f940ez.pdf');
     $tplidx = $pdf->ImportPage(1);
 }
 $pdf->setMargins(0, 0, 0, 0);
 $pdf->SetAutoPageBreak(FALSE);
 $pdf->SetFont('freeserif', '', 10);
 $pdf->AddPage();
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:31,代码来源:Form940ez.php

示例3: array

     $rows = Misc::ArrayGroupBy($rows, array(Misc::trimSortPrefix($filter_data['primary_group_by']), Misc::trimSortPrefix($filter_data['secondary_group_by'])), Misc::trimSortPrefix($ignore_elements));
 }
 if (isset($rows)) {
     foreach ($rows as $row) {
         $tmp_rows[] = $row;
     }
     //var_dump($tmp_rows);
     $special_sort_columns = array('pay_period');
     if (in_array(Misc::trimSortPrefix($filter_data['primary_sort']), $special_sort_columns)) {
         $filter_data['primary_sort'] = $filter_data['primary_sort'] . '_order';
     }
     if (in_array(Misc::trimSortPrefix($filter_data['secondary_sort']), $special_sort_columns)) {
         $filter_data['secondary_sort'] = $filter_data['secondary_sort'] . '_order';
     }
     $rows = Sort::Multisort($tmp_rows, Misc::trimSortPrefix($filter_data['primary_sort']), Misc::trimSortPrefix($filter_data['secondary_sort']), $filter_data['primary_sort_dir'], $filter_data['secondary_sort_dir']);
     $total_row = Misc::ArrayAssocSum($rows, NULL, 2);
     $last_row = count($rows);
     $rows[$last_row] = $total_row;
     foreach ($static_columns as $static_column_key => $static_column_val) {
         $rows[$last_row][Misc::trimSortPrefix($static_column_key)] = NULL;
     }
     unset($static_column_key, $static_column_val);
     //Convert units
     $tmp_rows = $rows;
     unset($rows);
     $trimmed_static_columns = array_keys(Misc::trimSortPrefix($static_columns));
     foreach ($tmp_rows as $row) {
         foreach ($row as $column => $column_data) {
             if (!strstr($column, 'wage') and !strstr($column, 'worked_days') and !in_array($column, $trimmed_static_columns)) {
                 $column_data = TTDate::getTimeUnit($column_data);
             }
开发者ID:alachaum,项目名称:timetrex,代码行数:31,代码来源:TimesheetSummary.php

示例4: sumRecords

 function sumRecords()
 {
     $this->records_total = Misc::ArrayAssocSum($this->records);
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:5,代码来源:GovernmentForms_Base.class.php

示例5: _outputPDFForm


//.........这里部分代码省略.........
                     } else {
                         $ee_data['l15' . $z . '_state_id'] = NULL;
                         $ee_data['l15' . $z . '_state'] = NULL;
                         $ee_data['l16' . $z] = NULL;
                         $ee_data['l17' . $z] = NULL;
                     }
                     //District income tax
                     if (isset($row['l18' . $z])) {
                         $ee_data['l18' . $z] = $row['l18' . $z];
                         $ee_data['l19' . $z] = $row['l19' . $z];
                         $ee_data['l20' . $z] = $row['l20' . $z];
                     } else {
                         $ee_data['l18' . $z] = NULL;
                         $ee_data['l19' . $z] = NULL;
                         $ee_data['l20' . $z] = NULL;
                     }
                 }
                 $fw2->addRecord($ee_data);
                 unset($ee_data);
                 $i++;
                 $n++;
             }
         }
     }
     $this->getFormObject()->addForm($fw2);
     if ($form_type == 'government') {
         //Handle W3
         $fw3 = $this->getFW3Object();
         $fw3->setShowBackground($show_background);
         $fw3->year = $fw2->year;
         $fw3->ein = $fw2->ein;
         $fw3->name = $fw2->name;
         $fw3->trade_name = $fw2->trade_name;
         $fw3->company_address1 = $fw2->company_address1;
         $fw3->company_address2 = $fw2->company_address2;
         $fw3->company_city = $fw2->company_city;
         $fw3->company_state = $fw2->company_state;
         $fw3->company_zip_code = $fw2->company_zip_code;
         $fw3->contact_name = $current_user->getFullName();
         $fw3->contact_phone = $current_user->getWorkPhoneExt() != '' ? $current_user->getWorkPhone() . 'x' . $current_user->getWorkPhoneExt() : $current_user->getWorkPhone();
         $fw3->contact_email = $current_user->getWorkEmail();
         $fw3->kind_of_payer = '941';
         $fw3->kind_of_employer = 'none';
         //$fw3->third_party_sick_pay = TRUE;
         if (isset($setup_data['state'][$fw2->company_state]) and isset($setup_data['state'][$fw2->company_state]['state_id']) and $setup_data['state'][$fw2->company_state]['state_id'] != '') {
             $fw3->state_id1 = $setup_data['state'][$fw2->company_state]['state_id'];
         }
         $fw3->lc = count($this->form_data);
         $fw3->control_number = $fw3->lc + 1;
         //$fw3->ld = '1234568';
         $total_row = Misc::ArrayAssocSum($this->form_data);
         //Debug::Arr($total_row, 'Total Row Data: ', __FILE__, __LINE__, __METHOD__,10);
         if (is_array($total_row)) {
             $fw3->l1 = $total_row['l1'];
             $fw3->l2 = $total_row['l2'];
             $fw3->l3 = $total_row['l3'];
             $fw3->l4 = $total_row['l4'];
             $fw3->l5 = $total_row['l5'];
             $fw3->l6 = $total_row['l6'];
             $fw3->l7 = $total_row['l7'];
             $fw3->l8 = $total_row['l8'];
             $fw3->l10 = $total_row['l10'];
             $fw3->l11 = $total_row['l11'];
             foreach (range('a', 'z') as $z) {
                 //State income tax
                 if (isset($total_row['l16' . $z])) {
                     $fw3->l16 += $total_row['l16' . $z];
                     $fw3->l17 += $total_row['l17' . $z];
                 }
                 //District income tax
                 if (isset($total_row['l18' . $z])) {
                     $fw3->l18 += $total_row['l18' . $z];
                     $fw3->l19 += $total_row['l19' . $z];
                 }
             }
         }
         $this->getFormObject()->addForm($fw3);
     }
     if ($format == 'efile') {
         $output_format = 'EFILE';
         if ($fw2->getDebug() == TRUE) {
             $file_name = 'w2_efile_' . date('Y_m_d') . '.csv';
         } else {
             $file_name = 'w2_efile_' . date('Y_m_d') . '.txt';
         }
         $mime_type = 'applications/octet-stream';
         //Force file to download.
     } elseif ($format == 'efile_xml') {
         $output_format = 'XML';
         $file_name = 'w2_efile_' . date('Y_m_d') . '.xml';
         $mime_type = 'applications/octet-stream';
         //Force file to download.
     } else {
         $output_format = 'PDF';
         $file_name = $this->file_name;
         $mime_type = $this->file_mime_type;
     }
     $output = $this->getFormObject()->output($output_format);
     return array('file_name' => $file_name, 'mime_type' => $mime_type, 'data' => $output);
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:FormW2Report.class.php

示例6: _getData

 function _getData($format = NULL)
 {
     $this->tmp_data = array('pay_stub_entry' => array(), 'user_total' => array());
     $columns = $this->getColumnDataConfig();
     $filter_data = $this->getFilterConfig();
     $form_data = $this->formatFormConfig();
     $setup_data = $this->getFormConfig();
     $pself = TTnew('PayStubEntryListFactory');
     $pself->getAPIReportByCompanyIdAndArrayCriteria($this->getUserObject()->getCompany(), $filter_data, NULL, NULL, NULL, array('user_id' => 'asc', 'pay_stub_transaction_date' => 'asc'));
     if ($pself->getRecordCount() > 0) {
         foreach ($pself as $pse_obj) {
             $user_id = $this->user_ids[] = $pse_obj->getColumn('user_id');
             $date_stamp = $this->date_stamps[] = TTDate::strtotime($pse_obj->getColumn('pay_stub_transaction_date'));
             $branch = $pse_obj->getColumn('default_branch');
             $department = $pse_obj->getColumn('default_department');
             $pay_stub_entry_name_id = $pse_obj->getPayStubEntryNameId();
             if (!isset($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp])) {
                 $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp] = array('pay_period_start_date' => strtotime($pse_obj->getColumn('pay_stub_start_date')), 'pay_period_end_date' => strtotime($pse_obj->getColumn('pay_stub_end_date')), 'pay_period_transaction_date' => strtotime($pse_obj->getColumn('pay_stub_transaction_date')), 'pay_period' => strtotime($pse_obj->getColumn('pay_stub_transaction_date')));
             }
             if (isset($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['psen_ids'][$pay_stub_entry_name_id])) {
                 $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['psen_ids'][$pay_stub_entry_name_id] = bcadd($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['psen_ids'][$pay_stub_entry_name_id], $pse_obj->getColumn('amount'));
             } else {
                 $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['psen_ids'][$pay_stub_entry_name_id] = $pse_obj->getColumn('amount');
             }
         }
         if (isset($this->tmp_data['pay_stub_entry']) and is_array($this->tmp_data['pay_stub_entry'])) {
             $payments_over_cutoff = $this->getF940Object()->payment_cutoff_amount;
             //Need to get this from the government form.
             $before_adjustment_tax_rate = $this->getF940Object()->futa_tax_before_adjustment_rate;
             $tax_rate = $this->getF940Object()->futa_tax_rate;
             if ($setup_data['line_10'] > 0) {
                 //Because they had to fill out a separate worksheet which we don't deal with,just average the excluded wages over each loop iteration.
                 $excluded_wage_divisor = 0;
                 foreach ($this->tmp_data['pay_stub_entry'] as $user_id => $data_a) {
                     foreach ($data_a as $date_stamp => $data_b) {
                         $excluded_wage_divisor++;
                     }
                 }
                 $excluded_wage_avg = bcdiv($setup_data['line_10'], $excluded_wage_divisor);
                 Debug::Text(' Excluded Wage Avg: ' . $excluded_wage_avg . ' Divisor: ' . $excluded_wage_divisor, __FILE__, __LINE__, __METHOD__, 10);
                 unset($user_id, $data_a, $data_b, $date_stamp);
             }
             foreach ($this->tmp_data['pay_stub_entry'] as $user_id => $data_a) {
                 foreach ($data_a as $date_stamp => $data_b) {
                     $quarter_month = TTDate::getYearQuarterMonth($date_stamp);
                     //Debug::Text(' Quarter Month: '. $quarter_month .' Date: '. TTDate::getDate('DATE+TIME', $date_stamp ), __FILE__, __LINE__, __METHOD__,10);
                     if (!isset($this->tmp_data['user_total'][$user_id])) {
                         $this->tmp_data['user_total'][$user_id]['net_payments'] = 0;
                         $this->tmp_data['user_total'][$user_id]['excess_payments'] = 0;
                     }
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['total_payments'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['total_payments']['include_pay_stub_entry_account'], $form_data['total_payments']['exclude_pay_stub_entry_account']);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['exempt_payments'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['exempt_payments']['include_pay_stub_entry_account'], $form_data['exempt_payments']['exclude_pay_stub_entry_account']);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['net_payments'] = bcsub($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['total_payments'], $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['exempt_payments']);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['excess_payments'] = $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['adjustment_tax'] = 0;
                     //Need to total up payments for each employee so we know when we exceed the limit.
                     $this->tmp_data['user_total'][$user_id]['net_payments'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['net_payments'];
                     if ($this->tmp_data['user_total'][$user_id]['excess_payments'] == 0) {
                         if ($this->tmp_data['user_total'][$user_id]['net_payments'] > $payments_over_cutoff) {
                             Debug::Text(' First time over cutoff for User: ' . $user_id, __FILE__, __LINE__, __METHOD__, 10);
                             $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['excess_payments'] = $this->tmp_data['user_total'][$user_id]['net_payments'] - $payments_over_cutoff;
                             $this->tmp_data['user_total'][$user_id]['excess_payments'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['excess_payments'];
                         }
                     } else {
                         Debug::Text(' Next time over cutoff for User: ' . $user_id . ' Date Stamp: ' . $date_stamp, __FILE__, __LINE__, __METHOD__, 10);
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['excess_payments'] = bcadd($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['excess_payments'], $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['net_payments']);
                     }
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['taxable_wages'] = bcsub($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['total_payments'], bcadd($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['exempt_payments'], $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['excess_payments']));
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['before_adjustment_tax'] = bcmul($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['taxable_wages'], $before_adjustment_tax_rate);
                     if ($setup_data['line_10'] > 0) {
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['adjustment_tax'] = bcadd($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['adjustment_tax'], $excluded_wage_avg);
                     } else {
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['adjustment_tax'] = bcmul($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['taxable_wages'], $tax_rate);
                     }
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['after_adjustment_tax'] = bcadd($this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['before_adjustment_tax'], $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['adjustment_tax']);
                     //Separate data used for reporting, grouping, sorting, from data specific used for the Form.
                     if (!isset($this->form_data['pay_period'][$quarter_month][$date_stamp])) {
                         $this->form_data['pay_period'][$quarter_month][$date_stamp] = Misc::preSetArrayValues(array(), array('total_payments', 'exempt_payments', 'excess_payments', 'taxable_wages', 'before_adjustment_tax', 'adjustment_tax', 'after_adjustment_tax'), 0);
                     }
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['total_payments'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['total_payments'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['exempt_payments'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['exempt_payments'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['excess_payments'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['excess_payments'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['taxable_wages'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['taxable_wages'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['before_adjustment_tax'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['before_adjustment_tax'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['adjustment_tax'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['adjustment_tax'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['after_adjustment_tax'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['after_adjustment_tax'];
                 }
             }
             //Total all pay periods by quarter
             if (isset($this->form_data['pay_period'])) {
                 foreach ($this->form_data['pay_period'] as $month_id => $pp_data) {
                     $this->form_data['quarter'][$month_id] = Misc::ArrayAssocSum($pp_data, NULL, 8);
                 }
                 //Total all quarters.
                 if (isset($this->form_data['quarter'])) {
                     $this->form_data['total'] = Misc::ArrayAssocSum($this->form_data['quarter'], NULL, 6);
                 }
             }
         }
     }
     $this->user_ids = array_unique($this->user_ids);
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:Form940Report.class.php

示例7: _outputPDFForm


//.........这里部分代码省略.........
     }
     Debug::Text('Form Type: ' . $form_type, __FILE__, __LINE__, __METHOD__, 10);
     $t4a->setType($form_type);
     $t4a->setStatus($setup_data['status_id']);
     $t4a->year = TTDate::getYear($filter_data['start_date']);
     $t4a->payroll_account_number = (isset($setup_data['payroll_account_number']) and $setup_data['payroll_account_number'] != '') ? $setup_data['payroll_account_number'] : $current_company->getBusinessNumber();
     $t4a->company_name = (isset($setup_data['company_name']) and $setup_data['company_name'] != '') ? $setup_data['company_name'] : $current_company->getName();
     $i = 0;
     foreach ($this->form_data as $row) {
         //if ( $i == $last_row ) {
         //	continue;
         //}
         if (!isset($row['user_id'])) {
             Debug::Text('User ID not set!', __FILE__, __LINE__, __METHOD__, 10);
             continue;
         }
         $ulf = TTnew('UserListFactory');
         $ulf->getById((int) $row['user_id']);
         if ($ulf->getRecordCount() == 1) {
             $user_obj = $ulf->getCurrent();
             $ee_data = array('first_name' => $user_obj->getFirstName(), 'middle_name' => $user_obj->getMiddleName(), 'last_name' => $user_obj->getLastName(), 'address1' => $user_obj->getAddress1(), 'address2' => $user_obj->getAddress2(), 'city' => $user_obj->getCity(), 'province' => $user_obj->getProvince(), 'employment_province' => $user_obj->getProvince(), 'postal_code' => $user_obj->getPostalCode(), 'sin' => $user_obj->getSIN(), 'employee_number' => $user_obj->getEmployeeNumber(), 'l16' => $row['pension'], 'l22' => $row['income_tax'], 'l18' => $row['lump_sum_payment'], 'l20' => $row['self_employed_commission'], 'l24' => $row['annuities'], 'l48' => $row['service_fees'], 'other_box_0_code' => NULL, 'other_box_0' => NULL, 'other_box_1_code' => NULL, 'other_box_1' => NULL, 'other_box_2_code' => NULL, 'other_box_2' => NULL, 'other_box_3_code' => NULL, 'other_box_3' => NULL, 'other_box_4_code' => NULL, 'other_box_4' => NULL, 'other_box_5_code' => NULL, 'other_box_5' => NULL);
             if ($row['other_box_0'] > 0 and isset($setup_data['other_box'][0]['box']) and $setup_data['other_box'][0]['box'] != '') {
                 $ee_data['other_box_0_code'] = $setup_data['other_box'][0]['box'];
                 $ee_data['other_box_0'] = $row['other_box_0'];
             }
             if ($row['other_box_1'] > 0 and isset($setup_data['other_box'][1]['box']) and $setup_data['other_box'][1]['box'] != '') {
                 $ee_data['other_box_1_code'] = $setup_data['other_box'][1]['box'];
                 $ee_data['other_box_1'] = $row['other_box_1'];
             }
             if ($row['other_box_2'] > 0 and isset($setup_data['other_box'][2]['box']) and $setup_data['other_box'][2]['box'] != '') {
                 $ee_data['other_box_2_code'] = $setup_data['other_box'][2]['box'];
                 $ee_data['other_box_2'] = $row['other_box_2'];
             }
             if ($row['other_box_3'] > 0 and isset($setup_data['other_box'][3]['box']) and $setup_data['other_box'][3]['box'] != '') {
                 $ee_data['other_box_3_code'] = $setup_data['other_box'][3]['box'];
                 $ee_data['other_box_3'] = $row['other_box_3'];
             }
             if ($row['other_box_4'] > 0 and isset($setup_data['other_box'][4]['box']) and $setup_data['other_box'][4]['box'] != '') {
                 $ee_data['other_box_4_code'] = $setup_data['other_box'][4]['box'];
                 $ee_data['other_box_4'] = $row['other_box_4'];
             }
             $t4a->addRecord($ee_data);
             unset($ee_data);
             $i++;
         }
     }
     $this->getFormObject()->addForm($t4a);
     //Handle T4ASummary
     $t4as = $this->getT4ASumObject();
     $t4as->setStatus($setup_data['status_id']);
     $t4as->year = $t4a->year;
     $t4as->payroll_account_number = $t4a->payroll_account_number;
     $t4as->company_name = $t4a->company_name;
     $t4as->company_address1 = (isset($setup_data['address1']) and $setup_data['address1'] != '') ? $setup_data['address1'] : $current_company->getAddress1();
     $t4as->company_address2 = (isset($setup_data['address2']) and $setup_data['address2'] != '') ? $setup_data['address2'] : $current_company->getAddress2();
     $t4as->company_city = (isset($setup_data['city']) and $setup_data['city'] != '') ? $setup_data['city'] : $current_company->getCity();
     $t4as->company_province = (isset($setup_data['province']) and ($setup_data['province'] != '' and $setup_data['province'] != 0)) ? $setup_data['province'] : $current_company->getProvince();
     $t4as->company_postal_code = (isset($setup_data['postal_code']) and $setup_data['postal_code'] != '') ? $setup_data['postal_code'] : $current_company->getPostalCode();
     $t4as->l76 = $this->getUserObject()->getFullName();
     //Contact name.
     $t4as->l78 = $current_company->getWorkPhone();
     $total_row = Misc::ArrayAssocSum($this->form_data);
     $t4as->l88 = count($this->form_data);
     $t4as->l16 = $total_row['pension'];
     $t4as->l22 = $total_row['income_tax'];
     $t4as->l18 = $total_row['lump_sum_payment'];
     $t4as->l20 = $total_row['self_employed_commission'];
     $t4as->l24 = $total_row['annuities'];
     $t4as->l48 = $total_row['service_fees'];
     if (isset($setup_data['other_box'])) {
         foreach ($setup_data['other_box'] as $key => $other_box_data) {
             //Debug::Text('zFound other box total for T4A Sum: '. $key .' Code: '. $other_box_data['box'], __FILE__, __LINE__, __METHOD__,10);
             if (in_array((int) $other_box_data['box'], array(28, 30, 32, 34, 40, 42))) {
                 //Debug::Text('Found other box total for T4A Sum: '. $key .' Code: '. $other_box_data['box'], __FILE__, __LINE__, __METHOD__,10);
                 $object_var = 'l' . (int) $other_box_data['box'];
                 $t4as->{$object_var} = $total_row['other_box_' . $key];
                 unset($object_var);
             }
         }
     }
     unset($other_box_data, $key);
     $total_other_deductions = Misc::MoneyFormat(Misc::sumMultipleColumns($total_row, array('other_box_0', 'other_box_1', 'other_box_2', 'other_box_3', 'other_box_4')), FALSE);
     $t4as->l101 = $total_other_deductions;
     //$total_deductions = Misc::MoneyFormat( Misc::sumMultipleColumns( $total_row, array('pension','income_tax','lump_sum_payment', 'self_employed_commission', 'annuities','service_fees') ), FALSE );
     //$t4as->l82 = $total_deductions;
     $t4as->l82 = $total_row['income_tax'];
     $this->getFormObject()->addForm($t4as);
     if ($format == 'efile_xml') {
         $output_format = 'XML';
         $file_name = 't4a_efile_' . date('Y_m_d') . '.xml';
         $mime_type = 'applications/octet-stream';
         //Force file to download.
     } else {
         $output_format = 'PDF';
         $file_name = $this->file_name;
         $mime_type = $this->file_mime_type;
     }
     $output = $this->getFormObject()->output($output_format);
     return array('file_name' => $file_name, 'mime_type' => $mime_type, 'data' => $output);
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:T4ASummaryReport.class.php

示例8: foreach

 }
 $x = 0;
 foreach ($data_b as $date_stamp => $data_c) {
     $sub_rows[$x]['date_stamp'] = $date_stamp;
     foreach ($data_c as $column => $total_time) {
         $sub_rows[$x][$column] = $total_time;
     }
     $x++;
 }
 if (isset($sub_rows)) {
     foreach ($sub_rows as $sub_row) {
         $tmp_sub_rows[] = $sub_row;
     }
     $sub_rows = Sort::Multisort($tmp_sub_rows, Misc::trimSortPrefix($filter_data['primary_sort']), Misc::trimSortPrefix($filter_data['secondary_sort']), $filter_data['primary_sort_dir'], $filter_data['secondary_sort_dir']);
     if ($action != 'display_timesheet' and $action != 'display_detailed_timesheet') {
         $total_sub_row = Misc::ArrayAssocSum($sub_rows, NULL, 2);
         $last_sub_row = count($sub_rows);
         $sub_rows[$last_sub_row] = $total_sub_row;
         //$static_columns['epoch'] = 'epoch';
         foreach ($static_columns as $static_column_key => $static_column_val) {
             $sub_rows[$last_sub_row][Misc::trimSortPrefix($static_column_key)] = NULL;
         }
         unset($static_column_key, $static_column_val);
     }
     //Convert units
     $tmp_sub_rows = $sub_rows;
     unset($sub_rows);
     $trimmed_static_columns = array_keys(Misc::trimSortPrefix($static_columns));
     foreach ($tmp_sub_rows as $sub_row) {
         foreach ($sub_row as $column => $column_data) {
             if ($action != 'display_timesheet' and $action != 'display_detailed_timesheet') {
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:31,代码来源:TimesheetDetail.php

示例9: _getData


//.........这里部分代码省略.........
                     $quarter_month = TTDate::getYearQuarterMonthNumber($date_stamp);
                     //Debug::Text('Quarter Month: '. $quarter_month .' Epoch: '. TTDate::getDate('DATE', $date_stamp), __FILE__, __LINE__, __METHOD__,10);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['wages'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['wages']['include_pay_stub_entry_account'], $form_data['wages']['exclude_pay_stub_entry_account']);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['income_tax'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['income_tax']['include_pay_stub_entry_account'], $form_data['income_tax']['exclude_pay_stub_entry_account']);
                     //FIXME: If employees are excluded from Social Security, it will still include total wages
                     //resulting in the 941 form being incorrect in its calculation.
                     //Add Form Setup tab field to select the Social Security tax/deductions?
                     //However there can often be two of them, is just the employee one enough? We could use the employees and include/exclude accounts from that at least then.
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['social_security_wages']['include_pay_stub_entry_account'], $form_data['social_security_wages']['exclude_pay_stub_entry_account']);
                     //Handle social security wage limit.
                     if (!isset($this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'])) {
                         $this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'] = 0;
                     }
                     if ($this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'] < $social_security_wage_limit) {
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['social_security_wages']['include_pay_stub_entry_account'], $form_data['social_security_wages']['exclude_pay_stub_entry_account']);
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_tips'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['social_security_tips']['include_pay_stub_entry_account'], $form_data['social_security_tips']['exclude_pay_stub_entry_account']);
                         if ($this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'] + $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'] + $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_tips'] > $social_security_wage_limit) {
                             $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'] = $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'] - ($this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'] + $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'] + $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_tips'] - $social_security_wage_limit);
                             $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_tips'] = 0;
                             $this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'] = $social_security_wage_limit;
                         } else {
                             $this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'];
                             $this->tmp_data['ytd_pay_stub_entry'][$user_id]['social_security_wages'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_tips'];
                         }
                     } else {
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'] = 0;
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_tips'] = 0;
                     }
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_wages'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['medicare_wages']['include_pay_stub_entry_account'], $form_data['medicare_wages']['exclude_pay_stub_entry_account']);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_additional_wages'] = 0;
                     //Handle medicare additional wage limit, only consider wages earned above the threshold to be "medicare_additional_wages"
                     if (!isset($this->tmp_data['ytd_pay_stub_entry'][$user_id]['medicare_wages'])) {
                         $this->tmp_data['ytd_pay_stub_entry'][$user_id]['medicare_wages'] = 0;
                     }
                     if ($this->tmp_data['ytd_pay_stub_entry'][$user_id]['medicare_wages'] > $medicare_additional_threshold_limit) {
                         $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_additional_wages'] = $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_wages'];
                     } else {
                         if ($this->tmp_data['ytd_pay_stub_entry'][$user_id]['medicare_wages'] + $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_wages'] > $medicare_additional_threshold_limit) {
                             $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_additional_wages'] = $this->tmp_data['ytd_pay_stub_entry'][$user_id]['medicare_wages'] + $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_wages'] - $medicare_additional_threshold_limit;
                         } else {
                             $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_additional_wages'] = 0;
                         }
                     }
                     //Debug::Text('User ID: '. $user_id .' DateStamp: '. $date_stamp .' YTD Medicare Additional Wages: '. $this->tmp_data['ytd_pay_stub_entry'][$user_id]['medicare_wages'] .' This Pay Stub: '. $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_additional_wages'], __FILE__, __LINE__, __METHOD__,10);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['sick_wages'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['sick_wages']['include_pay_stub_entry_account'], $form_data['sick_wages']['exclude_pay_stub_entry_account']);
                     $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['eic'] = Misc::calculateMultipleColumns($data_b['psen_ids'], $form_data['eic']['include_pay_stub_entry_account'], $form_data['eic']['exclude_pay_stub_entry_account']);
                     //Separate data used for reporting, grouping, sorting, from data specific used for the Form.
                     if (!isset($this->form_data['pay_period'][$quarter_month][$date_stamp])) {
                         $this->form_data['pay_period'][$quarter_month][$date_stamp] = Misc::preSetArrayValues(array(), array('l2', 'l3', 'l5a', 'l5b', 'l5c', 'l5d', 'l7', 'l9', 'l5a2', 'l5b2', 'l5c2', 'l5d', 'l8', 'l10'), 0);
                     }
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l2'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['wages'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l3'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['income_tax'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5a'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_wages'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5b'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['social_security_tips'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5c'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_wages'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5d'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['medicare_additional_wages'];
                     //$this->form_data['pay_period'][$quarter_month][$date_stamp]['l9'] += $this->tmp_data['pay_stub_entry'][$user_id][$date_stamp]['eic'];
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5f'] = 0;
                     //Not implemented currently.
                     //Calculated fields, make sure we don't use += on these.
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5a2'] = bcmul($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5a'], $this->getF941Object()->social_security_rate);
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5b2'] = bcmul($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5b'], $this->getF941Object()->social_security_rate);
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5c2'] = bcmul($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5c'], $this->getF941Object()->medicare_rate);
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5d2'] = bcmul($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5d'], $this->getF941Object()->medicare_additional_rate);
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5e'] = bcadd($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5a2'], bcadd($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5b2'], bcadd($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5c2'], $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5d2'])));
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l6'] = bcadd($this->form_data['pay_period'][$quarter_month][$date_stamp]['l3'], bcadd($this->form_data['pay_period'][$quarter_month][$date_stamp]['l5e'], $this->form_data['pay_period'][$quarter_month][$date_stamp]['l5f']));
                     //Calculate amounts for Schedule B.
                     $this->form_data['pay_period'][$quarter_month][$date_stamp]['l10'] = $this->form_data['pay_period'][$quarter_month][$date_stamp]['l6'];
                     //Add L6 -> L9 if they are implemented later.
                 }
             }
             //Total all pay periods by month_id
             if (isset($this->form_data['pay_period'])) {
                 foreach ($this->form_data['pay_period'] as $month_id => $pp_data) {
                     $this->form_data['quarter'][$month_id] = Misc::ArrayAssocSum($pp_data, NULL, 8);
                 }
                 //Total all quarters.
                 if (isset($this->form_data['quarter'])) {
                     $this->form_data['total'] = Misc::ArrayAssocSum($this->form_data['quarter'], NULL, 6);
                 }
             }
         }
     }
     $this->user_ids = array_unique($this->user_ids);
     //Used to get the total number of employees.
     //Debug::Arr($this->user_ids, 'User IDs: ', __FILE__, __LINE__, __METHOD__,10);
     Debug::Arr($this->form_data, 'Form Raw Data: ', __FILE__, __LINE__, __METHOD__, 10);
     //Debug::Arr($this->tmp_data, 'Tmp Raw Data: ', __FILE__, __LINE__, __METHOD__,10);
     //Get user data for joining.
     $ulf = TTnew('UserListFactory');
     $ulf->getAPISearchByCompanyIdAndArrayCriteria($this->getUserObject()->getCompany(), $filter_data);
     Debug::Text(' User Total Rows: ' . $ulf->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10);
     $this->getProgressBarObject()->start($this->getAMFMessageID(), $ulf->getRecordCount(), NULL, TTi18n::getText('Retrieving Data...'));
     foreach ($ulf as $key => $u_obj) {
         $this->tmp_data['user'][$u_obj->getId()] = (array) $u_obj->getObjectAsArray($this->getColumnDataConfig());
         $this->getProgressBarObject()->set($this->getAMFMessageID(), $key);
     }
     //Debug::Arr($this->tmp_data['user'], 'User Raw Data: ', __FILE__, __LINE__, __METHOD__,10);
     return TRUE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:Form941Report.class.php

示例10: array

     Debug::text(' User Name: ' . $user_obj->getFullName(), __FILE__, __LINE__, __METHOD__, 10);
     $user_percent = $user_total_time_obj->getColumn('branch_total_time') / $totals['users'][$user_total_time_obj->getColumn('user_id')];
     if (isset($pay_stub_rows[$user_total_time_obj->getColumn('user_id')])) {
         $user_gross_pay = $pay_stub_rows[$user_total_time_obj->getColumn('user_id')]['entries']['gross_pay'] * $user_percent;
     } else {
         $user_gross_pay = 0;
     }
     $user_entries[$user_total_time_obj->getColumn('branch_id')][] = array('user_id' => $user_total_time_obj->getColumn('user_id'), 'branch_id' => $user_total_time_obj->getColumn('branch_id'), 'full_name' => $user_obj->getFullName(), 'total_time' => $user_total_time_obj->getColumn('branch_total_time'), 'percent' => $user_percent, 'percent_display' => round($user_percent * 100, 2), 'gross_pay' => number_format($user_gross_pay, 2, '.', ''));
     unset($user_percent, $user_gross_pay);
 }
 if (isset($branch_ids)) {
     foreach ($branch_ids as $branch_id) {
         Debug::text(' Branch Done! Branch ID: ' . $branch_id, __FILE__, __LINE__, __METHOD__, 10);
         $branch_obj = $blf->getById($branch_id)->getCurrent();
         $branch_percent = $totals['branches'][$branch_id] / $totals['branches']['total'];
         $user_totals = Misc::ArrayAssocSum($user_entries[$branch_id], NULL, 2);
         $user_entries[$branch_id][] = array('full_name' => 'Total', 'total_time' => $totals['branches'][$branch_id], 'percent' => $branch_percent * 100, 'percent_display' => round($branch_percent * 100, 2), 'gross_pay' => number_format($user_totals['gross_pay'], 2, '.', ''));
         $rows[] = array('id' => $branch_id, 'name' => $branch_obj->getName(), 'percent' => $branch_percent, 'percent_display' => round($branch_percent * 100, 2), 'users' => $user_entries[$branch_id]);
         unset($branch_obj, $branch_percent, $user_totals);
     }
 }
 unset($branch_ids);
 //var_dump($rows);
 /*
 		if ( isset($tmp_rows) ) {
 			foreach($tmp_rows as $row) {
 				$rows[] = $row;
 			}
 			$rows = Sort::Multisort($rows, 'last_name');
 			//var_dump($rows);
 
开发者ID:alachaum,项目名称:timetrex,代码行数:30,代码来源:UserBranchSummary.php


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