Add check in javascript for Direct writing
This commit is contained in:
parent
fccc27bba6
commit
ef617907bf
4 changed files with 16 additions and 2 deletions
|
|
@ -894,12 +894,13 @@ class Acc_Ledger {
|
|||
$amount->name='amount'.$i;
|
||||
$amount->value=(isset(${'amount'.$i}))?${"amount".$i}:'';
|
||||
$amount->readonly=$p_readonly;
|
||||
|
||||
$amount->javascript=' onChange="checkTotalDirect()"';
|
||||
// D/C
|
||||
$deb=new widget('checkbox');
|
||||
$deb->name='ck'.$i;
|
||||
$deb->selected=(isset(${'ck'.$i}))?true:false;
|
||||
$deb->readonly=$p_readonly;
|
||||
$deb->javascript=' onChange="checkTotalDirect()"';
|
||||
|
||||
$ret.='<tr>';
|
||||
$ret.='<td>'.$quick_code->IOValue().'</td>';
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class widget {
|
|||
$check=( $this->selected==true )?"checked":"unchecked";
|
||||
$r='<input type="CHECKBOX" name="'.$this->name.'"';
|
||||
$r.=" $check";
|
||||
$r.=' '.$disabled.'>';
|
||||
$r.=' '.$disabled." ".$this->javascript.'>';
|
||||
}
|
||||
if ($this->table==1) {
|
||||
$r="<TD> $this->label </TD><TD> $r </TD>";
|
||||
|
|
|
|||
|
|
@ -174,6 +174,11 @@ define ('JS_CALENDAR','
|
|||
<script type="text/javascript" language="javascript" src="js/jrn_concerned.js">
|
||||
</script>');
|
||||
|
||||
define ('JS_COMPUTE_DIRECT','
|
||||
<script type="text/javascript" language="javascript" src="js/compute_direct.js">
|
||||
</script>');
|
||||
|
||||
|
||||
// One line calculator
|
||||
define ("JS_CALC_LINE",'
|
||||
<div style="border:outset black 3px; position:float; float:right;background-color:white;font-family:sans-serif;font-size:9pt;">
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ $id=(isset ($_REQUEST['p_jrn']))?$_REQUEST['p_jrn']:-1;
|
|||
|
||||
function show_direct_form($cn,$ledger,$p_array) {
|
||||
$id=(isset ($_REQUEST['p_jrn']))?$_REQUEST['p_jrn']:-1;
|
||||
echo JS_COMPUTE_DIRECT;
|
||||
|
||||
// Show the predef operation
|
||||
// Don't forget the p_jrn
|
||||
|
|
@ -57,9 +58,16 @@ function show_direct_form($cn,$ledger,$p_array) {
|
|||
echo $ledger->show_form($p_array);
|
||||
|
||||
echo widget::submit_button('summary','Sauvez');
|
||||
echo '<div class="info">
|
||||
Débit = <span id="totalDeb"></span>
|
||||
Crédit = <span id="totalCred"></span>
|
||||
Difference = <span id="totalDiff"></span>
|
||||
</div>
|
||||
';
|
||||
|
||||
|
||||
echo '</form>';
|
||||
echo "<div>".JS_CALC_LINE."</div>";
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue