Composition Setup |
---|
import.css=/download/attachments/327912/newLayout.css |
Portuguese | ||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Función: Rutina automática ATFA320 - Registro de bienes de terceros
Descripción: Ejemplo de utilización de la rutina automática del registro de Bienes de Terceros. Programa Fuente: ATFA320.PRW Sintaxis: Rutina automática ATFA320 - Registro de Bienes de Terceros ( [ ] ) Retorno:
Observaciones Ejemplos User Function Myatfa320()Local aItens := {}Local aDadosAuto := {} // Array con los datos que serán enviados por la MsExecAuto() para grabación automática del activo en terceiroLocal nOpcaoLocal aCab := { {'NO_FILIAL' ,'01 ' ,NIL},; {'NO_CODIGO' ,'000001' ,NIL},; {'NO_CBASE' ,'1234567890' ,NIL},; {'NO_ITEM' ,'1234' ,NIL},; {'NO_FORNEC' ,'000000' ,NIL},; {'NO_LOJA' ,'00' ,NIL},; {'NO_TIPCES' , 'C' ,NIL} } Private lMsHelpAuto := .f. // Determina si los mensajes de help se deben enviar al arch. de logPrivate lMsErroAuto := .f. // Determina si hubo alguna inconsistencia al ejecutar la rutina nOpcao := Aviso("Atencao - Bienis de Terceros", "Incluir / Alterar o Excluir ?", {"Incluir", "Alterar", "Excluir"})If nOpcao == 1 //Inclusión CODIGO 000001 //EN ESTE CASO EL CONTROL DE NUMERACIÓN DEBE ESTAR EN LA RUTINA DEL USUARIO aAdd(aItens,{ {'NO_SEQ' ,'001' , NIL},; {'NO_STATUS' ,'1' , NIL},; {'NO_VIGINI' ,CTOD('01/01/12'), NIL},; {'NO_VIGFIM' ,CTOD('31/12/12'), NIL},; {'NO_CONTATO' ,'INCLUSIÓN DEL CONTACTO' ,NIL} } ) MSExecAuto( {|a,b,c,x,y,z| ATFA320(a,b,c,x,y,z)} ,"SNO",0,3,3,aCab,aItens) ElseIf nOpcao == 2 //Alteracion aAdd(aItens,{ {'NO_SEQ' ,'001' , NIL},; // en alteración el campo Sec se debe informar {'NO_STATUS' ,'2' , NIL},; {'NO_VIGINI' ,CTOD('01/01/12'), NIL},; {'NO_VIGFIM' ,CTOD('31/12/12'), NIL},; {'NO_CONTATO' ,'ALTERACION DEL CONTACTO' ,NIL} } ) aAdd(aItens,{ {'NO_SEQ' ,'002' , NIL},; // en alteracion el campo Sec se debe informar {'NO_STATUS' ,'1' , NIL},; {'NO_VIGINI' ,CTOD('31/01/13'), NIL},; {'NO_VIGFIM' ,CTOD('31/12/13'), NIL},; {'NO_CONTATO' ,'NUEVO CONTACTO EN LA ALTERACION' ,NIL} } ) dbSelectArea("SNO") dbSetOrder(1) If dbSeek(xFilial()+'000001') // EN CASO DE ALTERACION USUARIO DEBE POSICIONAR EN EL REGISTRO QUE SE ALTERARÁ MSExecAuto( {|a,b,c,x,y,z| ATFA320(a,b,c,x,y,z)} ,"SNO",0,4,4,aCab,aItens) EndIf ElseIf nOpcao == 3 //Exclusión dbSelectArea("SNO") dbSetOrder(1) If dbSeek(xFilial()+'000001') //EN CASO DE EXCLUSION USUARIO DEBE POSICIONARSE EN EL REGISTRO QUE SE EXCLUIRÁ MSExecAuto( {|a,b,c,x,y,z| ATFA320(a,b,c,x,y,z)} ,"SNO",0,5,5,aCab,aItens) EndIfEndIf If lMsErroAuto lRetorno := .F. MostraErro()Else lRetorno:=.T.EndIfReturn Parámetros:
|