Exemplo n.º 1
0
    def update_totals(self):
        currency = self.app.config.get("CustSettings", "Currency")
        totals = Expenses.get_totals(self.current_date)
        self.ids.lbl_day_total.text = "{} {}".format(currency,
                                                     str(totals["day"]))
        self.ids.lbl_month_total.text = "{} {}".format(currency,
                                                       str(totals["month"]))
        self.ids.lbl_year_total.text = "{} {}".format(currency,
                                                      str(totals["year"]))

        day_limit = float(self.app.config.get("CustSettings", "DayLimitAmt"))
        day_limit_flg = self.app.config.get("CustSettings", "DayLimitFlg")
        if totals["day"] > day_limit and day_limit_flg == "True":
            self.app.theme_cls.primary_palette = "Red"
        else:
            self.app.theme_cls.primary_palette = "Teal"
Exemplo n.º 2
0
    def update_totals(self):
        currency = app_scr.config.get('CustSettings', 'Currency')
        totals = Expenses.get_totals(self.current_date)
        self.ids.lbl_day_total.text = '{} {}'.format(currency,
                                                     str(totals['day']))
        self.ids.lbl_month_total.text = '{} {}'.format(currency,
                                                       str(totals['month']))
        self.ids.lbl_year_total.text = '{} {}'.format(currency,
                                                      str(totals['year']))

        day_limit = float(app_scr.config.get('CustSettings', 'DayLimitAmt'))
        day_limit_flg = app_scr.config.get('CustSettings', 'DayLimitFlg')
        if totals['day'] > day_limit and day_limit_flg == 'True':
            app_scr.theme_cls.primary_palette = 'Red'
        else:
            app_scr.theme_cls.primary_palette = 'Teal'