PROCEDURE rckcx
PARAMETER RCPOPUP
PUBLIC CXFORM
PUBLIC XRCPOPUP , QRQ , ZRQ , SPPH , KH , HZH , HTH , CXJGTJ , RKZL , CKZL , RKJS ,
;
CKJS
PUSH KEY CLEAR
ON KEY LABEL ESC DO getout IN rckcx
SET SKIP OF MENU _MSYSMENU .T.
XRCPOPUP = RCPOPUP
CXJGTJ = ''
STORE 0 TO RKZL , CKZL , RKJS , CKJS
STORE SPACE(8) TO HTH
STORE SPACE(7) TO HZH
STORE SPACE(4) TO KH
STORE SPACE(8) TO SPPH
STORE {} TO QRQ , ZRQ
CXFORM = CREATEOBJECT('cxform')
CXFORM.SHOW
READ EVENTS
ENDPROC
*------
PROCEDURE getout
RELEASE CXFORM
RETURN
ENDPROC
*------
PROCEDURE cxtj
PARAMETER FN , FE , LE
IF
.NOT. EMPTY(CXJGTJ)
CKCXTJE = CXJGTJ + SPACE(1) + 'AND' + SPACE(1) + FN + LE + FE
ELSE
CKCXTJE = CXJGTJ + FN + LE + FE
ENDIF
RETURN CKCXTJE
ENDPROC
*------
DEFINE CLASS cxform AS Form
TOP = 0
LEFT = 0
HEIGHT = 405
WIDTH = 635
BACKCOLOR = RGB(255,240,230)
BORDERSTYLE = 2
KEYPREVIEW = .T.
ALWAYSONTOP = .F.
CAPTION = '入出库查询'
CLOSABLE = .F.
CONTROLBOX = .T.
MAXBUTTON = .F.
MINBUTTON = .F.
MOVABLE = .F.
VISIBLE = .T.
NAME = 'cxform'
ADD OBJECT SPPHLABEL AS LABEL WITH TOP = 10 , LEFT = 10 , HEIGHT = 25 , WIDTH = 55 ,
;
CAPTION = '商品编号:' , BACKCOLOR = RGB(255,240,230) , NAME =
;
'spphlabel'
ADD OBJECT SPPHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 65 , HEIGHT = 22 , WIDTH = 70 ,
;
INPUTMASK = 'XXXXXXXX' , CONTROLSOURCE = 'spph' , NAME = 'spphtext'
ADD OBJECT HTHLABEL AS LABEL WITH TOP = 10 , LEFT = 145 , HEIGHT = 22 , WIDTH = 45 ,
;
CAPTION = '合同号:' , BACKCOLOR = RGB(255,240,230) , NAME =
;
'hthlabel'
ADD OBJECT HTHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 190 , HEIGHT = 22 , WIDTH = 70 ,
;
INPUTMASK = 'XXXXXXXX' , CONTROLSOURCE = 'hth' , NAME = 'hthtext'
ADD OBJECT HZHLABEL AS LABEL WITH TOP = 10 , LEFT = 270 , HEIGHT = 22 , WIDTH = 45 ,
;
CAPTION = '货主号:' , BACKCOLOR = RGB(255,240,230) , NAME =
;
'hzhlabel'
ADD OBJECT HZHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 315 , HEIGHT = 22 , WIDTH = 60 ,
;
INPUTMASK = 'XXXXXXX' , CONTROLSOURCE = 'hzh' , NAME = 'hzhtext'
ADD OBJECT KHLABEL AS LABEL WITH TOP = 10 , LEFT = 385 , HEIGHT = 22 , WIDTH = 30 ,
;
CAPTION = '库号:' , BACKCOLOR = RGB(255,240,230) , NAME = 'khlabel'
ADD OBJECT KHTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 415 , HEIGHT = 22 , WIDTH = 40 ,
;
INPUTMASK = 'XXXX' , CONTROLSOURCE = 'kh' , NAME = 'khtext'
ADD OBJECT QRQLABEL AS LABEL WITH TOP = 10 , LEFT = 465 , HEIGHT = 22 , WIDTH = 45 ,
;
CAPTION = '起日期:' , BACKCOLOR = RGB(255,240,230) , NAME =
;
'qrqlabel'
ADD OBJECT QRQTEXT AS TEXTBOX WITH TOP = 6 , LEFT = 510 , HEIGHT = 22 , WIDTH = 75 ,
;
CONTROLSOURCE = 'qrq' , NAME = 'qrqtext'
ADD OBJECT ZRQLABEL AS LABEL WITH TOP = 35 , LEFT = 465 , HEIGHT = 22 , WIDTH = 45 ,
;
CAPTION = '止日期:' , BACKCOLOR = RGB(255,240,230) , NAME =
;
'zrqlabel'
ADD OBJECT ZRQTEXT AS TEXTBOX WITH TOP = 31 , LEFT = 510 , HEIGHT = 22 , WIDTH = 75 ,
;
CONTROLSOURCE = 'zrq' , NAME = 'zrqtext'
ADD OBJECT CXGRID AS GRID WITH TOP = 60 , LEFT = 0 , WIDTH = 520 , HEIGHT = 310 ,
;
SCROLLBARS = 3 , COLUMNCOUNT = 13 , GRIDLINES = 2 , VISIBLE = .F. ,
;
DELETEMARK = .F. , RECORDMARK = .T. , HEADERHEIGHT = 30 , ROWHEIGHT = 22 ,
;
NAME = 'cxgrid'
ADD OBJECT RKZLLABEL AS LABEL WITH TOP = 65 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,
;
FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =
;
'入库吨:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) , NAME =
;
'rkzllabel'
ADD OBJECT RKZLTEXT AS TEXTBOX WITH TOP = 85 , LEFT = 535 , HEIGHT = 25 , WIDTH = 95 ,
;
FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =
;
'rkzl' , INPUTMASK = '99999.999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,
;
DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'rkzltext'
ADD OBJECT CKZLLABEL AS LABEL WITH TOP = 115 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,
;
FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =
;
'出库吨:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) , NAME
;
= 'ckzllabel'
ADD OBJECT CKZLTEXT AS TEXTBOX WITH TOP = 135 , LEFT = 535 , HEIGHT = 25 , WIDTH =
;
95 , FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =
;
'ckzl' , INPUTMASK = '99999.999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,
;
DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'ckzltext'
ADD OBJECT RKJSLABEL AS LABEL WITH TOP = 165 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,
;
FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =
;
'入库件数:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) ,
;
NAME = 'rkjslabel'
ADD OBJECT RKJSTEXT AS TEXTBOX WITH TOP = 185 , LEFT = 535 , HEIGHT = 25 , WIDTH =
;
95 , FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =
;
'rkjs' , INPUTMASK = '99999999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,
;
DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'rkjstext'
ADD OBJECT CKJSLABEL AS LABEL WITH TOP = 215 , LEFT = 550 , HEIGHT = 25 , WIDTH = 70 ,
;
FONTSIZE = 12 , FONTNAME = '宋体' , VISIBLE = .F. , CAPTION =
;
'出库件数:' , FORECOLOR = RGB(255,0,0) , BACKCOLOR = RGB(255,240,230) ,
;
NAME = 'ckjslabel'
ADD OBJECT CKJSTEXT AS TEXTBOX WITH TOP = 235 , LEFT = 535 , HEIGHT = 25 , WIDTH =
;
95 , FONTSIZE = 12 , ENABLED = .F. , VISIBLE = .F. , CONTROLSOURCE =
;
'ckjs' , INPUTMASK = '99999999' , DISABLEDBACKCOLOR = RGB(255,240,230) ,
;
DISABLEDFORECOLOR = RGB(0,0,255) , NAME = 'ckjstext'
ADD OBJECT PRINTBUTTON AS COMMANDBUTTON WITH FONTNAME = '宋体' , CAPTION = '打
印' ,
;
VISIBLE = .F. , HEIGHT = 25 , TOP = 280 , LEFT = 550 , WIDTH = 70 ,
;
NAME = 'printbutton'
ADD OBJECT CXCX AS COMMANDBUTTON WITH FONTNAME = '宋体' , CAPTION = '查
询' ,
;
VISIBLE = .F. , HEIGHT = 25 , TOP = 315 , LEFT = 550 , WIDTH = 70 , NAME =
;
'cxcx'
ADD OBJECT CXGETOUT AS COMMANDBUTTON WITH FONTNAME = '宋体' , CAPTION = '退
出' ,
;
VISIBLE = .T. , HEIGHT = 25 , TOP = 350 , LEFT = 550 , WIDTH = 70 ,
;
NAME = 'cxgetout'
PROCEDURE Unload
CLEAR
CLOSE ALL
POP KEY
SET SKIP OF MENU _MSYSMENU .F.
RELEASE CXFORM , XRCPOPUP , QRQ , ZRQ , SPPH , KH , HZH , HTH , CXJGTJ , RKZL , CKZL ,
;
RKJS , CKJS
ENDPROC
*------
PROCEDURE spphtext.GotFocus
IF XRCPOPUP = 'ckpop'
THISFORM.CAPTION = '出库查询'
ELSE
THISFORM.CAPTION = '入库查询'
ENDIF
ENDPROC
*------
PROCEDURE spphtext.Valid
RKZL = 0
CKZL = 0
IF EMPTY(THISFORM.SPPHTEXT.VALUE)
THISFORM.HTHTEXT.ENABLED = .T.
ELSE
HTH = SPACE(8)
HZH = SPACE(7)
KH = SPACE(4)
QRQ = {}
ZRQ = {}
THISFORM.HTHTEXT.ENABLED = .F.
THISFORM.HZHTEXT.ENABLED = .F.
THISFORM.KHTEXT.ENABLED = .F.
THISFORM.QRQTEXT.ENABLED = .F.
THISFORM.ZRQTEXT.ENABLED = .F.
THISFORM.REFRESH
SELECT DSPPH , DCC , DPM , DGG , DSL , DKC , DKH , DFW , DHZH , DHTH , DRQ , DXH , DLX
;
FROM (PATH + 'lys') WHERE DSPPH = SPPH INTO CURSOR cxtmp
USE IN LYS
IF _TALLY = 0
?? CHR(7)
THISFORM.CXGRID.VISIBLE = .F.
WAIT WINDOW '无此条件数据!'
SPPH = SPACE(8)
THISFORM.REFRESH
RETURN 0
ELSE
SUM FOR DLX = '入库' TO RKZL DSL * DGG / 1000
SUM FOR DLX = '出库' TO CKZL -DSL * DGG / 1000
SUM FOR DLX = '入库' TO RKJS DSL
SUM FOR DLX = '出库' TO CKJS -DSL
GO TOP
THISFORM.SPPHTEXT.ENABLED = .F.
THISFORM.CXGRID.VISIBLE = .T.
THISFORM.CXGRID.RECORDSOURCE = 'cxtmp'
THISFORM.RKZLLABEL.VISIBLE = .T.
THISFORM.RKZLTEXT.VISIBLE = .T.
THISFORM.CKZLLABEL.VISIBLE = .T.
THISFORM.CKZLTEXT.VISIBLE = .T.
THISFORM.RKJSLABEL.VISIBLE = .T.
THISFORM.RKJSTEXT.VISIBLE = .T.
THISFORM.CKJSLABEL.VISIBLE = .T.
THISFORM.CKJSTEXT.VISIBLE = .T.
THISFORM.PRINTBUTTON.VISIBLE = .T.
THISFORM.CXCX.VISIBLE = .T.
THISFORM.REFRESH
ENDIF
ENDIF
ENDPROC
*------
PROCEDURE hthtext.Valid
THISFORM.QRQTEXT.ENABLED = .T.
THISFORM.ZRQTEXT.ENABLED = .T.
IF EMPTY(THISFORM.HTHTEXT.VALUE)
THISFORM.HZHTEXT.ENABLED = .T.
THISFORM.KHTEXT.ENABLED = .T.
ELSE
HZH = SPACE(7)
KH = SPACE(4)
THISFORM.HZHTEXT.ENABLED = .F.
THISFORM.KHTEXT.ENABLED = .F.
THISFORM.REFRESH
CXJGTJ = CXTJ('DHTH','hth','=')
ENDIF
ENDPROC
*------
PROCEDURE hzhtext.Valid
CXJGTJ = ''
IF
.NOT. EMPTY(THISFORM.HZHTEXT.VALUE)
CXJGTJ = CXTJ('DHZH','hzh','=')
ENDIF
ENDPROC
*------
PROCEDURE khtext.Valid
IF
.NOT. EMPTY(THISFORM.KHTEXT.VALUE)
CXJGTJ = CXTJ('DKH','kh','=')
ENDIF
ENDPROC
*------
PROCEDURE qrqtext.Valid
IF
.NOT. EMPTY(THISFORM.QRQTEXT.VALUE)
CXJGTJ = CXTJ('DRQ','qrq','>=')
ENDIF
ENDPROC
*------
PROCEDURE zrqtext.Valid
RKZL = 0
CKZL = 0
IF
.NOT. EMPTY(THISFORM.ZRQTEXT.VALUE)
CXJGTJ = CXTJ('DRQ','zrq','<=')
ELSE
IF EMPTY(CXJGTJ)
RETURN -5
ENDIF
ENDIF
IF XRCPOPUP = 'ckpop'
CXJGTJ = CXJGTJ + " AND dlx='出库'"
ELSE
CXJGTJ = CXJGTJ + " AND dlx='入库'"
ENDIF
IF LASTKEY() = 5 .OR. LASTKEY() = 19
RETURN -1
ELSE
SELECT dspph,dcc,dpm,dgg,dsl,dkc,dkh,dfw,dhzh,dhth,drq,dxh,dlx FROM (path+"lys") WHERE &cxjgtj INTO CURSOR cxtmp
USE IN LYS
IF _TALLY = 0
?? CHR(7)
THISFORM.HZHTEXT.ENABLED = .T.
THISFORM.KHTEXT.ENABLED = .T.
THISFORM.CXGRID.VISIBLE = .F.
WAIT WINDOW '无此条件数据!'
SPPH = SPACE(8)
HTH = SPACE(8)
HZH = SPACE(7)
KH = SPACE(4)
STORE {} TO QRQ , ZRQ
THISFORM.REFRESH
RETURN -5
ELSE
SUM FOR DLX = '入库' TO RKZL DSL * DGG / 1000
SUM FOR DLX = '出库' TO CKZL -DSL * DGG / 1000
SUM FOR DLX = '入库' TO RKJS DSL
SUM FOR DLX = '出库' TO CKJS -DSL
GO TOP
THISFORM.SPPHTEXT.ENABLED = .F.
THISFORM.HTHTEXT.ENABLED = .F.
THISFORM.HZHTEXT.ENABLED = .F.
THISFORM.KHTEXT.ENABLED = .F.
THISFORM.QRQTEXT.ENABLED = .F.
THISFORM.ZRQTEXT.ENABLED = .F.
THISFORM.CXGRID.VISIBLE = .T.
THISFORM.CXGRID.RECORDSOURCE = 'cxtmp'
THISFORM.RKZLLABEL.VISIBLE = .T.
THISFORM.RKZLTEXT.VISIBLE = .T.
THISFORM.CKZLLABEL.VISIBLE = .T.
THISFORM.CKZLTEXT.VISIBLE = .T.
THISFORM.RKJSLABEL.VISIBLE = .T.
THISFORM.RKJSTEXT.VISIBLE = .T.
THISFORM.CKJSLABEL.VISIBLE = .T.
THISFORM.CKJSTEXT.VISIBLE = .T.
THISFORM.PRINTBUTTON.VISIBLE = .T.
THISFORM.CXCX.VISIBLE = .T.
THISFORM.REFRESH
ENDIF
ENDIF
ENDPROC
*--