~strugee/homebank/improve-appstream

« back to all changes in this revision

Viewing changes to src/dsp-account.c

  • Committer: Maxime Doyen
  • Date: 2019-09-20 17:08:33 UTC
  • Revision ID: homebank@free.fr-20190920170833-pkgngx2k72mcb77g
5.2.8 release

Show diffs side-by-side

added added

removed removed

Lines of Context:
738
738
        Transaction *ope = list->data;
739
739
        gdouble value;
740
740
 
741
 
                //#1267344
 
741
                //#1267344 no remind in running balance
742
742
                if(!(ope->status == TXN_STATUS_REMIND))
743
743
                        balance += ope->amount;
744
744
 
749
749
                ope->overdraft = FALSE;
750
750
                value = hb_amount_round(balance, 2);
751
751
                if( value != 0.0 && value < data->acc->minimum )
 
752
                {
752
753
                        ope->overdraft = TRUE;
 
754
                }
753
755
 
754
756
                if(ope->date == ldate)
755
757
                {
856
858
        
857
859
        gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(GTK_LIST_STORE(model)), GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID, PREFS->lst_ope_sort_order);
858
860
 
859
 
        hastext = gtk_entry_get_text_length (GTK_ENTRY(data->ST_search)) >= 2;
 
861
        hastext = (gtk_entry_get_text_length (GTK_ENTRY(data->ST_search)) >= 2) ? TRUE : FALSE;
860
862
        needle = (gchar *)gtk_entry_get_text(GTK_ENTRY(data->ST_search));
861
863
 
862
864
        //build the mask flag for quick search
1334
1336
                }
1335
1337
                break;
1336
1338
 
1337
 
                //none
1338
1339
                case ACTION_ACCOUNT_NONE:
1339
1340
                {
1340
1341
                GtkTreeSelection *selection;
1373
1374
 
1374
1375
                }
1375
1376
                break;
1376
 
                //clear
 
1377
 
1377
1378
                case ACTION_ACCOUNT_CLEAR:
1378
1379
                {
1379
1380
                        GtkTreeSelection *selection;
1393
1394
                }
1394
1395
                break;
1395
1396
 
1396
 
 
1397
 
                //reconcile
1398
1397
                case ACTION_ACCOUNT_RECONCILE:
1399
1398
                {
1400
1399
                GtkTreeSelection *selection;
1434
1433
                }
1435
1434
                break;
1436
1435
 
1437
 
 
1438
1436
                case ACTION_ACCOUNT_FILTER:
1439
1437
                {
1440
1438
 
1491
1489
struct register_panel_data *data;
1492
1490
GtkTreeSelection *selection;
1493
1491
gint flags = GPOINTER_TO_INT(user_data);
 
1492
gboolean visible;
1494
1493
gint count = 0;
1495
1494
 
1496
1495
        data = g_object_get_data(G_OBJECT(gtk_widget_get_ancestor(widget, GTK_TYPE_WINDOW)), "inst_data");
1631
1630
                }
1632
1631
                ui_hub_account_populate(GLOBALS->mainwindow, NULL);
1633
1632
        }
 
1633
 
 
1634
        //#1835588
 
1635
        visible = PREFS->date_future_nbdays > 0 ? TRUE : FALSE;
 
1636
        if( !(filter_preset_daterange_future_enable( hbtk_combo_box_get_active_id(GTK_COMBO_BOX_TEXT(data->CY_range)) )) )
 
1637
                visible = FALSE;
 
1638
        hb_widget_visible(data->CM_future, visible);
 
1639
        DB( g_print(" - show future=%d\n", visible) );
1634
1640
        
1635
1641
        /* update fltinfo */
1636
1642
        DB( g_print(" - statusbar\n") );
1817
1823
 
1818
1824
        list_txn_set_column_acc_visible(GTK_TREE_VIEW(data->LV_ope), data->showall);
1819
1825
 
 
1826
        if( (data->showall == FALSE) && !(data->acc->flags & AF_NOBUDGET) )
 
1827
                list_txn_set_warn_nocategory(GTK_TREE_VIEW(data->LV_ope), TRUE);
 
1828
 
1820
1829
        //DB( g_print(" mindate=%d, maxdate=%d %x\n", data->filter->mindate,data->filter->maxdate) );
1821
1830
 
 
1831
        DB( g_print(" - set range or populate+update sensitive+balance\n") );
 
1832
        
 
1833
        register_panel_cb_filter_reset(widget, user_data);
 
1834
 
1822
1835
        DB( g_print(" - call update visual\n") );
1823
1836
        register_panel_update(widget, GINT_TO_POINTER(UF_VISUAL|UF_SENSITIVE));
1824
1837
 
1825
 
        DB( g_print(" - set range or populate+update sensitive+balance\n") );
1826
 
        
1827
 
        register_panel_cb_filter_reset(widget, user_data);
1828
 
 
1829
1838
}
1830
1839
 
1831
1840
/*
1930
1939
        { "ExportPDF"   , NULL                          , N_("Export as PDF..."), NULL,         N_("Export to a PDF file"), G_CALLBACK (register_panel_action_exportpdf) },
1931
1940
        { "ExportQIF"   , NULL                                          , N_("Export QIF..."), NULL,            N_("Export as QIF"), G_CALLBACK (register_panel_action_exportqif) },
1932
1941
        { "ExportCSV"   , NULL                                          , N_("Export CSV..."), NULL,            N_("Export as CSV"), G_CALLBACK (register_panel_action_exportcsv) },
1933
 
        { "Close"           , ICONNAME_CLOSE            , N_("_Close")                          , "<control>W", N_("Close the current account"),                G_CALLBACK (register_panel_action_close) },
1934
 
 
1935
 
        { "Add"                 , ICONNAME_HB_OPE_ADD       , N_("_Add..."), NULL,              N_("Add a new transaction"), G_CALLBACK (register_panel_action_add) },
1936
 
        { "Inherit"             , ICONNAME_HB_OPE_HERIT     , N_("_Inherit..."), NULL, N_("Inherit from the active transaction"), G_CALLBACK (register_panel_action_inherit) },
1937
 
        { "Edit"                , ICONNAME_HB_OPE_EDIT      , N_("_Edit..."), NULL, N_("Edit the active transaction"),  G_CALLBACK (register_panel_action_edit) },
1938
 
 
1939
 
        { "None"            , NULL                      , N_("_None"), "<control>N",            N_("Toggle none for selected transaction(s)"), G_CALLBACK (register_panel_action_none) },
1940
 
        { "Cleared"         , ICONNAME_HB_OPE_CLEARED   , N_("_Cleared"), "<control>C",         N_("Toggle cleared for selected transaction(s)"), G_CALLBACK (register_panel_action_clear) },
 
1942
        { "Close"           , ICONNAME_CLOSE            , N_("_Close")          , "<control>W", N_("Close the current account"),                G_CALLBACK (register_panel_action_close) },
 
1943
 
 
1944
        { "Add"                 , ICONNAME_HB_OPE_ADD       , N_("_Add..."), "<control>N",              N_("Add a new transaction"), G_CALLBACK (register_panel_action_add) },
 
1945
        { "Inherit"             , ICONNAME_HB_OPE_HERIT     , N_("_Inherit..."), "<control>U", N_("Inherit from the active transaction"), G_CALLBACK (register_panel_action_inherit) },
 
1946
        { "Edit"                , ICONNAME_HB_OPE_EDIT      , N_("_Edit..."), "<control>E", N_("Edit the active transaction"),  G_CALLBACK (register_panel_action_edit) },
 
1947
 
 
1948
        { "None"            , NULL                      , N_("_None"), "<control><shift>C",             N_("Toggle none for selected transaction(s)"), G_CALLBACK (register_panel_action_none) },
 
1949
        { "Cleared"         , ICONNAME_HB_OPE_CLEARED   , N_("_Cleared"), "<control><shift>R",          N_("Toggle cleared for selected transaction(s)"), G_CALLBACK (register_panel_action_clear) },
1941
1950
        { "Reconciled"  , ICONNAME_HB_OPE_RECONCILED, N_("_Reconciled"), "<control>R",          N_("Toggle reconciled for selected transaction(s)"), G_CALLBACK (register_panel_action_reconcile) },
1942
1951
 
1943
1952
        { "MultiEdit"   , ICONNAME_HB_OPE_MULTIEDIT , N_("_Multiple Edit..."), NULL, N_("Edit multiple transaction"),   G_CALLBACK (register_panel_action_multiedit) },
1944
1953
        { "Template"    , ICONNAME_CONVERT          , N_("Create template..."), NULL,           N_("Create template"), G_CALLBACK (register_panel_action_createtemplate) },
1945
 
        { "Delete"              , ICONNAME_HB_OPE_DELETE    , N_("_Delete..."), NULL,           N_("Delete selected transaction(s)"), G_CALLBACK (register_panel_action_remove) },
 
1954
        { "Delete"              , ICONNAME_HB_OPE_DELETE    , N_("_Delete..."), "Delete",               N_("Delete selected transaction(s)"), G_CALLBACK (register_panel_action_remove) },
1946
1955
 
1947
1956
        { "DuplicateMark", NULL                      , N_("Mark duplicate..."), NULL,   NULL, G_CALLBACK (register_panel_action_duplicate_mark) },
1948
1957
//      { "DuplicateClear", NULL                      , N_("Unmark duplicate"), NULL,   NULL, G_CALLBACK (register_panel_action_duplicate_unmark) },