noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 01/03: Fix problem in PRINTJRN simple for aut


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 01/03: Fix problem in PRINTJRN simple for autoreversed VAT + correct typo
Date: Sat, 3 Jun 2017 13:13:27 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 09128d75e60d9222626fa49d872a133a55c4b3c6
Author: Dany De Bontridder <address@hidden>
Date:   Tue Apr 18 20:52:46 2017 +0200

    Fix problem in PRINTJRN simple for autoreversed VAT + correct typo
---
 include/class/class_acc_ledger.php |  5 +++--
 include/impress_jrn.inc.php        | 24 ++++++++++++------------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/include/class/class_acc_ledger.php 
b/include/class/class_acc_ledger.php
index 3fa0cdc..29d1aa9 100644
--- a/include/class/class_acc_ledger.php
+++ b/include/class/class_acc_ledger.php
@@ -1095,9 +1095,10 @@ class Acc_Ledger extends jrn_def_sql
                 
                //
                // Retrieve data from jrnx
+                // Order is important for TVA autoreversed
                $sql = "select j_id,j_poste,j_montant, j_debit,j_qcode from 
jrnx where " .
-                               " j_grpt=" . $p_array['grpt_id'];
-               $Res2 = $this->db->exec_sql($sql);
+                               " j_grpt=$1 order by 1 desc"  ;
+               $Res2 = $this->db->exec_sql($sql,array($p_array['grpt_id']));
                $data_jrnx = Database::fetch_all($Res2);
                $c = 0;
 
diff --git a/include/impress_jrn.inc.php b/include/impress_jrn.inc.php
index ace77e2..15a66b9 100644
--- a/include/impress_jrn.inc.php
+++ b/include/impress_jrn.inc.php
@@ -41,11 +41,11 @@ if ($g_user->Admin() == 0 && $g_user->is_local_admin() == 0)
          from jrn_def join jrn_type on jrn_def_type=jrn_type_id
          join user_sec_jrn on uj_jrn_id=jrn_def_id
          where
-         uj_login='$g_user->login'
+         uj_login=$1
          and uj_priv in ('R','W')
                 order by jrn_def_name
          ";
-       $ret = $cn->make_array($sql);
+       $ret = $cn->make_array($sql,0,array($g_user->login));
 }
 else
 {
@@ -60,14 +60,14 @@ $NoPriv = $cn->count_sql("select 
jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_d
                        from jrn_def join jrn_type on jrn_def_type=jrn_type_id
                        join  user_sec_jrn on uj_jrn_id=jrn_def_id
                        where
-                       uj_login='$g_user->id'
+                       uj_login=$1
                        and uj_priv ='X'
-                       ");
+                       ",array($g_user->id));
 /*
  * Show all the available ledgers
  */
 $a = count($ret);
-$all = array('value' => 0, 'label' => 'Tous les journaux disponibles');
+$all = array('value' => 0, 'label' => _('Tous les journaux disponibles'));
 $ret[$a] = $all;
 if (count($ret) < 1)
        NoAccess();
@@ -102,8 +102,8 @@ echo HtmlInput::get_to_hidden(array('exercice'));
 echo '<TABLE  ><TR>';
 $w = new ISelect();
 $w->table = 1;
-$label = "Choisissez le journal";
-$w->selected = (isset($_GET['jrn_id'])) ? $_GET['jrn_id'] : '';
+$label = _("Choisissez le journal");
+$w->selected = HtmlInput::default_value_get('jrn_id','');
 print td($label) . $w->input("jrn_id", $ret);
 print '</TR>';
 print '<TR>';
@@ -128,18 +128,18 @@ $w->selected = (isset($_GET['to_periode'])) ? 
$_GET['to_periode'] : '';
 print td('Jusque ') . $w->input('to_periode', $periode_end);
 print "</TR><TR>";
 $a = array(
-       array('value' => 0, 'label' => 'Ecriture comptable'),
-       array('value' => 1, 'label' => 'Liste opérations'),
-       array('value' => 2, 'label' => 'Avec Détails opérations ')
+       array('value' => 1, 'label' => _('Liste opérations')),
+       array('value' => 0, 'label' => _('Ecriture comptable')),
+       array('value' => 2, 'label' => _('Avec Détails opérations '))
 );
 $w->selected = 1;
 print '</TR>';
 print '<TR>';
-$w->selected = (isset($_GET['p_simple'])) ? $_GET['p_simple'] : '';
+$w->selected = (isset($_GET['p_simple'])) ? $_GET['p_simple'] : '1';
 echo '<td>Style d\'impression '.HtmlInput::infobulle(32).'</td>' . 
$w->input('p_simple', $a);
 print "</TR>";
 echo '</TABLE>';
-print HtmlInput::submit('bt_html', 'Visualisation');
+print HtmlInput::submit('bt_html', _('Visualisation'));
 
 echo '</FORM>';
 echo '<hr>';



reply via email to

[Prev in Thread] Current Thread [Next in Thread]