VF进销存管理系统论文
在“合计金额”文本框的ProgrammaticChange事件下添加如下代码:
thisform.text17.value=this.value
在“实付金额”文本框的KeyPress事件下添加如下代码:
IF nkeycode=13
thisform.command2.click
ENDIF
在“实付金额”文本框的InterActiveChange事件下添加如下代码:
thisform.text17.value=thisform.text15.value-this.value
在“实付金额”文本框的GotFocus事件下添加如下代码:
thisform.text2.enabled=.t.
在“付款方式”组合框的ProgrammaticChange事件下添加如下代码:
this.interactivechange
在“付款方式”组合框的InterActiveChange事件下添加如下代码:
thisform.msgrid.textmatrix(thisform.msgrid.rows-1,6)=this.value
DO CASE
CASE this.value="现金"
thisform.label11.caption="实付金额"
thisform.label12.caption='未付金额'
CASE this.value="挂账"
thisform.label11.caption="应付金额"
thisform.label12.caption='未付金额'
CASE this.value="预付"
thisform.label11.caption="预付金额"
thisform.label12.caption='未付金额'
CASE this.value="支票"
thisform.label11.caption="支票金额"
thisform.label12.caption='未付金额'
ENDCASE
在“金额”文本框的InterActiveChange事件下添加如下代码:
thisform.msgrid.textmatrix(thisform.msgrid.rows-1,5)=this.value
thisform.msgrid.textmatrix(thisform.msgrid.rows-1,8)=;
thisform.text10.value*this.value
thisform.text14.value=thisform.msgrid.rows-1
thisform.text15.value=thisform.text10.value*this.value
在“金额”文本框的KeyPress事件下添加如下代码:
IF nkeycode=13
a=messagebox("还有其他进货商品吗?",32+4,"系统提示")
IF a=6
thisform.msgrid.additem('')
thisform.rainfunction1.setall("Text",6,4,'Value',"")
thisform.rainfunction1.setall("Text",8,7,"value",{})
thisform.rainfunction1.setall("Text",17,10,"value",0)
thisform.text9.value=""
thisform.rainfunction1.setall("Text",17,5,"enabled",.f.)
thisform.text1.programmaticchange
thisform.text2.programmaticchange
thisform.rainsupinput1.执行
thisform.combo1.programmaticchange
ELSE
thisform.rainfunction1.setall("Text",17,4,"enabled",.f.)
IF thisform.combo1.displayvalue<>"挂账"
thisform.text16.enabled=.t.
FOR m=1 TO thisform.msgrid.rows-1
thisform.text15.value=thisform.text15.value+;
val(thisform.msgrid.textmatrix(0,8))
ENDFOR
ENDIF
ENDIF
ENDIF
在“添加”按钮的Click事件下添加如下代码:
thisform.text1.value=thisform.rainfunction1.autonumber("入库信息表","RK")
thisform.text2.value= datetime()
this.enabled=.f.
thisform.command2.enabled=.t.
thisform.rainsupinput1.enabled=.t.
thisform.rainsupinput1.setfocus
thisform.msgrid.textmatrix(thisform.msgrid.rows-1,1)=RZBH
在“修改”按钮的Click事件下添加如下代码:
DIME rk(9)
a=messagebox("确定要保存操作吗?",32+4,"系统提示")
IF a=6
FOR m=1 TO thisform.msgrid.rows-1
FOR n=1 TO 9
rk(n)=thisform.msgrid.textmatrix(m,n) &&将表格中的数据存入数组
ENDFOR
INSERT INTO 入库日志 (编号,入库时间,供应商编号,商品编号,入库数量,;
付款方式,单价,金额,操作员)VALUES(rk(1),thisform.text2.value,rk(3),;
rk(4),val(rk(5)),rk(6),val(rk(7)),val(rk(8)),rk(9))
UPDATE 库存信息表 SET 库存数量=库存数量+val(rk(5)) WHERE 商品编号=rk(4)
ENDFOR
**存入欠款**
&&判断是否有未付金额。如果未付金额小于应付的千分之一,则程序忽略未付金额
IF alltrim(thisform.combo1.value)="现金" OR alltrim(thisform.combo1.value)="支票"
IF thisform.text15.value-thisform.text16.value> thisform.text15.value*0.0001
a=messagebox("并没有付清应付款数,是否当做欠款保存?",32+4,"系统提示")
IF a=6
bh=thisform.rainfunction1.autonumber("欠款信息表","QK")
ddbh=thisform.text1.value
khbh=thisform.rainfunction1.numbertoname("供应商信息表",;
"全称",alltrim(thisform.rainsupinput1.value),0)
yfje=thisform.text15.value
sfje=thisform.text16.value
wfje=thisform.text17.value
INSERT INTO 欠款信息表 ;
VALUES(bh,khbh,ddbh,yfje,sfje,wfje,date(),1,.f.,date()+20)
ENDIF
ENDIF
ELSE
bh=thisform.rainfunction1.autonumber("欠款信息表","QK")
ddbh=thisform.text1.value
khbh=thisform.rainfunction1.numbertoname("供应商信息表",;
"全称",alltrim(thisform.rainsupinput1.value),0)
yfje=thisform.text15.value
sfje=thisform.text16.value
wfje=thisform.text17.value
INSERT INTO 欠款信息表 ;
VALUES(bh,khbh,ddbh,yfje,sfje,wfje,date(),1,.f.,date()+20)
ENDIF
bh=thisform.text1.value
sj=thisform.text2.value
jkfs=thisform.combo1.displayvalue
hjzl=thisform.text14.value
hjje=thisform.text15.value
DO CASE
CASE jkfs="现金" OR jkfs="支票"
yfje=0
sfje=thisform.text16.value
wfje=hjje-sfje
CASE jkfs="挂账"
hjje=thisform.text17.value
yfje=0
sfje=0
wfje=hjje
CASE jkfs="预付"
yfje=thisform.text16.value
wfje=thisform.text17.value
sfje=yfje
ENDCASE
INSERT INTO 入库信息表 (编号,入库时间,供应商编号,日志编号,结款方式,合计种类,;
合计金额,操作员,预付金额,实付金额,未付金额);
VALUES(bh,sj,gys,rzbh,jkfs,hjzl,hjje,gly,yfje,sfje,wfje)
thisform.command1.enabled=.t.
thisform.command2.enabled=.f.
thisform.text16.enabled=.f.
&&将text1~text6的Value属性设置为空
thisform.rainfunction1.setall("TEXT",6,1,"value","") thisform.rainfunction1.setall("TEXT",8,7,"value",{})
thisform.rainfunction1.setall("TEXT",17,10,"value",0)
thisform.text9.value=""
thisform.combo1.value=""
thisform.rainsupinput2.enabled=.f.
thisform.rainsupinput2.value=""
thisform.rainsupinput1.value=""
thisform.text2.enabled=.f.
thisform.msgrid.rows=2
FOR m=1 TO thisform.msgrid.cols-1
thisform.msgrid.textmatrix(1,m)=""
ENDFOR
ENDIF
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>