*/
/**
 * @brief show the common parts of operation details 
 * 
 * Variables : $div = popup or box (det[0-9]
 * 
 */
// 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();
$nb_document = $detail->det->jr_pj_name != "" ? 1 : 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') . '(' . count($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';
    ?>
<ul  class="tabs">
 /**
  *@brief retrieve data from the table QUANT_*
  *@return return an object or null if there is no
  * data from the QUANT table
  *@see Acc_Sold Acc_Purchase Acc_Fin Acc_Detail Acc_Misc
  */
 function get_quant()
 {
     $ledger_id = $this->get_ledger();
     if ($ledger_id == '') {
         throw new Exception(_('Journal non trouvé'));
     }
     $oledger = new Acc_Ledger($this->db, $ledger_id);
     // retrieve info from jrn_info
     switch ($oledger->get_type()) {
         case 'VEN':
             $ret = new Acc_Sold($this->db, $this->jr_id);
             break;
         case 'ACH':
             $ret = new Acc_Purchase($this->db, $this->jr_id);
             break;
         case 'FIN':
             $ret = new Acc_Fin($this->db, $this->jr_id);
             break;
         default:
             $ret = new Acc_Misc($this->db, $this->jr_id);
             break;
     }
     $ret->get();
     if (empty($ret->det->array)) {
         $ret = new Acc_Misc($this->db, $this->jr_id);
         $ret->get();
     }
     $ret->get_info();
     return $ret;
 }