コード例 #1
0
 def _setup_events(self):
     SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
     SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
     StockDecreaseWizardFinishEvent.connect(
         self._on_StockDecreaseWizardFinish)
     StockTransferWizardFinishEvent.connect(
         self._on_StockTransferWizardFinish)
コード例 #2
0
ファイル: salereturnwizard.py プロジェクト: LeonamSilva/stoq
    def finish(self):
        for payment in self.model.group.payments:
            if payment.is_preview():
                # Set payments created on SaleReturnPaymentStep as pending
                payment.set_pending()

        SaleReturnWizardFinishEvent.emit(self.model)

        total_amount = self.model.total_amount
        # If the user chose to create credit for the client instead of returning
        # money, there is no need to display this messages.
        if not self.credit:
            if total_amount == 0:
                info(_("The client does not have a debt to this sale anymore. "
                       "Any existing unpaid installment will be cancelled."))
            elif total_amount < 0:
                info(_("A reversal payment to the client will be created. "
                       "You can see it on the Payable Application."))

        self.model.return_(method_name=u'credit' if self.credit else u'money')
        self.retval = self.model
        self.close()

        if self.credit:
            if yesno(_(u'Would you like to print the credit letter?'),
                     gtk.RESPONSE_YES, _(u"Print Letter"), _(u"Don't print")):
                print_report(ClientCreditReport, self.model.client)
コード例 #3
0
    def finish(self):
        for payment in self.model.group.payments:
            if payment.is_preview():
                # Set payments created on SaleReturnPaymentStep as pending
                payment.set_pending()

        SaleReturnWizardFinishEvent.emit(self.model)

        total_amount = self.model.total_amount
        # If the user chose to create credit for the client instead of returning
        # money, there is no need to display this messages.
        if not self.credit:
            if total_amount == 0:
                info(_("The client does not have a debt to this sale anymore. "
                       "Any existing unpaid installment will be cancelled."))
            elif total_amount < 0:
                info(_("A reversal payment to the client will be created. "
                       "You can see it on the Payable Application."))

        self.model.return_(method_name=u'credit' if self.credit else u'money')
        self.retval = self.model
        self.close()

        if self.credit:
            if yesno(_(u'Would you like to print the credit letter?'),
                     gtk.RESPONSE_YES, _(u"Print Letter"), _(u"Don't print")):
                print_report(ClientCreditReport, self.model.client)
コード例 #4
0
 def on_receive_button__clicked(self, event):
     if yesno(_(u'Receive pending returned sale?'), Gtk.ResponseType.NO,
              _(u'Receive'), _(u"Don't receive")):
         current_user = api.get_current_user(self.store)
         self.model.returned_sale.confirm(current_user)
         SaleReturnWizardFinishEvent.emit(self.model.returned_sale)
         self.store.commit(close=False)
         self._setup_status()
コード例 #5
0
 def on_receive_button__clicked(self, event):
     if yesno(_(u'Receive pending returned sale?'), gtk.RESPONSE_NO,
              _(u'Receive'), _(u"Don't receive")):
         current_user = api.get_current_user(self.store)
         self.model.returned_sale.confirm(current_user)
         SaleReturnWizardFinishEvent.emit(self.model.returned_sale)
         self.store.commit(close=False)
         self._setup_status()
コード例 #6
0
ファイル: nfeui.py プロジェクト: Guillon88/stoq
    def __init__(self):
        SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        StockDecreaseWizardFinishEvent.connect(self._on_StockDecreaseWizardFinish)
        StockTransferWizardFinishEvent.connect(self._on_StockTransferWizardFinish)
        # TODO: Before enable the the NF-e generation. Save the invoice data,
        # in Invoice table (for each operation below).
#        NewLoanWizardFinishEvent.connect(self._on_NewLoanWizardFinish)

        pm = PermissionManager.get_permission_manager()
        pm.set('InvoiceLayout', pm.PERM_HIDDEN)
        pm.set('InvoicePrinter', pm.PERM_HIDDEN)

        # since the nfe plugin was enabled, the user must not be able to print
        # the regular fiscal invoice (replaced by the nfe).
        pm.set('app.sales.print_invoice', pm.PERM_HIDDEN)
        self._update_forms()
コード例 #7
0
    def finish(self):
        for payment in self.model.group.payments:
            if payment.is_preview():
                # Set payments created on SaleReturnPaymentStep as pending
                payment.set_pending()

        SaleReturnWizardFinishEvent.emit(self.model)

        total_amount = self.model.total_amount
        if total_amount == 0:
            info(_("The client does not have a debt to this sale anymore. "
                   "Any existing unpaid installment will be cancelled."))
        elif total_amount < 0:
            info(_("A reversal payment to the client will be created. "
                   "You can see it on the Payable Application."))

        self.model.return_(method_name=u'credit' if self.credit else u'money')
        self.retval = self.model
        self.close()
コード例 #8
0
ファイル: nfeui.py プロジェクト: leandrodax/stoq
    def __init__(self):
        SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
        SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
        StockDecreaseWizardFinishEvent.connect(
            self._on_StockDecreaseWizardFinish)
        StockTransferWizardFinishEvent.connect(
            self._on_StockTransferWizardFinish)
        # TODO: Before enable the the NF-e generation. Save the invoice data,
        # in Invoice table (for each operation below).
        #        NewLoanWizardFinishEvent.connect(self._on_NewLoanWizardFinish)

        pm = PermissionManager.get_permission_manager()
        pm.set('InvoiceLayout', pm.PERM_HIDDEN)
        pm.set('InvoicePrinter', pm.PERM_HIDDEN)

        # since the nfe plugin was enabled, the user must not be able to print
        # the regular fiscal invoice (replaced by the nfe).
        pm.set('app.sales.print_invoice', pm.PERM_HIDDEN)
        self._update_forms()
コード例 #9
0
ファイル: salereturnwizard.py プロジェクト: metrorede/stak
    def finish(self):
        invoice_ok = InvoiceSetupEvent.emit()
        if invoice_ok is False:
            # If there is any problem with the invoice, the event will display an error
            # message and the dialog is kept open so the user can fix whatever is wrong.
            return

        login_user = api.get_current_user(self.store)
        self.model.return_(method_name=u'credit' if self.credit else u'money',
                           login_user=login_user)
        SaleReturnWizardFinishEvent.emit(self.model)
        self.retval = self.model
        self.close()

        # Commit before printing to avoid losing data if something breaks
        self.store.confirm(self.retval)
        if self.credit:
            if yesno(_(u'Would you like to print the credit letter?'),
                     Gtk.ResponseType.YES, _(u"Print Letter"), _(u"Don't print")):
                print_report(ClientCreditReport, self.model.client)
コード例 #10
0
    def finish(self):
        for payment in self.model.group.payments:
            if payment.is_preview():
                # Set payments created on SaleReturnPaymentStep as pending
                payment.set_pending()

        SaleReturnWizardFinishEvent.emit(self.model)

        total_amount = self.model.total_amount
        if total_amount == 0:
            info(
                _("The client does not have a debt to this sale anymore. "
                  "Any existing unpaid installment will be cancelled."))
        elif total_amount < 0:
            info(
                _("A reversal payment to the client will be created. "
                  "You can see it on the Payable Application."))

        self.model.return_(method_name=u'credit' if self.credit else u'money')
        self.retval = self.model
        self.close()
コード例 #11
0
    def finish(self):
        invoice_ok = InvoiceSetupEvent.emit()
        if invoice_ok is False:
            # If there is any problem with the invoice, the event will display an error
            # message and the dialog is kept open so the user can fix whatever is wrong.
            return

        for payment in self.model.group.payments:
            if payment.is_preview():
                # Set payments created on SaleReturnPaymentStep as pending
                payment.set_pending()

        total_amount = self.model.total_amount
        # If the user chose to create credit for the client instead of returning
        # money, there is no need to display this messages.
        if not self.credit:
            if total_amount == 0:
                info(
                    _("The client does not have a debt to this sale anymore. "
                      "Any existing unpaid installment will be cancelled."))
            elif total_amount < 0:
                info(
                    _("A reversal payment to the client will be created. "
                      "You can see it on the Payable Application."))

        login_user = api.get_current_user(self.store)
        self.model.return_(method_name=u'credit' if self.credit else u'money',
                           login_user=login_user)
        SaleReturnWizardFinishEvent.emit(self.model)
        self.retval = self.model
        self.close()

        # Commit before printing to avoid losing data if something breaks
        self.store.confirm(self.retval)
        if self.credit:
            if yesno(_(u'Would you like to print the credit letter?'),
                     Gtk.ResponseType.YES, _(u"Print Letter"),
                     _(u"Don't print")):
                print_report(ClientCreditReport, self.model.client)
コード例 #12
0
    def finish(self):
        invoice_ok = InvoiceSetupEvent.emit()
        if invoice_ok is False:
            # If there is any problem with the invoice, the event will display an error
            # message and the dialog is kept open so the user can fix whatever is wrong.
            return

        for payment in self.model.group.payments:
            if payment.is_preview():
                # Set payments created on SaleReturnPaymentStep as pending
                payment.set_pending()

        total_amount = self.model.total_amount
        # If the user chose to create credit for the client instead of returning
        # money, there is no need to display this messages.
        if not self.credit:
            if total_amount == 0:
                info(_("The client does not have a debt to this sale anymore. "
                       "Any existing unpaid installment will be cancelled."))
            elif total_amount < 0:
                info(_("A reversal payment to the client will be created. "
                       "You can see it on the Payable Application."))

        login_user = api.get_current_user(self.store)
        self.model.return_(method_name=u'credit' if self.credit else u'money',
                           login_user=login_user)
        SaleReturnWizardFinishEvent.emit(self.model)
        self.retval = self.model
        self.close()

        # Commit before printing to avoid losing data if something breaks
        self.store.confirm(self.retval)
        if self.credit:
            if yesno(_(u'Would you like to print the credit letter?'),
                     gtk.RESPONSE_YES, _(u"Print Letter"), _(u"Don't print")):
                print_report(ClientCreditReport, self.model.client)
コード例 #13
0
ファイル: nfeui.py プロジェクト: adrianoaguiar/stoq
 def _setup_events(self):
     SaleReturnWizardFinishEvent.connect(self._on_SaleReturnWizardFinish)
     SaleStatusChangedEvent.connect(self._on_SaleStatusChanged)
     StockDecreaseWizardFinishEvent.connect(self._on_StockDecreaseWizardFinish)
     StockTransferWizardFinishEvent.connect(self._on_StockTransferWizardFinish)