diff --git a/html/js/acc_ledger.js b/html/js/acc_ledger.js
index 6663c8405..e8b1371e2 100644
--- a/html/js/acc_ledger.js
+++ b/html/js/acc_ledger.js
@@ -1210,13 +1210,13 @@ function success_dsp_letter(req) {
try {
code_html.evalScripts();
} catch (e) {
- alert_box("DSPLETTER:" + content[48] + e.message);
+ alert_box("DSPLETTER1:" + content[48] + e.message);
}
}
function error_dsp_letter(req) {
- alert_box("DSPLETTER:" + content[48]);
+ alert_box("DSPLETTER2:" + content[48]);
}
function search_letter(obj) {
diff --git a/html/js/noalyss_script.js b/html/js/noalyss_script.js
index d4ebda780..8270a4a10 100644
--- a/html/js/noalyss_script.js
+++ b/html/js/noalyss_script.js
@@ -3571,7 +3571,7 @@ var Periode = function (p_ledger) {
}
}
if (count == 0) {
- smoke.signal("Sélectionner au moins une période", function () {
+ smoke.signal("Sélectionner au moins une période", function () {
}, {duration: 1500});
return;
}
diff --git a/html/test.php b/html/test.php
index 89d3fc4d7..3025d438e 100644
--- a/html/test.php
+++ b/html/test.php
@@ -65,17 +65,6 @@ if (!file_exists('authorized_debug'))
define('ALLOWED', 1);
load_all_script();
// To enable assert , set "zend.assertions" in the php.ini file
-ini_set("assert.active",1);
-// assert_options(ASSERT_ACTIVE, 1);
-// assert_options(ASSERT_WARNING, 1);
-//removed in PHP8 assert_options(ASSERT_QUIET_EVAL, 1);
-function my_assert_handler($file, $line, $code)
-{
- echo "
Assert Failed :
- File '$file'
- Line '$line'
- Code '$code'
";
-}
/******************************************************************************************************************/
/* Utilities
/******************************************************************************************************************/
@@ -279,4 +268,4 @@ else
echo "Diff = ".(round(($end_mem-$start_mem)/1024/1024, 2))." Mbytes ";
echo '
';
echo "Execution script ".$script." time = ".(round(($end_time-$start_time), 4))." secondes
";
-}
\ No newline at end of file
+}
diff --git a/include/ajax/ajax_display_letter.php b/include/ajax/ajax_display_letter.php
index bfd8d391a..d52330045 100644
--- a/include/ajax/ajax_display_letter.php
+++ b/include/ajax/ajax_display_letter.php
@@ -231,7 +231,8 @@ $html.=$date_error;
// echo $html;exit;
$html=escape_xml($html);
-header('Content-type: text/xml; charset=UTF-8');
+if (! defined('TEST_UNIT'))
+ header('Content-type: text/xml; charset=UTF-8');
echo <<
diff --git a/include/class/lettering.class.php b/include/class/lettering.class.php
index 33b1fc1c1..ef970cad1 100644
--- a/include/class/lettering.class.php
+++ b/include/class/lettering.class.php
@@ -20,11 +20,13 @@
// Copyright Author Dany De Bontridder danydb@aevalys.eu
-/* !\file
+/*!
+ *\file
* \brief letter the accounting entry (row level)
*/
/**
+ * @class
* @brief mother class for the lettering by account and by card
* use the tables jnt_letter, letter_deb and letter_cred
* - "account"=>"account", => the accounting of the j_id (use by Lettering_Account)
@@ -32,7 +34,14 @@
* - "start"=>"start", => date of the first day
* - "end"=>"end", => date of the last day
* - "sql_ledger"=>"sql_ledger" => the sql clause to filter on the available ledgers
+ *
+ * @see unit-test/include/class/acc_letterTest.php
+ * @see test scenario scenario/XML/ajax_display_letter.php
*/
+
+
+
+#[\AllowDynamicProperties]
class Lettering
{
@@ -50,6 +59,7 @@ class Lettering
var $sql_ledger;
var $object_type;
var $content;
+
/**
* constructor
* @param $p_init resource to database
@@ -351,7 +361,7 @@ class Lettering
}
/**
- * show only the lettered records from jrnx
+ * @brief show only the lettered records from jrnx
* it fills the array $this->content
*/
protected function show_lettered()
@@ -366,7 +376,7 @@ class Lettering
}
/**
- * show only the lettered records from jrnx
+ * @brief show only the lettered records from jrnx
* it fills the array $this->content
*/
protected function show_lettered_diff()
@@ -381,7 +391,7 @@ class Lettering
}
/**
- * show only the not lettered records from jrnx
+ * @brief show only the not lettered records from jrnx
* it fills the array $this->content
*/
protected function show_not_lettered()
@@ -479,8 +489,12 @@ class Lettering
}
/**
- * only for operation retrieved thanks a account (jrnx.j_poste)
+ *@class
+ * @brief only for operation retrieved thanks a account (jrnx.j_poste)
* manage the accounting entries for a given account
+ *
+ * @see unit-test/include/class/acc_letterTest.php
+ *
*/
class Lettering_Account extends Lettering
{
@@ -493,7 +507,7 @@ class Lettering_Account extends Lettering
}
/**
- * fills the this->content, datas are filtered thanks
+ * @brief fills the this->content, datas are filtered thanks
* - fil_deb poss values t (debit), f(credit), ' ' (everything)
* - fil_amount_max max amount
* - fil_amount_min min amount
@@ -548,7 +562,7 @@ class Lettering_Account extends Lettering
}
/**
- * fills this->content with all the operation for the this->account(jrnx.j_poste)
+ * @brief fills this->content with all the operation for the this->account(jrnx.j_poste)
*/
public function get_all()
{
@@ -577,7 +591,7 @@ class Lettering_Account extends Lettering
}
/**
- * same as get_all but only for lettered operation
+ * @brief same as get_all but only for lettered operation
*/
public function get_letter()
{
@@ -606,7 +620,7 @@ class Lettering_Account extends Lettering
}
/**
- * same as get_all but only for lettered operation
+ *@brief same as get_all but only for lettered operation
*/
public function get_letter_diff()
{
@@ -637,7 +651,7 @@ class Lettering_Account extends Lettering
}
/**
- * same as get_all but only for unlettered operation
+ *@brief same as get_all but only for unlettered operation
*/
public function get_unletter()
{
@@ -663,7 +677,8 @@ class Lettering_Account extends Lettering
}
/**
- * only for operation retrieved thanks a quick_code
+ * @class
+ * @brief only for operation retrieved thanks a quick_code
* manage the accounting entries for a given card
*/
class Lettering_Card extends Lettering
@@ -683,7 +698,7 @@ class Lettering_Card extends Lettering
}
/**
- * fills the this->content, datas are filtered thanks
+ *@brief fills the this->content, datas are filtered thanks
* - fil_deb poss values t (debit), f(credit), ' ' (everything)
* - fil_amount_max max amount
* - fil_amount_min min amount
@@ -743,7 +758,7 @@ class Lettering_Card extends Lettering
}
/**
- * fills this->content with all the operation for the this->quick_code(j_qcode)
+ * @brief fills this->content with all the operation for the this->quick_code(j_qcode)
*/
public function get_all()
{
@@ -773,7 +788,7 @@ class Lettering_Card extends Lettering
}
/**
- * same as get_all but only for lettered operation
+ * @brief same as get_all but only for lettered operation
*/
public function get_letter()
{
@@ -801,6 +816,10 @@ class Lettering_Card extends Lettering
$this->content=$this->db->get_array($sql, array($this->quick_code, $this->start, $this->end));
}
+ /**
+ * @brief lettered operation with a different amount
+ * @return void
+ */
public function get_letter_diff()
{
$sql="
@@ -829,7 +848,7 @@ class Lettering_Card extends Lettering
}
/**
- * same as get_all but only for unlettered operation
+ * @brief same as get_all but only for unlettered operation
*/
public function get_unletter()
{
@@ -852,7 +871,7 @@ class Lettering_Card extends Lettering
}
/**
- * fill $this->content with the rows from this query
+ * @brief fill $this->content with the rows from this query
* Columns are
* - j_id, id of jrnx
* - j_date, date opeation (yyyy.mm.dd)
diff --git a/include/lettering.gestion.inc.php b/include/lettering.gestion.inc.php
index 1749d2577..ac201118d 100644
--- a/include/lettering.gestion.inc.php
+++ b/include/lettering.gestion.inc.php
@@ -17,10 +17,13 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Copyright(2004) Dany De Bontridder danydb@aevalys.eu
-/*! \file
- * \brief lettering
+/*!
+ * \file
+ * \brief lettering : included from include/category_card.inc.php, which is part of manager.inc.php, customer.inc.php,...
+ *
* some variable are already defined ($cn, $g_user ...)
*/
+Noalyss\Dbg::echo_file(__FILE__);
if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
global $g_user;
echo '';
@@ -41,13 +44,13 @@ $periode=new Periode($cn);
list($first_per,$last_per)=$periode->get_limit($exercice);
$start=new IDate('start');
-$start->value=(isset($_GET['start']))?$http->get('start'):$first_per->first_day();
+$start->value=(isset($_GET['start']))?$http->get('start','date'):$first_per->first_day();
$r=td(_('Date début'));
$r.=td($start->input());
echo tr($r);
$end=new IDate('end');
-$end->value=(isset($_GET['end']))?$_GET['end']:$last_per->last_day();
+$end->value=(isset($_GET['end']))?$http->get('end','date'):$last_per->last_day();
$r=td(_('Date fin'));
$r.=td($end->input());
echo tr($r);
diff --git a/scenario/XML/ajax_display_letter.php b/scenario/XML/ajax_display_letter.php
new file mode 100644
index 000000000..4e81bab88
--- /dev/null
+++ b/scenario/XML/ajax_display_letter.php
@@ -0,0 +1,41 @@
+ '25',
+ 'j_id' => '343',
+ 'obj_type' => 'card',
+ 'search_start' => '01.01.2019',
+ 'search_end' => '31.12.2019',
+ 'op' => 'dl',
+);
+$_POST=array (
+);
+$_POST['gDossier']=$gDossierLogInput;
+$_GET['gDossier']=$gDossierLogInput;
+ $_REQUEST=array_merge($_GET,$_POST);
+echo h1('Raw');
+include 'ajax_misc.php';
+
+echo h1('Détail');
+ob_start();
+include 'ajax_misc.php';
+$var=ob_get_contents();
+ob_end_clean();
+
+
+$xml=simplexml_load_string($var);
+
+foreach ($xml as $key=>$value) {
+ echo ("key is $key
");
+ echo '';
+ echo '
';
+ print_r( $value);
+ echo '
';
+
+
+}
\ No newline at end of file
diff --git a/unit-test/create-dossier-test.sh b/unit-test/create-dossier-test.sh
index a609f783b..b3f65e29c 100755
--- a/unit-test/create-dossier-test.sh
+++ b/unit-test/create-dossier-test.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-export PGCLUSTER=12/main
+export PGCLUSTER=17/main
DOSSIER_TEST=rel91dossier25
FILE_TEST=dossier25.sql
diff --git a/unit-test/include/class/acc_letter.Test.php b/unit-test/include/class/acc_letterTest.php
similarity index 99%
rename from unit-test/include/class/acc_letter.Test.php
rename to unit-test/include/class/acc_letterTest.php
index 410a5a9b1..f6be39006 100644
--- a/unit-test/include/class/acc_letter.Test.php
+++ b/unit-test/include/class/acc_letterTest.php
@@ -33,7 +33,7 @@ use PHPUnit\Framework\TestCase;
*/
require DIRTEST.'/global.php';
-class Acc_Letter extends TestCase
+class Acc_LetterTest extends TestCase
{
/**
* @var Fiche