示例#1
0
def Crtx():
    Tempo.TelaAcao()
    log.EscreverLog('Entra Funçao Crt X')
    log.EscreverLog('Crt X')
    autoit.send("{CTRLDOWN}x{CTRLUP}")
    Tela.TelaAlertaCrt('Tela Vazia', 'Sem Alerta')
    log.EscreverLog('Sai Funçao Crt X')
示例#2
0
文件: Tela.py 项目: bopopescu/DevsON
def TratamentoRejeicoes():
    log.EscreverLog('Tratamento de Rejeicoes')
    try:
        Tecla.CrtE()
        Tecla.CrtR()

        Variaveis.Tempo = (Variaveis.TempoAdd + 1)
        log.EscreverLog('Tempo. ate ' + str(Variaveis.Tempo) + ' segundos')
        autoit.win_wait_active("[Class:TFRM_REJEICAONFE2]", Variaveis.Tempo)
        for x in range(0, 1000):
            log.EscreverLog("Tratar Rejeicoes")
            Tempo.TelaAcao()
            autoit.control_click("[Class:TFRM_REJEICAONFE2]",
                                 "TVSMColorButton1")
            Tempo.TelaAcao()
            Tela.AlertaRejeicao()
            Tela.AlertaRejeicao()
            Tempo.TeclaAcao()
    except:
        Tempo.TeclaAcao()
示例#3
0
def Vendedor(Doc,Tipo) :
    #if(autoit.win_wait("[CLASS:TFRM_FINALVENDA]"))==1:
    Variaveis.Retorno = 0
    while Variaveis.Retorno  == 0:
        Variaveis.Retorno = autoit.control_focus("[CLASS:TFRM_FINALVENDA]", "TRzDBButtonEdit1")
        Tempo.Loop()
        Tecla.LimpaTexto()

    #Tempo.Dig()
    log.EscreverLog('Função Vendedor')
    if Variaveis.CodVendedor == '0':
        sSql =  'SELECT  ' \
                'V.CODVEND ' \
                'FROM myouro.VENDEDORES V ' \
                'WHERE V.SITUACAO ="A" AND ' \
                '( V.BLOQUEARVENDA_EMOUTRALOJA = "N" ' \
                'OR V.CODLOJA =' + str(Variaveis.CodLoja) + ')' \
                'ORDER BY RAND() LIMIT 0,1'

        log.EscreverLog('Executando Sql:' + str(sSql))

        Resultado = FuncoesBD.ComDBSlave.Select(sSql)
        if Resultado.__len__() > 0:
            Result = Resultado[0]
            Variaveis.CodVendedor = str(Result[0])
    Tempo.ClickFinalVenda()

    autoit.control_click("[CLASS:TFRM_FINALVENDA]", "TRzDBButtonEdit1")

    Tecla.LimpaTexto()
    Tempo.TeclaAcao()
    log.EscreverLog('Vendedor :' + str(Variaveis.CodVendedor))
    autoit.send(str(Variaveis.CodVendedor))
    Tecla.Enter()


    if Doc == "ORC":
        Tempo.TelaAcao()
        autoit.win_wait_active("[Class:TFRM_SENHAFUNC]", Variaveis.Tempo)

        log.EscreverLog('Senha Libera Orcamento')
        autoit.control_send("[CLASS:TFRM_SENHAFUNC]", "TRzButtonEdit1", Variaveis.SenhaAdmin)
        Tempo.Dig()
        Tecla.Enter()
    Tempo.TempoR()
    log.EscreverLog('Sai Função Vendedor')
示例#4
0
def Lancamentos(Doc, Tipo, CodCli, Seq):
    log.EscreverLog('Rotina Lançamentos')
    Tempo.TelaAcao()

    # 1 - Sem entrega, sem desconto e sem arredondamento
    if (Seq == "1" or Seq == "0"):
        Funcao.ContadorVenda(Doc, Tipo, CodCli, 1)

        Documento.Documento(Doc)

        Venda.Venda()

        Tecla.F8LancamentoVenda()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)

        if CodCli == "0" and Doc == "ORC":
            Tempo.TelaFinalVenda()
            Tecla.Enter()
            DadosOrcamento.DadosOrcamento()

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 2 - Sem entrega, sem desconto e com arredondamento
    if (Seq == "2" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 2 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("0", "1,00")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"
        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 3 - Sem entrega, com desconto e sem arredondamento
    if (Seq == "3" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 3 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "0")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 4 - Sem entrega, com desconto e com arredondamento
    if (Seq == "4" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 4 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "1,00")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"
        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 5 - Sem entrega, com promoção, Sem desconto e sem arredondamento
    if (Seq == "5" or Seq == "0"):
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 5 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.5")

    # 6 - Sem entrega, com promoção, Sem desconto e com arredondamento
    if (Seq == "6" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 6 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("0", "1,00")
        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"
        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 7 - Sem entrega, com promoção, Com desconto e sem arredondamento
    if (Seq == "7" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 7 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "0")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 8 - Sem entrega, com promoção, Com desconto e com arredondamento
    if (Seq == "8" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 8 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "1,00")

        if (Tipo == "E" or Tipo == "V") and Variaveis.DocFiscal != "ORC":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 9 Sem entrega, com alt+w, Sem desconto e sem arredondamento
    if (Seq == "9" or Seq == "0"):
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 9 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 10 Sem entrega, com alt+w, Sem desconto e com arredondamento
    if (Seq == "10" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 10 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("0", "1")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 11 Sem entrega, com alt+w, Com desconto e sem arredondamento
    if (Seq == "11" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 11 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "0")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.11")

    # 12 Sem entrega, com alt+w, Com desconto e com arredondamento
    if (Seq == "12" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 12 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)  # 12')
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "1")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.12")

    # 13 Sem entrega,com promoção, com alt+w, Sem desconto e sem arredondamento
    if (Seq == "13" or Seq == "0"):
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 13 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)  # 13')
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

    # 14 Sem entrega,com promoção, com alt+w, Sem desconto e com arredondamento
    if (Seq == "14" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 14 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)

        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("0", "1")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.14")

    # 15 Sem entrega,com promoção, com alt+w, Com desconto e sem arredondamento
    if (Seq == "15" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 15 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()
            time.sleep(Variaveis.TEnterL)
        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "0")
        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"
        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.15")

    # 16 Sem entrega,com promoção, com alt+w, Com desconto e com arredondamento
    if (Seq == "16" or Seq == "0") and Tipo == "V":
        Variaveis.Nro += 1
        Teste = "Venda: " + str(
            Variaveis.Nro) + " Teste Seq: 16 " + "Doc: " + str(
                Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(Tipo)
        log.EscreverLog(Teste)
        Documento.Documento(Doc)
        Venda.Venda()
        F8.F8()

        if CodCli != "0":
            Cliente.Cliente(Tipo, CodCli)
        if CodCli == "0" and Doc == "ORC":
            time.sleep(Variaveis.TTela)
            time.sleep(Variaveis.TDig)
            log.EscreverLog("Enter")
            autoit.send("{ENTER}")
            time.sleep(Variaveis.TEnter)
            DadosOrcamento.DadosOrcamento()

        time.sleep(Variaveis.TEnterL)
        if Variaveis.VendedorAutomatico == 'N':
            Vendedor.Vendedor(Doc, Tipo)
        Desconto.Desconto("10", "1")

        if (
                Tipo == "E" or Tipo == "V"
        ) and Variaveis.DocFiscal != "ORC" and Variaveis.DocFiscal != "PREV":
            Rec = "S"
        else:
            Rec = "N"

        FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.16")

    if (Doc != "ORC"):
        # 17 Com entrega, Sem desconto e Sem arredondamento
        if (Seq == "17" or Seq == "0"):
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 17 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"

            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.17")

        # 18 Com entrega, sem desconto e com arredondamento
        if (Seq == "18" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 18 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 18')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.18")

        # 19 Com entrega, com desconto e sem arredondamento
        if (Seq == "19" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 19 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "0")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 20 Com entrega, com desconto e com arredondamento
        if (Seq == "20" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 20 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 21 Com entrega, com promoção, sem desconto e sem arredondamento
        if (Seq == "21" or Seq == "0"):
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 21 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 22 Com entrega, com promoção, Sem desconto e com arredondamento
        if (Seq == "22" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 22 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 23 Com entrega, com promoção, Com desconto e sem arredondamento
        if (Seq == "23" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 23 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "0")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 24 Com entrega, com promoção, Com desconto e com arredondamento
        if (Seq == "24" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 24 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 24')
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 25 Com entrega, com alt+w, sem desconto e sem arredondamento
        if (Seq == "25" or Seq == "0"):
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 25 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.25")

        # 26 Com entrega, com alt+w, sem desconto e com arredondamento
        if (Seq == "26" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 26 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 26')

            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.26")

        # 27 Com entrega, com alt+w, Com desconto e sem arredondamento
        if (Seq == "27" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 27 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("1", "0")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.27")

        # 28 Com entrega, com alt+w, Com desconto e com arredondamento
        if (Seq == "28" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 28 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 28')
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.28")

        # 29 Com entrega, com promoção com alt+w, sem desconto e sem arredondamento
        if (Seq == "29" or Seq == "0"):
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 29 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 29')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 30 Com entrega, com promoção com alt+w, sem desconto e com arredondamento
        if (Seq == "30" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 30 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.30")

        # 31 Com entrega, com promoção com alt+w, Com desconto e sem arredondamento
        if (Seq == "31" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 31 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 31')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("1", "0")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.31")

        # 32 Com entrega, com promoção com alt+w, Com desconto e com arredondamento
        if (Seq == "32" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 32 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)

        # 33 Com entrega, com troco, sem desconto e sem arredondamento
        if (Seq == "33" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 33 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 33')
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            TrocoEntrega.TrocoEntrega("1100")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.33")

        # 34 Com Entrega.Entrega, com troco, sem desconto e com arredondamento
        if (Seq == "34" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 34 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.34")

        # 35 Com Entrega.Entrega, com troco,  com desconto e sem arredondamento
        if (Seq == "35" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 35 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "0")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.35")

        # 36 Com Entrega.Entrega, com troco,  com desconto e com arredondamento
        if (Seq == "36" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 36 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 36')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.36")

        # 37 Com Entrega.Entrega, com troco, com promoção, sem desconto e sem arredondamento
        if (Seq == "37" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 37 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()

            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()

            Rec = "N"

            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.37")

        # 38 Com Entrega.Entrega, com troco,  com promoção, sem desconto e com arredondamento
        if (Seq == "38" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 38 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 38')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.38")

        # 39 Com Entrega.Entrega, com troco,  com promoção, Com desconto e sem arredondamento
        if (Seq == "39" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 39 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "0")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.39")

        # 40 Com Entrega.Entrega, com troco,  com promoção, Com desconto e com arredondamento
        if (Seq == "40" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 40 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 40')

            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.40")

        # 41 Com Entrega.Entrega, com troco,  com alt+w, sem desconto e sem arredondamento
        if (Seq == "41" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 41 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 41')

            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.41")

        # 42 Com Entrega.Entrega, com troco,  com alt+w, sem desconto e com arredondamento
        if (Seq == "42" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 42 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 42')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.42")

        # 43 Com Entrega.Entrega, com troco,  com alt+w, Com desconto e sem arredondamento
        if (Seq == "43" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 43 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 43')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "0")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.43")

        # 44 Com Entrega.Entrega, com troco,  com alt+w, sem desconto e sem arredondamento
        if (Seq == "44" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 44 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 44')
            Venda.Venda()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.44")

        # 45 Com Entrega.Entrega, com troco,  com promoção com alt+w, sem desconto e sem arredondamento
        if (Seq == "45" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 45 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 45')
            VendaAltwPromocao.VendaAltwPromocao()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.45")

        # 46 Com Entrega.Entrega, com troco,  com promoção com alt+w, sem desconto e com arredondamento
        if (Seq == "46" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 46 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 46')
            VendaAltwPromocao.VendaAltwPromocao()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("0", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.46")

        # 47 Com Entrega.Entrega, com troco,  com promoção com alt+w, Com desconto e sem arredondamento
        if (Seq == "47" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 47 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)  # 47')
            VendaAltwPromocao.VendaAltwPromocao()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "0")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.47")

        # 48 Com Entrega.Entrega, com troco,  com promoção com alt+w, sem desconto e sem arredondamento
        if (Seq == "48" or Seq == "0") and Tipo == "V":
            Variaveis.Nro += 1
            Teste = "Venda: " + str(
                Variaveis.Nro) + " Teste Seq: 48 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            VendaAltwPromocao.VendaAltwPromocao()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)
            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)
            Desconto.Desconto("10", "1")
            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()
            TrocoEntrega.TrocoEntrega("1200")
            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)  # "1.1.1.48")

        # Teste lotes Refazer depois

        # 1.1.1.49 Com Entrega.Entrega, Sem desconto e Sem arredondamento
        if (Seq == "49" or Seq == "0"):
            Variaveis.Nro += 1
            Teste = "Nro: " + str(
                Variaveis.Nro) + " Teste Seq: 49 " + "Doc: " + str(
                    Doc) + " Cliente: " + str(CodCli) + " Tipo Venda: " + str(
                        Tipo)
            log.EscreverLog(Teste)
            Documento.Documento(Doc)
            VendaLote.VendaLote()
            F8.F8()
            if CodCli != "0":
                Cliente.Cliente(Tipo, CodCli)

            if Variaveis.VendedorAutomatico == 'N':
                Vendedor.Vendedor(Doc, Tipo)

            if CodCli != "0":
                Entrega.Entrega()
            else:
                DadosEntrega.DadosEntrega()

            FechaDadosEntrega.FechaDadosEntrega()
            Rec = "N"
            FinalizaVenda.FinalizaVenda(Doc, Tipo, Rec)
示例#5
0
文件: Tela.py 项目: bopopescu/DevsON
def RecebeDinheiro():
    log.EscreverLog("Função RecebeDinheiro")
    try:
        log.EscreverLog("Forma Paganento")
        Variaveis.Tempo = (Variaveis.TempoAddFinalVenda + 5)
        log.EscreverLog('Tempo. ate ' + str(Variaveis.Tempo) + ' segundos')
        autoit.win_wait_active("[Class:TFRM_FORMAPAGTOOFF]", Variaveis.Tempo)
        log.EscreverLog("Abriu Forma Paganento")
        Recebe = choice([0, 1, 2])

        if Recebe == 1 or Recebe == 2:
            Tempo.TeclaAcaoFinalVenda()
            log.EscreverLog('Zerando Forma Dinheiro')
            autoit.control_set_text("[Class:TFRM_FORMAPAGTOOFF]",
                                    "TRzNumericEdit3", 0)
            Tecla.Enter()
            log.EscreverLog('Forma Pagamento Cheque')

        if Recebe == 2:
            Tempo.TeclaAcaoFinalVenda()
            log.EscreverLog('Zerando Forma Cheque')
            autoit.control_set_text("[Class:TFRM_FORMAPAGTOOFF]",
                                    "TRzNumericEdit2", 0)
            Tecla.Enter()
            log.EscreverLog('Forma Pagamento Cartão')

        if Recebe == 0:
            log.EscreverLog('Forma Pagamento Dinheiro')

        Tecla.TempoM()

        autoit.control_click("[Class:TFRM_FORMAPAGTOOFF]", "TVSMColorButton2")
        log.EscreverLog("Confirma Forma Pagamento")

        Tecla.TempoM()

        if Recebe == 1:
            try:
                Variaveis.Tempo = (Variaveis.TempoAddFinalVenda + 5)
                log.EscreverLog('Tempo. ate ' + str(Variaveis.Tempo) +
                                ' segundos')
                autoit.win_wait_active("[Class:TFRM_CHEQUE]", Variaveis.Tempo)
                autoit.control_set_text("[Class:TFRM_CHEQUE]",
                                        "TRzButtonEdit2", str(Variaveis.CPF))
                Tecla.Enter()

                autoit.control_click("[Class:TFRM_CHEQUE]", "TRzNumericEdit1")
                Tecla.TempoM()
                Tecla.LimpaTexto()
                autoit.control_set_text("[Class:TFRM_CHEQUE]",
                                        "TRzNumericEdit1", '18')

                Tecla.Enter()

                autoit.control_set_text("[Class:TFRM_CHEQUE]",
                                        "TRzNumericEdit5", '1')

                Tecla.Enter()

                autoit.control_click("[Class:TFRM_CHEQUE]", "TVSMColorButton3")
                Tecla.TempoM()

            except:
                log.EscreverLog('Timer ' + str(Variaveis.TAlertaR))

        if Recebe == 2:
            try:
                Variaveis.Tempo = (Variaveis.TempoAddFinalVenda + 5)
                log.EscreverLog('Tempo. ate ' + str(Variaveis.Tempo) +
                                ' segundos')
                autoit.win_wait_active("[Class:TFRM_SELECIONACARTAO]",
                                       Variaveis.Tempo)
                autoit.control_set_text("[Class:TFRM_SELECIONACARTAO]",
                                        "TRzEdit1", '00000')
                Tecla.TempoM()

                autoit.control_click("[Class:TFRM_SELECIONACARTAO]",
                                     "TVSMColorButton2")
                Tecla.TempoM()
            except:
                log.EscreverLog('Timer ' + str(Variaveis.TAlertaR))

        Tecla.TempoM()

        try:
            Variaveis.Tempo = (Variaveis.TempoAddFinalVenda + 5)
            log.EscreverLog('Tempo. ate ' + str(Variaveis.Tempo) + ' segundos')
            autoit.win_wait_active("[Class:TFRM_REJEICAONFE2]",
                                   Variaveis.Tempo)
            log.EscreverLog('Tratamento de Rejeições')
            Tecla.TempoM()
            autoit.control_click("[Class:TFRM_SELECIONACARTAO]",
                                 "TVSMColorButton2")
            Tecla.TempoL()
            Tela.Alerta('Nota Rejeitada', 'Sem Alerta')
            for x in range(0, 3):
                Tecla.Esc()
        except:
            log.EscreverLog('Nota Aceita')

        log.EscreverLog("Fecha Forma Paganento")
        Tecla.TempoM()
    except:
        log.EscreverLog("Venda Prazo ou Convenio não Abre Forma Pagamento")
    log.EscreverLog("Sai Função RecebeDinheiro")
    Tempo.TelaAcao()