📄 atpos.prg
字号:
release all
clear all
close all
set talk off
set date ymd
set safety off
set escape off
set exact on
set sysmenu off
set resource off
set exclusive on
set deleted on
set cursor off
set century on
clear macros
clear typeahead
set blink off
=sys(2009)
set procedure to atlib
do loadsdk
do initdata
=disablepli()
=autosize(.t.)
=showbmpin(0,0,639,449,'_marble.bmp')
if empty(tjdl())
set clock off
set color to
=sys(2009)
clear all
clear window
close all
quit
endif
if empty(srsky())
set clock off
set color to
=sys(2009)
clear all
clear window
close all
quit
endif
if file('dat\spmx.cdx')
erase dat\spmx.cdx
endif
if .not.used('spmx')
use in 0 dat\spmx
endif
select spmx
index on spma tag spma
index on yytxm tag yytxm
close databases
gn_num=0
do mainwind
do sjkbf
do gxsjk
do dispwelcome
do tohaltcl
do qtpd
do while .t.
do cssj
do clsnum
do case
case gn_sfg=0
if gn_num=0
=tishil('请输入商品编码或条形码!')
else
=tishil('请输入商品编码,条形码,数量或折扣信息!')
endif
case gn_sfg=1
=tishil('请输入折扣信息,选择结算方式或输入付款金额!')
endcase
set cursor on
do readk
set cursor off
do case
case gs_chc='51' .and. gn_no<>0
gn_num=gn_num+1
do srplu
do hjxs
case gs_chc='46'
do jp_dn
case gs_chc='47'
do jp_up
case gs_chc='53'
do qtcx
case gs_chc='12'
if gn_num>0
=tishiw('本次交易未完成,不能退出!',0)
loop
endif
a=goodbye()
if a=3
exit
endif
loop
case gs_chc='45'
if gn_num=0
=tishiw('无商品交易!!!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if zq='0' .and. gs_skydj<>'01'
do qxyz
if gs_qx='n'
select posfzk
use
=tishiw('无总清权限!',0)
loop
endif
endif
select posfzk
use
if .not.used('temp')
use in 0 temp
endif
if gn_num<>0
do czrz
select temp
goto bottom
if sl>0
if gs_gzbz='0'
do prt_cnt
else
gs_gzbz='0'
endif
endif
strr=replicate('=',37)
do prt with strr
strr=space(10)+'此小票作废!'
do prt with strr
do prt_head
endif
select temp
zap
use
do clswin
do dispwelcome
case gs_chc='10'
if gn_num=0
=tishiw('无商品交易!!!',0)
loop
endif
gn_yhbz=1
gn_scrollfg=0
do cxxp
do hjxs
do total
case gs_chc='11'
if gn_thbz=-1
=tishiw('此笔交易应为退货!',0)
loop
endif
if gn_sfg=0
=tishiw('请先进行合计!',0)
loop
endif
do gkfk
case gs_chc='16'
if gn_num>0
=tishiw('请把这项交易完成后再进行此操作!',0)
loop
endif
if gn_thbz=1
gn_thbz=-1
else
gn_thbz=1
endif
do jhbz
case gs_chc='22'
if gn_thbz=1
=tishiw('此笔交易应为销售!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if th='0'.and.gs_skydj<>'01'
do qxyz
if gs_qx='n'
select posfzk
use
=tishiw('无退货权限!',0)
loop
endif
endif
do hjxs
if gn_sfg=0
do total
endif
select posfzk
use
do gkfk
case gs_chc='28'
if gn_num<>0
=tishiw('请把这项交易完成后再进行此操作!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if bbdy='0' .and. g<>'01'
do qxyz
if gs_qx='n'
select posfzk
use
=tishiw('无报表打印权限!',0)
loop
endif
endif
select posfzk
use
do bbdy
case gs_chc='50'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if gn_sfg=0
=tishiw('请合计后再进行结算!',0)
loop
endif
do hyk
gn_yhbz=1
do cxxp
do hjxs
do total
case gs_chc='52'
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if gz='0'.and.gs_skydj<>'01'
do qxyz
if gs_qx='n'
select posfzk
use
=tishiw('无挂帐权限!',0)
loop
endif
endif
select posfzk
use
do gzgc
case gs_chc='07'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if gn_sfg=1
=tishiw('合计后不能进行变价!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if bj='0' .and. gs_skydj<>'01'
do qxyz
if gs_qx='n'
* =tishiw('无变价权限!',0)
select posfzk
use
loop
endif
endif
select posfzk
use
do srbj
case gs_chc='08'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if gn_sfg=1
=tishiw('合计后不能进行折扣!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if zk='0' .and. gs_skydj<>'01'
do qxyz
if gs_qx='n'
=tishiw('无折扣权限!',0)
select posfzk
use
loop
endif
endif
select posfzk
use
do srzk
case gs_chc='09'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if gn_sfg=1
=tishiw('合计后不能改变数量!',0)
loop
endif
do srsl
case gs_chc='18'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if gn_sfg=1
=tishiw('合计后不能进行折让!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if zr='0' .and. gs_skydj<>'01'
do qxyz
if gs_qx='n'
=tishiw('无折让权限!',0)
select posfzk
use
loop
endif
endif
select posfzk
use
do srzr
case gs_chc='80'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if zk='0' .and. gs_skydj<>'01'
do qxyz
if gs_qx='n'
=tishiw('无团体折扣权限!',0)
select posfzk
use
loop
endif
endif
select posfzk
use
do tgzk
case gs_chc='81'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if zr='0' .and. gs_skydj<>'01'
do qxyz
if gs_qx='n'
=tishiw('无团体折让权限!',0)
select posfzk
use
loop
endif
endif
select posfzk
use
do tgzr
case gs_chc='23'
if gn_num=0
=tishiw('无商品交易!',0)
loop
endif
if .not.used('posfzk')
use in 0 dat\posfzk
endif
select posfzk
if jcz='0' .and. gs_skydj<>'01'
do qxyz
if gs_qx='n'
=tishiw('没有减操作权限!',0)
select posfzk
use
loop
endif
endif
select posfzk
use
do jcz
case gs_chc='54'
do gxsjk
case gs_chc='48'
if gn_num>0
=tishiw('请把这项交易完成后再进行此操作!',0)
loop
endif
do sjp
case gs_chc='27'
do draw
endcase
enddo
quit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -