$gycode = $acctWork->param["gycode"];
 $gycode_calc = false;
 if ((int) ($gycode / 100) == 1 or (int) ($gycode / 100) == 4) {
     $gycode_calc = true;
 }
 $yyyy = (int) substr($acctWork->param["from_yyyymmdd"], 0, 4);
 $tmp_sum = 0;
 $month_credit_sum = 0;
 $month_debit_sum = 0;
 $month_credit_total_sum = 0;
 $month_debit_total_sum = 0;
 $data = array();
 $month = 0;
 $tmp_month = 0;
 if (count($acctWork->result) > 0) {
     while ($item = $acctWork->fetchMapRow()) {
         $jp_yyyymmdd = (int) $item['jp_yyyymmdd'];
         $jp_rem = $item['jp_rem'];
         $customer_id = $item['customer_id'];
         $debit = $item['debit'];
         $credit = $item['credit'];
         $jp_id = $item['jp_id'];
         $jp_no = $item['jp_no'];
         $jp_match_id = $item['jp_match_id'];
         //전월 이월
         if ($jp_yyyymmdd == -1) {
             $item['type'] = 1;
             $item['jp_yyyymmdd'] = '';
             if ($gycode_calc) {
                 $tmp_sum = $tmp_sum + $debit - $credit;
             } else {
Beispiel #2
0
<?php

require_once "../../../class/Utils.php";
require_once "../../../class/DBWork.php";
require_once "../../../acct_class/DBAcctReportWork.php";
$acctWork = new DBAcctReportWork(true);
try {
    $acctWork->createWork($_POST, true);
    $col_array = $acctWork->requestProfitReport();
    $item = $acctWork->fetchMapRow();
    $sum_array = array();
    $result = array();
    if (count($acctWork->result) > 0) {
        while (true) {
            $gycode = (int) $item['gycode'];
            //계산
            $calc = $gycode > 399;
            $group = (int) ($gycode / 100);
            $item['group'] = $group;
            $sum = 0;
            $checksum = 0;
            for ($idx = 0; $idx < count($col_array); $idx = $idx + 3) {
                $col1 = $col_array[$idx];
                $col2 = $col_array[$idx + 1];
                $col3 = $col_array[$idx + 2];
                $Cvalue = $item[$col1];
                $Dvalue = $item[$col2];
                $key = $col3;
                $checksum = $checksum + $Cvalue + $Dvalue;
                if (!$calc) {
                    $Cvalue = $Cvalue - $Dvalue;