[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 14/30: Bug Fiche_Def->insertAttribut when nee
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 14/30: Bug Fiche_Def->insertAttribut when needed to compute an attribute order |
Date: |
Sat, 3 Dec 2022 08:35:08 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit eba1a727d00c9b5608527fd3b5507b5b8c943d9e
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Wed Nov 23 18:33:21 2022 +0100
Bug Fiche_Def->insertAttribut when needed to compute an attribute order
---
include/class/fiche_def.class.php | 2 +-
unit-test/include/class/Fiche_DefTest.php | 9 ++++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/include/class/fiche_def.class.php
b/include/class/fiche_def.class.php
index 3d169078f..261ff94ce 100644
--- a/include/class/fiche_def.class.php
+++ b/include/class/fiche_def.class.php
@@ -639,7 +639,7 @@ $order
if ( $p_order == -1 ) {
$order = $this->cn->get_value("select ad_default_order from
attr_def where ad_id=$1",[$p_ad_id]);
if ( $order == 0 || empty($order)) {
- $max=$this->get_value("select count(*) from jnt_fic_attr where
fd_id=$1",[$this->id]);
+ $max=$this->cn->get_value("select count(*) from jnt_fic_attr
where fd_id=$1",[$this->id]);
$order=$max*15;
}
}
diff --git a/unit-test/include/class/Fiche_DefTest.php
b/unit-test/include/class/Fiche_DefTest.php
index 03d0a2908..9dbaefcb5 100644
--- a/unit-test/include/class/Fiche_DefTest.php
+++ b/unit-test/include/class/Fiche_DefTest.php
@@ -158,6 +158,7 @@ class Fiche_DefTest extends Testcase
}
}
+
/**
* @testdox getAttribut
*/
@@ -183,7 +184,13 @@ class Fiche_DefTest extends Testcase
// percent deductible
$fiche_def->InsertAttribut(20);
$fiche_def->InsertAttribut(21,120);
- $fiche_def->InsertAttribut(22);
+
+ // check if the automatic order works
+ $defaultOrder=$g_connection->get_value("select ad_default_order from
attr_def where ad_id=22");
+ $g_connection->exec_sql("update attr_def set ad_default_order=null
where ad_id=22");
+ $fiche_def->InsertAttribut(22,-1);
+ $g_connection->exec_sql("update attr_def set ad_default_order=$1 where
ad_id=22",[$defaultOrder]);
+
// accouting for not deductible
$fiche_def->InsertAttribut(51);
- [Noalyss-commit] [noalyss] 29/30: Cosmetic : color, (continued)
- [Noalyss-commit] [noalyss] 29/30: Cosmetic : color, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 28/30: cosmetic, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 30/30: Cosmetic, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 04/30: Show tag in operations list, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 08/30: To let TOOLS plugin to add tag to operation, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 01/30: Bug : no filter on card for ledger PURCHASE, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 05/30: Cosmetic : display cards on one row in account search, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 11/30: Improve Test and set the Patch level to 181, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 13/30: Better error message when cannot save a plugin, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 12/30: Fix : bug cannot save an empty FIN Ledger, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 14/30: Bug Fiche_Def->insertAttribut when needed to compute an attribute order,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 26/30: WHen creating from follow-up , keep a link to the event in the operation, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 24/30: Cosmetic, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 23/30: Comptability : Falkon doesn't understand the javascript token "??", Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 10/30: Bug : typo change by accident function name, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 16/30: Fix bug : prevent identical tags on operation, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 21/30: Change DB version, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 20/30: fix bug followup cannot add first comment, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 22/30: cosmetic : waiting_box, Dany De Bontridder, 2022/12/03
- [Noalyss-commit] [noalyss] 15/30: Cosmetic :, Dany De Bontridder, 2022/12/03