det->currency_id != 0 ) {
echo th(_("Devise"),' class="num" ');
}
if ($owner->MY_ANALYTIC != 'nu' /* && $div == 'popup' */ ){
$anc=new Anc_Plan($cn);
$a_anc=$anc->get_list(' order by pa_id ');
$x=count($a_anc);
/* set the width of the col */
$str_anc.='
| Code | Poste | Montant | ' . _('Compt. Analytique') . ' | ';
/* add hidden variables pa[] to hold the value of pa_id */
$str_anc.= Anc_Plan::hidden($a_anc);
}
echo '
';
$amount_idx=0; $sum_prod_currency=0;
for ($e=0;$edet->array);$e++) {
$row=''; $q=$obj->det->array;
$view_history = HtmlInput::history_account($q[$e]['j_poste'], $q[$e]['j_poste'], "", $exercice);
$row.=td($view_history);
if ( $q[$e]['j_qcode'] !='') {
$fiche=new Fiche($cn);
$fiche->get_by_qcode($q[$e]['j_qcode']);
$view_history=HtmlInput::history_card($fiche->id, $q[$e]['j_qcode'], "", $exercice);
}
else
$view_history='';
$row.=td($view_history);
$l_lib = $q[$e]['j_text'] ;
if ( $l_lib!='')
{
$l_lib=$q[$e]['j_text'];
}
else if ( $q[$e]['j_qcode'] !='') {
// nom de la fiche
$ff=new Fiche($cn);
$ff->get_by_qcode( $q[$e]['j_qcode']);
$l_lib=$ff->get_attribute(ATTR_DEF_NAME);
} else {
// libellé du compte
$name=$cn->get_value('select pcm_lib from tmp_pcmn where pcm_val=$1',array($q[$e]['j_poste']));
$l_lib=$name;
}
$l_lib=strip_tags($l_lib);
if ($owner->MY_UPDLAB == 'Y')
{
$hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
$input = new IText("e_march" . $q[$e]['j_id'] . "_label", $l_lib);
$input->css_size="100%";
}
else
{
$input = new ISpan("e_march" . $q[$e]['j_id'] . "_label");
$input->value=$l_lib;
$hidden = HtmlInput::hidden("j_id[]", $q[$e]['j_id']);
}
$row.=td($input->input().$hidden);
$montant=td(nbm($q[$e]['j_montant']),'class="num"');
$row.=($q[$e]['j_debit']=='t')?$montant:td('');
$row.=($q[$e]['j_debit']=='f')?$montant:td('');
/*
* Compute total in currency if not default one
*/
if ( $obj->det->currency_id != 0 && $q[$e]['j_debit']=='f' ) {
$value=$obj->db->get_value("select oc_amount+oc_vat_amount from operation_currency where j_id=$1",[$q[$e]['j_id']]);
$sum_prod_currency=bcadd($sum_prod_currency,$value,2);
}
/* Analytic accountancy */
if ( $owner->MY_ANALYTIC != "nu" /*&& $div=='popup'*/){
if ( $g_parameter->match_analytic($q[$e]['j_poste'])) {
echo HtmlInput::hidden("amount_t".$amount_idx,$q[$e]['j_montant']);
$anc_op=new Anc_Operation($cn);
$anc_op->j_id=$q[$e]['j_id'];
$anc_op->in_div=$div;
$side=($q[$e]['j_debit'] == 'f')?'C':'D';
$str_anc.='';
$str_anc.=HtmlInput::hidden('opanc[]',$anc_op->j_id);
$str_anc.=td($q[$e]['j_qcode']);
$str_anc.=td($q[$e]['j_poste']);
$str_anc.=td(nbm($q[$e]['j_montant'])." {$side}");
$str_anc.=$anc_op->display_table(1,$q[$e]['j_montant'],$div);
$str_anc.='
';
$amount_idx++;
}
}
$class=($e%2==0)?' class="even"':'class="odd"';
if ( $obj->det->currency_id != 0 ) {
$cur_amount=$cn->get_value("select oc_amount from operation_currency where j_id=$1",
[$q[$e]['j_id']]);
$row.=td(nbm($cur_amount,2),' class="num" ');
}
echo tr($row,$class);
}
?>
det->currency_id != "" && $obj->det->currency_id > 0)
{
$currency=new Acc_Currency($obj->db, $obj->det->currency_id);
$four_space=" "." "." "." ";
echo $currency->get_code(),$four_space;
echo _("Taux utilisé")," ", nbm($obj->det->currency_rate,4),$four_space;
echo _("Taux Réf"), " ",nbm($obj->det->currency_rate_ref,4).$four_space;
echo _("Montant en devise"), " ",nbm($sum_prod_currency,4).$four_space;
}
?>