Cell($size[$l],6,$date,0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,$row['jr_internal'],0,0,$align[$l]);$l++;
@@ -83,6 +87,7 @@ $pdf->Ln();
$pdf->Cell($size[$l],6,(($row['letter']!=-1)?$row['letter']:''),0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$row['deb_montant'])),0,0,$align[$l]);$l++;
$pdf->Cell($size[$l],6,(sprintf('% 12.2f',$row['cred_montant'])),0,0,$align[$l]);$l++;
+ $pdf->Cell($size[$l],6,(sprintf('% 12.2f',abs($progress))),0,0,$align[$l]);$l++;
$pdf->ln();
$tot_deb+=$row['deb_montant'];
$tot_cred+=$row['cred_montant'];
diff --git a/include/class_acc_account_ledger.php b/include/class_acc_account_ledger.php
index a50cd63f5..c46b23434 100644
--- a/include/class_acc_account_ledger.php
+++ b/include/class_acc_account_ledger.php
@@ -300,20 +300,25 @@ function get_solde_detail($p_cond="") {
"| Description | ".
" Débit | ".
" Crédit | ".
- th('Let.','style=\"text-align:right\"').
+ th('Prog.','style="text-align:right"').
+ th('Let.','style="text-align:right"');
"";
-
+ $progress=0;
foreach ( $this->row as $op ) {
$vw_operation=sprintf('%s',
$op['jr_id'], dossier::id(), $op['jr_internal']);
$let='';
if ( $op['letter'] !=-1) $let=$op['letter'];
+ $progress+=$op['deb_montant']-$op['cred_montant'];
+
echo "".
"| ".$vw_operation." | ".
"".$op['j_date']." | ".
"".h($op['description']).' '.h($op['jr_pj_number'])." | ".
"".sprintf("%.2f",$op['deb_montant'])." | ".
"".sprintf("%.2f",$op['cred_montant'])." | ".
+ td(sprintf('%.2f',abs($progress)),'style="text-align:right"').
+
td($let,' style="color:red;text-align:right"').
"
";
diff --git a/include/class_fiche.php b/include/class_fiche.php
index b1c060dcf..b77089ea4 100644
--- a/include/class_fiche.php
+++ b/include/class_fiche.php
@@ -1096,7 +1096,7 @@ av_text1=>'name'
{
if ( $p_array == null)
$p_array=$_REQUEST;
-
+ $progress=0;
$name=h($this->getName()).'['.$this->strAttribut(ATTR_DEF_QUICKCODE).']';
list($array,$tot_deb,$tot_cred)=$this->get_row_date( $p_array['from_periode'],
@@ -1118,7 +1118,8 @@ av_text1=>'name'
""._('Description')." | ".
""._('Débit')." | ".
""._('Crédit')." | ".
- th('Let.','style=\"text-align:right\"');
+ th('Prog.','style="text-align:right"').
+ th('Let.','style="text-align:right"');
"";
foreach ( $this->row as $op ) {
@@ -1126,12 +1127,14 @@ av_text1=>'name'
$op['jr_id'], dossier::id(), $op['jr_internal']);
$let='';
if ( $op['letter'] !=-1) $let=$op['letter'];
+ $progress+=$op['deb_montant']-$op['cred_montant'];
echo "".
"| ".$vw_operation." | ".
"".format_date($op['j_date_fmt'])." | ".
"".h($op['description'])." | ".
"".sprintf("%.2f",$op['deb_montant'])." | ".
"".sprintf("%.2f",$op['cred_montant'])." | ".
+ td(sprintf('%.2f',abs($progress)),'style="text-align:right"').
td($let,' style="color:red;text-align:right"').
"
";
diff --git a/include/stock_inc.php b/include/stock_inc.php
index 4bd96e57f..f193e9150 100644
--- a/include/stock_inc.php
+++ b/include/stock_inc.php
@@ -47,7 +47,7 @@ function ViewStock($p_cn,$p_year) {
$sql=" select distinct sg_code
from stock_goods
where
- sg_code is not null and sg_code != '' and sg_code!='null'";
+ sg_code is not null and sg_code not in ('','null','--not found--','- ERROR -')";
@@ -202,7 +202,7 @@ $sql="select sg_code,
$r.="Quantité | ";
$r.="Prix/Cout Unitaire | ";
$r.="";
-
+ $tot_quantity=0;
for ( $i=0; $i < $M;$i++) {
$l=Database::fetch_array($Res,$i);
$r.="";
@@ -217,7 +217,12 @@ $sql="select sg_code,
$r.=($l['sg_type']=='c')?'OUT':'IN';
$r.="";
+ if ( $l['sg_type']=='c')
+ $quantity=(-1)*$l['sg_quantity'];
+ else
+ $quantity=$l['sg_quantity'];
+ $tot_quantity+=$quantity;
// comment
$r.="| ";
$r.=$l['comment'];
@@ -240,7 +245,7 @@ $sql="select sg_code,
$r.=" | ";
//quantity
$r.='';
- $r.=$l['sg_quantity'];
+ $r.=$quantity;
$r.=" | ";
// Unit Price
@@ -253,6 +258,11 @@ $sql="select sg_code,
$r.="
";
}// for ($i
+ // write the total
+ $row=td('Total',' colspan="4" style="width:auto;text-align:right"');
+ $row.=td($tot_quantity, 'style="text-align:right"');
+ $row.=td();
+ $r.=td($row);
$r.="";