#include <lffiles.h>
#include "ve2100r.h"

TOOLBAR "" 0 20 60 2
 #include <toolbar.h>
ENDPAGE

PAGE "Archivio sconti di riga " 11 60 14

GROUPBOX DLG_NULL 75 10
BEGIN
  PROMPT 0 0 ""
  FLAG "R"
END

STRING F_R_RICERCA 2
BEGIN
  PROMPT 2 2 "Cat. vendita  "
  FIELD CODCAT
  FLAG "HU"
  KEY 1
  USE LF_SCONTI SELECT CODCAT != ""
  JOIN CVE  ALIAS 201 INTO CODTAB==CODCAT
  INPUT TIPO F_R_TIPO SELECT
  INPUT CODCAT F_R_RICERCA
  INPUT CODART F_R_CODART
  INPUT UM F_R_UM
  DISPLAY "Cat.Vend." CODCAT
  DISPLAY "Codice art.@20" CODART
  DISPLAY "U.M." UM
  DISPLAY "N. scaglione" NSCAGL
  DISPLAY "Sconto@25" SCONTO
  OUTPUT F_R_RICERCA CODCAT
  OUTPUT F_R_CODCAT CODCAT
  OUTPUT F_R_DESCAT -201->S0
  OUTPUT F_R_CODART CODART
  OUTPUT F_R_UM UM
  OUTPUT F_R_SCA NSCAGL
  MESSAGE COPY,F_R_CODCAT
END

LIST F_R_TIPO 20
BEGIN
  PROMPT 100 100 ""
  FIELD TIPO
  FLAGS "D"
  KEY 1
  ITEM "R|Sconti di riga"
END

STRING F_R_CODCAT 2
BEGIN
  PROMPT 2 2 "Cat. vendita  "
  FIELD CODCAT
  FLAG "U"
  KEY 1
  USE CVE
  INPUT CODTAB F_R_CODCAT
  DISPLAY "Codice" CODTAB
  DISPLAY "Descrizione@50" S0
  OUTPUT F_R_CODCAT CODTAB
  OUTPUT F_R_DESCAT S0
  CHECKTYPE FORCED
END

STRING F_R_DESCAT 50
BEGIN
  PROMPT 22 2 ""
  FLAG "D"
END

STRING F_R_RICERCA_A 20
BEGIN
  PROMPT 2 4 "Cod. articolo "
  FIELD CODART
  FLAG "HU"
  KEY 1
  USE LF_SCONTI
  JOIN LF_ANAMAG INTO CODART==CODART
  JOIN CVE  ALIAS 201 INTO CODTAB==CODCAT
  INPUT TIPO F_R_TIPO SELECT
  INPUT CODCAT F_R_RICERCA SELECT
  INPUT CODART F_R_RICERCA_A
  INPUT UM F_R_UM
  DISPLAY "Codice art.@20" CODART
  DISPLAY "U.M." UM
  DISPLAY "N. scaglione" NSCAGL
  DISPLAY "Sconto@25" SCONTO
  OUTPUT F_R_RICERCA_A CODART
  OUTPUT F_R_CODART CODART
  OUTPUT F_R_UM UM
  OUTPUT F_R_DESART LF_ANAMAG->DESCR
  OUTPUT F_R_SCA NSCAGL
  MESSAGE COPY,F_R_CODART
END

STRING F_R_CODART 20
BEGIN
  PROMPT 2 4 "Cod. articolo "
  FIELD CODART
  FLAG "U"
  KEY 1
  USE LF_ANAMAG
  INPUT CODART F_R_CODART
  DISPLAY "Codice@20" CODART
  DISPLAY "Descrizione@50" DESCR
  OUTPUT F_R_CODART CODART
  OUTPUT F_R_DESART DESCR
  VALIDATE REQIF_FUNC 1 F_R_UM
  CHECKTYPE REQUIRED
  WARNING "Il codice articolo e' necessario se si specifica l'unita' di misura"
  ADD RUN VE2 -3
END

STRING F_R_UM 2
BEGIN
  PROMPT 40 4 "U.M. "
  FIELD UM
  FLAG "U"
  KEY 1
  USE LF_UMART KEY 2
  JOIN %UMS INTO CODTAB=UM
  INPUT CODART F_R_CODART SELECT
  INPUT UM F_R_UM
  DISPLAY "U.M." UM
  DISPLAY "Descrizione@50" %UMS->S0
  OUTPUT F_R_UM UM
  CHECKTYPE REQUIRED
END

NUMBER F_R_SCA 1
BEGIN
  PROMPT 50 4 "N.ro scaglione "
  FIELD NSCAGL
  KEY 1
  CHECKTYPE REQUIRED
END

STRING F_R_DESART 50
BEGIN
  PROMPT 2 6 "Descrizione   "
  FLAG "D"
END

NUMBER F_R_QLIM 15 5
BEGIN
  PROMPT 2 10 "Q.ta' limite scagl. "
  FIELD QLIM
END


STRING F_R_SCONTO 25
BEGIN
  PROMPT 2 12 "Sconto              "
  FIELD SCONTO
END

ENDPAGE

ENDMASK
