Code rewriting and improve of P0RAP for linked operations
This commit is contained in:
parent
a48140d3cc
commit
4a0c11d6c7
6 changed files with 735 additions and 580 deletions
|
|
@ -1,71 +1,96 @@
|
|||
<?php
|
||||
//This file is part of NOALYSS and is under GPL
|
||||
//see licence.txt
|
||||
?><table class="result">
|
||||
<tr>
|
||||
<th>
|
||||
<?php echo _("N°")?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo _("Date")?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo _("N° op")?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo _("n° pièce")?>
|
||||
</th>
|
||||
<th>
|
||||
<?php echo _("Libellé")?>
|
||||
</th>
|
||||
<th style="text-align:right">
|
||||
<?php echo _("Montant")?>
|
||||
</th>
|
||||
</tr>
|
||||
<?php
|
||||
for ($i=0;$i<count($array);$i++) {
|
||||
$tot=$acc_reconciliation->get_amount_noautovat($array[$i]['first']['jr_id'],$array[$i]['first']['jr_montant']);
|
||||
|
||||
$r='';
|
||||
$r.=td($i);
|
||||
$r.=td(format_date($array[$i]['first']['jr_date']));
|
||||
$detail = HtmlInput::detail_op($array[$i]['first']['jr_id'], $array[$i]['first']['jr_internal']);
|
||||
$r.=td($detail);
|
||||
$r.=td($array[$i]['first']['jr_pj_number']);
|
||||
$r.=td($array[$i]['first']['jr_comment']);
|
||||
$r.=td(nbm($tot),'style="text-align:right"');
|
||||
echo tr($r);
|
||||
// check if operation does exist in v_detail_quant
|
||||
$ret=$acc_reconciliation->db->execute('detail_quant',array($array[$i]['first']['jr_id']));
|
||||
$acc_reconciliation->show_detail($ret);
|
||||
if ( isset($array[$i]['depend']) )
|
||||
{
|
||||
$tot2=0;
|
||||
$limit=count($array[$i]['depend'])-1;
|
||||
for ($e=0;$e<count($array[$i]['depend']);$e++) {
|
||||
$r='';
|
||||
$r.=td($i);
|
||||
$r.=td(format_date($array[$i]['depend'][$e]['jr_date']));
|
||||
$detail = HtmlInput::detail_op($array[$i]['depend'][$e]['jr_id'], $array[$i]['depend'][$e]['jr_internal']);
|
||||
$r.=td($detail);
|
||||
$r.=td($array[$i]['depend'][$e]['jr_pj_number']);
|
||||
$r.=td($array[$i]['depend'][$e]['jr_comment']);
|
||||
$r.=td(nbm($array[$i]['depend'][$e]['jr_montant']),'style="text-align:right"');
|
||||
|
||||
$amount_dep=$acc_reconciliation->get_amount_noautovat($array[$i]['depend'][$e]['jr_id'],$array[$i]['depend'][$e]['jr_montant']);
|
||||
$tot2=bcadd($tot2,$amount_dep);
|
||||
|
||||
if ( $e==$limit)
|
||||
echo '<tr>'.$r.'</tr>';
|
||||
else
|
||||
echo tr($r);
|
||||
$ret=$acc_reconciliation->db->execute('detail_quant',array($array[$i]['depend'][$e]['jr_id']));
|
||||
$acc_reconciliation->show_detail($ret);
|
||||
}
|
||||
echo tr(td(_('Total ')).td(_('opération')).td(nbm($tot)).td(_('opérations dépendantes')).td(nbm($tot2)).td(_('Delta')).td(bcsub($tot,$tot2)),' class="highlight"');
|
||||
echo tr(td('<hr>',' colspan="6" style="witdh:auto"'));
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<div class="rpm_main">
|
||||
<?php
|
||||
for ($i = 0; $i < count($array); $i++) {
|
||||
?>
|
||||
<div class="rpm_operation rpm_title">
|
||||
<div >
|
||||
<?php echo _("N°") ?>
|
||||
</div>
|
||||
<div >
|
||||
<?php echo _("Date") ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php echo _("Interne") ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php echo _("N° pièce") ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php echo _("Libellé") ?>
|
||||
</div>
|
||||
<div>
|
||||
<?php echo _("Montant") ?>
|
||||
</div>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="rpm_operation ">
|
||||
<div><?= $i ?></div>
|
||||
<div><?=$array[$i]['str_jr1_jr_date']?></div>
|
||||
<div><?= HtmlInput::detail_op($array[$i]['jr1_jr_id'], $array[$i]['jr1_jr_internal']) ?></div>
|
||||
<div><?= $array[$i]['jr1_jr_pj_number'] ?></div>
|
||||
<div><?= $array[$i]['jr1_jr_comment'] ?></div>
|
||||
<?php
|
||||
$x=($array[$i]['to1_sum_amount']!=0)?$array[$i]['to1_sum_amount']:$array[$i]['jr1_jr_montant'];
|
||||
?>
|
||||
<div><?=nbm($x)?></div>
|
||||
|
||||
<div class="rpm_detail">
|
||||
<?php
|
||||
$r = '';
|
||||
|
||||
// check if operation does exist in v_detail_quant
|
||||
// $ret = $acc_reconciliation->db->execute('detail_quant', array($array[$i]['jr1_jr_id']));
|
||||
// echo '<table>';
|
||||
// $acc_reconciliation->show_detail($ret);
|
||||
// echo '</table>';
|
||||
|
||||
if ( $array[$i]['depend_count']>0) {
|
||||
$depend=$acc_reconciliation->db->get_array("select *
|
||||
from temp_total_operation
|
||||
where
|
||||
jr1_jr_id=$1 and ra1_jra_concerned != jr1_jr_id"
|
||||
,[$array[$i]['jr1_jr_id']]);
|
||||
$nb_depend = count($depend);
|
||||
$totdepend=0;$delta=$x;
|
||||
?>
|
||||
<div class="rpm_detail">
|
||||
<h4><?=_("Opération liée")?></h4>
|
||||
<?php
|
||||
for ($e = 0; $e < $nb_depend ; $e++) {
|
||||
$y=($depend[$e]['to2_sum_amount']!=0)?$depend[$e]['to2_sum_amount']:$depend[$e]['jr2_jr_montant'];
|
||||
$totdepend=bcadd($totdepend,$y,2);
|
||||
$delta=bcsub($delta,$y,2);
|
||||
?>
|
||||
<div class="rpm_operation">
|
||||
<div><?= $i ?></div>
|
||||
<div><?=$depend[$e]["str_jr2_jr_date"] ?></div>
|
||||
<div><?= HtmlInput::detail_op($depend[$e]["ra1_jra_concerned"],$depend[$e]["jr2_jr_internal"]) ?></div>
|
||||
<div><?=$depend[$e]["jr2_jr_pj_number"] ?></div>
|
||||
<div><?=$depend[$e]["jr2_jr_comment"] ?></div>
|
||||
<div><?= nbm($y) ?></div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
?></div>
|
||||
|
||||
<?php
|
||||
} // end for ($e = 0; $e < count($array[$i]['depend']); $e++)
|
||||
|
||||
?></div>
|
||||
<div class="rpm_detail highlight">
|
||||
<?=sprintf(_("Total opération liée : %.2f Delta %.2f"),$totdepend,$delta)?>
|
||||
</div>
|
||||
<?php
|
||||
} // if ( $array[$i]['depend_count']>1)
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
} // end for ($i=0;$i<count($array);$i++)
|
||||
?>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue