Task #1749: Cases «Débit» dans les OD's
fait remarquer si débit ou crédit
This commit is contained in:
parent
cafeec15f5
commit
15be1c4e64
3 changed files with 31 additions and 5 deletions
|
|
@ -87,6 +87,26 @@ function activate_checkbox_range(p_range_name) {
|
|||
checkbox_set_range(event, elt, p_range_name);
|
||||
},false));
|
||||
}
|
||||
;
|
||||
|
||||
/**
|
||||
* Checkbox for Debit - Credit , from Misc Operation
|
||||
*/
|
||||
function activate_checkbox_side()
|
||||
{
|
||||
var aCheckBox=$$('.debit-credit')
|
||||
aCheckBox.forEach((item)=>item.addEventListener('click',function (event) {display_dcside(item)}))
|
||||
aCheckBox.forEach((item)=>display_dcside(item))
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the SPAN , id based on checkbox id (txtck0), if checked , display Debit otherwise Credit
|
||||
* @param item
|
||||
*/
|
||||
function display_dcside(item)
|
||||
{
|
||||
if (item.checked == true) {
|
||||
$('txt'+item.id).update("Débit")
|
||||
} else {
|
||||
$('txt'+item.id).update("Crédit")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -995,7 +995,7 @@ class Acc_Ledger extends jrn_def_sql
|
|||
'<th style="text-align:left">'._('Poste').$info_poste.'</th>'.
|
||||
'<th class="visible_gt800 visible_gt1155" style="text-align:left">'._('Libellé').'</th>'.
|
||||
'<th style="text-align:left">'._('Montant').'</th>'.
|
||||
'<th style="text-align:left">'._('Débit').'</th>'.
|
||||
'<th style="text-align:left">'._('Côté').'</th>'.
|
||||
'</tr>';
|
||||
|
||||
|
||||
|
|
@ -1065,13 +1065,13 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$amount->value=(isset(${'amount'.$i}))?${"amount".$i}:''
|
||||
;
|
||||
$amount->readonly=$p_readonly;
|
||||
$amount->javascript=' onChange="format_number(this);checkTotalDirect()"';
|
||||
$amount->javascript='onChange="format_number(this);checkTotalDirect()"';
|
||||
// D/C
|
||||
$deb=new ICheckBox();
|
||||
$deb->name='ck'.$i;
|
||||
$deb->selected=(isset(${'ck'.$i}))?true:false;
|
||||
$deb->readonly=$p_readonly;
|
||||
$deb->javascript=' onChange="checkTotalDirect()"';
|
||||
$deb->javascript='class="debit-credit" onChange="checkTotalDirect()"';
|
||||
$str_add_button=($add_card==true)?$this->add_card("-1",
|
||||
$quick_code->id):"";
|
||||
$ret.='<tr>';
|
||||
|
|
@ -1085,7 +1085,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
'</td>';
|
||||
$ret.='<td class="visible_gt800 visible_gt1155">'.$line_desc->input().'</td>';
|
||||
$ret.='<td>'.$amount->input().'</td>';
|
||||
$ret.='<td>'.$deb->input().'</td>';
|
||||
$ret.='<td>'.$deb->input()
|
||||
.'<span id="txt'.$deb->id.'"></span>'
|
||||
.'</td>';
|
||||
$ret.='</tr>';
|
||||
// If readonly == 1 then show CA
|
||||
}
|
||||
|
|
@ -1099,6 +1101,9 @@ class Acc_Ledger extends jrn_def_sql
|
|||
$ret.=sprintf(_("Réconciliation/rapprochements : %s"), $w->input());
|
||||
}
|
||||
$ret.=create_script("$('".$wDate->id."').focus()");
|
||||
// for displaying Credit or Debit
|
||||
$ret.=create_script("activate_checkbox_side()");
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
* \brief to write into the ledgers ODS a new operation
|
||||
*/
|
||||
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
|
||||
\Noalyss\Dbg::echo_file(__FILE__);
|
||||
|
||||
|
||||
global $g_user,$g_parameter,$http;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue