PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → Aula 1175 WinDev Curso ErpAmarildo 032 - Tabela Custo Mesmo Nivel
Aula 1175 WinDev Curso ErpAmarildo 032 - Tabela Custo Mesmo Nivel
Débuté par amarildo, 10 juin 2017 02:58 - Aucune réponse
Membre enregistré
535 messages
Popularité : +14 (14 votes)
Posté le 10 juin 2017 - 02:58
Vamos continuar a fazer o codigo da tabela de custo,
no mesmo nivel


Let's continue to do the cost table code,
On the same level

 

Vamos a seguir haciendo el código de la tabla de coste,
En el mismo nivel


//incluir_nivel_mesmo()

_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

_nivel=1

_centro_custo="01"

// como é a primeira vez, entao vamos deixar fixo 1 e 01

// As it is the first time, then we will leave fixed 1 and 01

// Como es la primera vez, entonces vamos a dejar fijos 1 y 01

ELSE

_nivel=TABLE_CUSTOS.COL_NIVEL

// aqui pego o nivel atual

// Here I take the current level

// Eu bati aqui ou nível Atual



_centro_custo=TABLE_CUSTOS.COL_CENTRO_CUSTO

// VARIAVEL CENTRO DE CUSTOS É IGUAL A TABLE CENTRO DE CUSTOS

// VARIABLE COST CENTER IS EQUAL TO TABLE COST CENTER

// VARIABLE CENTRO DE COSTOS ES IGUAL A TABLE CENTRO DE COSTOS



LOOP

// AQUI ESTOU FAZENDO UM LOOP ATE NAO EXISTIR CENTRO DE CUSTO

// HERE I AM MAKING A LOOP ATE THERE IS NO COST CENTER

// AQUÍ ESTOY HACIENDO UN LOOP ATE NO EXISTIR CENTRO DE COSTE




_centro_custo=StringIncrement(_centro_custo,FromEnd)

// aqui vou pegar o centro de custo, e somar + 1

// Here I'll get the cost center, and add + 1

// Aquí voy a recoger el centro de coste, y sumar + 1



HReadSeekFirst(CUSTOS,chave_idempresa_centrocusto,[gn_retorna_id_empresa_codigo,_centro_custo])

IF HFound(CUSTOS) THEN

// ESTOU LENDO A TABELA CUSTO , COM CHAVE COMPOSTA, DE ID EMPRESA E CENTRO DE CUSTOS,

// E PERGUNTANDO SE EXISTE

// I'M READING THE TABLE COST, WITH COMPOSITE KEY, COMPANY ID AND COST CENTER,

// AND ASKING IF IT EXISTS

// ESTOY LENDO LA TABLA COSTO, CON CLAVE COMPUESTA, DE ID EMPRESA Y CENTRO DE COSTOS,

// Y PREGUNTANDO SI EXISTE

ELSE

// SENAO



BREAK

// VOU FINALIZAR O LOOP POIS NAO ENCONTREI ESSE CENTRO DE CUSTOS

// WILL FINISH THE LOOP SO I WILL NOT FIND THIS COST CENTER

// VOY FINALIZAR EL LOOP POIS NO ENCONTRE ES ES CENTRO DE COSTOS

END

END



END

HReset(CUSTOS)

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_mesmo()//SEM COMENTARIOS

_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,taCurrentFirst)


http://windevdesenvolvimento.blogspot.com.br/2017/06/aula-1175-windev-curso-erpamarildo-032.html