Example #1
0
echo $style->input();
?>
		    </td>
		</tr>

		<?php 
if ($inside_dossier) {
    $l_user_per = $g_user->get_periode();
    if ($l_user_per == "") {
        $l_user_per = $cn->get_value("select min(p_id) from parm_periode where p_closed='f'");
    }
    // if periode is closed then warns the users
    $period = new Periode($cn, $l_user_per);
    $period->p_id = $l_user_per;
    $period->jrn_def_id = 0;
    if ($period->is_closed($l_user_per) == 1) {
        $msg = _('Attention cette période est fermée, vous ne pourrez rien modifier dans le module comptable');
        $msg = '<h2 class="notice">' . $msg . '</h2>';
    }
    $period = new IPeriod("period");
    $period->user = $g_user;
    $period->cn = $cn;
    $period->filter_year = false;
    $period->value = $l_user_per;
    $period->type = ALL;
    $l_form_per = $period->input();
    ?>
    		<tr><td><?php 
    echo _('Période');
    ?>
</td>
    echo HtmlInput::hidden('p_jrn', $oLedger->id);
}
?>

<?php 
/**
 * if you can write
 */
if ($access == 'W') {
    echo HtmlInput::submit('save', _('Sauver'), 'onClick="return verify_ca(\'popup\');"');
    $owner = new Own($cn);
    if ($owner->MY_ANALYTIC != 'nu') {
        echo '<input type="button" class="smallbutton" value="' . _('verifie CA') . '" onClick="verify_ca(\'' . $div . '\');">';
    }
    $per = new Periode($cn, $obj->det->jr_tech_per);
    if ($per->is_closed() == 0 && $owner->MY_STRICT == 'N' && $g_user->check_action(RMOPER) == 1) {
        $remove = new IButton('Effacer');
        $remove->label = _('Effacer');
        $remove->javascript = "return confirm_box(null,'Vous confirmez effacement ?',function () {removeOperation('" . $obj->det->jr_id . "'," . dossier::id() . ",'" . $div . "')})";
        echo $remove->input();
    }
    $reverse = new IButton('bext' . $div);
    $reverse->label = _('Extourner');
    $reverse->javascript = "g('ext" . $div . "').style.display='block'";
    echo $reverse->input();
    echo '</p>';
    echo '</form>';
    echo '<div id="ext' . $div . '" class="inner_box" style="position:relative;top:-150px;display:none">';
    $date = new IDate('ext_date');
    $r = "<form id=\"form_" . $div . "\" onsubmit=\"return false;\">";
    $r .= HtmlInput::hidden('jr_id', $_REQUEST['jr_id']) . HtmlInput::hidden('div', $div) . dossier::hidden() . HtmlInput::hidden('act', 'reverseop');
Example #3
0
 /**
  * @brief
  * check if the current ledger is closed
  * \return 1 for yes, otherwise 0
  * \see Periode::is_closed
  */
 function is_closed($p_periode)
 {
     $per = new Periode($this->db);
     $per->set_jrn($this->id);
     $per->set_periode($p_periode);
     $ret = $per->is_closed();
     return $ret;
 }