X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep705.php;h=ad10656cdc0f5f142359a2c5ad67a539e76fba34;hb=31966256a900343308ce287a246fe3a52e9a613c;hp=0d2c370fa833cf49b8ac127ee48a12e496c9d49c;hpb=42e7c789b5c755130859f7e487d7c3057fadfcdf;p=fa-stable.git diff --git a/reporting/rep705.php b/reporting/rep705.php index 0d2c370f..ad10656c 100644 --- a/reporting/rep705.php +++ b/reporting/rep705.php @@ -29,10 +29,10 @@ print_annual_expense_breakdown(); //---------------------------------------------------------------------------------------------------- -function getPeriods($year, $account, $dimension, $dimension2) +function getPeriods($row, $account, $dimension, $dimension2) { - $yr = $year; - $mo = 12; + $yr = $row['yr']; + $mo = $row['mo']; $date13 = date('Y-m-d',mktime(0,0,0,$mo+1,1,$yr)); $date12 = date('Y-m-d',mktime(0,0,0,$mo,1,$yr)); $date11 = date('Y-m-d',mktime(0,0,0,$mo-1,1,$yr)); @@ -115,8 +115,13 @@ function print_annual_expense_breakdown() //$yr = date('Y'); //$mo = date('m'): // from now - $yr = $year; - $mo = 12; + $sql = "SELECT begin, end, YEAR(end) AS yr, MONTH(end) AS mo FROM ".TB_PREF."fiscal_year WHERE id=".db_escape($year); + $result = db_query($sql, "could not get fiscal year"); + $row = db_fetch($result); + + $year = sql2date($row['begin'])." - ".sql2date($row['end']); + $yr = $row['yr']; + $mo = $row['mo']; $da = 1; if ($date_system == 1) list($yr, $mo, $da) = jalali_to_gregorian($yr, $mo, $da); @@ -211,7 +216,7 @@ function print_annual_expense_breakdown() if ($account['account_code'] != null) { - $bal = getPeriods($year, $account["account_code"], $dimension, $dimension2); + $bal = getPeriods($row, $account["account_code"], $dimension, $dimension2); if (!$bal['per01'] && !$bal['per02'] && !$bal['per03'] && !$bal['per04'] && !$bal['per05'] && !$bal['per06'] && !$bal['per07'] && !$bal['per08'] && !$bal['per09'] && !$bal['per10'] && !$bal['per11'] && !$bal['per12'])