Example #1
0
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
$title = eval($node->widgetConfig->summaryView->templateTitleEval);
$month = '';
$year = 'FY' . _getYearValueFromID(_getRequestParamValue('year'));
$monthDetails = CheckbookDateUtil::getMonthDetails(_getRequestParamValue('month'));
$amount = custom_number_formatter_format(_getRequestParamValue('amt'), 2);
if (isset($monthDetails)) {
    $month = strtoupper($monthDetails[0]['month_name']);
}
$summaryContent = <<<EOD
<div class="contract-details-heading">
\t<div class="contract-id">
\t\t<h2 class="contract-title">{$title}</h2>
\t\t<div class="spending-tx-subtitle"><b>Year</b>: {$year}<br><b>Month</b>: {$month}</div>
\t</div>
\t<div class="dollar-amounts"><div class="total-spending-amount">{$amount}<div class="amount-title">Total Spending Amount</div></div></div>
</div>
EOD;
print $summaryContent;
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$results = $node->data[0];
if ($results) {
    $total_annual_salary = custom_number_formatter_format($results['total_annual_salary'], 2, '$');
    $total_gross_pay = custom_number_formatter_format($results['total_gross_pay'], 2, '$');
    $total_base_pay = custom_number_formatter_format($results['total_base_pay'], 2, '$');
    $total_other_payments = custom_number_formatter_format($results['total_other_payments'], 2, '$');
    $total_overtime_pay = custom_number_formatter_format($results['total_overtime_pay'], 2, '$');
    $total_salaried_employees = number_format($results['total_salaried_employees@checkbook:payroll_year_month']);
    $total_hourly_employees = number_format($results['total_hourly_employees@checkbook:payroll_year_month']);
    $total_employees = number_format($results['total_employees@checkbook:payroll_year_month']);
    $year = $results['year_year'];
    $month = $results['month_month'];
    $yearType = $results['year_type_year_type'];
    $year_value = _getYearValueFromID($year);
    $month_num = _getMonthValueFromId($month);
    if (isset($month_num)) {
        $dateObj = DateTime::createFromFormat('!m', $month_num);
        $month_value = $dateObj->format('F');
    }
    $yeartype = 'FY';
    if (_getRequestParamValue('yeartype') == 'C') {
        $yeartype = 'CY';
    }
    if (_getRequestParamValue('smnid') == 491) {
        $total_overtime_employees_label = WidgetUtil::getLabel('total_no_of_ot_employees') . ':';
        $overtime_employees_value = number_format($results['total_overtime_employees']);
    }
    $table = "\r\n<div id='payroll-tx-static-content'>\r\n<div class='payroll-year-month'><span class='label'>" . WidgetUtil::getLabel('month') . ": </span><span class='data'> {$month_value} </span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class='label'>" . WidgetUtil::getLabel('year') . ":</span><span class='data'> {$yeartype} {$year_value}</span></div>\r\n    <table id='payroll-tx-static-content-table'>\r\n        <tr>\r\n            <td width='50%'><strong>" . WidgetUtil::getLabel('annual_salary') . "</strong>: {$total_annual_salary}</td>\r\n            <td width='50%'><strong>" . WidgetUtil::getLabel('total_no_of_employees') . "</strong>: {$total_employees}</td>\r\n        </tr>\r\n        <tr>\r\n            <td><strong>" . WidgetUtil::getLabel('gross_pay') . "</strong>: {$total_gross_pay}</td>\r\n            <td><strong>" . WidgetUtil::getLabel('total_no_of_sal_employees') . "</strong>: {$total_salaried_employees}</td>\r\n        </tr>\r\n        <tr>\r\n            <td><strong>" . WidgetUtil::getLabel('base_pay') . "</strong>:{$total_base_pay}</td>\r\n            <td><strong>" . WidgetUtil::getLabel('total_no_of_non_sal_employees') . "</strong>: {$total_hourly_employees}</td>\r\n        </tr>\r\n        <tr>\r\n            <td><strong>" . WidgetUtil::getLabel('other_pay') . "</strong>: {$total_other_payments}</td>\r\n            <td><strong>" . WidgetUtil::getLabel('overtime_pay') . "</strong>: {$total_overtime_pay}</td>\r\n        </tr>";
    if (isset($overtime_employees_value)) {
Example #3
0
         // Dates are in different fiscal year
         if ($start_fy != $end_fy) {
             if ($start_cy_year == $end_cy_year) {
                 $year_id_value = $start_fy > 0 ? $start_fy : $end_fy;
                 $q = preg_replace("/\\/chkdate\\/[^\\/]*/", "", $q);
                 $year_type_value = 'C';
                 $cal_year_id_value = $year_id_value;
                 $q = $q . "/yeartype/C/year/";
                 $calYearSet = true;
             } else {
                 $display = false;
             }
         } else {
             $year_id_value = $start_fy > 0 ? $start_fy : $end_fy;
             $q = preg_replace("/\\/chkdate\\/[^\\/]*/", "", $q);
             if (_getYearValueFromID($year_id_value) == 2010) {
                 $year_type_value = 'C';
                 $cal_year_id_value = $year_id_value;
                 $q = $q . "/yeartype/C/year/";
                 $calYearSet = true;
             } else {
                 $year_type_value = 'B';
                 $q = $q . "/yeartype/B/year/";
             }
         }
     } else {
         $display = false;
     }
 } else {
     if (!preg_match('/yeartype/', $_GET['q'])) {
         $display = false;
Example #4
0
 static function generateLabelMappingNoDiv($labelAlias, $labelOnly = false)
 {
     $dynamic_labelAlias = array("current_modified", "previous_modified", "previous_1_modified", "previous_2_modified", "recognized_current", "recognized_1", "recognized_2", "recognized_3");
     if (in_array($labelAlias, $dynamic_labelAlias)) {
         $year = _getYearValueFromID(_getRequestParamValue('year'));
         $dynamic_labels = array("current_modified" => "Modified<br/>" . $year, "previous_modified" => "Modified<br/>" . ($year - 1), "previous_1_modified" => "Modified<br/>" . ($year - 2), "previous_2_modified" => "Modified<br/>" . ($year - 3), "recognized_current" => "Recognized<br/>" . $year, "recognized_1" => "Recognized<br/>" . ($year + 1), "recognized_2" => "Recognized<br/>" . ($year + 2), "recognized_3" => "Recognized<br/>" . ($year + 3));
         $label = $dynamic_labels[$labelAlias];
     } else {
         $label = NULL;
         if ($labelOnly) {
             $label = self::getLabel($labelAlias);
         } else {
             $label = self::$labels[$labelAlias];
         }
     }
     return $label;
 }
* 
* Copyright (C) 2012, 2013 New York City
* 
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Affero General Public License for more details.
* 
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$year1 = _getYearValueFromID(_getRequestParamValue('year'));
$year2 = _getYearValueFromID(_getRequestParamValue('year') + 1);
$year3 = _getYearValueFromID(_getRequestParamValue('year') + 2);
$total_revenue_recognized_yr1 = custom_number_formatter_format($node->data[0]['current_recognized'], 2, '$');
$total_revenue_recognized_yr2 = custom_number_formatter_format($node->data[0]['recognized_1'], 2, '$');
$total_revenue_recognized_yr3 = custom_number_formatter_format($node->data[0]['recognized_2'], 2, '$');
$total_others = custom_number_formatter_format($node->data[0]['other_years'], 2, '$');
$total_remaining_budget = custom_number_formatter_format($node->data[0]['remaining_amount'], 2, '$');
print '<div class="dollar-amounts">';
print '<div class="total-spending-amount">' . $total_revenue_recognized_yr3 . "<div class='amount-title'>Total Revenue Recognized " . $year3 . "</div>" . '</div>';
print '<div class="total-spending-amount">' . $total_revenue_recognized_yr2 . "<div class='amount-title'>Total Revenue Recognized " . $year2 . "</div>" . '</div>';
print '<div class="total-spending-amount">' . $total_revenue_recognized_yr1 . "<div class='amount-title'>Total Revenue Recognized " . $year1 . "</div>" . '</div>';
print '<div class="total-spending-amount">' . $total_others . "<div class='amount-title'>Total Others</div>" . '</div>';
print '<div class="total-spending-amount">' . $total_remaining_budget . "<div class='amount-title'>Total Remaining<br />Budget</div>" . '</div>';
print '</div>';
Example #6
0
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
$title = eval($node->widgetConfig->summaryView->templateTitleEval);
$month = '';
$yearType = _getRequestParamValue('yeartype');
$year = _getRequestParamValue('calyear');
$yearLabel = $yearType == 'C' ? 'CY' : 'FY';
$year = isset($year) ? _getYearValueFromID(_getRequestParamValue('calyear')) : _getYearValueFromID(_getRequestParamValue('year'));
$year = $yearLabel . $year;
$amount = _checkbook_project_pre_process_aggregation($node, 'check_amount_sum');
$amount = custom_number_formatter_format($amount, 2, '$');
$catname = RequestUtil::getSpendingTransactionTitle();
$monthDetails = CheckbookDateUtil::getMonthDetails(_getRequestParamValue('month'));
if (isset($monthDetails)) {
    $month = strtoupper($monthDetails[0]['month_name']);
}
$summaryContent = <<<EOD
<div class="contract-details-heading">
\t<div class="contract-id">
\t\t<h2 class="contract-title">{$title}</h2>
\t\t<div class="spending-tx-subtitle"><b>Year</b>: {$year}<br><b>Month</b>: {$month}</div>
\t</div>
\t<div class="dollar-amounts"><div class="total-spending-amount">{$amount}<div class="amount-title">{$catname} Amount</div></div></div>
Example #7
0
* Copyright (C) 2012, 2013 New York City
* 
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Affero General Public License for more details.
* 
* You should have received a copy of the GNU Affero General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
$output = '';
$urlPath = drupal_get_path_alias($_GET['q']);
$pathParams = explode('/', $urlPath);
$yrIndex = array_search("year", $pathParams);
$revcatIndex = array_search("revcat", $pathParams);
$fundsrcIndex = array_search("fundsrccode", $pathParams);
$agencyIndex = array_search("agency", $pathParams);
if (!$revcatIndex && !$fundsrcIndex && !$agencyIndex) {
    $output .= '<h2>' . _getYearValueFromID($pathParams[$yrIndex + 1]) . ' NYC Revenue</h2>';
}
foreach ($node->data as $key => $value) {
    $output .= '<div class="field-label">Adopted</div><div class="field-items">' . custom_number_formatter_format($value['adopted_budget'], 2, '$') . '</div>';
    $output .= '<div class="field-label">Modified</div><div class="field-items">' . custom_number_formatter_format($value['current_modified_budget'], 2, '$') . '</div>';
    $output .= '<div class="field-label">Revenue Collected</div><div class="field-items">' . custom_number_formatter_format($value['revenue_amount_sum'], 2, '$') . '</div>';
}
print $output;