[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 27/46: Task #0002014: Comptabilité analytique
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 27/46: Task #0002014: Comptabilité analytique ordre par date Database_Core setter/getter for sql |
Date: |
Tue, 13 Jul 2021 05:01:57 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 8e95a3a154813b110ab5c4b708d561700e6df13f
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Thu Jun 17 13:44:58 2021 +0200
Task #0002014: Comptabilité analytique ordre par date
Database_Core setter/getter for sql
---
include/class/document_export.class.php | 23 ++++++++++++++++++++---
include/lib/database_core.class.php | 22 ++++++++++++++++++++--
2 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/include/class/document_export.class.php
b/include/class/document_export.class.php
index 6158a5a..ab4c5d7 100644
--- a/include/class/document_export.class.php
+++ b/include/class/document_export.class.php
@@ -59,7 +59,7 @@ class Document_Export
try
{
$this->check_file();
- $stmt=PDFTK." ".$this->store_pdf.'/stamp_*pdf output
'.$this->store_pdf.'/result.pdf';
+ $stmt=PDFTK." ".$this->store_pdf.'/*-stamp_*pdf output
'.$this->store_pdf.'/result.pdf';
$status=0;
echo $stmt;
passthru($stmt, $status);
@@ -171,6 +171,8 @@ class Document_Export
$cnt_feedback=0;
global $cn;
+ $p_array=$this->reorder_array($p_array);
+ $order=0;
// follow progress
$step=round(16/count($p_array), 2);
@@ -254,7 +256,8 @@ class Document_Export
rename($output2, $output);
// Move the PDF into another temp directory
- $this->move_file($output, 'stamp_'.$file_pdf);
+ $this->move_file($output, $order.'-stamp_'.$file_pdf);
+ $order++;
}
$progress->set_value(93);
@@ -430,5 +433,19 @@ class Document_Export
}
return array("output"=>$output,"filepdf"=>$file_pdf);
}
-
+ /**
+ * @brief Order the array with the date
+ * @param array $p_array array of jrn.jr_id
+ */
+ function reorder_array($p_array)
+ {
+ global $cn;
+ if (empty($p_array)) {return array();}
+
+ $list_jrn_id=join(',', $p_array);
+
+ $array=$cn->get_array("select jr_id ,jr_date from jrn where jr_id in
($list_jrn_id) order by jr_date");
+ $array=array_column($array, 'jr_id');
+ return $array;
+ }
}
diff --git a/include/lib/database_core.class.php
b/include/lib/database_core.class.php
index 1b47b24..965c55d 100644
--- a/include/lib/database_core.class.php
+++ b/include/lib/database_core.class.php
@@ -40,6 +40,7 @@ class DatabaseCore
private $ret;
/**< return value */
private $is_open; /*!< true is connected */
+ protected $sql; //!< last SQL stmt executed
/*** Connect to a database return an connx to db or false if it fails
*
@@ -75,7 +76,7 @@ class DatabaseCore
}
$this->is_open = TRUE;
-
+ $this->sql="";
}
@@ -143,8 +144,25 @@ class DatabaseCore
{
$this->is_open = $is_open;
}
-
+ /**
+ * last SQL stmt executed
+ * @param string $sql
+ */
+ public function get_sql()
+ {
+ return $this->sql;
+ }
/**
+ * last SQL stmt executed
+ * @param string $sql
+ */
+ public function set_sql($sql)
+ {
+ $this->sql=$sql;
+ return $this;
+ }
+
+ /**
* \brief send a sql string to the database
* \param $p_string sql string
* \param $p_array array for the SQL string (see pg_query_params)
- [Noalyss-commit] [noalyss] 11/46: protect SQL, (continued)
- [Noalyss-commit] [noalyss] 11/46: protect SQL, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 16/46: Improve email sent : check if file attached, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 15/46: Task #0001417: Reconnexion souple connect, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 09/46: Add waiting_box, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 17/46: Task #0001595: CA - liste d'opérations - pas de choix de l'execice., Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 19/46: clean code : remove useless comment, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 20/46: New #0001983: CA - permettre désactivation poste, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 18/46: Bug: possible to set an empy name for an Analytic plan, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 21/46: Bug #0002011: Encodage opération – Verrouillage nombre de lignes si non vides, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 23/46: Task #0002014: Comptabilité analytique = export des pièces des opérations rapprochées, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 27/46: Task #0002014: Comptabilité analytique ordre par date Database_Core setter/getter for sql,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 24/46: Task #0001974: Duplication d'opération – Inclure l'intitulé, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 33/46: If database connx failed then reload the form, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 12/46: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 22/46: Cosmetic, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 26/46: Typo menu, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 28/46: Task #0002015: Export CSV depuis ANCGL : ajout de colonnes, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 29/46: Use autoload, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 31/46: Module decrease font-size, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 32/46: Code Cleaning #0002022: Utilisation d'un autoloader, Dany De Bontridder, 2021/07/13
- [Noalyss-commit] [noalyss] 35/46: Update Translation, Dany De Bontridder, 2021/07/13