ÿØÿà JFIF ` ` ÿþ
Server : Apache System : Linux ruga7-004.fmcity.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : tkt_travelbus ( 1137) PHP Version : 7.0.0p1 Disable Function : mysql_pconnect Directory : /tkt_travelbus/www/admin/cal/ |
Upload File : |
<? function year_cal_master($period_yy){ for($m = 1; $m <=12; $m++){ $period_mm = sprintf("%02d",$m);; $period_start = $period_yy."-".$period_mm; $data_a = array(); // 에약 데이터 로드 $data_res = TO_get_reserv_data($period_start); foreach($data_res as $k => $row){ $data_a['total_tour'] += 1; $data_a['total_inwon'] += $row['person']; $data_a['total_sell_price'] += $row['sales_total'] + $row['agent_total']; $data_a['total_buy_price'] += $row['buy_total']; } // 인건비 정산 내역 $data_p = db_fetch("select SUM(cal_basic_pay) as total_basic, SUM(cal_incentive_price) as total_incentive, SUM(cal_km_price+cal_gg_price+cal_gy_price+cal_sj_price+cal_jg_price) as total_insu from TB_CAL_PERSONNEL where cal_year = '{$period_yy}' and cal_month = '{$period_mm}' ORDER BY cal_pseq ASC"); // 운영비 내역 $operate_mp = $operate_sp = $operate_surtax = $operate_income = 0; $sql = "select * from TB_CAL_OPERATE where cal_year = '{$period_yy}' and cal_month = '{$period_mm}'"; $rs = db_query($sql); for($i=0 ; $row = db_fetch_array($rs) ; $i++) { switch($row['cal_item_type']){ case "SP"; // 퇴직금 $operate_sp += $row['cal_item_price']; break; case "MP"; // 운영비 $operate_mp += $row['cal_item_price']; break; case "SUR"; // 부가세 $operate_surtax = $row['cal_item_price']; break; case "GEIN"; // 소득세 $operate_income = $row['cal_item_price']; break; } } // 회사 수익 계산 $total_profit = $data_a['total_sell_price'] - $data_a['total_buy_price']; // 매출 - 매입 $total_profit -= $data_p['total_basic'] + $data_p['total_incentive']; // 기본급+성과급 $total_profit -= $data_p['total_insu']; // 4대보험 $total_profit -= $operate_sp + $operate_mp + $operate_surtax + $operate_income; // 월간통계 $data_month[$period_mm] = array( 'year' => $period_yy, 'month' => $period_mm, 'total_tour' => $data_a['total_tour'], 'total_inwon' => $data_a['total_inwon'], 'total_sell_price' => $data_a['total_sell_price'], 'total_buy_price' => $data_a['total_buy_price'], 'total_basic' => $data_p['total_basic'], 'total_incentive' => $data_p['total_incentive'], 'total_insu' => $data_p['total_insu'], 'operate_sp' => $operate_sp, 'operate_mp' => $operate_mp, 'operate_surtax' => $operate_surtax, 'operate_income' => $operate_income, 'total_profit' => $total_profit ); } return $data_month; } ?>