segunda-feira, 12 de junho de 2017

Aula 1179 WinDev Curso ErpAmarildo 036 - TABELA CUSTO - FINAL









TABELA AJUSTE FINAL - Video no Youtube Se Gostou clique aqui para dar joinha




HELP1





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
FORMULARIO CUSTOS - CODIGO - ERP35 / AULA 1178
TABELA CUSTOS - AJUSTES FINAIS - ERP36 - AULA 1179





Nessa aula de hoje

VAMOS FINALIZAR A PARTE DA TABELA DE CUSTOS, VOU ARRUMAR A ORDEM,
VOU FAZER COM QUE A DESCRICAO, TENHA ESPACAMENTO CONFORME O NIVEL,
E COLOCAR UMA COR NO NIVEL 1, E TAMBEM FILTRAR OS CUSTOS POR EMPRESA

LET'S FINISH PART OF THE COST TABLE, I'LL TAKE THE ORDER,
I WILL MAKE THE DESCRIPTION, HAVE SPACES ACCORDING TO THE LEVEL,
AND PLACE A COLOR IN LEVEL 1, AND ALSO FILTER THE COSTS BY COMPANY


En esta clase de hoy

VAMOS FINALIZAR LA PARTE DE LA TABLA DE COSTOS, VOY ARRUMAR EL ORDEN,
VOY HACER CON QUE LA DESCRIPCIÓN, TIENE ESPACIO CONFORME A NIVEL,
Y COLOCAR UN COLOR EN EL NIVEL 1, Y TAMBIEN FILTRAR LOS COSTOS POR LA EMPRESA
 




// TABELA CUSTOS - CODIGOS

// DISPLAYING A ROW OF TABLE_CUSTOS

// VOU COLOCAR OS COMANDOS , DENTRO DE DISPLAYING A ROW OF TABLES CUSTOS
// I WILL PLACE THE COMMANDS, INSIDE OF DISPLAYING A ROW OF TABLES COSTS
// VOU COLOCAR OS COMANDOS, DENTRO DE DISPLAYING UNA FILA DE TABLAS CUSTOS

IF TABLE_CUSTOS.COL_NIVEL=1 THEN
   // SE O NIVEL FOR IGUAL A 1 ENTÃO
   // IF THE LEVEL IS EQUAL TO 1 THEN
   // SI EL NIVEL FOR IGUAL A 1 ENTONCES
  
   TABLE_CUSTOS[CurrentSubscript()]..Color = DarkGreen
   // ESTOU COLOCANDO A COR VERDE NA LINHA DOS NIVELS 1
   // I AM PUTTING GREEN COLOR IN LEVEL 1
   // ESTOY COLOCANDO EL COLOR VERDE EN LA LÍNEA DE LOS NIVELS 1

ELSE // SENAO
   TABLE_CUSTOS.COL_DESCRICAO=RepeatString(" ", TABLE_CUSTOS.COL_NIVEL * 2) + ...
                                                TABLE_CUSTOS.COL_DESCRICAO
   // ESTOU PEGANDO O NIVEL MULTIPLANDO POR 2 , QUE VAI DAR UMA QUANTIDADE DE ESPACOS, QUE
   //                  ESTOU ACRESCENTANDO NA DESCRICAO
   // I'M GETTING THE LEVEL MULTIPLING FOR 2, THAT WILL GIVE AN AMOUNT OF SPACES,
   // WHICH I'M ADDING IN THE DESCRIPTION
   //ESTOY PEGANDO EL NIVEL MULTIPLANDO POR 2, QUE VA DAR UNA CANTIDAD DE ESPACOS,
   //                    QUE ESTOY AÑADIR EN LA DESCRIPCIÓN
END




// INCLUI CONTA LANCAMENTO
// CONTA LANÇAMENTO
_nivel is int=0
_grupo is boolean=False
_centro_custo is string=""
IF TABLE_CUSTOS.COL_CONTA_GRUPO=True THEN
    _nivel=TABLE_CUSTOS.COL_NIVEL+1
    _centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO
ELSE //senao
    _nivel=TABLE_CUSTOS.COL_NIVEL
    _posicao_final is int=(_nivel-1)*3
    _centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO[[1 TO _posicao_final]]
END
HReset(CUSTOS)
Open(WIN_Form_CUSTOS,_nivel,_grupo,_centro_custo)   
TableDisplay(TABLE_CUSTOS,taCurrentFirst)




//incluir_nivel_mesmo()
_nivel is int=0
_grupo is boolean=True
_centro_custo is string=""
IF TableSelect(TABLE_CUSTOS) = -1 THEN
    _nivel=1
    _centro_custo="01"
ELSE
    _nivel=TABLE_CUSTOS.COL_NIVEL
    _centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO
    LOOP
        _centro_custo=StringIncrement(_centro_custo,FromEnd) 
        HReadSeekFirst(CUSTOS,chave_idempresa_centrocusto,[gn_retorna_id_empresa_codigo,_centro_custo])
        IF HFound(CUSTOS) THEN
        ELSE
            BREAK
        END       
    END  
   
END
HReset(CUSTOS)
Open(WIN_Form_CUSTOS,_nivel,_grupo,_centro_custo)   
TableDisplay(TABLE_CUSTOS,taCurrentRecord)





// incluir nivel abaixo // Include level below // Incluir el nivel abajo
_nivel is int=0
_grupo is boolean=True
_centro_custo is string=""
IF TableSelect(TABLE_CUSTOS) = -1 THEN
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)



//FORMULARIO CUSTOS - CODIGOS

PROCEDURE WIN_Form_CUSTOS(_nivel,_grupo,_centro_custos)

//END OF INITIALIZATION OF WIN_FORM_CUSTOS
FileToScreen()
IF CUSTOS..NewRecord=True THEN
    EDT_EmpresaID=gn_retorna_id_empresa_codigo
    EDT_NIVEL=_nivel
    CBOX_CONTA_GRUPO=_grupo
    EDT_CENTRO_CUSTO=_centro_custos
    IF _grupo=True THEN
        EDT_DESCRICAO..Caption="NOME GRUPO"
    END
END

ReturnToCapture(EDT_DESCRICAO)

MyWindow..ReturnedValue = False




// BOTAO F2 - GRAVA CUSTOS

ScreenToFile()
IF CUSTOS..NewRecord THEN
    _data_source is Data Source
    _sql is string
    _sql = [
        SELECT
        Max(CUSTOS.id_empresa_custo) AS ultimo
        FROM
        CUSTOS
        where
        CUSTOS.empresaID=%1
    ]
    _sql = StringBuild(_sql,gn_retorna_id_empresa_codigo)
    IF HExecuteSQLQuery(_data_source,hQueryDefault,_sql) THEN
        HReadFirst(_data_source)
        CUSTOS.id_empresa_custo=_data_source.ultimo+1
    ELSE
        CUSTOS.id_empresa_custo=1
    END
    IF CUSTOS.CONTA_GRUPO=False THEN
        CUSTOS.CENTRO_CUSTO=CUSTOS.CENTRO_CUSTO+"."+NumToString(CUSTOS.id_empresa_custo,"03D")
    END
    HAdd(CUSTOS)
ELSE
    HModify(CUSTOS)
END
MyWindow..ReturnedValue = True
























Aula 1178 WinDev Curso ErpAmarildo 035 - Formulario Custo









Video FORMULARIO CUSTO no Youtube Se Gostou clique aqui para dar joinha







Nessa aula de hoje

vamos nessa aula de hoje, mostrar como
cadastrar o centro de custos, com niveis


En esta clase de hoy

En esta clase de hoy, mostrar cómo
Registrar el centro de costes, con niveles


In this class today

Let's go to this class today, show how
Register the cost center, with levels

 


help1




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
FORMULARIO CUSTOS - CODIGO - ERP35 / AULA 1178
TABELA CUSTOS - AJUSTES FINAIS - ERP36 - AULA 1179




// GLOBAL WIN_FORM_CUSTOS
PROCEDURE WIN_Form_CUSTOS(_nivel,_grupo,_centro_custos)
// EM PROCEDURE, ADICIONEI PARA RECEBER 3 PARAMETROS, NIVEL, GRUPO E CENTRO CUSTOS
// IN PROCEDURE, I ADDITION TO RECEIVE 3 PARAMETERS, LEVEL, GROUP AND COST CENTER
// EN PROCEDURE, ADICIONE PARA RECIBIR 3 PARAMETROS, NIVEL, GRUPO Y CENTRO COSTOS





//END OF INITIALIZATION OF WIN_FORM_CUSTOS
FileToScreen()

IF CUSTOS..NewRecord=True THEN
    // SE FOR NOVO REGISTRO,QUER DIZER INCLUSAO, ENTAO
    // IF YOU ARE A NEW REGISTRATION, YOU WANT TO SAY INCLUSION, ENTAO
    // Si es nuevo REGISTRO, QUIERE DECIRSE, ENTABLE   
   
    EDT_EmpresaID=gn_retorna_id_empresa_codigo
    EDT_NIVEL=_nivel
    CBOX_CONTA_GRUPO=_grupo
    EDT_CENTRO_CUSTO=_centro_custos
    // ESTOU COLOCANDO OS DADOS FIXOS
    // I'M PLACING FIXED DATA
    // ESTOY COLOCANDO LOS DATOS FIJOS
   
    IF _grupo=True THEN
        EDT_DESCRICAO..Caption="NOME GRUPO"
    END
    // SE FOR GRUPO, VAI APARECER NA DESCRICAO, NOME GRUPO PARA PREENCHER
    // IF FOR GROUP, IT WILL APPEAR IN THE DESCRIPTION, NAME GROUP TO FILL IN
    // SI ES GRUPO, VA APARECER EN LA DESCRIPCIÓN, NOMBRE GRUPO PARA PREENCHER
END

ReturnToCapture(EDT_DESCRICAO)

// Default return value
MyWindow..ReturnedValue = False





ScreenToFile()
IF CUSTOS..NewRecord THEN
    // SE FOR NOVO REGISTRO,QUER DIZER INCLUSAO, ENTAO // IF YOU ARE A NEW REGISTRATION, YOU WANT TO SAY INCLUSION, ENTAO
    // Si es nuevo REGISTRO, QUIERE DECIRSE, ENTABLE   
    _data_source is Data Source
    _sql is string
    _sql = [
        SELECT
        Max(CUSTOS.id_empresa_custo) AS ultimo
        FROM
        CUSTOS
        where
        CUSTOS.empresaID=%1
    ]
    // MONTEI SQL PARA SABER O PROXIMO ID DA EMPRESA CUSTOS    // MONTEI SQL TO KNOW THE COMPANY'S COST ID
    // MONTEI SQL PARA SABRE EL PROXIMO ID DE LA EMPRESA COSTES
    _sql = StringBuild(_sql,gn_retorna_id_empresa_codigo)
    // AQUI COLOCANDO O SQL, MAIS O CODIGO DA EMPRESA,SUBSTITUILDO O %1 // HERE PLACING SQL, PLUS THE COMPANY CODE, REPLACING% 1
    // AQUI COLOCANDO O SQL, MAIS O CODIGO DA EMPRESA, SUSTITUCION O% 1
    IF HExecuteSQLQuery(_data_source,hQueryDefault,_sql) THEN
        HReadFirst(_data_source)
        CUSTOS.id_empresa_custo=_data_source.ultimo+1
    ELSE
        CUSTOS.id_empresa_custo=1
    END
    // ESTOU LENDO O SQL, SE FOR A PRIMEIRA VEZ VAI COLOCAR 1 SENAO VAI PEGAR O ULTIMO + 1 // I'M READING SQL, IF FOR THE FIRST TIME YOU WILL PLACE 1 SENAO GOES TO TAKE THE LAST + 1
    // ESTOU LENDO O SQL, SE PARA UN PRIMEIRA VEZ VAI COLOCAR 1 SENAO VAI PEGAR O ULTIMO + 1
    IF CUSTOS.CONTA_GRUPO=False THEN
        CUSTOS.CENTRO_CUSTO=CUSTOS.CENTRO_CUSTO+"."+NumToString(CUSTOS.id_empresa_custo,"03D")
    END
    // SE GRUPO FOR FALSE, QUER DIZER LANCAMENTO,VOU ADICIONAR NO CUSTO O NUMERO DO ID //  // IF GROUP IS FALSE, YOU WANT TO SAY RELEASE, YOU WILL ADD IN THE COST THE ID NUMBER   
    //  SE GRUPO PARA FALSO, QUER DIZER LANCAMENTO, VOU ADICIONAR NO CUSTO O NUMERO DO ID
    HAdd(CUSTOS)
ELSE
    HModify(CUSTOS)
END
MyWindow..ReturnedValue = True






















domingo, 11 de junho de 2017

Aula 1177 WinDev Curso ErpAmarildo 034 - Tabela Custo Lançamentos









Video PLANO LANCAMENTOS no Youtube Se Gostou clique aqui para dar joinha




help1




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
FORMULARIO CUSTOS - CODIGO - ERP35 / AULA 1178




Nessa aula de hoje

Vamos continuar a fazer o codigo da tabela de custo,
agora, revisando a parte de conta lancamento

In this class today

Let's continue to do the cost table code,
Now, revising the part of account launch


En esta clase de hoy

Vamos a seguir haciendo el código de la tabla de coste,
Ahora, revisando la parte de cuenta de lanzamiento




// CONTA LANÇAMENTO
// LAUNCHING ACCOUNT
// CUENTA LANZAMIENTO
_nivel is int=0
_grupo is boolean=False
_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 TABLE_CUSTOS.COL_CONTA_GRUPO=True THEN
    // se conta grupo for igual a sim
    // If group count is equal to yes
    // Si cuenta grupo es igual a sí
    _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 ...   
   
ELSE //senao
    _nivel=TABLE_CUSTOS.COL_NIVEL
    // PEGO O NIVEL ATUAL
    // PEGO OR CURRENT LEVEL
    // PEGO EL NIVEL ACTUAL
    _posicao_final is int=(_nivel-1)*3
    // VOU PEGAR A POSICAO FINAL, PEGANDO O NIVEL - 1 E MULTIPLICANDO POR 3
    // I'LL TAKE THE FINAL POSITION, TAKING LEVEL - 1 AND MULTIPLYING FOR 3
    // VOY PEGAR LA POSICION FINAL, PEGANDO EL NIVEL - 1 Y MULTIPLICANDO POR 3   
    _centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO[[1 TO _posicao_final]]
    // aqui pego o centro de custo , mas como já é de lancamento, vou tirar as ultimas 4 posicoes
    // Here I take the cost center, but as it is already launched, I will take the last 4 positions
    // aquí atrapado el centro de coste, sino como es poner en marcha, yo tomo a los últimos 4 posiciones
   
END
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 



//SEM COMENTARIOS

// CONTA LANÇAMENTO
// LAUNCHING ACCOUNT
// CUENTA LANZAMIENTO
_nivel is int=0
_grupo is boolean=False
_centro_custo is string=""
IF TABLE_CUSTOS.COL_CONTA_GRUPO=True THEN
    _nivel=TABLE_CUSTOS.COL_NIVEL+1
    _centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO
ELSE //senao
    _nivel=TABLE_CUSTOS.COL_NIVEL
    _posicao_final is int=(_nivel-1)*3
    _centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO[[1 TO _posicao_final]]
END
HReset(CUSTOS)
Open(WIN_Form_CUSTOS,_nivel,_grupo,_centro_custo)   
TableDisplay(TABLE_CUSTOS,taCurrentFirst)





















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