Merged revisions 3246-3260 via svnmerge from

file:///home/developper/svn/phpcompta/branches/rel510

........
  r3247 | danydb | 2010-05-26 10:47:02 +0200 (Wed, 26 May 2010) | 4 lines
  
  Before the fix: FIN ledger numbers the operations even when there is no 
  receipt nb
........
  r3248 | danydb | 2010-05-26 19:28:36 +0200 (Wed, 26 May 2010) | 1 line
  
  Problem with the creation of document (need verification)
........
  r3249 | danydb | 2010-05-26 21:02:27 +0200 (Wed, 26 May 2010) | 2 lines
  
  Check return value for Acc_Tva->load
........
  r3250 | danydb | 2010-05-26 21:07:49 +0200 (Wed, 26 May 2010) | 1 line
  
  Problem with the creation of document, bug due to a confusion between MY_TVA and MY_TVA_USE
........
  r3251 | danydb | 2010-05-28 10:31:02 +0200 (Fri, 28 May 2010) | 2 lines
  
  Account Export CSV :  Add the label to accountings
........
  r3252 | danydb | 2010-05-28 10:31:35 +0200 (Fri, 28 May 2010) | 2 lines
  
  typo
........
  r3253 | danydb | 2010-05-28 10:33:11 +0200 (Fri, 28 May 2010) | 2 lines
  
  Account export CSV : fix number of column
........
  r3254 | danydb | 2010-05-28 10:34:03 +0200 (Fri, 28 May 2010) | 1 line
  
  Account export CSV
........
  r3255 | danydb | 2010-05-28 10:35:14 +0200 (Fri, 28 May 2010) | 2 lines
  
  Balance PDF : bug column D & C are inversed
........
  r3256 | danydb | 2010-05-28 14:12:31 +0200 (Fri, 28 May 2010) | 1 line
  
  Fix bug : for quick_writing when a row is added, the value is duplicated
........
  r3257 | danydb | 2010-05-28 14:43:42 +0200 (Fri, 28 May 2010) | 1 line
  
  Fix problem with max article
........
  r3258 | danydb | 2010-05-28 14:45:57 +0200 (Fri, 28 May 2010) | 1 line
  
  Bug with predefined operation : the nb of item was incorrect in input
........
  r3259 | danydb | 2010-05-30 17:11:47 +0200 (Sun, 30 May 2010) | 2 lines
  
  Fix small bug : make_list remove bad heading and trailing coma
........
  r3260 | danydb | 2010-05-30 17:42:45 +0200 (Sun, 30 May 2010) | 2 lines
  
  Avoid duplicate in table fiche::HtmlTableDetail
........
This commit is contained in:
Dany De Bontridder 2010-05-31 13:52:09 +00:00
parent 17a8b3c777
commit 048f8e1f34
11 changed files with 41 additions and 22 deletions

View file

@ -333,6 +333,12 @@ function quick_writing_add_row(){
new_tt.evalScripts();
}
$("qc_"+nb.value).value="";
$("amount"+nb.value).value="";
$("poste"+nb.value).value="";
$("ld"+nb.value).value="";
nb.value++;
}

View file

@ -108,6 +108,7 @@ if ( ! isset ($_REQUEST['oper_detail'])) {
continue;
echo '"Poste";'.
'"Lib.";'.
'"QuickCode";'.
"\"Code interne\";".
"\"Date\";".
@ -122,8 +123,9 @@ if ( ! isset ($_REQUEST['oper_detail'])) {
$op->jr_id=$a['jr_id'];
$result=$op->get_jrnx_detail();
foreach ( $result as $r) {
printf('"%s";"%s";"%s";"%s";"%s";%12.2f;"%s %s"',
printf('"%s";"%s";"%s";"%s";"%s";"%s";"%s";%12.2f;"%s"',
$r['j_poste'],
$r['pcm_lib'],
$r['j_qcode'],
$r['jr_internal'],
$r['jr_date'],

View file

@ -1,5 +1,4 @@
<?php
/*
* This file is part of PhpCompta.
*
@ -108,8 +107,8 @@ $pdf->SetFont('DejaVuCond','B',8);
$pdf->Cell(110,6,'Totaux');
$pdf->Cell(20,6,$tp_deb,'T',0,'R',0);
$pdf->Cell(20,6,$tp_cred,'T',0,'R',0);
$pdf->Cell(20,6,$tp_solc,'T',0,'R',0);
$pdf->Cell(20,6,$tp_sold,'T',0,'R',0);
$pdf->Cell(20,6,$tp_solc,'T',0,'R',0);
$pdf->Ln();

View file

@ -105,8 +105,10 @@ class Acc_Account_Ledger {
"case when j_debit='f' then j_montant else 0 end as cred_montant,".
" jr_comment as description,jrn_def_name as jrn_name,".
"j_debit, jr_internal,jr_pj_number,coalesce(comptaproc.get_letter_jnt(j_id),-1) as letter ".
" from jrnx left join jrn_def on jrn_def_id=j_jrn_def ".
" left join jrn on jr_grpt_id=j_grpt".
",pcm_lib ".
" from jrnx left join jrn_def on (jrn_def_id=j_jrn_def )".
" left join jrn on (jr_grpt_id=j_grpt)".
" left join tmp_pcmn on (j_poste=pcm_val)".
" where j_poste=$1 and ".
" ( to_date($2,'DD.MM.YYYY') <= j_date and ".
" to_date($3,'DD.MM.YYYY') >= j_date )".

View file

@ -706,7 +706,10 @@ class Acc_Ledger_Fin extends Acc_Ledger {
$acc_operation->mt=$mt;
$idx_operation++;
$acc_operation->pj=$e_pj.str_pad($idx_operation,3,0,STR_PAD_LEFT);
if ( trim($e_pj) != '')
$acc_operation->pj=$e_pj.str_pad($idx_operation,3,0,STR_PAD_LEFT);
else
$acc_operation->pj='';
$jr_id=$acc_operation->insert_jrn();
$acc_operation->set_pj();

View file

@ -152,7 +152,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger {
$owner=new Own($this->db);
// Check if the given tva id is valid
if ( $owner->MY_TVA=='Y') {
if ( $owner->MY_TVA_USE=='Y') {
if (${'e_march'.$i.'_tva_id'} == 0 )
throw new Exception(_('La fiche ').${'e_march'.$i}._('a un code tva invalide').' ['.${'e_march'.$i.'_tva_id'}.']',13);
$tva_rate=new Acc_Tva($this->db);
@ -887,13 +887,14 @@ array
// Record the current number of article
$Hid=new IHidden();
$p_article= ( isset ($p_article))?$p_article:MAX_ARTICLE;
$p_article= ( isset ($nb_item))?$nb_item:MAX_ARTICLE;
$r.=$Hid->input("nb_item",$p_article);
$e_comment=(isset($e_comment))?$e_comment:"";
$max=($p_article < MAX_ARTICLE)?MAX_ARTICLE:$p_article;
// For each article
//--
for ($i=0;$i< MAX_ARTICLE;$i++) {
for ($i=0;$i< $max ;$i++) {
// Code id, price & vat code
//--
$march=(isset(${"e_march$i"}))?${"e_march$i"}:"";

View file

@ -154,12 +154,11 @@ class Acc_Ledger_Sold extends Acc_Ledger {
// Check if the given tva id is valid
$owner=new Own($this->db);
if ( $owner->MY_TVA=='Y') {
if ( $owner->MY_TVA_USE=='Y') {
if ( isNumber(${'e_march'.$i.'_tva_id'}) == 0 )
throw new Exception(_('La fiche ').${'e_march'.$i}._('a un code tva invalide').' ['.${'e_march'.$i.'_tva_id'}.']',13);
$tva_rate=new Acc_Tva($this->db);
$tva_rate->set_parameter('id',${'e_march'.$i.'_tva_id'});
if ( $tva_rate->load() != 0 )
throw new Exception(_('La fiche ').${'e_march'.$i}._('a un code tva invalide').' ['.${'e_march'.$i.'_tva_id'}.']',13);
}
@ -997,14 +996,16 @@ class Acc_Ledger_Sold extends Acc_Ledger {
// Record the current number of article
$Hid=new IHidden();
$p_article= ( isset ($p_article))?$p_article:MAX_ARTICLE;
$p_article= ( isset ($nb_item))?$nb_item:MAX_ARTICLE;
$r.=$Hid->input("nb_item",$p_article);
$max=($p_article < MAX_ARTICLE)?MAX_ARTICLE:$p_article;
$f_legend_detail=_("Détail articles vendus");
// For each article
//--
for ($i=0;$i< MAX_ARTICLE;$i++) {
for ($i=0;$i< $max;$i++) {
// Code id, price & vat code
//--
$march=(isset(${"e_march$i"}))?${"e_march$i"}:"";

View file

@ -482,6 +482,7 @@ de donn&eacute;es");
$ret.=$f.$aArray[$i][$idx];
$f=',';
}
$ret=trim($ret,',');
return $ret;
}
/*!

View file

@ -656,12 +656,12 @@ class Document
extract ($_POST);
$id='e_march'.$counter.'_tva_id';
if ( !isset (${$id}) ) return "";
if ( ${$id} == -1 ) return "";
if ( ${$id} == -1 || ${$id}=='' ) return "";
$march_id='e_march'.$counter.'_price' ;
if ( ! isset (${$march_id})) return '';
$tva=new Acc_Tva($this->db);
$tva->set_parameter("id",${$id});
$tva->load();
if ( $tva->load() == -1) return '';
return $tva->get_parameter("rate");
break;
@ -722,8 +722,8 @@ class Document
|| strlen(trim( $price )) ==0
|| strlen(trim($qt)) ==0)
return "";
$oTva=new Acc_Tva($cn,${$tva});
if ($oTva->load() == null) return "";
$oTva=new Acc_Tva($this->db,${$tva});
if ($oTva->load() == -1 ) return "";
$r=round(${$price},2)*$oTva->get_parameter('rate');
$r=round($r,2);
break;
@ -739,8 +739,9 @@ class Document
|| strlen(trim( $price )) ==0
|| strlen(trim($qt)) ==0)
return "";
$tva=new Acc_Tva($cn,${$id});
if ($tva->load() == null) {
if ( ! isset (${$tva}) ) return '';
$tva=new Acc_Tva($this->db,${$tva});
if ($tva->load() == -1 ) {
$r=round(${$price},2);
}else {
$r=round(${$price}*$tva->get_parameter('rate')+${$price},2);

View file

@ -888,8 +888,7 @@ Array
return;
}
$qcode=$this->strAttribut(ATTR_DEF_QUICKCODE);
$Res=$this->cn->exec_sql("select j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,j_qcode,".
$Res=$this->cn->exec_sql("select distinct j_date,to_char(j_date,'DD.MM.YYYY') as j_date_fmt,j_qcode,".
"case when j_debit='t' then j_montant else 0 end as deb_montant,".
"case when j_debit='f' then j_montant else 0 end as cred_montant,".
" jr_comment as description,jrn_def_name as jrn_name,".
@ -953,7 +952,7 @@ Array
return;
$rep="";
$already_seen=array();
echo '<h2 class="info">'.$this->id." ".$name.'</h2>';
echo "<TABLE class=\"result\" width=\"100%\">";
echo "<TR>".
@ -965,6 +964,10 @@ Array
"</TR>";
foreach ( $this->row as $op ) {
if ( in_array($op['jr_internal'],$already_seen) )
continue;
else
$already_seen[]=$op['jr_internal'];
echo "<TR style=\"text-align:center;background-color:lightgrey\">".
"<td >".$op['jr_internal']."</td>".
"<td >".$op['j_date']."</td>".