';
$rjrn='';
-$radio=new IRadio('choice');
-$choice=(isset($_GET['choice']))?$_GET['choice']:0;
-$r_jrn=(isset($_GET['r_jrn']))?$_GET['r_jrn']:'';
+
+$choice=$http->get("choice","string",0);
+$r_jrn=$http->get("r_jrn","string","");
echo '
';
echo '
';
echo '
';
@@ -96,7 +85,7 @@ $acc_reconciliation=new Acc_Reconciliation($cn);
$acc_reconciliation->a_jrn=$r_jrn;
$acc_reconciliation->start_day=$dstart->value;
$acc_reconciliation->end_day=$dend->value;
-
+$acc_reconciliation->prepare_query_detail_quant();
$array=$acc_reconciliation->get_data($choice);
$gDossier=Dossier::id();
diff --git a/include/template/impress_reconciliation.php b/include/template/impress_reconciliation.php
index 4de4fe761..821ae3029 100644
--- a/include/template/impress_reconciliation.php
+++ b/include/template/impress_reconciliation.php
@@ -1,71 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
= $i ?>
+
=$array[$i]['str_jr1_jr_date']?>
+
= HtmlInput::detail_op($array[$i]['jr1_jr_id'], $array[$i]['jr1_jr_internal']) ?>
+
= $array[$i]['jr1_jr_pj_number'] ?>
+
= $array[$i]['jr1_jr_comment'] ?>
+
+
=nbm($x)?>
+
+
+ db->execute('detail_quant', array($array[$i]['jr1_jr_id']));
+// echo '
';
+// $acc_reconciliation->show_detail($ret);
+// echo '
';
+
+ if ( $array[$i]['depend_count']>0) {
+ $depend=$acc_reconciliation->db->get_array("select *
+ from temp_total_operation
+ where
+ jr1_jr_id=$1 and ra1_jra_concerned != jr1_jr_id"
+ ,[$array[$i]['jr1_jr_id']]);
+ $nb_depend = count($depend);
+ $totdepend=0;$delta=$x;
+ ?>
+
+
=_("Opération liée")?>
+
+
+
= $i ?>
+
=$depend[$e]["str_jr2_jr_date"] ?>
+
= HtmlInput::detail_op($depend[$e]["ra1_jra_concerned"],$depend[$e]["jr2_jr_internal"]) ?>
+
=$depend[$e]["jr2_jr_pj_number"] ?>
+
=$depend[$e]["jr2_jr_comment"] ?>
+
= nbm($y) ?>
+
+
+
+
+
+ =sprintf(_("Total opération liée : %.2f Delta %.2f"),$totdepend,$delta)?>
+
+ 1)
+ ?>
+
+
+
+
\ No newline at end of file
diff --git a/unit-test/include/class/Acc_ReconciliationTest.php b/unit-test/include/class/Acc_ReconciliationTest.php
new file mode 100644
index 000000000..49e21199f
--- /dev/null
+++ b/unit-test/include/class/Acc_ReconciliationTest.php
@@ -0,0 +1,105 @@
+
+ *
+ */
+
+/**
+ * @file
+ * @brief noalyss
+ */
+use PHPUnit\Framework\TestCase;
+
+/**
+ * @testdox Class Acc_Reconciliation for operations links
+ * @backupGlobals enabled
+ * @coversDefaultClass Acc_Reconciliation
+ */
+class Acc_ReconciliationTest extends TestCase {
+
+ /**
+ * @var Fiche
+ */
+ protected $object;
+ protected $connection;
+ private $g_user;
+
+ /**
+ * @backupGlobals enabled
+ * Sets up the fixture, for example, opens a network connection.
+ * This method is called before a test method is executed.
+ */
+ protected function setUp(): void {
+ require DIRTEST . '/global.php';
+ $this->connection = $g_connection;
+ $this->g_user = $g_user;
+ }
+
+ /**
+ * @testdox Count rows not linked
+ * @global $g_connection
+ */
+ function testNotReconcilied() {
+ $acc_reconciliation = new \Acc_Reconciliation($this->connection);
+ $acc_reconciliation->prepare_query_detail_quant();
+ $array = $acc_reconciliation->get_data(3);
+ $this->assertEquals(18, count($array), "count number of rows found");
+ }
+ /**
+ * @brief build an object Acc_Reconciliation
+ * @return \Acc_Reconciliation
+ */
+ function build_object() {
+ $acc_reconciliation = new \Acc_Reconciliation($this->connection);
+ $acc_reconciliation->start_day = '01.01.2019';
+ $acc_reconciliation->end_day = '01.01.2019';
+ return $acc_reconciliation;
+ }
+
+ /**
+ * @testdox Count rows linked
+ * @backupGlobals enabled
+ */
+ function testReconcilied() {
+ $acc_reconciliation = $this->build_object();
+ $array = $acc_reconciliation->get_data(0);
+ $this->assertEquals(8, count($array), "count number of rows found");
+ }
+
+ /**
+ * @testdox Count rows linked but with different amount
+ * @backupGlobals enabled
+ */
+ function testReconciliedDifferentAmount() {
+ $acc_reconciliation = new \Acc_Reconciliation($this->connection);
+ $array = $acc_reconciliation->get_data(1);
+ $this->assertEquals(0, count($array), "count number of rows found");
+ }
+
+ function testBuild_temp_total_operation() {
+ $acc_reconciliation = new \Acc_Reconciliation($this->connection);
+ $acc_reconciliation->build_temp_total_operation();
+ $acc_reconciliation->build_temp_total_operation();
+ $acc_reconciliation->build_temp_total_operation();
+ $cnt = $this->connection->get_value("select count(*) from temp_total_operation");
+ $this->assertEquals(16, $cnt, " incorrect number of rows");
+ }
+}