[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [skrooge] /: "5 main categories of expenditure" in dashboard and report is now clickable
From:       Stephane Mankowski <stephane () mankowski ! fr>
Date:       2015-07-31 20:12:36
Message-ID: E1ZLGfU-0005vM-7V () scm ! kde ! org
[Download RAW message or body]

Git commit 198c9205bee744e090b1493a99d1aece6b9300ce by Stephane Mankowski.
Committed on 31/07/2015 at 20:09.
Pushed by smankowski into branch 'master'.

"5 main categories of expenditure" in dashboard and report is now clickable

M  +1    -0    CHANGELOG
M  +1    -1    plugins/generic/skg_monthly/skgmonthlypluginwidget.cpp
M  +1    -1    plugins/skrooge/default/categories_period_table.html
M  +1    -1    plugins/skrooge/default/categories_previous_period_table.html
M  +5    -3    skgbankmodeler/skgdocumentbank.cpp

http://commits.kde.org/skrooge/198c9205bee744e090b1493a99d1aece6b9300ce

diff --git a/CHANGELOG b/CHANGELOG
index 1f51261..bf2255f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -15,6 +15,7 @@ skrooge (2.1.0)
   *New feature: "Open..." action in contextual menu of reports  
   *New feature: New function to import simple rules (payee=xxx => category=yyy) from \
                csv file  
   *New feature: More period options in dashboard widgets  
+  *New feature: "5 main categories of expenditure" in dashboard and report is now \
clickable  
  -- Stephane MANKOWSKI <stephane@mankowski.fr>  xxx
  
diff --git a/plugins/generic/skg_monthly/skgmonthlypluginwidget.cpp \
b/plugins/generic/skg_monthly/skgmonthlypluginwidget.cpp index bf850c0..dab95d5 \
                100644
--- a/plugins/generic/skg_monthly/skgmonthlypluginwidget.cpp
+++ b/plugins/generic/skg_monthly/skgmonthlypluginwidget.cpp
@@ -246,7 +246,7 @@ void SKGMonthlyPluginWidget::dataModified(const QString& \
iTableName, int iIdTran  
         QDate date = QDate::currentDate();
         QStringList list;
-	// TODO(Stephane MANKOWSKI): v_operation_display must be generic
+        // TODO(Stephane MANKOWSKI): v_operation_display must be generic
         getDocument()->getDistinctValues("v_operation_display", "MIN(d_DATEMONTH)", \
"d_date<=CURRENT_DATE", list);  if (list.count()) {
             if (!list[0].isEmpty()) {
diff --git a/plugins/skrooge/default/categories_period_table.html \
b/plugins/skrooge/default/categories_period_table.html index b5b1650..57e8633 100644
--- a/plugins/skrooge/default/categories_period_table.html
+++ b/plugins/skrooge/default/categories_period_table.html
@@ -10,7 +10,7 @@
     {% if forloop.first %}
     {% else %}    
 	<tr{% if item.0 %} class="tabletotal" {% endif %}>
-	    <td>{{ forloop.counter0 }}: {{ item.1 }}</td>
+	    <td>{{ forloop.counter0 }}: <a \
href="skg://Skrooge_operation_plugin/SKGOPERATION_CONSOLIDATED_DEFAULT_PARAMETERS/?operationTable=v_suboperation_consolidated&operationWhereClause={{ \
item.3|encode }}&title={{ item.1|encode }}/{{ report.categories_period.0.2 \
}}&title_icon=view-categories">{{ item.1 }}</a></td>  <td align="right">{{ \
item.2|money|safe }}</td>  </tr>
     {% endif %}        
diff --git a/plugins/skrooge/default/categories_previous_period_table.html \
b/plugins/skrooge/default/categories_previous_period_table.html index \
                807e842..ac69bf0 100644
--- a/plugins/skrooge/default/categories_previous_period_table.html
+++ b/plugins/skrooge/default/categories_previous_period_table.html
@@ -10,7 +10,7 @@
     {% if forloop.first %}
     {% else %}    
 	<tr{% if item.0 %} class="tabletotal" {% endif %}>
-	    <td>{{ forloop.counter0 }}: {{ item.1 }}</td>
+	    <td>{{ forloop.counter0 }}: <a \
href="skg://Skrooge_operation_plugin/SKGOPERATION_CONSOLIDATED_DEFAULT_PARAMETERS/?operationTable=v_suboperation_consolidated&operationWhereClause={{ \
item.3|encode }}&title={{ item.1|encode }}/{{ report.categories_previous_period.0.2 \
}}&title_icon=view-categories">{{ item.1 }}</a></td>  <td align="right">{{ \
item.2|money|safe }}</td>  </tr>
     {% endif %}        
diff --git a/skgbankmodeler/skgdocumentbank.cpp b/skgbankmodeler/skgdocumentbank.cpp
index c3b73e3..245b56a 100644
--- a/skgbankmodeler/skgdocumentbank.cpp
+++ b/skgbankmodeler/skgdocumentbank.cpp
@@ -3110,10 +3110,11 @@ QVariantList SKGDocumentBank::getMainCategories(const \
QString& iPeriod, int iNb)  QVariantList table;
     SKGServices::SKGUnitInfo primary = getPrimaryUnit();
 
+    QString wc = "t_TRANSFER='N' AND " + SKGServices::getPeriodWhereClause(iPeriod) \
+ " AND t_TYPEEXPENSE='-'"; +
     SKGStringListList listTmp;
     SKGError err = executeSelectSqliteOrder("SELECT t_REALCATEGORY, \
                TOTAL(f_REALCURRENTAMOUNT) FROM v_suboperation_consolidated "
-                                            "where t_TRANSFER='N' AND " + \
                SKGServices::getPeriodWhereClause(iPeriod) + " AND t_TYPEEXPENSE='-' \
                "
-                                            "group by t_REALCATEGORY order by \
TOTAL(f_REALCURRENTAMOUNT) LIMIT " % SKGServices::intToString(iNb) % ";", +           \
"WHERE " % wc % " GROUP BY t_REALCATEGORY ORDER BY TOTAL(f_REALCURRENTAMOUNT) LIMIT " \
% SKGServices::intToString(iNb) % ";",  listTmp);
     int nbval = listTmp.count();
     if (!err && nbval) {
@@ -3123,7 +3124,8 @@ QVariantList SKGDocumentBank::getMainCategories(const QString& \
iPeriod, int iNb)  
         for (int i = 1; i < nbval; ++i) {  // Ignore header
             double v = qAbs(SKGServices::stringToDouble(listTmp.at(i).at(1)));
-            table.push_back(QVariantList() << false << listTmp.at(i).at(0) << v);
+            QString cat = listTmp.at(i).at(0);
+            table.push_back(QVariantList() << false << cat << v << QString(wc % " \
AND t_REALCATEGORY='" % SKGServices::stringToSqlString(cat) % "'"));  }
     }
     return table;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic