passiva rekeningen hebben een tegoed (exclusief rekeningen zeiomgekeerd) li> \n"
" Ul> \n"
"Gebruik de rekening van de betalingsbalans te controleren. Span>"
@@ -2952,3 +3196,4 @@ msgstr "Categorie van documenten"
#: html/parametre.php:139
msgid "Ajoute des catégories de documents,..."
msgstr "Voegt categorieën van documenten toe"
+
diff --git a/include/deprecated_jrn.php b/include/deprecated_jrn.php
deleted file mode 100644
index f56bfa0c1..000000000
--- a/include/deprecated_jrn.php
+++ /dev/null
@@ -1,821 +0,0 @@
-";
- $disable=($p_mode==0)?"disabled":"";
- $str_dossier=dossier::get();
- $count=0;
- for ( $i =0 ; $i < sizeof($l_array); $i++) {
- $content=$l_array[$i] ;
-
- // for the first line
- if ( $i == 0 ) {
- $r.="";
- $r.="";
- $r.="";
- $r.='Postes ';
- $r.='Description ';
- $r.='Débit ';
- $r.='Crédit ';
-
- $own = new Own($p_cn);
- $r.=" ";
- }
- $r.="";
- if ( $content['j_debit'] == 'f' ) $r.=$col_vide;
- // $r.="".$content['j_debit']." ";
-
- $r.="".$content['j_poste']." ";
- if ( $content['j_debit'] == 't' ) $r.=$col_vide;
- $qc=($content['j_qcode'] != "")?" [".$content['j_qcode']."]":"";
- if ( $content['j_text'] == '')
- $r.="".$qc.h($content['vw_name'])." ";
- else
- $r.="".$qc.h($content['j_text'])." ";
- if ( $content['j_debit'] == 'f' ) $r.=$col_vide;
- $r.="".$content['j_montant']." ";
- if ( $content['j_debit'] == 't' ) $r.=$col_vide;
- //-- add ca
- //
- if ( $own->MY_ANALYTIC != "nu" && myereg("^[6,7]+",$content['j_poste']))
- {
-
- $r.=display_table_ca($p_cn,$count,$content['j_id'],$own,$p_mode,$content['j_montant']);
- $count++;
- }
-
- $r.=" ";
-
- // }// foreach ($l_array[$i] as $value=>$content)
- }// for ( $i =0 ; $i < sizeof($l_array); $i++)
- if ( $p_mode == 1) {
- $file=new IFile();
- $file->table=1;
- //doc
- if ( $content['jr_pj_name'] != "")
- $r.='Effacer PJ ';
- }
- $r.="".sprintf('%s ',
- $content['jr_id'],
- $content['jr_grpt_id'],
- $str_dossier,
- $content['jr_pj_name']
-
- )." ";
- $r.="
";
-
- if ( $p_mode == 1 ) {
- $r.=" ";
- $r.='Document ';
- $r.= "";
- $r.=tr("Document ".$file->input("pj","","Pièce justificative"));
- $r.="
";
- }
- $r.=" ";
-
- $r.="";
- $r.="Total ".$content['jr_montant']." ";
-
- /* count the number of additionnal info */
- $acc_jrn_info=new Acc_Ledger_Info($p_cn);
- $acc_jrn_info->set_jrn_id($p_jr_id);
-
- /* if additional info > 0 show them */
- if ( $acc_jrn_info->count() > 0 ) {
- $array=$acc_jrn_info->load_all();
- foreach ($array as $row) {
- if ( strpos($row->id_type,'BON_COMMANDE') ===0) {
- $r.="Num bon de commande : ".$row->ji_value.' ';
- }
- if ( strpos($row->id_type,'OTHER') ===0) {
- $r.="Autre info : ".$row->ji_value.' ';
- }
-
- }
- }
-
- if ( $p_mode==1) {
- // show all the related operation
- $rec=new Acc_Reconciliation($p_cn);
- $rec->set_jr_id($content['jr_id']);
- $a=$rec->get();
-
- if ( $a != null ) {
- $r.="Operation concernée ";
-
- $r.= '';
- foreach ($a as $key => $element) {
- $operation=new Acc_operation($p_cn);
- $operation->jr_id=$element;
- $r.=sprintf ('%s ',
- $operation->get_internal($p_cn,$element),
- $element,
- $gDossier);
- $r.=sprintf(' ',
- $content['jr_id'],$element,$gDossier);
- }//for
- $r.= "
";
- }// if ( $a != null )
-
- $search=' ";
-
- $r.= 'Autre rapprochement :
- '.$search;
-
- } // if mode == 1
-
- $r.=' ';
- return $r;
-}
-
-/*!
- * \brief Display the form to UPDATE account operation in the user view
- *
- * \param $p_cn database connection
- * \param $jr_id pk of jrn
- * \param mode 1 editable, 0 for CA
- */
-function deprecated_ShowOperationUser($p_cn,$p_jr_id,$p_mode=1)
-{
-
- $gDossier=dossier::id();
- $l_array=get_dataJrnJrIdUser($p_cn,$p_jr_id);
- $str_dossier=dossier::get();
- /* if the operation doesn't exist in the quant_xxx table then we
- * show the expert view
- */
-
- if ( $l_array == null || empty($l_array) == true) {
- // If the operation is not in quant_sold or quant_purchase
- // because those tables comes later
- $r=ShowOperationExpert($p_cn,$p_jr_id,$p_mode);
- return $r;
- }
-
- // own
- $own=new own($p_cn);
-
- // Javascript
- $r=JS_LEDGER;
-
- // Build the form
- $col_vide=" ";
-
-
- $content=$l_array[0] ;
- // for the first line
- $internal=$content['jr_internal'];
-
- $r.='';
- $r.='';
- $client=new Fiche($p_cn,$content['qp_supplier']);
- $r.="Client : ".$client->getName();
-
- /* now we get the different lines for this operation thanks */
- /* the qp_internal == jr_internal */
- $r.='';
- $r.='Nom ';
- $r.='PU ';
- $r.='Quantité ';
- $r.=' Dep. priv. ';
- if ( $own->MY_TVA_USE=='Y') {
- $r.='tva ';
- $r.='tva ';
- $r.='non ded. ';
- $r.='tva nd ';
- $r.='tva d impot ';
- $r.='total htva ';
- $r.='total tvac ';
- } else
- $r.='total ';
-
- $r.=' ';
- $object=new gestion_purchase($p_cn);
- $object->qp_internal=$internal;
- $array=$object->get_list();
- $tot_tva=0.0;
- $tot_amount=0.0;
- $tot_nd=0.0;
- $tot_tva_nd=0.0;
- $tot_tva_nd_recup=0.0;
- $tot_dep_priv=0.0;
- $i=0;
- $i_march=0;
- foreach ($array as $row) {
-
- $fiche=new Fiche($p_cn,$row->qp_fiche);
- // compute sum
- $tot_tva+=$row->qp_vat;
- $tot_nd+=$row->qp_nd_amount;
- $tot_tva_nd+=$row->qp_nd_tva;
- $tot_tva_nd_recup+=$row->qp_nd_tva_recup;
- $tot_amount+=$row->qp_price;
- $tot_dep_priv+=$row->qp_dep_priv;
-
- // $hid_jid=new IHidden("","p_jid_".$row->j_id,$row->j_id);
- $r.=($i%2==0)?"":' '; $i++;
- $pu=0.0;
- if ( $row->qp_price != 0.0 && $row->qp_price != 0 )
- $pu=round(($row->qp_nd_amount+$row->qp_price)/$row->qp_quantite,2);
- $r.=' '.$fiche->strAttribut(ATTR_DEF_NAME).' ';
- $r.=''.$pu.' ';
- $r.=''.$row->qp_quantite.' ';
- $r.=''.$row->qp_dep_priv.' ';
- // do not show TVA field if we don't use them
- if ($own->MY_TVA_USE == 'Y' ) {
- $r.=''.$row->qp_vat.' ';
- $r.=''.$row->tva_label.' ';
- $r.=''.$row->qp_nd_amount.' ';
- $r.=''.$row->qp_nd_tva.' ';
- $r.=''.$row->qp_nd_tva_recup.' ';
- }
- $r.=''.sprintf("% 12.2f",$row->qp_price).' ';
- $r.=''.sprintf("% 12.2f",$row->qp_vat+$row->qp_nd_amount+$row->qp_nd_tva+$row->qp_nd_tva_recup+$row->qp_price).' ';
- //-- add ca
- //
-
- $content['j_poste']=$fiche->strAttribut(ATTR_DEF_ACCOUNT);
- // echo "j_poste= ".$content['j_poste'];
- if ( $own->MY_ANALYTIC != "nu" && myereg("^[6,7]+",$content['j_poste']))
- {
- $r.=display_table_ca($p_cn,$i_march,$row->j_id,$own,$p_mode,round($tot_amount,2));
- $i_march++;
- }
-
-
- }
- // display sum
- $r.=' ';
- $r.=''.
- 'Total HTVA '.
- ''.sprintf('% 12.2f',$tot_amount)." ".
- " ";
- if ( $tot_tva != 0 )
- $r.=''.
- 'Total TVA '.
- ''.sprintf('%12.2f',$tot_tva)
- ." ".
- " ";
- if ( $tot_nd !=0 )
- $r.=''.
- 'Total nd '.
- ''.sprintf('%12.2f',$tot_nd)." ".
- " ";
- if ( $tot_tva_nd !=0 )
- $r.=''.
- 'Total tva nd '.
- ''.sprintf('%12.2f',$tot_tva_nd)." ".
- " ";
- if ( $tot_tva_nd_recup !=0 )
- $r.=''.
- 'Total tva nd recup. par impot '.
- ''.sprintf('%12.2f',$tot_tva_nd_recup)." ".
- " ";
- if ( $tot_dep_priv !=0 )
- $r.=''.
- 'Total tva nd recup. par impot '.
- ''.sprintf('%12.2f',$tot_dep_priv)." ".
- " ";
-
- $r.=''.
- 'Total '.
- ''.sprintf('%12.2f',$tot_dep_priv+$tot_amount+$tot_tva+$tot_tva_nd_recup+$tot_nd+$tot_tva_nd)." ".
- " ";
-
-
-
- }
-
- // for selling ledger
- if ( $content['jrn_def_type'] == 'VEN' )
- {
- $client=new Fiche($p_cn,$content['qs_client']);
- $r.="Client : ".$client->getName();
-
- /* now we get the different lines for this operation thanks */
- /* the qs_internal == jr_internal */
- $r.'
';
- $r.='';
- $r.='';
- $r.='Nom ';
- $r.='PU ';
- $r.='Quantité ';
- if ($own->MY_TVA_USE == 'Y' ) {
- $r.='tva ';
- $r.='code tva ';
- }
- $r.='prix ';
-
- $own = new Own($p_cn);
-
- $r.=' ';
- $object=new gestion_sold($p_cn);
- $object->qs_internal=$internal;
- $array=$object->get_list();
- $tot_tva=0.0;
- $tot_amount=0.0;
- $i=0;
- $i_march=0;
- foreach ($array as $row) {
- $fiche=new Fiche($p_cn,$row->qs_fiche);
- $tot_tva+=$row->qs_vat;
- $tot_amount+=$row->qs_price;
- $r.=($i%2==0)?"":' '; $i++;
- $pu=0.0;
- if ( $row->qs_price != 0.0 && $row->qs_price != 0 ) $pu=round($row->qs_price/$row->qs_quantite,2);
- $r.=($i%2==0)?" ":' '; $i++;
- $r.=' '.$fiche->strAttribut(ATTR_DEF_NAME).' ';
- $r.=''.$pu.' ';
- $r.=''.$row->qs_quantite.' ';
- if ($own->MY_TVA_USE == 'Y' ) {
- $r.=''.$row->qs_vat.' ';
- $r.=''.$row->tva_label.' ';
- }
- $r.=''.$row->qs_price.' ';
- //-- add ca
- //
-
- $content['j_poste']=$fiche->strAttribut(ATTR_DEF_ACCOUNT);
-
- // echo "j_poste= ".$content['j_poste'];
- if ( $own->MY_ANALYTIC != "nu" && myereg("^[6,7]+",$content['j_poste']))
- {
- $r.=display_table_ca($p_cn,$i_march,$row->j_id,$own,$p_mode,round($row->qs_price,2));
- }
- $i_march++;
-
-
- }
- $r.='
';
- $r.=' ';
- if ($own->MY_TVA_USE == 'Y' ) {
- $r.='";
-
- /* count the number of additionnal info */
- $acc_jrn_info=new Acc_Ledger_Info($p_cn);
- $acc_jrn_info->set_jrn_id($p_jr_id);
-
- /* if additional info > 0 show them */
- if ( $acc_jrn_info->count() > 0 ) {
- $array=$acc_jrn_info->load_all();
- foreach ($array as $row) {
- if ( strpos($row->id_type,'BON_COMMANDE') ===0) {
- $r.="Num bon de commande : ".$row->ji_value.' ';
- }
- if ( strpos($row->id_type,'OTHER') ===0) {
- $r.="Autre info : ".$row->ji_value.' ';
- }
-
- }
- }
-
- $r.=" ";
- if ( $p_mode == 1 ) {
- $r.='Document ';
- $r.= "";
-
- $r.=tr($file->input("pj","","Pièce justificative"));
- $r.="
";
- $r.=" ";
-
- $r.="";
- $r.="Total ".$content['jr_montant']." ";
- // show all the related operation
- $rec=new Acc_Reconciliation($p_cn);
- $rec->set_jr_id($content['jr_id']);
- $a=$rec->get();
-
-
-
- if ( $a != null ) {
- $r.="Operation concernée ";
-
- $r.= '';
- foreach ($a as $key => $element) {
- $operation=new Acc_operation($p_cn);
- $operation->jr_id=$element;
- $r.=sprintf ('%s ',
- $operation->get_internal(),
- $element,
- $gDossier);
- $r.=sprintf(' ',
- $content['jr_id'],$element,$gDossier);
- }//for
- $r.= "
";
- }// if ( $a != null )
-
- $search=' ";
-
- $r.= 'Autre rapprochement :
- '.$search;
- } // if p_mode==1
- $r.=' ';
- // echo $r;
- return $r;
-}
-
-
-/*!
- * \brief Get data from jrn and jrnx thanks the jr_id
- *
- *
- * \param connection
- * \param p_jr_id (jrn.jr_id)
- *
- *
- * \return array
- *
- */
-function deprecated_get_dataJrnJrId ($p_cn,$p_jr_id) {
-
- $Res=$p_cn->exec_sql("select
- j_text,
- j_debit,
- j_poste,
- pcm_lib,
- j_montant,
- jr_montant,
- j_id,
- jr_pj_name,
- jr_grpt_id,
- jr_comment,
- to_char(jr_ech,'DD.MM.YYYY') as jr_ech,
- to_char(jr_date,'DD.MM.YYYY') as jr_date,
- jr_id,jr_internal, jr_rapt,jrn_def_type,
- j_qcode,
- jr_pj_number
- from
- jrnx
- inner join jrn on j_grpt=jr_grpt_id
- inner join jrn_def on jrn_def.jrn_def_id=jrn.jr_def_id
- left outer join tmp_pcmn on j_poste=pcm_val
- where
- jr_id=$p_jr_id
- order by j_debit desc,j_id asc");
- $MaxLine=Database::num_row($Res);
- if ( $MaxLine == 0 ) return null;
-
- for ( $i=0; $i < $MaxLine; $i++) {
- $line=Database::fetch_array($Res,$i);
- $array['j_debit']=$line['j_debit'];
- // is there a name from this j_qcode
- //
- if ( strlen( $line['j_qcode']) != 0 )
- {
- $fiche=new Fiche($p_cn);
- $fiche->get_by_qcode($line['j_qcode']);
-
- $array['vw_name']=$fiche->getName();
- }
- else
- {
- $array['vw_name']=$line['pcm_lib'];
- }
- $array['j_text']=$line['j_text'];
- $array['jr_comment']=$line['jr_comment'];
- $array['j_montant']=$line['j_montant'];
- $array['jr_id']=$line['jr_id'];
- $array['j_id']=$line['j_id'];
- $array['jr_date']=$line['jr_date'];
- $array['jr_internal']=$line['jr_internal'];
- $array['j_poste']=$line['j_poste'];
- $array['jr_montant']=$line['jr_montant'];
- $array['jr_rapt']=$line['jr_rapt'];
- $array['jrn_def_type']=$line['jrn_def_type'];
- $array['jr_grpt_id']=$line['jr_grpt_id'];
- $array['jr_pj_name']=$line['jr_pj_name'];
- $array['j_qcode']=$line['j_qcode'];
- $array['jr_pj_number']=$line['jr_pj_number'];
- // $array['']=$line[''];
-
- $ret_array[$i]=$array;
- }
- return $ret_array;
-}
-/*!
- * \brief Get data from quant_sold or quand_purchase for the user
- * view mode
- *
- *
- * \param connection
- * \param p_jr_id (jrn.jr_id)
- *
- *
- * \return array or null if there is no value
- *
- */
-function deprecated_get_dataJrnJrIdUser ($p_cn,$p_jr_id) {
-
-
- $Res=$p_cn->exec_sql("select ".
- "*,to_char(jr_ech,'DD-MM-YYYY') as ech_fmt".
- " from quant_sold join jrn on (qs_internal=jr_internal) ".
- " join jrn_def on (jr_def_id=jrn_def_id) ".
- " inner join jrnx on (j_grpt=jr_grpt_id )".
- " join tmp_pcmn on (pcm_val=j_poste)".
- " where jr_id=$p_jr_id order by jrnx.j_id");
-
-
- $MaxLine=Database::num_row($Res);
-
-
- // if no info found in quant_sold try in quant_purchase
- if ( $MaxLine == 0 )
- {
- $Res=$p_cn->exec_sql("select ".
- "*,to_char(jr_ech,'DD-MM-YYYY') as ech_fmt".
- " from quant_purchase join jrn on (qp_internal=jr_internal)".
- " join jrn_def on (jr_def_id=jrn_def_id) ".
- " inner join jrnx on (j_grpt=jr_grpt_id) ".
- " join tmp_pcmn on (pcm_val=j_poste)".
- " where jr_id=$p_jr_id");
- $MaxLine=Database::num_row($Res);
- if ( $MaxLine == 0 ) return null;
-
-
-
- }
-
-
- for ( $i=0; $i < $MaxLine; $i++) {
- $line=Database::fetch_array($Res,$i);
-
-
- $array['j_debit']=$line['j_debit'];
- // is there a name from this j_qcode
- //
- if ( strlen( $line['j_qcode']) != 0 )
- {
- $fiche=new Fiche($p_cn);
- $fiche->get_by_qcode($line['j_qcode']);
-
- $array['vw_name']=$fiche->getName();
- }
- else
- {
- $array['vw_name']=$line['pcm_lib'];
- }
-
- if ( isset ($line['qs_client']))
- {
- /* It is an invoice */
- $array['qs_client']=$line['qs_client'];
- }
- else
- {
- /* it a purchase */
- $array['qp_supplier']=$line['qp_supplier'];
-
- }
-
- $array['jr_comment']=$line['jr_comment'];
- $array['j_montant']=$line['j_montant'];
- $array['jr_id']=$line['jr_id'];
- $array['j_id']=$line['j_id'];
- $array['jr_date']=$line['jr_date'];
- $array['jr_internal']=$line['jr_internal'];
- $array['j_poste']=$line['j_poste'];
- $array['jr_montant']=$line['jr_montant'];
- $array['jr_rapt']=$line['jr_rapt'];
- $array['jrn_def_type']=$line['jrn_def_type'];
- $array['jr_grpt_id']=$line['jr_grpt_id'];
- $array['jr_pj_name']=$line['jr_pj_name'];
- $array['jr_pj_number']=$line['jr_pj_number'];
- $array['jrn_ech']=$line['jrn_ech'];
- $array['ech_fmt']=$line['ech_fmt'];
-
- // $array['']=$line[''];
- $ret_array[$i]=$array;
- }
- return $ret_array;
-}
-/*\brief Display a table with analytic accounting in modify_op.php
- * (detail of operation )
- *\param $p_cn database cnx
- *\param $p_seq sequence (nb item)
- *\param $p_jid the concerned j_id
- *\param $p_own object own
- *\param $p_mode readonly or writable
- *\param $p_amount amount
- *\return string to display
- */
-function deprecated_display_table_ca($p_cn,$p_seq,$p_jid,$p_own,$p_mode,$p_amount) {
-
- $op=new Anc_Operation($p_cn);
- $array=$op->get_by_jid($p_jid) ;
- if ( $array != null ) {
- $request=$op->to_request($array,$p_seq);
- return "".$op->display_form_plan($request,1,$p_mode,$p_seq,$p_amount)." ";
- } else {
- return ''.$op->display_form_plan(null,1,$p_mode,$p_seq,$p_amount)." ";
- }
- return "";
-
-}
-?>