diff --git a/html/form_csv.php b/html/form_csv.php index 03a4c512e..799d52173 100644 --- a/html/form_csv.php +++ b/html/form_csv.php @@ -40,7 +40,7 @@ $User->Check(); $Form=new rapport($cn,$_GET['form_id']); -$Form->GetName(); +$Form->get_name(); // Step ? //-- if ( $_GET['p_step'] == 0 ) diff --git a/html/form_pdf.php b/html/form_pdf.php index e7ad4c8bd..2d72a9838 100644 --- a/html/form_pdf.php +++ b/html/form_pdf.php @@ -72,7 +72,7 @@ if ( $_GET['p_step'] == 0 ) } -$Libelle=sprintf("(%s) %s ",$Form->id,$Form->GetName()); +$Libelle=sprintf("(%s) %s ",$Form->id,$Form->get_name()); $pdf->ezText($Libelle,30); // without step diff --git a/html/jrn_csv.php b/html/jrn_csv.php index 77268950c..4530b5e11 100644 --- a/html/jrn_csv.php +++ b/html/jrn_csv.php @@ -49,7 +49,7 @@ if ( $User->CheckAction($cn,IMP) == 0 || $Jrn=new Acc_Ledger($cn,$_GET['jrn_id']); -$Jrn->GetName(); +$Jrn->get_name(); $jrn_type=$Jrn->get_type(); // Detailled printing //--- diff --git a/html/jrn_pdf.php b/html/jrn_pdf.php index cbf807208..8fe9324a7 100644 --- a/html/jrn_pdf.php +++ b/html/jrn_pdf.php @@ -50,7 +50,7 @@ if ($_GET['central'] == 'on' ) { } $Jrn=new Acc_Ledger($cn,$_GET['jrn_id']); -$Jrn->GetName(); +$Jrn->get_name(); $User=new cl_user(DbConnect()); $User->Check(); diff --git a/html/poste_csv.php b/html/poste_csv.php index 7dacbb157..719b7e03c 100644 --- a/html/poste_csv.php +++ b/html/poste_csv.php @@ -50,7 +50,7 @@ if ( count($a_poste) == 0 ) foreach ($a_poste as $pos) { $Poste=new poste($cn,$pos['pcm_val']); - $Poste->GetName(); + $Poste->get_name(); list($array,$tot_deb,$tot_cred)=$Poste->GetRow( $_POST['from_periode'], $_POST['to_periode'] ); diff --git a/html/poste_pdf.php b/html/poste_pdf.php index 3fb28d020..d62a2ab88 100644 --- a/html/poste_pdf.php +++ b/html/poste_pdf.php @@ -62,7 +62,7 @@ foreach ($a_poste as $poste) if ( count($array) == 0 ) { continue; } - $Libelle=sprintf("(%s) %s ",$Poste->id,$Poste->GetName()); + $Libelle=sprintf("(%s) %s ",$Poste->id,$Poste->get_name()); // $pdf->ezText($Libelle,30); $pdf->ezTable($array, diff --git a/html/send_jrn_pdf.php b/html/send_jrn_pdf.php index cb5055de9..44bd9055b 100644 --- a/html/send_jrn_pdf.php +++ b/html/send_jrn_pdf.php @@ -33,6 +33,8 @@ include_once("postgres.php"); include_once("class.ezpdf.php"); include_once("impress_inc.php"); include_once("preference.php"); +require_once('class_acc_ledger.php'); + echo_debug('send_jrn_pdf.php',__LINE__,"imp pdf journaux"); $l_Db=sprintf("dossier%d",$gDossier); $cn=DbConnect($gDossier); @@ -43,12 +45,8 @@ if ( isset ($_POST['central']) ) { $centr=" centralisé "; $l_centr=1; } - -if ( $_GET["filter"] == YES) { - $name_jrn=GetJrnName($cn,$_GET["p_id"]).$centr; -} else { - $name_jrn="Grand livre ".$centr; -} +$oJrn=new Acc_Ledger($cn,$_GET['p_id']); +$name=$oJrn->get_name().$centr; $ret=""; $pdf=& new Cezpdf("A4"); $pdf->selectFont('./addon/fonts/Helvetica.afm'); diff --git a/include/class_acc_ledger.php b/include/class_acc_ledger.php index bfbcbcbde..22e0b940f 100644 --- a/include/class_acc_ledger.php +++ b/include/class_acc_ledger.php @@ -77,7 +77,7 @@ return $ret['jrn_def_type']; * \brief Return the name of a ledger * */ -function GetName() { +function get_name() { if ( $this->id==0 ) { $this->name=" Grand Livre "; return $this->name; @@ -487,7 +487,7 @@ foreach ( $data_jrnx as $code ) { echo_debug('class_acc_ledger',__LINE__,$code['j_qcode'].'est F ou C'); $p_array['TVAC']=$code['j_montant']; - $p_array['client']=($trunc==0)?$fiche->GetName():substr($fiche->GetName(),0,20); + $p_array['client']=($trunc==0)?$fiche->get_name():substr($fiche->get_name(),0,20); $p_array['reversed']=false; if ( $fiche_def_id == FICHE_TYPE_CLIENT && $code['j_debit']=='f') { @@ -510,7 +510,7 @@ foreach ( $data_jrnx as $code ) { echo_debug('class_acc_ledger',__LINE__,$code['j_qcode']."n 'est PAS F ou C"); $p_array['TVAC']=$code['j_montant']; - $p_array['client']= ($trunc==0)?$fiche->GetName():substr($fiche->GetName(),0,20); + $p_array['client']= ($trunc==0)?$fiche->get_name():substr($fiche->get_name(),0,20); $p_array['reversed']=false; if ($p_jrn_type == 'ACH' && $code['j_debit']=='t') { @@ -813,7 +813,7 @@ function get_propertie() $oposte=new poste($this->db,${'poste'.$i}); $strPoste=$oposte->id; $ret.="
| '.$p_val['code'].' | '.$p_val['date_exec'].' | '.$p_val['montant'].' EUR |
| Journal : ".GetJrnName($p_cn,$p_val['jrn'])." | poste comptable Destination : ".$p_val['bq_account']." | |
| Journal : ".$oJrn->get_name()." | poste comptable Destination : ".$p_val['bq_account']." | |
| '.$p_val['detail'].' | ||
| '.$wConcerned->IOValue("e_concerned".$counter).' | ||
| '.$w->IOValue().' '.$s->IOValue('poste'.$counter.'_label').
diff --git a/include/impress_jrn.inc.php b/include/impress_jrn.inc.php
index 677034d57..2fa12a38b 100644
--- a/include/impress_jrn.inc.php
+++ b/include/impress_jrn.inc.php
@@ -38,7 +38,7 @@ include("class_acc_ledger.php");
$d=var_export($_POST,true);
echo_debug('impress_jrn.php',__LINE__,$d);
$Jrn=new Acc_Ledger($cn,$_POST['jrn_id']);
- $Jrn->GetName();
+ $Jrn->get_name();
if ( $_POST['p_simple']==0 )
{
$Jrn->GetRow( $_POST['from_periode'],
diff --git a/include/impress_rapport.inc.php b/include/impress_rapport.inc.php
index b3065554c..83ed9af92 100644
--- a/include/impress_rapport.inc.php
+++ b/include/impress_rapport.inc.php
@@ -34,7 +34,7 @@ include_once("class_widget.php");
if ( isset( $_GET['bt_html'] ) ) {
include("class_rapport.php");
$Form=new rapport($cn,$_GET['form_id']);
- $Form->GetName();
+ $Form->get_name();
// step asked ?
//--
if ($_GET['p_step'] == 0 ) {
diff --git a/include/jrn.php b/include/jrn.php
index 24a71e664..6fd6e6157 100644
--- a/include/jrn.php
+++ b/include/jrn.php
@@ -740,27 +740,6 @@ function GetInternal($p_cn,$p_id) {
return $l_line['jr_internal'];
}
-/*!
- * \brief Return the name of the jrn
- *
- * parm :
- * - p_cn connexion resource
- * - jrn id
- * gen :
- * - none
- * return:
- * - string or null if not found
- *
- */
-function GetJrnName($p_cn,$p_id) {
- $Res=ExecSql($p_cn,"select jrn_def_name from ".
- " jrn_def where jrn_def_id=".
- $p_id);
- $Max=pg_NumRows($Res);
- if ($Max==0) return null;
- $ret=pg_fetch_array($Res,0);
- return $ret['jrn_def_name'];
-}
/*!
* \brief
* Get the number of the next jrn
diff --git a/include/quick_writing.inc.php b/include/quick_writing.inc.php
index 4c52d7478..b0218ed87 100644
--- a/include/quick_writing.inc.php
+++ b/include/quick_writing.inc.php
@@ -100,7 +100,7 @@ if ( $User->AccessJrn($cn,$id) == false ) {
exit();
}
echo ' ';
-echo ' Journal : '.$ledger->GetName().''; +echo 'Journal : '.$ledger->get_name().''; echo widget::button_href('Autre journal','?p_action='.$_REQUEST['p_action'].'&'.dossier::get()); // User can write ? if ( CheckJrn(dossier::id(),$_SESSION['g_user'],$id) != 2 ) { | ||