#include "ve1100.h"

PAGE "STAMPA DOCUMENTI VENDITA" -1 -1 40 19

STRING F_CODNUM 4 4
BEGIN
        PROMPT 1 1 "Codice Num. "
        FLAG "U"
        USE NUM
        INPUT CODTAB F_CODNUM
        DISPLAY "Cod. Num." CODTAB
        DISPLAY "Descrizione@50" S0
        OUTPUT F_CODNUM CODTAB
        CHECKTYPE REQUIRED
END

NUMBER F_ANNO 4 0
BEGIN
        PROMPT 26 1 "Anno "
        CHECKTYPE REQUIRED
END

LIST F_PROVV 8
BEGIN
        PROMPT 26 4 ""
        ITEM "P|Provvis."
        ITEM "D|Definit."
END

RADIOBUTTON F_DATA_O_NUM 20
BEGIN
        PROMPT 1 3 "Selezione su "
        ITEM "N|Numero" MESSAGE ENABLE,1@|DISABLE,2@
        ITEM "D|Data" MESSAGE ENABLE,2@|DISABLE,1@
END

GROUPBOX DLG_NULL 38 5
BEGIN
  PROMPT 1 7 "Selezione per numero"
END

GROUPBOX DLG_NULL 38 5
BEGIN
  PROMPT 1 12 "Selezione per data"
END

NUMBER F_DA_NDOC 7 0
BEGIN
        PROMPT 2 8  "Dal num. "
        USE 33 KEY 1 SELECT CODNUM==#F_CODNUM|ANNO==#F_ANNO
        JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
        JOIN 13 TO 20 INTO COM=COMCF
        INPUT CODNUM F_CODNUM SELECT
        INPUT ANNO F_ANNO SELECT
        INPUT NDOC F_DA_NDOC
        INPUT PROVV F_PROVV
        DISPLAY "Data@10" DATADOC
        DISPLAY "Numero@7" NDOC
        DISPLAY "Cliente/Fornitore@40" 20->RAGSOC
        DISPLAY "Comune@20" 13->DENCOM
        OUTPUT F_DA_NDOC NDOC
        OUTPUT F_DA_DATADOC DATADOC
        GROUP 1
        CHECKTYPE NORMAL
END

NUMBER F_A_NDOC 7 0
BEGIN
        PROMPT 2 10 "Al num.  "
        COPY USE F_DA_NDOC
        INPUT CODNUM F_CODNUM SELECT
        INPUT ANNO F_ANNO SELECT
        INPUT NDOC F_A_NDOC
        INPUT PROVV F_PROVV
        COPY DISPLAY F_DA_NDOC
        OUTPUT F_A_NDOC NDOC
        OUTPUT F_A_DATADOC DATADOC
        GROUP 1
        CHECKTYPE NORMAL
END

DATE F_DA_DATADOC
BEGIN
        PROMPT 2 13 "Dalla data "
        USE 33 KEY 3 SELECT CODNUM==#F_CODNUM|ANNO==#F_ANNO
        JOIN 20 INTO CODCF=CODCF TIPOCF=TIPOCF
        JOIN 13 TO 20 INTO COM=COMCF
        INPUT CODNUM F_CODNUM
        INPUT ANNO F_ANNO
        INPUT DATADOC F_DA_DATADOC
        INPUT PROVV F_PROVV
        COPY DISPLAY F_DA_NDOC
        OUTPUT F_DA_NDOC NDOC
        OUTPUT F_DA_DATADOC DATADOC
        GROUP 2
        CHECKTYPE NORMAL
END

DATE F_A_DATADOC
BEGIN
        PROMPT 2 15 "Alla data  "
        COPY USE F_DA_DATADOC
        INPUT CODNUM F_CODNUM
        INPUT ANNO F_ANNO
        INPUT DATADOC F_A_DATADOC
        INPUT PROVV F_PROVV
        COPY DISPLAY F_DA_NDOC
        OUTPUT F_A_NDOC NDOC
        OUTPUT F_A_DATADOC DATADOC
        GROUP 2
        CHECKTYPE NORMAL
END

BUTTON DLG_SELECT 9 2
BEGIN
        PROMPT -12 -1 "Selezione"
        MESSAGE EXIT,K_ENTER
END

BUTTON DLG_QUIT 9 2
BEGIN
        PROMPT -22 -1 ""
END

ENDPAGE

ENDMASK
