sábado, 10 de junho de 2017

Aula 1176 WinDev Curso ErpAmarildo 033 - Tabela Custo Nivel Abaixo









TABELA CUSTO NIVEL ABAIXO - Video no Youtube Se Gostou clique aqui para dar joinha




help 1

Nessa aula de hoje

Vamos continuar a fazer o codigo da tabela de custo,
agora, revisando o nivel abaixo

In this class today

Let's continue to do the cost table code,
Now by reviewing the level below


En esta clase de hoy

Vamos a seguir haciendo el código de la tabla de coste,
Ahora, revisando el nivel abajo



http://www.windev.com/ts/download/windev22/windev22_063m.htm



Lançamento Curso Iniciante ao Avancado - Windev/Mobile/Webdev 001/... Aula 1133
Criar Analise/Conexao e Tabela de Empresa - Curso 002/... Aula 1140
ErpAmarildo - Menu Principal - Curso 003/... Aula 1145
Menu Ribbon - Menu Principal - Curso 004/... Aula 1146
Botao Empresa - Menu Ribbon - Curso 005/... Aula 1147
Query Empresa - Cadastro Wdl - Curso 006/... Aula 1148
Tabela Empresa - Curso 007 - Aula 1149
Incluir - Botao Incluir Empresa Tabela Codigo - Curso 008 - Aula 1150
Icone Botao de Incluir - Brinde - Curso ErpAmarildo 9/... aula 1151
Icones Novos - Tabela - Curso ErpAmarldo 10/... Aula 1152
Codigos alteracao Tabela Empresa - Curso ErpAmarildo 11/... Aula 1153
Exclusão Codigos - Tabela Empresa - Curso ErpAmarildo 12/... Aula 1154
Procure - TableEnableFilter - Curso ErpAmarildo 13/... Aula 1155
Menu - Empresas - Chamar Wdl - Curso ErpAmarldo 14/... Aula 1156
Analise - Centro Custo - Niveis - Curso ErpAmarildo 15/... Aula 1157
Conexão Hyperfile - Curso ErpAmarildo 16/... Aula 1158
Tabela-Formulario Custos - Curso ErpAmarildo 17... Aula 1159
Menu Erp Custo - Curso ErpAmarildo 18.. Aula 1160
Tabela Seleciona Empresa - Curso Erp 19/... Aula 1162
CODIGO SELECIONA EMPRESA - CURSO ERP 20/... AULA 1163
ERP CHAMA SELECIONA EMPRESA - CURSO ERP 21/... AULA 1164
ERP AJUSTE -APARECER CODIGO E NOME EMPRESA - CURSO ERP22/... AULA 1165
ERP AJUSTE TELA - CURSO ERP23/... AULA 1166
CODIGO JANELA MDI - CURSO ERP 24/... AULA 1167
Conexao Duvida eRP 25/.. AULA 1168
EMPRESA AJUSTANDO - ERP 26/... AULA 1169
Formulario Custo Ajustando erp 27... aula 1170
Tabela Custo Ajustando erp 28 /... AULA 1171
Formulario Custos - Codigos - erp 29/... AULA 1172
x Nao Sair - Curso Erp 30/... AULA 1173
Tabela Custo - 2o Nivel - ERP 31/ AULA 1174
TABELA CUSTO - MESMO NIVEL - CODIGO - ERP32 / AULA 1175
TABELA CUSTO - NIVEL ABAIXO - CODIGO - ERP33/ AULA 1176
TABELA CUSTOS - LANCAMENTOS - CODIGO - ERP34 / AULAS 1177





// incluir nivel abaixo // Include level below // Incluir el nivel abajo
_nivel is int=0
_grupo is boolean=True
_centro_custo is string=""
// vamos primeiro criar 3 variaveis, nivel, grupo e centro custos
// Let's first create 3 variables, level, group and center costs
// Primero crear 3 variables, nivel, grupo y centro de costes
IF TableSelect(TABLE_CUSTOS) = -1 THEN
    // se nao existir nada na tabela
    // If there is nothing in the table
    // Si no hay nada en la tabla
ELSE

END   
_nivel=TABLE_CUSTOS.COL_NIVEL+1
// aqui pego o nivel atual e soma mais 1
// Here I get the current level and add 1 more
// Aquí llego el nivel actual y suma más 1   
_centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO
// aqui pego o centro de custo atual ex: 01.001 / ou 01 / etc...
// Here I take the current cost center ex: 01.001 / or 01 / etc ...
// Aquí el centro de coste actual ex: 01.001 / o 01 / etc ...   

// AQUI NESSE PONTO VAMOS APRIMORAR O CODIDO DO NIVEL ABAIXO
// HERE WE WILL APPRIMRIATE THE LEVEL CODE BELOW
// AQUÍ EN ESTE PUNTO VAMOS APRIMORAR EL CODIDO DEL NIVEL ABAJO
n_CONTADOR is int=3
// CRIEI UMA VARIAVEL CHAMADO CONTADOR E COLOQUEI 3 COMO INICIO
// I CREATED A VARIABLE CALLED COUNTER AND COLLECTED 3 HOW TO START
// CRIEI UNA VARIABLE LLAMADO CONTADOR Y COLOQUE 3 COMO INICIO
LOOP
    //AGORA VOU MOVER PARA KA O QUE ESTA NA LINHA 23 ATE LINHA 28, VAMOS TROCAR
    //                     O NUMERO 3 PELO N_CONTADOR
    //NOW I'LL MOVE TO KA WHAT IS ON THE LINE 23 ATE LINE 28, LET'S CHANGE
    //                     NUMBER 3 BY N_CONTADOR
    //AHORA VOY MOVER PARA KA QUÉ ESTA EN LA LÍNEA 23 ATE LÍNEA 28, VAMOS CAMBIAR
    //                     EL NUMERO 3 POR EL N_CONTADOR
    IF _centro_custo[[n_CONTADOR]]="" THEN
        _centro_custo=_centro_custo+".000"
        // se o n_contador posicao estiver em branco entao vou colocar ponto e 3 zeros
        // If the position counter is blank then I will place 3 zeros
        // Si el n_contador de posición está en blanco entonces voy a poner punto y 3 ceros
        BREAK
        // VOU DAR UM BREAK PARA SAIR DO LOOP
        // I WILL GIVE A BREAK TO LEAVE THE LOOP
        // VOY DAR UN BREAK PARA SALIR DEL LOOP
    ELSE // SENAO
         n_CONTADOR+=1
         // ESTAMOS SOMANDO 1 NO CONTADOR
         // WE ARE SOMARING 1 IN THE COUNTER
         // ESTAMOS SOMANDO 1 EN EL CONTADOR    
    END   
END
_centro_custo=StringIncrement(_centro_custo,FromEnd)
// soma 1 no final    exe: 01.000 ficara 01.001 // 01.001 ficara 01.002 / e assim por diante
// Suma 1 al final exe: 01.000 quedara 01.001 // 01.001 quedara 01.002 / y así sucesivamente
// Sum 1 at the end exe: 01,000 will be 01.001 // 01.001 will be 01.002 / and so on   
HReset(CUSTOS)
// reinializa os valores
// Re-validates the values
// Reinializa los valores
Open(WIN_Form_CUSTOS,_nivel,_grupo,_centro_custo)   
// estou abrindo janela, mandando parametros, nivel,grupo e centro de custos
// I'm opening the window, sending parameters, level, group and cost center
// Que se abre ventana, mandando parámetros, nivel, grupo y centro de costos
TableDisplay(TABLE_CUSTOS,taCurrentFirst)
// estou atualizando a tabela
// I'm updating the table
// Estoy actualizando la tabla 




// incluir nivel abaixo // Include level below // Incluir el nivel abajo
// SEM COMENTARIOS
_nivel is int=0
_grupo is boolean=True
_centro_custo is string=""
IF TableSelect(TABLE_CUSTOS) = -1 THEN
ELSE

END   
_nivel=TABLE_CUSTOS.COL_NIVEL+1
_centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO
n_CONTADOR is int=3
LOOP
    IF _centro_custo[[n_CONTADOR]]="" THEN
        _centro_custo=_centro_custo+".000"
        BREAK
    ELSE // SENAO
        n_CONTADOR+=1
    END   
END
_centro_custo=StringIncrement(_centro_custo,FromEnd)
HReset(CUSTOS)
Open(WIN_Form_CUSTOS,_nivel,_grupo,_centro_custo)   
TableDisplay(TABLE_CUSTOS,taCurrentFirst)
























Teste

Teste
teste