예제 #1
0
    def __init__(self, store):
        """A dialog to print the PaymentFlowHistoryReport report.

        :param store: a store
        """
        self.store = store
        DateRangeDialog.__init__(self, title=self.title, header_text=self.desc)
예제 #2
0
    def confirm(self):
        DateRangeDialog.confirm(self)
        start = self.retval.start
        end = self.retval.end

        results = PaymentFlowDay.get_flow_history(self.store, start, end)
        if not results:
            info(_('No payment history found.'))
            return False

        print_report(PaymentFlowHistoryReport, payment_histories=results)
        return True
예제 #3
0
    def test_confirm(self):
        dialog = DateRangeDialog()
        start = end = datetime.date(2013, 1, 1)
        dialog.date_filter.set_state(start=start, end=end)
        dialog.confirm()
        self.assertEqual(dialog.retval, date_range(start=start, end=end))

        dialog = DateRangeDialog()
        start = datetime.date(2013, 1, 1)
        end = datetime.date(2013, 2, 1)
        dialog.date_filter.set_state(start=start, end=end)
        dialog.confirm()
        self.assertEqual(dialog.retval, date_range(start=start, end=end))
예제 #4
0
 def test_create(self):
     dialog = DateRangeDialog()
     self.check_dialog(dialog, 'dialog-date-range')