1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

cp0320b

Discussão em 'EMS , HCM e Totvs 11' iniciado por Carlos Alberto Giusti, Junho 18, 2025.

  1. Carlos Alberto Giusti

    Carlos Alberto Giusti Membro Ativo

    Tenho código abaixo. Não conseguir encontrar onde monta o bloco Saldo em Estoque. Poderia me ajudar mostrando onde monta esse bloco?

    &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
    &ANALYZE-RESUME
    /* Connected Databases
    */
    &Scoped-define WINDOW-NAME w-window
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS w-window
    /********************************************************************************
    ** Copyright DATASUL S.A. (1997)
    ** Todos os Direitos Reservados.
    **
    ** Este fonte e de propriedade exclusiva da DATASUL, sua reproducao
    ** parcial ou total por qualquer meio, so podera ser feita mediante
    ** autorizacao expressa.
    *******************************************************************************/
    {include/i-prgvrs.i CP0320B 2.00.00.029 } /*** 010029 ***/

    &IF "{&EMSFND_VERSION}" >= "1.00" &THEN
    {include/i-license-manager.i cp0320b MCP}
    &ENDIF


    /*------------------------------------------------------------------------

    File:

    Description: from cntnrwin.w - ADM SmartWindow Template

    Input Parameters:
    <none>

    Output Parameters:
    <none>

    History:

    ------------------------------------------------------------------------*/
    /* This .W file was created with the Progress UIB. */
    /*----------------------------------------------------------------------*/

    /* Create an unnamed pool to store all the widgets created
    by this procedure. This is a good default which assures
    that this procedure's triggers and internal procedures
    will execute in this procedure's storage, and that proper
    cleanup will occur on deletion of the procedure. */

    CREATE WIDGET-POOL.

    /* *************************** Definitions ************************** */

    {cdp/cdcfgman.i} /* Include com preprocessador para release 2.02 */

    /* Definicao de temp-tables */
    {cpp/cpapi001.i1}
    {cpp/cp0320.i1}

    /* Parameters Definitions --- */
    define input parameter table for tt-raw-transfere.
    define input parameter table for tt-saldo-estoq.
    define input parameter wh-handle-browse-reservas as handle no-undo.
    define input parameter i-seq as integer no-undo.
    define input-output parameter l-cancelou as logical no-undo.

    /* Local Variable Definitions --- */

    def var v-row-1 as rowid no-undo.
    def var h-handle as handle no-undo.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK

    /* ******************** Preprocessor Definitions ******************** */

    &Scoped-define PROCEDURE-TYPE SmartWindow
    &Scoped-define DB-AWARE no

    &Scoped-define ADM-CONTAINER WINDOW

    /* Name of first Frame and/or Browse and/or first Query */
    &Scoped-define FRAME-NAME F-Main

    /* Standard List Definitions */
    &Scoped-Define ENABLED-OBJECTS RECT-1 RECT-4 RECT-5 RECT-6 ~
    tb-mostra-saldo-zero bt-add bt-del bt-mod tb-processo bt-ok bt-cancelar ~
    bt-ajuda
    &Scoped-Define DISPLAYED-OBJECTS fi-it-codigo fi-quant-requis fi-un ~
    tb-mostra-saldo-zero fi-quant-soma tb-processo fi-label-retangulo ~
    fi-label-retangulo-2 fi-label-retangulo-3

    /* Custom List Definitions */
    /* List-1,List-2,List-3,List-4,List-5,List-6 */

    /* _UIB-PREPROCESSOR-BLOCK-END */
    &ANALYZE-RESUME



    /* *********************** Control Definitions ********************** */

    /* Define the widget handle for the window */
    DEFINE VAR w-window AS WIDGET-HANDLE NO-UNDO.

    /* Definitions of handles for SmartObjects */
    DEFINE VARIABLE h_b24in403 AS HANDLE NO-UNDO.
    DEFINE VARIABLE h_b27in390 AS HANDLE NO-UNDO.

    /* Definitions of the field level widgets */
    DEFINE BUTTON bt-add
    IMAGE-UP FILE "image~\iu-down":U
    LABEL ""
    SIZE 7 BY 1.

    DEFINE BUTTON bt-ajuda
    LABEL "&Ajuda"
    SIZE 10 BY 1.

    DEFINE BUTTON bt-cancelar AUTO-END-KEY
    LABEL "&Cancelar"
    SIZE 10 BY 1.

    DEFINE BUTTON bt-del
    IMAGE-UP FILE "image~\iu-up":U
    LABEL ""
    SIZE 7 BY 1.

    DEFINE BUTTON bt-mod
    LABEL "&Modifica"
    SIZE 10 BY 1.

    DEFINE BUTTON bt-ok AUTO-GO
    LABEL "&OK"
    SIZE 10 BY 1.

    DEFINE VARIABLE fi-it-codigo AS CHARACTER FORMAT "X(16)":U
    LABEL ""
    VIEW-AS FILL-IN
    SIZE 15 BY .88 NO-UNDO.

    DEFINE VARIABLE fi-label-retangulo AS CHARACTER FORMAT "X(256)":U
    VIEW-AS TEXT
    SIZE 18 BY .63 NO-UNDO.

    DEFINE VARIABLE fi-label-retangulo-2 AS CHARACTER FORMAT "X(256)":U
    VIEW-AS TEXT
    SIZE 19 BY .63 NO-UNDO.

    DEFINE VARIABLE fi-label-retangulo-3 AS CHARACTER FORMAT "X(256)":U
    VIEW-AS TEXT
    SIZE 12 BY .63 NO-UNDO.

    DEFINE VARIABLE fi-per-ppm AS DECIMAL FORMAT "->>,>>9.9999":U INITIAL ?
    LABEL ""
    VIEW-AS FILL-IN
    SIZE 12 BY .88 NO-UNDO.

    DEFINE VARIABLE fi-quant-requis AS DECIMAL FORMAT "->>>>>,>>9.9999" INITIAL 0
    LABEL "":R15
    VIEW-AS FILL-IN
    SIZE 17 BY .88 NO-UNDO.

    DEFINE VARIABLE fi-quant-soma AS DECIMAL FORMAT "->>>>>,>>9.9999" INITIAL 0
    LABEL "":R15
    VIEW-AS FILL-IN
    SIZE 11 BY .88 NO-UNDO.

    DEFINE VARIABLE fi-un AS CHARACTER FORMAT "X(2)":U
    VIEW-AS FILL-IN
    SIZE 4 BY .88 NO-UNDO.

    DEFINE RECTANGLE RECT-1
    EDGE-PIXELS 2 GRAPHIC-EDGE
    SIZE 80 BY 1.38
    BGCOLOR 7 .

    DEFINE RECTANGLE RECT-4
    EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
    SIZE 80 BY 1.63.

    DEFINE RECTANGLE RECT-5
    EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
    SIZE 80 BY 4.33.

    DEFINE RECTANGLE RECT-6
    EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
    SIZE 80 BY 4.42.

    DEFINE VARIABLE tb-mostra-saldo-zero AS LOGICAL INITIAL no
    LABEL ""
    VIEW-AS TOGGLE-BOX
    SIZE 31.29 BY .79 NO-UNDO.

    DEFINE VARIABLE tb-processo AS LOGICAL INITIAL yes
    LABEL ""
    VIEW-AS TOGGLE-BOX
    SIZE 31.29 BY .79 NO-UNDO.


    /* ************************ Frame Definitions *********************** */

    DEFINE FRAME F-Main
    fi-it-codigo AT ROW 1.79 COL 21 COLON-ALIGNED
    fi-quant-requis AT ROW 1.79 COL 47 COLON-ALIGNED HELP
    "Quantidade original da Reserva"
    fi-un AT ROW 1.79 COL 66 COLON-ALIGNED NO-LABEL
    fi-per-ppm AT ROW 1.79 COL 66 COLON-ALIGNED
    tb-mostra-saldo-zero AT ROW 7.71 COL 29.72
    bt-add AT ROW 8 COL 2.57
    bt-del AT ROW 8 COL 10.57
    bt-mod AT ROW 8 COL 18.57
    fi-quant-soma AT ROW 8 COL 66.57 COLON-ALIGNED HELP
    "Quantidade original da Reserva"
    tb-processo AT ROW 8.58 COL 29.72
    bt-ok AT ROW 14.21 COL 2
    bt-cancelar AT ROW 14.21 COL 12
    bt-ajuda AT ROW 14.21 COL 70
    fi-label-retangulo AT ROW 1 COL 2 NO-LABEL
    fi-label-retangulo-2 AT ROW 2.88 COL 2 NO-LABEL
    fi-label-retangulo-3 AT ROW 9.25 COL 2 NO-LABEL
    RECT-1 AT ROW 13.92 COL 1
    RECT-4 AT ROW 1.25 COL 1
    RECT-5 AT ROW 3.17 COL 1
    RECT-6 AT ROW 9.5 COL 1
    WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
    SIDE-LABELS NO-UNDERLINE THREE-D
    AT COL 1 ROW 1
    SIZE 80.14 BY 14.46
    FONT 1.


    /* *********************** Procedure Settings ************************ */

    &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
    /* Settings for THIS-PROCEDURE
    Type: SmartWindow
    Allow: Basic,Browse,DB-Fields,Query,Smart,Window
    */
    &ANALYZE-RESUME _END-PROCEDURE-SETTINGS

    /* ************************* Create Window ************************** */

    &ANALYZE-SUSPEND _CREATE-WINDOW
    IF SESSION:DISPLAY-TYPE = "GUI":U THEN
    CREATE WINDOW w-window ASSIGN
    HIDDEN = YES
    TITLE = "Baixa das Reservas"
    HEIGHT = 14.46
    WIDTH = 80.14
    MAX-HEIGHT = 14.46
    MAX-WIDTH = 80.14
    VIRTUAL-HEIGHT = 14.46
    VIRTUAL-WIDTH = 80.14
    RESIZE = no
    SCROLL-BARS = no
    STATUS-AREA = yes
    BGCOLOR = ?
    FGCOLOR = ?
    THREE-D = yes
    MESSAGE-AREA = no
    SENSITIVE = yes.
    ELSE {&WINDOW-NAME} = CURRENT-WINDOW.
    /* END WINDOW DEFINITION */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB w-window
    /* ************************* Included-Libraries *********************** */

    {src/adm/method/containr.i}
    {include/w-window.i}
    {utp/ut-glob.i}

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME




    /* *********** Runtime Attributes and AppBuilder Settings *********** */

    &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
    /* SETTINGS FOR WINDOW w-window
    VISIBLE,,RUN-PERSISTENT */
    /* SETTINGS FOR FRAME F-Main
    */
    /* SETTINGS FOR FILL-IN fi-it-codigo IN FRAME F-Main
    NO-ENABLE */
    /* SETTINGS FOR FILL-IN fi-label-retangulo IN FRAME F-Main
    NO-ENABLE ALIGN-L */
    /* SETTINGS FOR FILL-IN fi-label-retangulo-2 IN FRAME F-Main
    NO-ENABLE ALIGN-L */
    /* SETTINGS FOR FILL-IN fi-label-retangulo-3 IN FRAME F-Main
    NO-ENABLE ALIGN-L */
    /* SETTINGS FOR FILL-IN fi-per-ppm IN FRAME F-Main
    NO-DISPLAY NO-ENABLE */
    ASSIGN
    fi-per-ppm:HIDDEN IN FRAME F-Main = TRUE.

    /* SETTINGS FOR FILL-IN fi-quant-requis IN FRAME F-Main
    NO-ENABLE */
    /* SETTINGS FOR FILL-IN fi-quant-soma IN FRAME F-Main
    NO-ENABLE */
    /* SETTINGS FOR FILL-IN fi-un IN FRAME F-Main
    NO-ENABLE */
    IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(w-window)
    THEN w-window:HIDDEN = yes.

    /* _RUN-TIME-ATTRIBUTES-END */
    &ANALYZE-RESUME





    /* ************************ Control Triggers ************************ */

    &Scoped-define SELF-NAME w-window
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL w-window w-window
    ON END-ERROR OF w-window /* Baixa das Reservas */
    OR ENDKEY OF {&WINDOW-NAME} ANYWHERE DO:
    /* This case occurs when the user presses the "Esc" key.
    In a persistently run window, just ignore this. If we did not, the
    application would exit. */
    IF THIS-PROCEDURE:pERSISTENT THEN RETURN NO-APPLY.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL w-window w-window
    ON WINDOW-CLOSE OF w-window /* Baixa das Reservas */
    DO:
    /* This ADM code must be left here in order for the SmartWindow
    and its descendents to terminate properly on exit. */
    APPLY "CLOSE":U TO THIS-PROCEDURE.
    RETURN NO-APPLY.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-add
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-add w-window
    ON CHOOSE OF bt-add IN FRAME F-Main
    DO:
    RUN pi-posicao-browse IN h_b24in403 (output v-row-1).
    if v-row-1 ne ? then do:
    RUN pi-add-browse IN h_b27in390 (input v-row-1).
    RUN dispatch IN h_b27in390 ('open-query':U).

    RUN pi-retorna-soma IN h_b27in390 (OUTPUT fi-quant-soma).
    ASSIGN fi-quant-soma:SCREEN-VALUE IN FRAME {&FRAME-NAME} = STRING(fi-quant-soma).

    RUN dispatch IN h_b27in390 ('open-query':U).
    end.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-ajuda
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-ajuda w-window
    ON CHOOSE OF bt-ajuda IN FRAME F-Main /* Ajuda */
    OR HELP OF FRAME {&FRAME-NAME}
    DO:
    {include/ajuda.i}
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-cancelar
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-cancelar w-window
    ON CHOOSE OF bt-cancelar IN FRAME F-Main /* Cancelar */
    DO:
    assign l-cancelou = yes.
    apply "close" to this-procedure.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-del
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-del w-window
    ON CHOOSE OF bt-del IN FRAME F-Main
    DO:
    RUN pi-deleta-registro IN h_b27in390.
    RUN pi-retorna-soma IN h_b27in390 (OUTPUT fi-quant-soma).
    ASSIGN fi-quant-soma:SCREEN-VALUE IN FRAME {&FRAME-NAME} = STRING(fi-quant-soma).
    RUN dispatch IN h_b27in390 ('open-query':U).
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-mod
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-mod w-window
    ON CHOOSE OF bt-mod IN FRAME F-Main /* Modifica */
    DO:

    run new-state( "atributo":U ).

    RUN pi-retorna-soma IN h_b27in390 (OUTPUT fi-quant-soma).
    ASSIGN fi-quant-soma:SCREEN-VALUE IN FRAME {&FRAME-NAME} = STRING(fi-quant-soma).

    RUN dispatch IN h_b27in390 ('open-query':U).
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME bt-ok
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL bt-ok w-window
    ON CHOOSE OF bt-ok IN FRAME F-Main /* OK */
    DO:
    assign l-cancelou = no.
    run pi-envia-temp-table in h_b27in390 (input wh-handle-browse-reservas).
    run pi-envia-temp-table in h_b24in403 (input wh-handle-browse-reservas).
    apply "close" to this-procedure.
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME tb-mostra-saldo-zero
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL tb-mostra-saldo-zero w-window
    ON VALUE-CHANGED OF tb-mostra-saldo-zero IN FRAME F-Main
    DO:
    run pi-atualiza-parametros in h_b24in403 (input tb-mostra-saldo-zero:checked,
    input tb-processo:checked).
    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &Scoped-define SELF-NAME tb-processo
    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL tb-processo w-window
    ON VALUE-CHANGED OF tb-processo IN FRAME F-Main
    DO:
    run pi-atualiza-parametros in h_b24in403 (input tb-mostra-saldo-zero:checked,
    input tb-processo:checked).

    END.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    &UNDEFINE SELF-NAME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK w-window


    /* *************************** Main Block *************************** */

    /* Include custom Main Block code for SmartWindows. */
    {src/adm/template/windowmn.i}

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME


    /* ********************** Internal Procedures *********************** */

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-create-objects w-window _ADM-CREATE-OBJECTS
    PROCEDURE adm-create-objects :
    /*------------------------------------------------------------------------------
    Purpose: Create handles for all SmartObjects used in this procedure.
    After SmartObjects are initialized, then SmartLinks are added.
    Parameters: <none>
    ------------------------------------------------------------------------------*/
    DEFINE VARIABLE adm-current-page AS INTEGER NO-UNDO.

    RUN get-attribute IN THIS-PROCEDURE ('Current-Page':U).
    ASSIGN adm-current-page = INTEGER(RETURN-VALUE).

    CASE adm-current-page:

    WHEN 0 THEN DO:
    RUN init-object IN THIS-PROCEDURE (
    INPUT 'inbrw/b24in403.w':U ,
    INPUT FRAME F-Main:HANDLE ,
    INPUT 'Layout = ':U ,
    OUTPUT h_b24in403 ).
    RUN set-position IN h_b24in403 ( 3.50 , 4.00 ) NO-ERROR.
    /* Size in UIB: ( 3.75 , 75.00 ) */

    RUN init-object IN THIS-PROCEDURE (
    INPUT 'inbrw/b27in390.w':U ,
    INPUT FRAME F-Main:HANDLE ,
    INPUT 'Layout = ':U ,
    OUTPUT h_b27in390 ).
    RUN set-position IN h_b27in390 ( 10.00 , 4.00 ) NO-ERROR.
    /* Size in UIB: ( 3.75 , 75.00 ) */

    /* Links to SmartBrowser h_b24in403. */
    RUN add-link IN adm-broker-hdl ( h_b27in390 , 'State':U , h_b24in403 ).

    /* Links to SmartBrowser h_b27in390. */
    RUN add-link IN adm-broker-hdl ( THIS-PROCEDURE , 'State':U , h_b27in390 ).

    /* Adjust the tab order of the smart objects. */
    RUN adjust-tab-order IN adm-broker-hdl ( h_b24in403 ,
    fi-per-ppm:HANDLE IN FRAME F-Main , 'AFTER':U ).
    RUN adjust-tab-order IN adm-broker-hdl ( h_b27in390 ,
    tb-processo:HANDLE IN FRAME F-Main , 'AFTER':U ).
    END. /* Page 0 */

    END CASE.

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available w-window _ADM-ROW-AVAILABLE
    PROCEDURE adm-row-available :
    /*------------------------------------------------------------------------------
    Purpose: Dispatched to this procedure when the Record-
    Source has a new row available. This procedure
    tries to get the new row (or foriegn keys) from
    the Record-Source and process it.
    Parameters: <none>
    ------------------------------------------------------------------------------*/

    /* Define variables needed by this internal procedure. */
    {src/adm/template/row-head.i}

    /* Process the newly available records (i.e. display fields,
    open queries, and/or pass records on to any RECORD-TARGETS). */
    {src/adm/template/row-end.i}

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI w-window _DEFAULT-DISABLE
    PROCEDURE disable_UI :
    /*------------------------------------------------------------------------------
    Purpose: DISABLE the User Interface
    Parameters: <none>
    Notes: Here we clean-up the user-interface by deleting
    dynamic widgets we have created and/or hide
    frames. This procedure is usually called when
    we are ready to "clean-up" after running.
    ------------------------------------------------------------------------------*/
    /* Delete the WINDOW we created */
    IF SESSION:DISPLAY-TYPE = "GUI":U AND VALID-HANDLE(w-window)
    THEN DELETE WIDGET w-window.
    IF THIS-PROCEDURE:pERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable_UI w-window _DEFAULT-ENABLE
    PROCEDURE enable_UI :
    /*------------------------------------------------------------------------------
    Purpose: ENABLE the User Interface
    Parameters: <none>
    Notes: Here we display/view/enable the widgets in the
    user-interface. In addition, OPEN all queries
    associated with each FRAME and BROWSE.
    These statements here are based on the "Other
    Settings" section of the widget Property Sheets.
    ------------------------------------------------------------------------------*/
    DISPLAY fi-it-codigo fi-quant-requis fi-un tb-mostra-saldo-zero fi-quant-soma
    tb-processo fi-label-retangulo fi-label-retangulo-2
    fi-label-retangulo-3
    WITH FRAME F-Main IN WINDOW w-window.
    ENABLE RECT-1 RECT-4 RECT-5 RECT-6 tb-mostra-saldo-zero bt-add bt-del bt-mod
    tb-processo bt-ok bt-cancelar bt-ajuda
    WITH FRAME F-Main IN WINDOW w-window.
    {&OPEN-BROWSERS-IN-QUERY-F-Main}
    VIEW w-window.
    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-destroy w-window
    PROCEDURE local-destroy :
    /*------------------------------------------------------------------------------
    Purpose: Override standard ADM method
    Notes:
    ------------------------------------------------------------------------------*/

    /* Code placed here will execute PRIOR to standard behavior. */

    /* Dispatch standard ADM method. */
    RUN dispatch IN THIS-PROCEDURE ( INPUT 'destroy':U ) .
    {include/i-logfin.i}

    /* Code placed here will execute AFTER standard behavior. */

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-exit w-window
    PROCEDURE local-exit :
    /* -----------------------------------------------------------
    Purpose: Starts an "exit" by APPLYing CLOSE event, which starts "destroy".
    Parameters: <none>
    Notes: If activated, should APPLY CLOSE, *not* dispatch adm-exit.
    -------------------------------------------------------------*/
    APPLY "CLOSE":U TO THIS-PROCEDURE.

    RETURN.

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE local-initialize w-window
    PROCEDURE local-initialize :
    /*------------------------------------------------------------------------------
    Purpose: Override standard ADM method
    Notes:
    ------------------------------------------------------------------------------*/

    /* Code placed here will execute PRIOR to standard behavior. */
    {utp/ut-liter.i Mostra_saldos_zerados_ou_negativos_? MCP R}
    assign tb-mostra-saldo-zero:label in frame {&frame-name} = return-value.

    {utp/ut-liter.i "Total"}
    ASSIGN fi-quant-soma:label in frame {&frame-name} = return-value.

    {utp/ut-liter.i Mostra_apenas_depósitos_de_processo_? MCP R}
    assign tb-processo:label in frame {&frame-name} = return-value.

    {utp/ut-field.i mgind reservas it-codigo 1}
    assign fi-it-codigo:label in frame {&frame-name} = return-value.

    {utp/ut-field.i mgind reservas quant-requis 2}
    assign fi-quant-requis:label in frame {&frame-name} = return-value.

    {utp/ut-table.i mgind reservas 1}
    assign fi-label-retangulo:screen-value in frame {&frame-name} = return-value
    fi-label-retangulo = return-value.

    {utp/ut-table.i mgind saldo-estoq 1}
    assign fi-label-retangulo-2:screen-value in frame {&frame-name} = return-value
    fi-label-retangulo-2 = return-value.

    {utp/ut-table.i mgind requisicao 1}
    assign fi-label-retangulo-3:screen-value in frame {&frame-name} = return-value
    fi-label-retangulo-3 = return-value.

    /* Dispatch standard ADM method. */
    {utp/ut9000.i "CP0320B" "2.00.00.027"}
    RUN dispatch IN THIS-PROCEDURE ( INPUT 'initialize':U ) .

    /* Code placed here will execute AFTER standard behavior. */

    find first tt-raw-transfere no-lock no-error.
    create tt-reservas.
    raw-transfer tt-raw-transfere.raw-registro to tt-reservas.

    assign fi-it-codigo = tt-reservas.it-codigo
    fi-quant-requis = tt-reservas.quant-requis
    fi-un = tt-reservas.un.

    display fi-it-codigo
    fi-quant-requis
    fi-un
    with frame {&frame-name}.

    run pi-atualiza-variaveis in h_b24in403 (input tt-reservas.it-codigo ,
    input tt-reservas.cod-refer ,
    &IF DEFINED (bf_man_per_ppm) &THEN
    input tt-reservas.per-ppm ,
    input tt-reservas.tipo-formula,
    &ENDIF
    input table tt-saldo-estoq ).

    run pi-recebe-tt-raw-transfere in h_b27in390 (input table tt-raw-transfere,
    input i-seq).


    &IF DEFINED (bf_man_per_ppm) &THEN
    find item where
    item.it-codigo = tt-reservas.it-codigo no-lock no-error.
    find first param-global no-lock.
    if param-global.modulo-per-ppm and
    item.tipo-formula >= 2 and
    item.tipo-formula <= 3 then
    assign fi-per-ppm:hidden in frame {&frame-name} = false
    fi-it-codigo:column in frame {&frame-name} = 11.5
    h-handle = fi-it-codigo:side-label-handle
    h-handle:column = h-handle:column - 11.5
    fi-quant-requis:column in frame {&frame-name} = 36
    h-handle = fi-quant-requis:side-label-handle
    h-handle:column = h-handle:column - 13
    fi-un:column in frame {&frame-name} = 53
    fi-per-ppm:sensitive in frame {&frame-name} = false
    fi-per-ppm:label in frame {&frame-name} = if item.tipo-formula = 2 then {ininc/i25in172.i 04 02} /* + "(%)":u */
    else {ininc/i25in172.i 04 03}
    fi-per-ppm:format in frame {&frame-name} = if item.tipo-formula = 2 then ">>9.9999":u
    else ">>>>,>>9.9999":u
    fi-per-ppm:screen-value in frame {&frame-name} = string(tt-reservas.per-ppm).
    &ELSE
    assign fi-per-ppm:hidden in frame {&frame-name} = true.
    &ENDIF

    RUN pi-retorna-soma IN h_b27in390 (OUTPUT fi-quant-soma).
    ASSIGN fi-quant-soma:SCREEN-VALUE IN FRAME {&FRAME-NAME} = STRING(fi-quant-soma).

    RUN dispatch IN h_b27in390 ('open-query':U).

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE RTB_xref_generator w-window
    PROCEDURE RTB_xref_generator :
    /* -----------------------------------------------------------
    Purpose: Generate RTB xrefs for SMARTOBJECTS.
    Parameters: <none>
    Notes: This code is generated by the UIB. DO NOT modify it.
    It is included for Roundtable Xref generation. Without
    it, Xrefs for SMARTOBJECTS could not be maintained by
    RTB. It will in no way affect the operation of this
    program as it never gets executed.
    -------------------------------------------------------------*/
    RUN "inbrw/b24in403.w *RTB-SmObj* ".
    RUN "inbrw/b27in390.w *RTB-SmObj* ".

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records w-window _ADM-SEND-RECORDS
    PROCEDURE send-records :
    /*------------------------------------------------------------------------------
    Purpose: Send record ROWID's for all tables used by
    this file.
    Parameters: see template/snd-head.i
    ------------------------------------------------------------------------------*/

    /* SEND-RECORDS does nothing because there are no External
    Tables specified for this SmartWindow, and there are no
    tables specified in any contained Browse, Query, or Frame. */

    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

    &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed w-window
    PROCEDURE state-changed :
    /* -----------------------------------------------------------
    Purpose:
    Parameters: <none>
    Notes:
    -------------------------------------------------------------*/
    DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
    DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
    END PROCEDURE.

    /* _UIB-CODE-BLOCK-END */
    &ANALYZE-RESUME

Compartilhe esta Página