Exemple #1
0
    def __init__(self):
        self._ui = None
        self.default_store = get_default_store()
        self._printer_verified = False
        # Delay printer creation until we are accessing pos or till app. Other
        # applications should still be accessible without a printer
        self._printer = None

        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale)
        TillOpenEvent.connect(self._on_TillOpen)
        TillCloseEvent.connect(self._on_TillClose)
        TillAddCashEvent.connect(self._on_TillAddCash)
        TillAddTillEntryEvent.connect(self._on_AddTillEntry)
        TillRemoveCashEvent.connect(self._on_TillRemoveCash)
        StartApplicationEvent.connect(self._on_StartApplicationEvent)
        StopApplicationEvent.connect(self._on_StopApplicationEvent)
        CouponCreatedEvent.connect(self._on_CouponCreatedEvent)
        GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent)
        GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent)
        CheckECFStateEvent.connect(self._on_CheckECFStateEvent)
        HasPendingReduceZ.connect(self._on_HasPendingReduceZ)
        HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent)

        self._till_summarize_action = gtk.Action(
            'Summary', _('Summary'), None, None)
        self._till_summarize_action.connect(
            'activate', self._on_TillSummary__activate)

        add_bindings([
            ('plugin.ecf.read_memory', '<Primary>F9'),
            ('plugin.ecf.summarize', '<Primary>F11'),
        ])
Exemple #2
0
    def _receive(self):
        with api.new_store() as store:
            till = Till.get_current(store)
            assert till

            in_payment = self.results.get_selected()
            payment = store.fetch(in_payment.payment)
            assert self._can_receive(payment)

            retval = run_dialog(SalePaymentConfirmSlave, self, store,
                                payments=[payment], show_till_info=False)
            if not retval:
                return

            try:
                TillAddCashEvent.emit(till=till, value=payment.value)
            except (TillError, DeviceError, DriverError) as e:
                warning(str(e))
                return

            till_entry = till.add_credit_entry(payment.value,
                                               _(u'Received payment: %s') % payment.description)

            TillAddTillEntryEvent.emit(till_entry, store)

        if store.committed:
            self.search.refresh()
Exemple #3
0
    def __init__(self):
        self._ui = None
        self.default_store = get_default_store()
        self._printer_verified = False
        # Delay printer creation until we are accessing pos or till app. Other
        # applications should still be accessible without a printer
        self._printer = None

        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale)
        TillOpenEvent.connect(self._on_TillOpen)
        TillCloseEvent.connect(self._on_TillClose)
        TillAddCashEvent.connect(self._on_TillAddCash)
        TillAddTillEntryEvent.connect(self._on_AddTillEntry)
        TillRemoveCashEvent.connect(self._on_TillRemoveCash)
        StartApplicationEvent.connect(self._on_StartApplicationEvent)
        StopApplicationEvent.connect(self._on_StopApplicationEvent)
        CouponCreatedEvent.connect(self._on_CouponCreatedEvent)
        GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent)
        GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent)
        CheckECFStateEvent.connect(self._on_CheckECFStateEvent)
        HasPendingReduceZ.connect(self._on_HasPendingReduceZ)
        HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent)

        self._till_summarize_action = gtk.Action('Summary', _('Summary'), None,
                                                 None)
        self._till_summarize_action.connect('activate',
                                            self._on_TillSummary__activate)

        add_bindings([
            ('plugin.ecf.read_memory', '<Primary>F9'),
            ('plugin.ecf.summarize', '<Primary>F11'),
        ])
Exemple #4
0
    def on_confirm(self):
        till = self.model.till
        assert till
        try:
            TillAddCashEvent.emit(till=till, value=self.model.value)
        except (TillError, DeviceError, DriverError) as e:
            warning(str(e))
            self.retval = False
            return

        till_entry = till.add_credit_entry(self.model.value, (_(u"Cash in: %s") % (self.reason.get_text(),)))

        TillAddTillEntryEvent.emit(till_entry, self.store)
        _create_transaction(self.store, till_entry)
Exemple #5
0
    def on_confirm(self):
        value = abs(self.model.value)
        till = self.model.till
        assert till
        try:
            self.event.emit(till=till, value=value)
        except (TillError, DeviceError, DriverError) as e:
            warning(str(e))
            self.retval = False
            return

        till_entry = self.create_entry(till, value, self.model.reason)

        TillAddTillEntryEvent.emit(till_entry, self.store)
        _create_transaction(self.store, till_entry)
Exemple #6
0
    def on_confirm(self):
        value = abs(self.model.value)
        till = self.model.till
        assert till
        try:
            self.event.emit(till=till, value=value)
        except (TillError, DeviceError, DriverError) as e:
            warning(str(e))
            self.retval = False
            return

        till_entry = self.create_entry(till, value, self.model.reason)

        TillAddTillEntryEvent.emit(till_entry, self.store)
        _create_transaction(self.store, till_entry)
Exemple #7
0
    def on_confirm(self):
        till = self.model.till
        value = abs(self.model.value)
        assert till
        try:
            TillRemoveCashEvent.emit(till=till, value=value)
        except (TillError, DeviceError, DriverError) as e:
            warning(str(e))
            self.retval = False
            return
        till_entry = till.add_debit_entry(
            value, (_(u'Cash advance paid to employee: %s') %
                    (self._get_employee_name(), )))

        TillAddTillEntryEvent.emit(till_entry, self.store)
        _create_transaction(self.store, till_entry)
Exemple #8
0
    def on_confirm(self):
        till = self.model.till
        value = abs(self.model.value)
        assert till
        try:
            TillRemoveCashEvent.emit(till=till, value=value)
        except (TillError, DeviceError, DriverError) as e:
            warning(str(e))
            self.retval = False
            return
        till_entry = till.add_debit_entry(
            value, (_(u'Cash advance paid to employee: %s') % (
                    self._get_employee_name(), )))

        TillAddTillEntryEvent.emit(till_entry, self.store)
        _create_transaction(self.store, till_entry)
Exemple #9
0
    def on_confirm(self):
        till = self.model.till
        assert till
        try:
            TillAddCashEvent.emit(till=till, value=self.model.value)
        except (TillError, DeviceError, DriverError) as e:
            warning(str(e))
            self.retval = False
            return

        till_entry = till.add_credit_entry(
            self.model.value,
            (_(u'Cash in: %s') % (self.reason.get_text(), )))

        TillAddTillEntryEvent.emit(till_entry, self.store)
        _create_transaction(self.store, till_entry)
Exemple #10
0
 def _setup_events(self):
     SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
     SaleAvoidCancelEvent.connect(self._on_SaleAvoidCancel)
     TillOpenEvent.connect(self._on_TillOpen)
     TillCloseEvent.connect(self._on_TillClose)
     TillAddCashEvent.connect(self._on_TillAddCash)
     TillAddTillEntryEvent.connect(self._on_AddTillEntry)
     TillRemoveCashEvent.connect(self._on_TillRemoveCash)
     StartApplicationEvent.connect(self._on_StartApplicationEvent)
     CouponCreatedEvent.connect(self._on_CouponCreatedEvent)
     GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent)
     GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent)
     CheckECFStateEvent.connect(self._on_CheckECFStateEvent)
     HasPendingReduceZ.connect(self._on_HasPendingReduceZ)
     HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent)
     EditorCreateEvent.connect(self._on_EditorCreateEvent)
     ECFGetPrinterUserNumberEvent.connect(self._on_ECFGetPrinterUserNumberEvent)
Exemple #11
0
 def _setup_events(self):
     SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
     SaleAvoidCancelEvent.connect(self._on_SaleAvoidCancel)
     TillOpenEvent.connect(self._on_TillOpen)
     TillCloseEvent.connect(self._on_TillClose)
     TillAddCashEvent.connect(self._on_TillAddCash)
     TillAddTillEntryEvent.connect(self._on_AddTillEntry)
     TillRemoveCashEvent.connect(self._on_TillRemoveCash)
     StartApplicationEvent.connect(self._on_StartApplicationEvent)
     StopApplicationEvent.connect(self._on_StopApplicationEvent)
     CouponCreatedEvent.connect(self._on_CouponCreatedEvent)
     GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent)
     GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent)
     CheckECFStateEvent.connect(self._on_CheckECFStateEvent)
     HasPendingReduceZ.connect(self._on_HasPendingReduceZ)
     HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent)
     EditorCreateEvent.connect(self._on_EditorCreateEvent)