[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 75/219: PRINTJRN Use new class http_input
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 75/219: PRINTJRN Use new class http_input |
Date: |
Mon, 18 Dec 2017 13:22:41 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 5d4ba5cf27356d4943b38b1c71a1a9fe19ad3528
Author: Dany De Bontridder <address@hidden>
Date: Tue Oct 10 12:51:11 2017 +0200
PRINTJRN Use new class http_input
---
include/impress_jrn.inc.php | 153 ++++++++++++++++++++++++--------------------
1 file changed, 84 insertions(+), 69 deletions(-)
diff --git a/include/impress_jrn.inc.php b/include/impress_jrn.inc.php
index 5144bf5..f900ab9 100644
--- a/include/impress_jrn.inc.php
+++ b/include/impress_jrn.inc.php
@@ -31,7 +31,7 @@ load_all_script();
$gDossier = dossier::id();
global $g_user,$http;
//-----------------------------------------------------
-// Show the jrn and date
+// Show the ledger and date
//-----------------------------------------------------
require_once NOALYSS_INCLUDE.'/lib/database.class.php';
@@ -94,7 +94,6 @@ echo '</form>';
?>
<?php
-
echo '<FORM METHOD="GET">' . dossier::hidden();
echo HtmlInput::get_to_hidden(array('ac', 'type'));
echo HtmlInput::hidden('type', 'jrn');
@@ -109,22 +108,26 @@ print '</TR>';
print '<TR>';
// filter on the current year
$filter_year = " where p_exercice='" . sql_string($exercice) . "'";
+// Get the from_periode and to_periode
+$from_periode=$http->get("from_periode","numeric","");
+$to_periode=$http->get("to_periode","numeric","");
$periode_start = $cn->make_array("select p_id,to_char(p_start,'DD-MM-YYYY')
from parm_periode $filter_year order by p_start,p_end");
-$w->selected = (isset($_GET['from_periode'])) ? $_GET['from_periode'] : '';
+$w->selected = $from_periode ;
+
print td('Depuis') . $w->input('from_periode', $periode_start);
print '</TR>';
print '<TR>';
$periode_end = $cn->make_array("select p_id,to_char(p_end,'DD-MM-YYYY') from
parm_periode $filter_year order by p_start,p_end");
-$w->selected = (isset($_GET['to_periode'])) ? $_GET['to_periode'] : '';
+$w->selected = $to_periode ;
// By default , show last day of exercice
- if ($w->selected== '' ){
- $t_periode=new Periode($cn);
- list($per_max,$per_min)=$t_periode->get_limit($exercice);
- $w->selected=$per_min->p_id;
- }
+if ($w->selected== '' ){
+ $t_periode=new Periode($cn);
+ list($per_max,$per_min)=$t_periode->get_limit($exercice);
+ $w->selected=$per_min->p_id;
+}
print td('Jusque ') . $w->input('to_periode', $periode_end);
print "</TR><TR>";
$a = array(
@@ -135,9 +138,10 @@ $a = array(
$w->selected = 1;
print '</TR>';
print '<TR>';
-$w->selected = (isset($_GET['p_simple'])) ? $_GET['p_simple'] : '1';
+$w->selected = (isset($simple)) ? $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'));
@@ -152,72 +156,83 @@ echo '<hr>';
//-----------------------------------------------------
if (isset($_REQUEST['bt_html']))
{
+ // Type of report : listing=1 , Accounting writing=0, detail =2
+ $simple=$http->get("p_simple","numeric");
+
+ $jrn_id=$http->get("jrn_id","numeric");
+
require_once NOALYSS_INCLUDE.'/class/acc_ledger.class.php';
+ /*
+ * If it is not asked to print separately the ledger
+ * or if a specific ledger is asked
+ */
+ $Jrn = new Acc_Ledger($cn, $jrn_id);
+ $Jrn->get_name();
+ $ledger_type=$Jrn->get_type() ;
+ switch ($simple)
+ {
+ case "0":
+ // List of accounting writing
+ $Row = $Jrn->get_row($from_periode, $to_periode);
+ break;
+ case "1":
+ // simple list of operations, one row / operation
+ $Row = $Jrn->get_rowSimple($from_periode,
$to_periode);
+
+ case "2":
+ // Detail for each operation
+ $Row = $Jrn->get_rowSimple($from_periode,
$to_periode);
+ break;
+ default:
+ die(__FILE__ . ":" . __LINE__ . " error unknown
style [$simple ] ");
+ }
+ $rep = "";
+ $hid = new IHidden();
+ echo '<div class="content">';
+ echo '<h2 class="info">' . h($Jrn->name) . '</h2>';
+ echo "<table>";
+ echo '<TR>';
+ echo '<TD><form method="GET" ACTION="?">' . dossier::hidden() .
+ $hid->input("type", "jrn") . $hid->input('p_action', 'impress') .
"</form></TD>";
- $d = var_export($_GET, true);
- $Jrn = new Acc_Ledger($cn, $_GET['jrn_id']);
- $Jrn->get_name();
- switch ($_GET['p_simple'])
- {
- case "0":
- $Row = $Jrn->get_row($_GET['from_periode'],
$_GET['to_periode']);
- break;
- case "1":
- $Row = $Jrn->get_rowSimple($_GET['from_periode'],
$_GET['to_periode']);
- break;
- case "2":
- $Row = $Jrn->get_rowSimple($_GET['from_periode'],
$_GET['to_periode']);
- break;
- default:
- var_dump($_GET['p_simple']);
- die(__FILE__ . ":" . __LINE__ . " error unknown style
");
- }
- $rep = "";
- $hid = new IHidden();
- echo '<div class="content">';
- echo '<h2 class="info">' . h($Jrn->name) . '</h2>';
- echo "<table>";
- echo '<TR>';
- echo '<TD><form method="GET" ACTION="?">' . dossier::hidden() .
- $hid->input("type", "jrn") . $hid->input('p_action', 'impress') .
"</form></TD>";
-
- echo '<TD><form method="GET" ACTION="export.php">' . dossier::hidden()
.
- HtmlInput::submit('bt_pdf', "Export PDF") .
- HtmlInput::hidden('act', 'PDF:ledger') .
- $hid->input("type", "jrn") .
- $hid->input("jrn_id", $Jrn->id) .
- $hid->input("from_periode", $_GET['from_periode']) .
- $hid->input("to_periode", $_GET['to_periode']);
- echo $hid->input("p_simple", $_GET['p_simple']);
- echo HtmlInput::get_to_hidden(array('ac', 'type'));
- echo "</form></TD>";
+ echo '<TD><form method="GET" ACTION="export.php">' .
dossier::hidden() .
+ HtmlInput::submit('bt_pdf', "Export PDF") .
+ HtmlInput::hidden('act', 'PDF:ledger') .
+ $hid->input("type", "jrn") .
+ $hid->input("jrn_id", $Jrn->id) .
+ $hid->input("from_periode", $from_periode) .
+ $hid->input("to_periode", $to_periode);
+ echo $hid->input("p_simple", $simple);
+ echo HtmlInput::get_to_hidden(array('ac', 'type'));
+ echo "</form></TD>";
- echo '<TD><form method="GET" ACTION="export.php">' . dossier::hidden()
.
- HtmlInput::submit('bt_csv', "Export CSV") .
- HtmlInput::hidden('act', 'CSV:ledger') .
- $hid->input("type", "jrn") .
- $hid->input("jrn_id", $Jrn->id) .
- $hid->input("from_periode", $_GET['from_periode']) .
- $hid->input("to_periode", $_GET['to_periode']);
- echo $hid->input("p_simple", $_GET['p_simple']);
- echo HtmlInput::get_to_hidden(array('ac', 'type'));
- echo "</form></TD>";
+ echo '<TD><form method="GET" ACTION="export.php">' .
dossier::hidden() .
+ HtmlInput::submit('bt_csv', "Export CSV") .
+ HtmlInput::hidden('act', 'CSV:ledger') .
+ $hid->input("type", "jrn") .
+ $hid->input("jrn_id", $Jrn->id) .
+ $hid->input("from_periode", $from_periode) .
+ $hid->input("to_periode", $to_periode);
+ echo $hid->input("p_simple", $simple);
+ echo HtmlInput::get_to_hidden(array('ac', 'type'));
+ echo "</form></TD>";
- echo '<td style="vertical-align:top">';
- echo HtmlInput::print_window();
- echo '</td>';
- echo "</TR>";
+ echo '<td style="vertical-align:top">';
+ echo HtmlInput::print_window();
+ echo '</td>';
+ echo "</TR>";
- echo "</table>";
- if (count($Jrn->row) == 0
- && $Row == null)
- exit;
+ echo "</table>";
+ if (count($Jrn->row) == 0
+ && $Row == null)
+ exit;
+
/////////////////////////////////////////////////////////////////////////////////////
// Ecriture comptable
/////////////////////////////////////////////////////////////////////////////////////
- if ($_GET['p_simple'] == 0)
+ if ($simple== 0)
{
echo '<TABLE class="result">';
// detailled printing
@@ -250,14 +265,14 @@ if (isset($_REQUEST['bt_html']))
echo "</table>";
// show the saldo
- $solde = $Jrn->get_solde($_GET['from_periode'],
$_GET['to_periode']);
+ $solde = $Jrn->get_solde($from_periode, $to_periode);
echo "solde débiteur:" . $solde[0] . "<br>";
echo "solde créditeur:" . $solde[1];
} // if
/////////////////////////////////////////////////////////////////////////////////////
// Liste opérations
/////////////////////////////////////////////////////////////////////////////////////
- elseif ($_GET['p_simple'] == 1)
+ elseif ($simple == 1)
{
if ( $Jrn->get_type() != 'ACH' && $Jrn->get_type() != 'VEN')
{
@@ -337,7 +352,7 @@ if (isset($_REQUEST['bt_html']))
/////////////////////////////////////////////////////////////////////////////////////
// Détaillé
/////////////////////////////////////////////////////////////////////////////////////
- elseif ($_GET['p_simple'] == 2)
+ elseif ($simple == 2)
{
foreach ($Row as $line)
{
- [Noalyss-commit] [noalyss] 175/219: Change autocomplete and adapt Icard setWidth is false + indicator icon for ICard, (continued)
- [Noalyss-commit] [noalyss] 175/219: Change autocomplete and adapt Icard setWidth is false + indicator icon for ICard, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 81/219: PRINTPOSTE : esthetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 121/219: correct js : getMessage instead of message, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 78/219: InPlace_Switch : add a supplemental javascript command, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 10/219: GESTION -> CUST, MANAGER, ADM ... esthetic move the name of the tiers to the right, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 50/219: task #0001467: Journaux VENTES - inversion D/C dans liste de catégorie de fiches, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 169/219: For MSIE, force to unicode (still problem with MSIE11) !, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 94/219: Fix background color for button 'modele operation', Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 139/219: Javascript : small error, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 42/219: SQL : protection injection, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 75/219: PRINTJRN Use new class http_input,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 82/219: Fix Doxygen issue : @example must be in a function otherwise the detailed section of Doxygen disappear, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 64/219: Inplace_Edit : cosmetic, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 137/219: Infobulle : avoid that the info balloon exceed limit of the display, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 193/219: SansationLight add the readme.txt file with license, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 85/219: Task #1349 : si une seule catégorie de fiche , alors on ne doit pas la choisir, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 07/219: Bug : cannot print action in profil Cannot add a export / printing in profile, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 79/219: PRINTGL : do not print accounting without operation, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 182/219: Icon move / fix, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 111/219: Comment Table, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 92/219: Esthetic : hide some columns when screen too small, Dany De Bontridder, 2017/12/18