diff --git a/html/poste_csv.php b/html/poste_csv.php index 04db280df..fa5e9055d 100644 --- a/html/poste_csv.php +++ b/html/poste_csv.php @@ -38,16 +38,16 @@ $cn=DbConnect($gDossier); $User=new User($cn); $User->Check(); -if ( isset ( $_POST['poste_fille']) ) +if ( isset ( $_REQUEST['poste_fille']) ) { //choisit de voir tous les postes - $a_poste=get_array($cn,"select pcm_val from tmp_pcmn where pcm_val::text like '".$_POST["poste_id"]."%'"); + $a_poste=get_array($cn,"select pcm_val from tmp_pcmn where pcm_val::text like '".$_REQUEST["poste_id"]."%'"); } else { - $a_poste=get_array($cn,"select pcm_val from tmp_pcmn where pcm_val = '".$_POST['poste_id']."'"); + $a_poste=get_array($cn,"select pcm_val from tmp_pcmn where pcm_val = '".$_REQUEST['poste_id']."'"); } -if ( ! isset ($_POST['oper_detail'])) { +if ( ! isset ($_REQUEST['oper_detail'])) { if ( count($a_poste) == 0 ) exit; @@ -55,8 +55,8 @@ if ( ! isset ($_POST['oper_detail'])) { { $Poste=new Acc_Account_Ledger($cn,$pos['pcm_val']); $Poste->get_name(); - list($array,$tot_deb,$tot_cred)=$Poste->get_row( $_POST['from_periode'], - $_POST['to_periode'] + list($array,$tot_deb,$tot_cred)=$Poste->get_row( $_REQUEST['from_periode'], + $_REQUEST['to_periode'] ); if ( count($Poste->row ) == 0 ) continue; @@ -98,8 +98,8 @@ if ( ! isset ($_POST['oper_detail'])) { { $Poste=new Acc_Account_Ledger($cn,$pos['pcm_val']); $Poste->get_name(); - list($array,$tot_deb,$tot_cred)=$Poste->get_row( $_POST['from_periode'], - $_POST['to_periode'] + list($array,$tot_deb,$tot_cred)=$Poste->get_row( $_REQUEST['from_periode'], + $_REQUEST['to_periode'] ); if ( count($Poste->row ) == 0 ) continue; @@ -127,7 +127,7 @@ if ( ! isset ($_POST['oper_detail'])) { $a['description'], $r['j_montant'], $r['debit']); - printf("\n"); + printf("\r\n"); } diff --git a/html/quick_code_csv.php b/html/quick_code_csv.php index 304d47fb3..a05f3dd2e 100644 --- a/html/quick_code_csv.php +++ b/html/quick_code_csv.php @@ -48,6 +48,9 @@ if ( count($Fiche->row ) == 0 ) echo "Aucune donnée"; return; } + + +if ( ! isset ($_REQUEST['oper_detail'])) { echo '"Qcode";'. "\"Code interne\";". "\"Date\";". @@ -55,21 +58,48 @@ echo '"Qcode";'. "\"Débit\";". "\"Crédit\""; printf("\n"); + foreach ( $Fiche->row as $op ) { + echo '"'.$op['j_qcode'].'";'. + '"'.$op['jr_internal'].'"'.";". + '"'.$op['j_date'].'"'.";". + '"'.$op['description'].'"'.";". + sprintf("%8.4f",$op['deb_montant']).";". + sprintf("%8.4f",$op['cred_montant']); + printf("\n"); + + } +}else { + echo '"Poste";"Qcode";"internal"'; + echo '"Date";'. + "\"Description\";". + "\"Montant\";". + "\"D/C\""; + + printf("\r\n"); + + foreach ( $Fiche->row as $op ) { + $acc=new Acc_Operation($cn); + $acc->jr_id=$op['jr_id']; + $result= $acc->get_jrnx_detail(); + foreach ( $result as $r) { + printf('"%s";"%s";"%s";"%s";"%s";%12.2f;"%s"', + $r['j_poste'], + $r['j_qcode'], + $r['jr_internal'], + $r['j_date'], + $a['description'], + $r['j_montant'], + $r['debit']); + printf("\r\n"); + + } -foreach ( $Fiche->row as $op ) { - echo '"'.$op['j_qcode'].'";'. - '"'.$op['jr_internal'].'"'.";". - '"'.$op['j_date'].'"'.";". - '"'.$op['description'].'"'.";". - sprintf("%8.4f",$op['deb_montant']).";". - sprintf("%8.4f",$op['cred_montant']); - printf("\n"); - - -} + + } + } $solde_type=($tot_deb>$tot_cred)?"solde débiteur":"solde créditeur"; -$diff=abs($tot_deb-$tot_cred); + $diff=abs($tot_deb-$tot_cred); printf( '"'."$solde_type".'"'.";". sprintf("%8.4f",$diff).";". diff --git a/include/class_acc_account_ledger.php b/include/class_acc_account_ledger.php index a7d43c2a4..7b9c8d3e7 100644 --- a/include/class_acc_account_ledger.php +++ b/include/class_acc_account_ledger.php @@ -221,9 +221,8 @@ function get_solde_detail($p_cond="") { function HtmlTable() { $this->get_name(); - - list($array,$tot_deb,$tot_cred)=$this->get_row( $_POST['from_periode'], - $_POST['to_periode'] + list($array,$tot_deb,$tot_cred)=$this->get_row( $_REQUEST['from_periode'], + $_REQUEST['to_periode'] ); if ( count($this->row ) == 0 ) @@ -289,12 +288,12 @@ function get_solde_detail($p_cond="") { widget::submit('bt_pdf',"Export PDF"). $hid->IOValue("type","poste"). $hid->IOValue('p_action','impress'). - $hid->IOValue("poste_id",$_POST['poste_id']). - $hid->IOValue("from_periode",$_POST['from_periode']). - $hid->IOValue("to_periode",$_POST['to_periode']); - if (isset($_POST['poste_fille'])) + $hid->IOValue("poste_id",$_REQUEST['poste_id']). + $hid->IOValue("from_periode",$_REQUEST['from_periode']). + $hid->IOValue("to_periode",$_REQUEST['to_periode']); + if (isset($_REQUEST['poste_fille'])) echo $hid->IOValue('poste_fille','on'); - if (isset($_POST['oper_detail'])) + if (isset($_REQUEST['oper_detail'])) echo $hid->IOValue('oper_detail','on'); echo ""; @@ -304,12 +303,12 @@ function get_solde_detail($p_cond="") { widget::submit('bt_csv',"Export CSV"). $hid->IOValue("type","poste"). $hid->IOValue('p_action','impress'). - $hid->IOValue("poste_id",$_POST['poste_id']). - $hid->IOValue("from_periode",$_POST['from_periode']). - $hid->IOValue("to_periode",$_POST['to_periode']); - if (isset($_POST['poste_fille'])) + $hid->IOValue("poste_id",$_REQUEST['poste_id']). + $hid->IOValue("from_periode",$_REQUEST['from_periode']). + $hid->IOValue("to_periode",$_REQUEST['to_periode']); + if (isset($_REQUEST['poste_fille'])) echo $hid->IOValue('poste_fille','on'); - if (isset($_POST['oper_detail'])) + if (isset($_REQUEST['oper_detail'])) echo $hid->IOValue('oper_detail','on'); echo ""; diff --git a/include/class_acc_operation.php b/include/class_acc_operation.php index 878e13770..94fb192c5 100644 --- a/include/class_acc_operation.php +++ b/include/class_acc_operation.php @@ -212,7 +212,7 @@ function get_internal() { $r.=$a; $csv.='"'.$a.'"'; - $csv.="\n\r"; + $csv.="\r\n"; $r.=''; $r.=''; diff --git a/include/class_customer.php b/include/class_customer.php index 9f23b0653..a35d3f831 100644 --- a/include/class_customer.php +++ b/include/class_customer.php @@ -22,7 +22,7 @@ require_once("constant.php"); require_once("postgres.php"); require_once("class_parm_code.php"); require_once("class_widget.php"); - +require_once('class_periode.php'); require_once('class_fiche.php'); require_once('class_acc_account_ledger.php'); require_once('user_common.php'); @@ -195,7 +195,7 @@ where */ function Summary($p_search) { - $str_dossier=dossier::get(); + $str_dossier=dossier::get(); $p_search=FormatString($p_search); $url=urlencode($_SERVER['REQUEST_URI']); $script=$_SERVER['PHP_SELF']; @@ -208,6 +208,13 @@ where $bar=jrn_navigation_bar($offset,$all_client,$_SESSION['g_pagesize'],$page); // set a filter ? $search=""; + + $user=new User($this->cn); + $exercice=$user->get_exercice(); + $tPeriode=new Periode($this->cn); + list($max,$min)=$tPeriode->get_limit($exercice); + + if ( trim($p_search) != "" ) { $search=" and f_id in @@ -229,7 +236,7 @@ where
| Code interne | ". + "Date | ". + "Description | ". + "Débit | ". + "Crédit | ". + "
|---|---|---|---|---|
| ".$op['jr_internal']." | ". + "".$op['j_date']." | ". + "".$op['description']." | ". + ""." | ". + ""." | ". + "
| $solde_type". + " | $diff | ". + "". + " | $tot_deb | ". + "$tot_cred | ". + "