Пример #1
0
 /**
  * @covers Acc_Balance::filter_cat
  * @todo   Implement testFilter_cat().
  */
 public function testFilter_cat()
 {
     $this->object->jrn = 1;
     $this->object->filter_cat(array());
     $this->assertEquals($this->object->jrn, null);
     $this->object->filter_cat(array('FIN'));
     $this->assertEquals($this->object->jrn[0], 2);
 }
Пример #2
0
// Display result
//-----------------------------------------------------
if (isset($_GET['view'])) {
    $bal = new Acc_Balance($cn);
    if ($_GET['p_filter'] == 1) {
        for ($e = 0; $e < count($selected); $e++) {
            if (isset($selected[$e]) && in_array($selected[$e], $array)) {
                $bal->jrn[] = $selected[$e];
            }
        }
    }
    if ($_GET['p_filter'] == 0) {
        $bal->jrn = null;
    }
    if ($_GET['p_filter'] == 2 && isset($_GET['r_cat'])) {
        $bal->filter_cat($_GET['r_cat']);
    }
    $bal->from_poste = $_GET['from_poste'];
    $bal->to_poste = $_GET['to_poste'];
    if (isset($_GET['unsold'])) {
        $bal->unsold = true;
    }
    $previous = isset($_GET['previous_exc']) ? 1 : 0;
    $row = $bal->get_row($_GET['from_periode'], $_GET['to_periode'], $previous);
    $previous = isset($row[0]['sum_cred_previous']) ? 1 : 0;
    $periode = new Periode($cn);
    $a = $periode->get_date_limit($_GET['from_periode']);
    $b = $periode->get_date_limit($_GET['to_periode']);
    echo "<h2 class=\"info\"> période du " . $a['p_start'] . " au " . $b['p_end'] . "</h2>";
    echo '<span style="display:block">';
    echo _('Filtre') . HtmlInput::infobulle(24);