热敏打印机.txt
ï??è?…ä?Šé??åŠ?è??ä?Šçº?ï?Œä??è?Œä??è?Œå??é??æ??æ??å??è?Œäº†ï??
//==================================================================== // å‡?æ??: gf_posprint()
//-------------------------------------------------------------------- // æ è??:
//-------------------------------------------------------------------- // å?‚æ??:
// value datawindow aw_master
// value datawindow aw_detail
// value datawindow aw_pay
// value string as_flag
//-------------------------------------------------------------------- // è??å›?å??: (none)
//-------------------------------------------------------------------- // ä?œè?…: ç?‹åœ?å?? æ?,期: 2007.05.26
//-------------------------------------------------------------------- // ä??æ??å?†å ?:
//
//-------------------------------------------------------------------- // é‚?ç??ï?šwangzaixue8118@163.com // å,‡æ??:
//====================================================================
//IF aw_detail.RowCount() = 0 THEN RETURN
Integer li_FileNum,i,li_prerow,li_spaces
String ls_print,ls_temp,ls_spaces
String
ls_start_title1,ls_start_title2,ls_end_title1,ls_end_title2,ls_end_title3,ls_end_title4
Decimal ldc_zl,ldc_fact_xfje
// //==================================================================== //// æ å ?iniæ?‡ä??çš„ç›?å…?è??ç??
////==================================================================== //ls_spaces = ProfileString( "pos.INI", 'printset', 'spaces','10' ) //ls_start_title1 = ProfileString("pos.INI", 'printset', 'title1','' ) //ls_start_title2 = ProfileString("pos.INI", 'printset', 'title2','' ) //åˆ,æ??æ‰?å??机æ??å??æ??å??
ls_start_title1 =gstr_printset.S_title1//'aaaa'// Mid(ls_start_title1,2)
ls_start_title2 = gstr_printset.S_title2//Mid(ls_start_title2,2) ls_end_title1=gstr_printset.e_title1
ls_end_title2=gstr_printset.e_title2
ls_end_title3=gstr_printset.e_title3
ls_end_title4=gstr_printset.e_title4
li_FileNum = FileOpen("LPT1",LineMode!, Write!, LockWrite!, Append!) IF li_FileNum < 0 THEN RETURN
//==================================================================== // æ‰?å??é??ç??
//==================================================================== FileWrite(li_FileNum,char(27)+char(112)+char(0)+char(48)) //==================================================================== // æ‰?å??ä??äºŒæ ‡é??
//====================================================================
//ls_print = ls_start_title1+"~r~n"+ls_start_title2
//FileWrite(li_FileNum,ls_print)
//
//==================================================================== // æ‰?å??ç,?å??ï?Œæ??é??ï?Œå??å?? æ??é??å??ä??æ??
//====================================================================
ls_print = "äº,æ??ç,?å ?:"+aw_master.Object.flow_no[aw_master.GetRow()]+"~r~n" ls_print =
ls_print+'äº,æ??æ??é??:'+String(aw_master.Object.sale_datetime[aw_master.GetRow()],'yyyy-mm-dd hh:mm:ss')+"~r~n"
ls_print =ls_print+
"æ??é??å??:"+aw_master.Object.cashier_name[aw_master.GetRow()]//+"]"+aw_master.Object.cashier_no[aw_master.GetRow()]+"["
//ls_print = ls_print+"~r~n"
ls_print = ls_print+"
"+'è?µå??å ?:'+aw_master.Object.card_name[aw_master.GetRow()]//+aw_master.Object.card_no[aw_master.GetRow()]+
ls_print = ls_print+"~r~n"+'===============================' FileWrite(li_FileNum,ls_print)
//==================================================================== // åˆ,æ??æ‰?å??情况
//==================================================================== IF as_flag = 'é??è??' THEN
ls_print = '********é??è??********'//'+"~r~n"
FileWrite(li_FileNum,ls_print)
ELSEIF as_flag = 'é??è??&è?,æ‰?' THEN
ls_print = '********é??è??&è?,æ‰?********'//+"~r~n"
FileWrite(li_FileNum,ls_print)
ELSEIF as_flag = 'é??å??&è?,æ‰?' THEN
ls_print = '********é??å??&è?,æ‰?********'//+"~r~n"
FileWrite(li_FileNum,ls_print)
END IF
//====================================================================
// æ‰?å??æ??ç?†
//====================================================================
ls_print=''
FOR i = 1 TO aw_detail.RowCount()
//æ‰?å??å?Œå?šä??å?†å??å??å?Œæ??ç •
ls_temp = aw_detail.Object.goods_no[i]
ls_print = ls_print+ls_temp+' '+aw_detail.Object.goods_subname[i]
ls_print = ls_print+"~r~n"
//æ‰?å??å?Œå?šä??å?†å??æ??é‡?
IF Left(ls_temp,2) = '27' THEN
ls_temp = '1X'
ELSE
ls_temp = String(Integer(aw_detail.Object.sale_qty[i]))+'X'
END IF
li_spaces = 11 -
Len(ls_temp)//æ??é‡?å‰?å,šåŠ ä??ä?ªç?ºæ ?ï?Œçº?å??åº?31ä?ªç?ºæ ?å??åº?
ls_print = ls_print+Space(li_spaces)+ls_temp
//å?†å??å??ä??
ls_temp = String(aw_detail.Object.sale_price[i],'0.00')
li_spaces = 10 - Len(ls_temp)
ls_print = ls_print+Space(li_spaces)+ls_temp
//å?†å??é‡?é??
ls_temp=string(aw_detail.o b j e c t.sale_amount[i] - aw_detail.o b j e c
t.single_amt[i] - aw_detail.o b j e c t.vip_amt[i],'0.00')
li_spaces = 10 - Len(ls_temp)
ls_print = ls_print+Space(li_spaces)+ls_temp
//æ‰?å??ä?šå??ä??æƒ
if aw_detail.o b j e c t.vip_amt[i] > 0 then
ls_print = ls_print+"~r~n"
ls_temp=string(aw_detail.o b j e c t.vip_amt[i],'0.00')
li_spaces = 10 - Len(ls_temp)
ls_print = ls_print+space(21 -
len('ä?šå??ä??æƒ '))+"ä?šå??ä??æƒ "+Space(li_spaces)+ls_temp
end if
//æ‰?å??å??å??æŠ?å‡?ä??æƒ
if aw_detail.o b j e c t.single_amt[i] >0 then
ls_print = ls_print+"~r~n"
ls_temp=string(aw_detail.o b j e c t.single_amt[i],'0.00')
li_spaces = 10 - Len(ls_temp)
ls_print = ls_print+space(21 -
len('æŠ?å‡?ä??æƒ '))+"æŠ?å‡?ä??æƒ "+Space(li_spaces)+ls_temp
end if
//æ??è?Œ
ls_print = ls_print+"~r~n"
NEXT
if ls_print='' then
ls_print = '==============================='
else
ls_print = ls_print+'==============================='
end if
FileWrite(li_FileNum,ls_print)
//==================================================================== // æ‰?å??å??è??å?Œå?ˆè??ï?Œæ??ä??æŠ?è??
//==================================================================== IF aw_master.Object.discount_amt[aw_master.GetRow()] > 0 OR aw_master.Object.cutback_amt[aw_master.GetRow()] > 0 THEN
//æ‰?å ?å? è??
ls_temp = String(aw_master.Object.sale_amount[aw_master.GetRow()],'0.00')
ls_print = "å? è??"+Space(31 - Len("å? è??") - Len(ls_temp) ) + ls_temp
FileWrite(li_FileNum,ls_print)
//æ??ä??æŠ?è??
IF aw_master.Object.discount_amt[aw_master.GetRow()] > 0 THEN
ls_temp = String(aw_master.Object.discount_amt[aw_master.GetRow()],'0.00')
ls_print = "æ??ä??æŠ?è??"+Space(31 - Len("æ??ä??æŠ?è??") - Len(ls_temp))+ls_temp
FileWrite(li_FileNum,ls_print)
END IF
//æ‰?å??æ??ä??å‡?ä??
IF aw_master.Object.cutback_amt[aw_master.GetRow()] > 0 THEN
ls_temp = String(aw_master.Object.cutback_amt[aw_master.GetRow()],'0.00')
ls_print = "æ??ä??å‡ ä??"+Space(31 - Len("æ??ä??å‡ ä??") - Len(ls_temp))+ls_temp //String(aw_master.Object.cutback_amt[aw_master.GetRow()])
FileWrite(li_FileNum,ls_print)
END IF
//æ‰?å??å?ˆè??
ldc_fact_xfje = aw_master.Object.sale_amount[aw_master.GetRow()] -
aw_master.Object.discount_amt[aw_master.GetRow()]
-aw_master.Object.cutback_amt[aw_master.GetRow()]
ls_temp = String(ldc_fact_xfje,'0.00')
ls_print = "å?ˆè??"+Space(31 - Len("å?ˆè??") - Len(ls_temp) ) + ls_temp
FileWrite(li_FileNum,ls_print)
ELSE
//æ‰?å??å?ˆè??
ldc_fact_xfje = aw_master.Object.sale_amount[aw_master.GetRow()]// - aw_master.Object.discount_amt[aw_master.GetRow()]
-aw_master.Object.cutback_amt[aw_master.GetRow()]
ls_temp = String(ldc_fact_xfje,'0.00')
ls_print = "å?ˆè??"+Space(31 - Len("å?ˆè??") - Len(ls_temp) ) + ls_temp
FileWrite(li_FileNum,ls_print)
END IF
//==================================================================== // æ‰?å??æ??ä??æ??æ??ç?†
//==================================================================== ls_print = ''
FOR i = 1 TO aw_pay.RowCount()
ls_temp = aw_pay.Object.pay_name[i]
ls_print = ls_print+ls_temp+Space(21 - Len(ls_temp) -
Len(String(aw_pay.Object.pay_amt[i],'0.00')))
ls_print = ls_print +String(aw_pay.Object.pay_amt[i],'0.00') +"~r~n" //+aw_pay.o b j e c t.pay_amt[i]
NEXT
//FileWrite(li_FileNum,ls_print)
//==================================================================== // æ‰?å ?å??éƒ?
//==================================================================== ls_temp = String(aw_master.Object.pay_amount[aw_master.GetRow()],'0.00') ls_print = ls_print+"å??ä??é‡?é? "+Space(21 - Len("å??ä??é‡?é? ") -
Len(ls_temp))+ls_temp+"~r~n" //aw_master.Object.pay_amount[aw_master.GetRow()]
//å??é?…é‡?é??ï??å??å??æŠ?è??å??æ??é?? ï?? æ??ä??æŠ? ï?? æ??ä??å‡?
ldc_fact_xfje = aw_master.Object.sale_amount[aw_master.GetRow()] - aw_master.Object.discount_amt[aw_master.GetRow()]
-aw_master.Object.cutback_amt[aw_master.GetRow()]
//æ‰?é›?ï??å??ä??é‡?é?? ï?? å??é?…é‡?é??
ldc_zl = aw_master.Object.pay_amount[aw_master.GetRow()] - ldc_fact_xfje ls_temp = String(ldc_zl,'0.00')
ls_print = ls_print+"æ‰?é›?é‡?é? "+Space(21 - Len("æ‰?é›?é‡?é? ") -
Len(ls_temp))+ls_temp
//string(aw_master.Object.pay_amount[aw_master.GetRow()],'0.00')
FileWrite(li_FileNum,ls_print) ls_print = ls_end_title1
FileWrite(li_FileNum,ls_print)
ls_print =ls_end_title2
FileWrite(li_FileNum,ls_print)
ls_print =ls_end_title3
FileWrite(li_FileNum,ls_print)
ls_print =ls_end_title4
FileWrite(li_FileNum,ls_print) ls_print ="~r~n"//+''+"~r~n"
FileWrite(li_FileNum,ls_print) //æ‰?å ?å??æ ‡é??
ls_print = space((integer(31 - len(ls_start_title1))/2))+ls_start_title1+"~r~n"+space((integer(31 -
len(ls_start_title2))/2))+ls_start_title2 FileWrite(li_FileNum,ls_print)
//long job
//ll_Job=PrintOpen()
FileClose(li_FileNum)
//PrintSend(ll_Job,char(27)+char(112)+char(0)+char(48))
//PrintClose(ll_Job)
本文档为【热敏打印机.txt】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。