Ejemplo n.º 1
0
    def Pagar(self, id):
        # print(self.tb_Parcelas.item(id, 0).text())

        if self.tb_Parcelas.cellWidget(id, 3).text():
            INSERI = CrudAPagar()
            INSERI.idConta = self.tb_Parcelas.item(id, 0).text()
            INSERI.valorPago = self.tb_Parcelas.cellWidget(
                id, 3).text().replace(",", ".")
            INSERI.formaPagamento = self.cb_FormaPagamento.currentData()
            INSERI.dataPagamento = QtCore.QDate.toString(
                QtCore.QDate.currentDate(), "yyyy-MM-dd")

            INSERI.PagarConta()
            self.ParcelasAPagar()
Ejemplo n.º 2
0
    def PagarParcela(self, id):

        if not self.tx_valorPago.text():
            self.tx_valorPago.setFocus()
        elif not self.cb_formaPagamento.currentData():
            self.cb_formaPagamento.setFocus()
        else:
            INSERI = CrudAPagar()
            INSERI.idConta = self.tx_Cod.text()
            INSERI.formaPagamento = self.cb_formaPagamento.currentData()
            INSERI.valorPago = self.tx_valorPago.text().replace(",", ".")
            INSERI.dataPagamento = QtCore.QDate.toString(
                QtCore.QDate.currentDate(), "yyyy-MM-dd")
            INSERI.PagarConta()
            self.BuscaContaAPagar(self.tx_Cod.text())

        pass
Ejemplo n.º 3
0
    def CadContaCompra(self):
        INSERI = CrudAPagar()

        if self.tb_Parcelas.rowCount() > 0:
            for i in range(self.tb_Parcelas.rowCount()):
                try:
                    self.tb_Parcelas.item(i, 0).text()
                    INSERI.idConta = self.tb_Parcelas.item(i, 0).text()
                except:
                    INSERI.idConta = ''
                INSERI.idCompra = self.tx_Cod.text()
                INSERI.idFornecedor = self.tx_Id.text()
                INSERI.descricao = """Pedido de Compra {}. Parcela {} de {} """.format(
                    self.tx_Cod.text(), i + 1, self.tb_Parcelas.rowCount())
                INSERI.obs = ""
                INSERI.categoria = 1
                INSERI.dataVencimento = QtCore.QDate.toString(
                    self.tb_Parcelas.cellWidget(i, 1).date(), "yyyy-MM-dd")
                INSERI.valor = self.tb_Parcelas.item(i, 2).text()
                INSERI.formaPagamento = self.cb_FormaPagamento.currentIndex()
                INSERI.cadContaPagar()