⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 poslib.prg

📁 超市收银系统,所需系统dos6.22,ucdos,foxpro另外加上一些外设的驱动程序.
💻 PRG
📖 第 1 页 / 共 5 页
字号:
		endfor
	else
        ldc_kzfe=0    
		for k=1 to gi_card_num+1
			bb(1)=[253]
			bb(2)='hyk'+right('000'+alltrim(str(k,3)),3)
			bb(3)=hyk(k,1)
			bb(4)=hyk(k,4)
			bb(5)=0.00
			bb(6)=hyk(k,2)
			ldc_kzfe=ldc_kzfe+hyk(k,2)
			bb(7)=jyrq
			bb(8)=jysj
			bb(9)=yyym
			bb(10)=skym
			bb(11)=sksjph
			bb(12)=allt(hyk(k,3))
			bb(13)=gklx
			bb(14)=jihao
			bb(15)=[03]
			bb(16)=0
			if k=gi_card_num+1

				bb(3)=[]
*				bb(6)=jy(2,2)
				bb(6)=ldc_hj-ldc_kzfe
				bb(12)=allt(jy(2,1))
			endif
			sele pcxs
			append from array bb
		endfor
	endif
	rele bb
endif

if not used("hyk_tj")
	use tradedat\hyk_tj in 0
endif
select hyk_tj
zap
use
sele pcxs
repl all mbk with '01'
sele spxb
append from pcxs
sele netxb
append from pcxs
rq1=left(dtoc(date()),4)+substr(dtoc(date()),6,2)+right(dtoc(date()),2)
rq=right(rq1,6)
fileaaa='bak\xb'+rq+'.dbf'
select 25
use &fileaaa
append from pcxs
sele pcxs
use
erase pcxs
sele spxb
use
if flag_net='OK'.and.!file(pospath+"\tradedat\xslsnet.txt")  &&  网络通
	if !file('f:\hpos\posnet.txt') .or. file(pospath+"\control.txt")
		sele netxb
		use
		sele temp
		use
		sele lsbflast
		use
		return    &&网络断开或交易数据正被读取,则不作下步处理
	endif
	copy file yes.txt to &pospath\pos.txt
	if file(pospath+'\error.txt')
		do cwcl
	else
		sele lsbflast
		zap
		appe from tradedat\netxb
		count to rowcount
		go top
		m.spma=spma
		insert into  lsbflast (tzm,spma,sl) values ('000',m.spma,rowcount)
		fileaa=pospath+'\tradedat\xslsnet.txt'
		copy to tradedat\xslsnet.txt type delimited with tab
		li_i = 0
		do while (uf_filesize(pospath+"\tradedat\xslsnet.txt")<>uf_filesize("tradedat\xslsnet.txt"))
	 	    li_i = li_i + 1
	 	    If li_i>3
	 	    	=xx("网络错误,请检测网络!",1)
	 	    	Exit
	 	    EndIf
	 	    copy file tradedat\xslsnet.txt to &pospath\tradedat\xslsnet.txt
        enddo
		=file(pospath+'\tradedat\xslsnet.txt')
		=file(pospath+'\tradedat\xslsnet.txt')
		=file(pospath+'\tradedat\xslsnet.txt')
		if file(pospath+'\tradedat\xslsnet.txt')
			select netxb
			zap
		endif
		fileaaa='pos.txt'
		erase &pospath\&fileaaa
		erase tradedat\xslsnet.txt
	endif
endif
sele netxb
use
sele temp
use
sele lsbflast
use
=tishil([交易数据已成功存盘!])
return
*=========================================
*报表打印
*=========================================
procedure bbdy
if no=1
	*系统参数报表
	do xtcsbb
	return
endif
if not used([tradedat\netxb])
	use tradedat\netxb in 0
endif
select netxb
if recco()>0
	strr=[ POS机销售数据未完全回收!!! ]
	do prtproce with strr
endif
select netxb
use
do skybbl_mx
return

*=================================================
* xtcsbb	
*    描述:系统参数报表
*
*=================================================
procedure xtcsbb
private ls_s

if not used([posfzk]) 
	use dat\posfzk
endif
select posfzk
ls_s=[商场名称: ]+scmg
do prtproce with ls_s
select posfzk
ls_s=[机号    : ]+jihao
do prtproce with ls_s
select posfzk
ls_s=[当前票号: ]+allt(str(piaohao))
do prtproce with ls_s

select posfzk
if substr(syrm,1,1)=[0]
	ls_s=[打印方式: 按行打印]
else
	ls_s=[打印方式: 按票打印]
endif
do prtproce with ls_s
select posfzk
if substr(syrm,2,1)=[0]
	ls_s=[打印格式: 格式0]
else
	ls_s=[打印格式: 格式1]
endif
do prtproce with ls_s
select posfzk
if substr(syrm,3,1)=[0]
	ls_s=[四舍五入:金额到角]
else
	ls_s=[四舍五入:金额到分]
endif
do prtproce with ls_s

select posfzk
if substr(syrm,4,1)=[0]
	ls_s=[9开头的条形码:变价]
else
	ls_s=[9开头的条形码:正常]
endif
do prtproce with ls_s

if used([posfzk]) 
	select posfzk
	use 
endif
do creat_end
return
*=================================================
*收款员明细日报表
*=================================================
procedure skybbl_mx

P_Color='B/W,W+/B,W/W,W+/B,W/B,W+/B,GR/W,W/B,N/W,W+/W'    && 建立窗口
=DefiWind('xsms',8,20,14,60,"colo &P_Color titl '收款员明细日报表'")
=ActiWind('xsms')
@ 2,7 say [请输入查询日期:] color 8/7
=dnrect(C2X(23)-2,R2Y(2)-2,C2X(29)+2,R2Y(3))
set cursor on
set colo to w+/b,b/w
rq1=left(dtoc(date()),4)+substr(dtoc(date()),6,2)+right(dtoc(date()),2)
rq=right(rq1,6)
ls_kcrq=rq
=tishil([请输入查询日期YYMMDD])
@2,23 get ls_kcrq color w/w
read
=relewind('xsms')
L_bbhj=0
	filedbf='bak\xb'+ls_kcrq+'.dbf'
	if !file(filedbf)
		=tishil('日期错!')
		do alarm
		return
	endif

sele ssje,skym,sksjph from &filedbf into dbf aaa;
where allt(tzm)#[p].and.allt(tzm)#[5].and.allt(tzm)#[6].and.tzm#'253'
sele ssje as ssje,skym,sksjph from &filedbf into dbf bbb;
where (allt(tzm)==[5].or.allt(tzm)==[6])
sele ssje,skym,jsbz from &filedbf into dbf ccc;
where allt(jsbz)#[00].and.tzm#'000'

sele skym,sum(ssje) as ssje from aaa into dbf ddd group by 1 order by 1
use in aaa
erase aaa.dbf

sele skym,sum(ssje) as ssje from bbb into dbf eee group by 1 order by 1
use in bbb
erase bbb.dbf


sele skym,jsbz,sum(ssje) as ssje from ccc into dbf fff group by 1,2 order by 1
use in ccc
erase ccc.dbf

*====================
select eee
i2=recc()
goto top
for step=1 to i2
	select eee
	gh_eee=skym
	select ddd
	goto top
	loca for skym=gh_eee
	if !found()
		insert into  ddd  (ssje,skym) values (0,gh_eee)
	endif
	select eee
	skip
endfor
*====================

select ddd
i=recc()
strr=space(5)+[收款员明细报表]
do prtproce with strr
do delay1


strr='报表日期:'+'20'+substr(ls_kcrq,1,2)+'/'+substr(ls_kcrq,3,2)+'/'+substr(ls_kcrq,5,2)
do prtproce with strr
do delay1

if i=0.and.i2=0
	strr=[      此日无销售 ]
	do prtproce with strr
else
	strr=repl([-],26)
	do prtproce with strr
	do delay1
	use dat\yuangzd in 15
	sele ddd
	go top

	for ss=1 to i
		fph=skym
		je=ssje

		sele yuangzd                &&打印姓名行
		go top
		locate for allt(gonghao)==allt(fph)
		if found()
			strr=space(1)+'姓 名'+space(10)+padr(allt(xingmin),8,[ ])
			do prtproce with strr
		endif

		strr=space(1)+'销售额'+space(7)+str(je,10,2)                   && 打印总销售额
		do prtproce with strr
		do delay1

		sele eee                 &&打印退货额
		ssje_th=0
		goto top
		loca for skym=fph
		if found()
			ssje_th=ssje
			strr=space(1)+'退货额'+space(7)+str(ssje_th,10,2)
			do prtproce with strr
		endif

		L_bbhj=L_bbhj+(je-ssje_th)
		strr=space(1)+'实收金额 '+space(5)+str(je-ssje_th,10,2)         &&打印实收金额
		do prtproce with strr

		li_ymbje=je-ssje_th
		strr=space(1)+'其中  '         &&打印
		do prtproce with strr
		select fff
		re_ff=recc()
		if re_ff>0
			use dat\posfbk in 20
			select fff

			goto top
			for sss=1 to re_ff
				ls_jsbz=jsbz
				select posfbk
				goto top
				loca for bzbh=ls_jsbz
				ls_bzmc=bzmc
				select fff
				if skym=fph
					strr=space(1)+ls_bzmc+space(5)+str(ssje,10,2)
					do prtproce with strr
					select fff
					li_ymbje=li_ymbje-ssje
				endif
				skip
				do delay1
			endfor
			select posfbk
			use
		endif
		strr='人民币'+space(5)+str(li_ymbje,10,2)
		do prtproce with strr


		strr=repl([-],26)
		do prtproce with strr
		do delay1

		sele ddd
		skip
	endfor
	sele yuangzd
	use
endif
use in ddd
use in eee
use in fff
erase ddd.dbf
erase eee.dbf
erase fff.dbf

strr='合计'+space(8)+str(L_bbhj,10,2)
do prtproce with strr

do creat_end
close database
return

*=================================================
*收款员明细日报表
*=================================================
procedure skybbl
private rq,k,ss,fph,strr,je,filiedbf,L_bbhj

*=================
P_Color='B/W,W+/B,W/W,W+/B,W/B,W+/B,GR/W,W/B,N/W,W+/W'    && 建立窗口
*       =DefiWind('xsms',8,20,17,60,"colo &P_Color titl '收款员明细日报表'")
=DefiWind('xsms',8,20,14,60,"colo &P_Color titl '收款员明细日报表'")
do alarm
set colo to w+/b,b/w
=ActiWind('xsms')
*       =dnrect(C2X(2),R2Y(1)-5,C2X(36),R2Y(4.5)+2)
*       =uprect(C2X(2)+1,R2Y(1)-4,C2X(36)-1,R2Y(4.5)+1)
*       =ShowIco(C2X(34)-5,R2Y(7)-3,'NOTE.ICO')
@ 2,7 say [请输入查询日期:] color 8/7
=dnrect(C2X(23)-2,R2Y(2)-2,C2X(27)+2,R2Y(3))
set cursor on
set colo to w+/b,b/w
ls_kcrq=space(4)
=tishil([请输入查询日期......])
@2,23 get ls_kcrq color w/w
read
=relewind('xsms')
if ls_kcrq#space(4)
	nost=ls_kcrq+'0'
endif
*================================
L_bbhj=0
if len(nost)=5
	rq=left(dtoc(date()),4)+left(nost,4)
	filedbf='bak\xbbk'+left(nost,4)+'.dbf'
	if !file(filedbf)
		=tishil('日期错!')
		do alarm
		return
	endif
	filedbf='bak\xbbk'+left(nost,4)
else
	rq=left(dtoc(date()),4)+substr(dtoc(date()),6,2)+right(dtoc(date()),2)
	filedbf='tradedat\spxb'
endif
sele ssje,skym,sksjph from &filedbf into dbf aaa;
where len(allt(tzm))=1.and.allt(tzm)#[5].and.allt(tzm)#[6].and.allt(jyrq)==allt(rq)
sele -ssje as ssje,skym,sksjph from &filedbf into dbf bbb;
where (allt(tzm)==[5].or.allt(tzm)==[6]).and.allt(jyrq)==allt(rq)
sele ssje,jsbz,skym,sksjph from &filedbf into dbf ccc;
where len(allt(tzm))=3.and.allt(jyrq)==allt(rq)
sele dist sksjph from &filedbf into dbf ddd;
where (allt(tzm)==[15].or.allt(tzm)==[16]).and.allt(jyrq)==allt(rq)

if len(nost)=5
	filedbf='xbbk'+left(nost,4)
	select &filedbf
	use
else
	use in spxb
endif
sele ddd
k=recc()
if k#0
	go top
	for ss=1 to k
		fph=sksjph
		sele ccc
		go top
		locate for sksjph==fph
		do while .t.
			if found().and.!eof()
				repl ssje with -ssje
			else
				exit
			endif
			continue
		enddo
		sele ddd
		skip
	endfor
endif
sele aaa
append from bbb
append from ccc
use in bbb
use in ccc
use in ddd
erase bbb.dbf
erase ccc.dbf
erase ddd.dbf
sele skym,sum(ssje) as ssje from aaa into dbf bbb group by 1 order by 1
use in aaa
erase aaa.dbf
use dat\yuangzd in 0
use dat\posfzk in 0
sele bbb
k=recc()
if k=0
	strr=[        ]+allt(scmc)+[收款员明细报表 ]
	do prtproce with strr
	if len(nost)=5
		strr=space(9)+'报表日期:'+substr(rq,3,2)+'/'+substr(rq,5,2)+'/'+substr(rq,7,2)
		do prtproce with strr
	endif
	strr=space(4)+dtoc(date())+space(10)+'POS No.'+'('+skjh+')  '
	do prtproce with strr
	strr=[           此日无销售 ]
	do prtproce with strr
else
	strr=[        ]+allt(scmc)+[收款员明细报表 ]
	do prtproce with strr
	if len(nost)=5
		strr=space(9)+'报表日期:'+substr(rq,3,2)+'/'+substr(rq,5,2)+'/'+substr(rq,7,2)
		do prtproce with strr
	endif
	strr=space(3)+dtoc(date())+space(9)+'POS No.'+'('+skjh+')  '
	do prtproce with strr
	strr=[  姓 名]+space(22)+[金 额]
	do prtproce with strr
	strr=repl([-],35)
	do prtproce with strr
	sele bbb
	go top
	for ss=1 to k
		fph=skym
		je=ssje
		L_bbhj=L_bbhj+ssje
		sele yuangzd
		go top
		locate for allt(gonghao)==allt(fph)
		if found()
			strr=space(1)+padr(allt(xingmin),8,[ ])+space(5)+right(space(30)+allt(str(je,10,2)),15)
			do prtproce with strr
		endif
		sele bbb
		skip
	endfor
endif
strr=repl([-],35)
do prtproce with strr
strr=' 合计 '+space(18)+str(L_bbhj,10,2)
do prtproce with strr
strr=[  REG ]+allt(sk_n)+space(16)+time()
do prtproce with strr
strr=[]
do prtproce with strr
select posfzk
strr='  '
do prtproce with strr
do prtproce with strr
strr=space(12)+scmg
do prtproce with strr
strr=space(4)+'诚 实 持 重'+space(6)+'便 民 利 众'
do prtproce with strr
strr=space(3)+dtoc(date())+space(9)+'Tel:'+scdh
do prtproce with strr
strr=space(3)+' REG '+sk_n+'          '+'POS No.'+'('+skjh+')'
do prtproce with strr
do tmcut
use in bbb
erase bbb.dbf
use in yuangzd
use in posfzk
return

*=================================================
*收款员柜组报表
*=================================================
procedure skygzbb
private rq,k,ss,fph,strr,je,filiedbf,L_bbhj=0

L_bbhj=0
if len(nost)=5
	rq=left(dtoc(date()),4)+left(nost,4)
	filedbf='bak\xbbk'+left(nost,4)+'.dbf'
	if !file(filedbf)
		=tishil('日期错!')
		do alarm
		return
	endif
	filedbf='bak\xbbk'+left(nost,4)
else
	rq=left(dtoc(date()),4)+substr(dtoc(date()),6,2)+right(dtoc(date()),2)
	filedbf='tradedat\spxb'
endif
*******************
sele ssje,skym,sksjph,yyym from &filedbf into dbf sky_gz;
where skym=sk_n
sele spxb
use
sele yyym,sum(ssje) as ssje from sky_gz into dbf bbb group by 1 order by 1
count to yyy_cout
goto top

use dat\yuangzd in 11
goto top
for k=1 to yyy_cout
	sele bbb
	yyy_m=yyym
	sele yuangzd
	locate for allt(gonghao)==allt(yyy_m)
	if found()
		L_gzbh=gzbh
		sele bbb
		repl yyym with L_gzbh
	else
		sele bbb
	endif
	skip
endfor
sele yuangzd
use
sele yyym,sum(ssje) as ssje from bbb into dbf yyy_gz group by 1 order by 1
sele bbb
use
erase bbb.dbf

sele yyy_gz
k=recc()
if k=0
* handle=fcreat('prtcch.dat')
	strr=[        ]+allt(scmc)+[收款员部门报表 ]
	do prtproce with strr
* =fput(handle,strr)
	if len(nost)=5
		strr=space(9)+'报表日期:'+substr(rq,3,2)+'/'+substr(rq,5,2)+'/'+substr(rq,7,2)
		do prtproce with strr
*       =fput(handle,strr)
	endif
	strr=space(7)+dtoc(date())+space(8)+'POS No.'+'('+skjh+')  '

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -