set_position("normal"); $cn=Dossier::connect(); // Contains all the linked actions $a_followup = Follow_Up::get_all_operation($jr_id); // // Contains all the linked operations $oRap=new Acc_Reconciliation($cn); $oRap->jr_id=$jr_id; $aRap=$oRap->get(); // Detail of operation $detail = new Acc_Misc($cn, $obj->jr_id); $detail->get(); // find out exercice $periode_id=new Periode($cn,$detail->det->jr_tech_per); $exercice=$periode_id->get_exercice(); $nb_document=($detail->det->jr_pj_name != "")?1:0; $nb_aRap=(is_array($aRap))?count($aRap):0; // Array of tab // $a_tab['writing_div']=array('id'=>'writing_div'.$div,'label'=>_('Ecriture Comptable'),'display'=>'none'); $a_tab['info_operation_div']=array('id'=>'info_operation_div'.$div,'label'=>_('Information'),'display'=>'none'); $a_tab['linked_operation_div']=array('id'=>'linked_operation_div'.$div,'label'=>_('Opérations liées').'('.$nb_aRap.')','display'=>'none'); $a_tab['document_operation_div']=array('id'=>'document_operation_div'.$div,'label'=>_('Document').'('.$nb_document.')','display'=>'block'); $a_tab['linked_action_div']=array('id'=>'linked_action_div'.$div,'label'=>_('Actions Gestion').'('.count($a_followup).')','display'=>'none'); $a_tab['analytic_div']=array('id'=>'analytic_div'.$div,'label'=>_('Comptabilité Analytique'),'display'=>'none'); // show tabs if ( $div != "popup") : $a_tab['document_operation_div']['display']='block'; ?>
$a_value): $a_tab[$idx]['display']='block'; endforeach; endif; ?> info->command); $other=new IText('OTHER',$obj->info->other); ?>

'; for ($e = 0; $e < count($detail->det->array); $e++) { $row = ''; $q = $detail->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); if ($q[$e]['j_text']=="") { if ($q[$e]['j_qcode'] != '') { // nom de la fiche $ff = new Fiche($cn); $ff->get_by_qcode($q[$e]['j_qcode']); $row.=td($ff->get_attribute(h(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'])); $row.=td(h($name)); } } else $row.=td(h($q[$e]['j_text'])); $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(''); $class=($e%2==0)?' class="even"':'class="odd"'; echo tr($row,$class); } ?>

: input(); ?>
: input();?>
det->jr_optype)->input(); ?>
er

det->jr_montant; $tableid="tb".$div; $total_rec=0; $operation=new Acc_Operation($cn); $operation->set_id($jr_id); echo ''; for ($e=0;$ejr_id=$aRap[$e]; $internal=$opRap->get_internal(); $array_jr=$cn->get_array('select jr_date,jr_pj_number,jr_montant,jr_comment , jr_internal ,jr_optype from jrn where jr_id=$1', array($aRap[$e])); $amount=$array_jr[0]['jr_montant']; switch (substr($array_jr[0]['jr_internal'],0,1)) { case 'A': $amount = $cn->get_value("select sum(qp_price+qp_vat+qp_nd_tva+qp_nd_tva_recup-qp_vat_sided) from quant_purchase qp where qp_internal=$1", array($internal)); // add additional tax if any $add=$operation->get_sum_other_tax(); $amount=noalyss_bcadd($amount,$add,2); break; case 'V': $amount=$cn->get_value("select sum(qs_price+qs_vat-qs_vat_sided) from quant_sold qs where qs_internal=$1", array($internal)); // add additional tax if any $add=$operation->get_sum_other_tax(); $amount=bcadd($amount??0,$add??0,2); break; } $total_rec=bcadd($total_rec,$amount??0); $str="modifyOperation(".$aRap[$e].",".$gDossier.")"; // If write access , allow to drop Reconciles operations if ( $access=='W') { $js="return confirm_box(null,'"._("vous confirmez?")."',"; $js.=sprintf('function () { dropLink(\'%s\',\'%s\',\'%s\',\'%s\');deleteRowRec(\'%s\',$(\'row%d\'));})', $gDossier, $div, $jr_id, $aRap[$e], $tableid, $e ); $remove=Icon_Action::trash(uniqid(), $js); } else $remove=''; $comment=strip_tags($array_jr[0]['jr_comment']??""); $pj_nb=h($array_jr[0]['jr_pj_number']); echo tr (td(format_date($array_jr[0]['jr_date'])). td(''.$internal.''). td($pj_nb). td($comment). td(_('montant').'='.nbm($amount)). td(_('delta').'='.nbm(bcsub(abs($amount_tva_include),abs($total_rec)))). td($remove),' id = "row'.$e.'"'); } echo '
'; } ?> amount_id=$obj->det->jr_montant; $wConcerned->div="search_reconcile"; $wConcerned->set_hideOperation( $obj->jr_id); echo $wConcerned->input(); } ?>

'; for ($i = 0; $i < count($a_followup); $i++) { $remove=''; if ( $access=='W') $remove=HtmlInput::button_action_remove_operation($a_followup[$i]['ago_id']); if ( $div == 'popup') { echo '
  • '.HtmlInput::detail_action($a_followup[$i]['ag_id'], h($a_followup[$i]['ag_ref']." ".$a_followup[$i]['ag_title']),0).$remove.'
  • '; } else { echo '
  • '.HtmlInput::detail_action($a_followup[$i]['ag_id'], h($a_followup[$i]['ag_ref']." ".$a_followup[$i]['ag_title']),1).$remove.'
  • '; } } echo ''; $related=new IRelated_Action('related'); $related->id='related'.$div; if ( $access=='W') echo $related->input(); echo '
    '; ?>

    MY_ANALYTIC != "nu") : if ( strpos($str_anc,'') == true ): ?>

    '; if ( $div != 'popup' ) { $a=new IButton('Fermer',_('Fermer')); $a->label=_("Fermer"); $a->javascript="removeDiv('".$div."')"; echo $a->input(); } else { echo HtmlInput::hidden('p_jrn',$oLedger->id); } ?> MY_ANALYTIC != 'nu' /*&& $div=='popup' */){ $select_box->add_javascript(_("Vérification CA"), sprintf("verify_ca('%s')",$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) { $javascript="return confirm_box(null,content[50],function () {removeOperation('".$obj->det->jr_id."',".dossier::id().",'".$div."')})"; $select_box->add_javascript(_("Supprimer"), $javascript); } //---------------------------------------------------- // Extourne //---------------------------------------------------- $select_box->add_javascript(_("Extourne"), sprintf("g('ext%s').style.display='block'",$div)); //------------------------------------------------------------------- // Duplicate //------------------------------------------------------------------- $select_box->add_javascript(_("Dupliquer"),sprintf("duplicate_operation('%s','%s')",Dossier::id(),$obj->jr_id)); //------------------------------------------------------------------- // Export PDF //------------------------------------------------------------------- $select_box->add_url(_("Export PDF"), "export.php?". http_build_query(array("act"=>"PDF:operation_detail","gDossier"=>Dossier::id(),"operation_id"=>$obj->jr_id))); echo $select_box->input(); echo '

    '; echo ''; echo ''; }else { echo '

    '; } ?>