Operation detail in HTML

========================
Start of the ODS operation, we have cosmetic problems when
the details are too big.

Start of Analytic accountancy
This commit is contained in:
Dany De Bontridder 2010-06-27 18:38:12 +00:00
parent 7c3f523d36
commit b7efe5e5f4
7 changed files with 145 additions and 9 deletions

View file

@ -103,7 +103,7 @@ case 'de':
$obj=$op->get_quant(); /* return an obj. ACH / FIN or VEN or null if nothing is found*/
$oLedger=new Acc_Ledger($cn,$ledger);
if ( $obj == null ) {
if ( $obj==null || $obj->signature == 'ODS' ) {
/* only the details */
ob_start();
require_once('template/ledger_detail_misc.php');

View file

@ -472,7 +472,12 @@ function success_box(req,json)
code_html=unescape_xml(code_html);
g(name_ctl).innerHTML=code_html;
g(name_ctl).style.height='auto';
g(name_ctl).style.width='auto';
// if IE set to 60 %
if(navigator.appName == "Microsoft Internet Explorer")
g(name_ctl).style.width='auto';
else
g(name_ctl).style.width='auto';
}
catch (e) {
alert("success_box"+e.message);}

View file

@ -845,12 +845,15 @@ div.op_detail {
font-family:helvetica,arial,sans-serif;
padding:0;
margin:0;
overflow:none;
overflow:hidden;
z-index:3;
position:absolute;width:500;height:200;left:200;
position:absolute;
left:10%;right:10%;
border:1px solid darkblue; width:300;
border:1px solid darkblue;
}
div.op_detail_title {
background-color:grey;

View file

@ -556,7 +556,38 @@ function get_balance($p_from,$p_to,$p_plan_id)
$sql="delete from operation_analytique where j_id=$p_jid";
$this->db->exec_sql($sql);
}
/**
*@brief return a HTML table with the data of a specific
* operation (jrnx.j_id). First, it load data from the database
* and after it displays them
*@param $div is the div id used to give a name to the table
*@param $opt 0 if the CA is mandatory and 1 for optional
*@note the data must be first loaded
*@see Anc_Operation::get_by_jid
*/
function print_table($array,$div,$opt,$j_id,$seq) {
$r='';
$col=0;
$r.=HtmlInput::hidden('ident['.$seq.']',$j_id);
$plan=new Anc_Plan($this->db);
$a_plan=$plan->get_list();
if (empty($a_plan)) return '';
/* create the table */
$table_id="tb".$div."[$seq]";
$r.="<table id=\"$table_id\">";
$r.=tr($plan->header().th('Montant',' class="inum"'));
/* numb. of rows for this operation */
$nb_row=$this->db->get_value('select max(oa_row) from operation_analytique where j_id=$1',array($j_id));
for ( $i=0;$i<$nb_row;$i++) {
/* each plan is a column */
foreach ($a_plan as $r_plan) {
}
}
}
/*\brief test the class
*\param
*\param
@ -569,4 +600,5 @@ function get_balance($p_from,$p_to,$p_plan_id)
}
}

View file

@ -28,7 +28,7 @@ if ($aRap != null ) {
$remove=$rmReconciliation->input();
else
$remove='';
echo tr (td('<a href="#" onclick="'.$str.'" >'.$internal.'</A>').td($amount).td($remove));
echo tr (td('<a href="javascript:void(0)" onclick="'.$str.'" >'.$internal.'</A>').td($amount).td($remove));
}
echo '</table>';
}

View file

@ -1,4 +1,99 @@
<h2> MISC </h2>
<? var_dump($_REQUEST);
<? require_once('template/ledger_detail_top.php'); ?>
<?
require_once('class_own.php');
require_once ('jrn.php');
require_once ('class_anc_plan.php');
?>
<div class="content" style="padding:0">
?>
<? if ( $access=='W') : ?>
<form onsubmit="return op_save(this);">
<? endif; ?>
<? echo HtmlInput::hidden('whatdiv',$div).HtmlInput::hidden('jr_id',$jr_id).dossier::hidden();?>
<table>
<tr>
<? echo td('Date').td($obj->det->jr_date);?>
</tr>
<tr>
<?
$itext=new IText('lib');
$itext->value=$obj->det->jr_comment;
$itext->size=40;
echo td(_('Libellé')).td($itext->input());
?>
</tr>
<tr>
<? echo td('montant').td($obj->det->jr_montant,' class="inum"');?>
</tr>
<tr>
<?
$itext=new IText('npj');
$itext->value=$obj->det->jr_pj_number;
echo td(_('Pièce')).td($itext->input());
?>
</tr>
</table>
<fieldset>
<legend>
<?=_('Détail')?>
<?
require_once('class_own.php');
$owner=new Own($cn);
?>
</legend>
<table class="result">
<tr>
<?
echo th(_('Poste Comptable'));
echo th(_('Quick Code'));
echo th(_('Libellé'));
echo th(_('Débit'));
echo th(_('Crédit'));
if ($owner->MY_ANALYTIC != 'nu'){
echo th('Plan Analytique');
}
$idx_ca=0;
for ($e=0;$e<count($obj->det->array);$e++) {
$row=''; $q=$obj->det->array;
$row=td($q[$e]['j_poste']);
$row.=td($q[$e]['j_qcode']);
if ( $q[$e]['j_qcode'] !='') {
// nom de la fiche
$ff=new Fiche($cn);
$ff->get_by_qcode( $q[$e]['j_qcode']);
$row.=td(h($ff->strAttribut(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));
}
$montant=td($q[$e]['j_montant'],'class="num"');
$row.=($q[$e]['j_debit']=='t')?$montant:td('');
$row.=($q[$e]['j_debit']=='f')?$montant:td('');
/* Analytic accountancy */
if ( $owner->MY_ANALYTIC != "nu"){
if ( preg_match('/^(6|7)/',$q[$e]['j_poste'])) {
$row.=display_table_ca($cn,$idx_ca,$q[$e]['j_id'],$owner,1,$q[$e]['j_montant']);
$idx_ca++;
} else {
$row.=td('');
}
}
echo tr($row);
}
?>
</table>
</fieldset>
<?
require_once('ledger_detail_bottom.php');
?>
</div>

View file

@ -1,5 +1,6 @@
<div style="text-align:right;height:13px">
<?
echo '<A style="margin-right:5px;background-color:blue;color:white;text-decoration:none" HREF="javascript:void(0)" onclick="var a=getElementById(\''.$div.'\');a.style.width=\'95%\';a.style.height=\'95%\';a.style.top=\'2%\';a.style.left=\'2%\';a.style.overflow=\'auto\';">Agrandir</A>';
echo '<A style="background-color:blue;color:white;text-decoration:none" HREF="javascript:void(0)" onclick="removeDiv(\''.$div.'\');">Fermer</A>';
?>
</div>