[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 219/219: Task #1378 : show only the ledger of
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 219/219: Task #1378 : show only the ledger of a given type |
Date: |
Mon, 18 Dec 2017 13:23:05 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 689dfc28be3ebcf8b978efd3cb5aea70dda61797
Author: Dany De Bontridder <address@hidden>
Date: Sun Dec 17 18:47:21 2017 +0100
Task #1378 : show only the ledger of a given type
---
html/js/scripts.js | 40 ++++++++++++++++++++++++++++++++++++++
include/cfgledger.inc.php | 5 +++++
include/class/acc_ledger.class.php | 2 +-
3 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/html/js/scripts.js b/html/js/scripts.js
index 02c4792..65192cd 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -3002,4 +3002,44 @@ function pin (object_id) {
);
$('pin_'+object_id).firstChild.innerHTML="≊";
}
+}
+/**
+ * Show only the rows into the table (p_table_id) with the attribute
(p_attribute_name) and if this attribute
+ * has the value of (attribut_value)
+ * @param p_table_id table id
+ * @param p_attribute_name the name of the attribute
+ * @param p_attribute_value the value of the attribute we want to show
+ */
+function show_only_row(p_table_id,p_attribute_name,p_attribute_value)
+{
+ if ( ! $(p_table_id)) {
+ throw "Invalide table id"
+ }
+ var mTable=$(p_table_id) ;
+ var ncount=mTable.rows.length
+ for (var i = 0;i < ncount;i++) {
+ var mRow=mTable.rows[i];
+ if (mRow.getAttribute(p_attribute_name) != undefined &&
mRow.getAttribute(p_attribute_name)!=p_attribute_value){
+ mRow.hide();
+ } else {
+ mRow.show();
+ }
+ }
+}
+/**
+ * Show all the rows into the table (p_table_id)
+ * @param p_table_id table id
+ */
+function show_all_row(p_table_id)
+{
+ if ( ! $(p_table_id)) {
+ throw "Invalide table id"
+ }
+ var mTable=$(p_table_id) ;
+ var ncount=mTable.rows.length
+ for (var i = 0;i < ncount;i++) {
+ var mRow=mTable.rows[i];
+ mRow.show();
+ }
+
}
\ No newline at end of file
diff --git a/include/cfgledger.inc.php b/include/cfgledger.inc.php
index 7002f6e..d9fc2b3 100644
--- a/include/cfgledger.inc.php
+++ b/include/cfgledger.inc.php
@@ -159,6 +159,11 @@ switch ($sa)
// Display list of ledgers
//////////////////////////////////////////////////////////////////////////
if ( $show_menu == 1 ) {
+ echo HtmlInput::anchor_action(_("Tout"),
'show_all_row(\'cfgledger_table_id\')','ledger_all_bt','smallbutton ');
+ echo HtmlInput::anchor_action(_("Financier"),
'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'FIN\')','ledger_fin_bt','smallbutton
');
+ echo HtmlInput::anchor_action(_("Achat"),
'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'ACH\')','ledger_ach_bt','smallbutton
');
+ echo HtmlInput::anchor_action(_("Opérations Diverses"),
'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'ODS\')','ledger_ods_bt','smallbutton
');
+ echo HtmlInput::anchor_action(_("Vente"),
'show_only_row(\'cfgledger_table_id\',\'ledger_type\',\'VEN\')','ledger_ven_bt','smallbutton
');
echo '<div class="content">';
echo $ledger->listing();
echo '</div>';
diff --git a/include/class/acc_ledger.class.php
b/include/class/acc_ledger.class.php
index a146403..9755412 100644
--- a/include/class/acc_ledger.class.php
+++ b/include/class/acc_ledger.class.php
@@ -2617,7 +2617,7 @@ class Acc_Ledger extends jrn_def_sql
{
$l_line=Database::fetch_array($ret, $i);
$url=$base_url."&sa=detail&p_jrn=".$l_line['jrn_def_id'];
- $r.=sprintf('<TR><TD><A HREF="%s">%s</A></TD></TR>', $url,
+ $r.=sprintf('<TR ledger_type="%s"><TD><A
HREF="%s">%s</A></TD></TR>', $l_line['jrn_def_type'],$url,
h($l_line['jrn_def_name']).'
('.$l_line['jrn_def_type'].')');
}
$r.="</TABLE>";
- [Noalyss-commit] [noalyss] 182/219: Icon move / fix, (continued)
- [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
- [Noalyss-commit] [noalyss] 39/219: Acc_Reconciliation : improve function get_amount_noautovat, set the prepare query inside the function, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 172/219: Merge branch 'master' of ns3:/srv/git/noalyss, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 143/219: ANC : balance analytique / comptabilité, corrige bug SQL, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 155/219: Task #1493 Encodage VEN , ACH, Ordre des opérations Déplacement du bouton modèle d'opérations, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 130/219: ANC groupe : little bug in PLANANC, allow a group null, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 142/219: ANC : balance croisée double fixe SQL query, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 160/219: INSTALL : check PHP version minimum 5.5, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 219/219: Task #1378 : show only the ledger of a given type,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 215/219: ICheckBox : add attribute to allow to select checkbox thanks its attribute with the js select_checkbox_attribute, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 170/219: Traduction, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 216/219: Task #1378 : select ledger thanks their type, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 201/219: Task #0001507: Click sur détail opérations apparaît trop haut Problem comes from window.onload loaded with detail operation. Move into do.php , recherche.php , popup.php from script.js, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 40/219: Test : utilisation nouvelle police nouveau theme Stock... Correction bug http_input SQL : correction table jnt_letter , col. inutile, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 86/219: Improve appearance, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 150/219: HttpInput: Exception if the type is not known, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 98/219: esthetic change icon, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 141/219: CSS Esthetic : comment span or IText can have the CSSclass label_item, Dany De Bontridder, 2017/12/18
- [Noalyss-commit] [noalyss] 117/219: Task #0001297: Perfectionnement menu COMPTA/ADV/OPEN remove dead code, Dany De Bontridder, 2017/12/18