📄 newjzform.pas
字号:
begin
showmessage('卡内储值金额不对!需要校对');
ICKjd(aa[0],aa[1],aa[2]);
kh.Text:='';
kye.text:='';
kcz.Text:='';
kxf.Text:='';
exit;
end;
if aa[2]<>trim(copy(ls,31,10)) then
begin
showmessage('卡内消费金额不对!需要校对');
ICKjd(aa[0],aa[1],aa[2]);
kh.Text:='';
kye.text:='';
kcz.Text:='';
kxf.Text:='';
exit;
end;
end;
end;
end;
procedure Tnewjz.skChange(Sender: TObject);
begin
if trim(sk.Text)='' then sk.Text:='0';
if trim(djq.Text)='' then djq.Text:='0';
if trim(djq.Text)='-' then exit;
ling.Text:=floattostr(strtofloat(jym.Text)+strtofloat(sk.Text)+strtofloat(djq.Text));
end;
procedure Tnewjz.skKeyPress(Sender: TObject; var Key: Char);
begin
if (key=#13) and (BitBtn1.Enabled) then BitBtn1.SetFocus;
end;
procedure Tnewjz.khExit(Sender: TObject);
var aa:array[0..3] of string;
begin
getvalue(aa,'select 卡号,储值,消费,卡类别 from hykmx where 卡号='''+trim(kh.Text)+'''');
if aa[0]='' then
begin
kh.Text:='';
kcz.Text:='';
kxf.Text:='';
kye.Text:='';
klb.Caption:='';
if trim(jzfsname.Text)='会员卡' then
showmessage('卡号错误!');
kyc.Enabled:=false;
// zk.Enabled:=true;
exit;
end;
if trim(aa[0])<>'' then
begin
jzfsname.ItemIndex:=7;
jzfs.ItemIndex:=7;
jzfsname.Text:='会员卡';
end;
if trim(aa[0])<>'' then
begin
query3.Active:=false;
query3.SQL.Clear;
query3.SQL.Add('update nowin set jzfs=''06'',sdjcode='''+trim(aa[0])+''' where accno=:paccno ');
query3.ParamByName('paccno').asstring:=paccount;
query3.Prepare;
query3.ExecSQL;
end;
if trim(aa[0])<>'' then
begin
query3.Active:=false;
query3.SQL.Clear;
query3.SQL.Add('select roomno,roomprice,truntime from nowin where accno=:paccno and istime=0 and sex=2');
query3.SQL.Add('union (select handno,roomprice,turntime from changeroom where accno=:paccno and istime=0 and sex=2)');
query3.ParamByName('paccno').asstring:=paccount;
query3.Prepare;
query3.Open;
while not query3.Eof do
begin
query4.Active:=false ;
query4.SQL.Clear;
query4.SQL.Add('update nowin set roomprice=(select max(hyprice12) from roomtype where roomtype=(select max(roomtype) from room1 where roomno=:proom)) where truntime=''12'' and roomno=:proom');
query4.SQL.Add('update nowin set roomprice=(select max(hyprice24) from roomtype where roomtype=(select max(roomtype) from room1 where roomno=:proom)) where truntime=''24'' and roomno=:proom');
query4.SQL.Add('update changeroom set roomprice=(select max(hyprice12) from roomtype where roomtype=(select max(roomtype) from room1 where roomno=:proom)) where turntime=''12'' and handno=:proom');
query4.SQL.Add('update changeroom set roomprice=(select max(hyprice24) from roomtype where roomtype=(select max(roomtype) from room1 where roomno=:proom)) where turntime=''24'' and handno=:proom');
query4.ParamByName('proom').asstring:=query3.fields[0].asstring;
query4.Prepare;
query4.ExecSQL;
query3.Next;
end;
end;
{ kxf.Text:=aa[2];
kcz.Text:=aa[1];
kye.Text:=floattostr(strtofloat(aa[1])-strtofloat(aa[2]));}
klb.Caption:=aa[3];
kyc.Enabled:=true;
getvalue(aa,'select * from xflxk where 卡类型='''+trim(klb.Caption)+'''');
zk.Value:=strtoint(aa[2]);
zk.Enabled:=false;
StoredProc1.UnPrepare;
StoredProc1.Prepare;
StoredProc1.ParamByName('@oAccno').asstring:=paccount;
StoredProc1.ParamByName('@ohyklb').asstring:=klb.Caption;
StoredProc1.Prepare;
StoredProc1.ExecProc;
StoredProc1.UnPrepare;
BitBtn4Click(nil);
end;
procedure Tnewjz.khKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then khExit(nil);
key:=#0;
end;
procedure Tnewjz.kycChange(Sender: TObject);
begin
BitBtn7.Enabled:=(kyc.Text<>'');
end;
procedure Tnewjz.kycKeyPress(Sender: TObject; var Key: Char);
var ls:real;
begin
try
if key='-' then exit;
ls:=strtofloat(kyc.text+key);
except
key:=#0;
end;
end;
procedure Tnewjz.BitBtn7Click(Sender: TObject);
var dy:integer;
begin
{ dy:= ICKcz(strtofloat(kyc.Text),kh.text,czy.text,kcz.Text,kxf.Text);
if dy=-1 then showmessage('储值金额不对,请输入正确金额');
if dy=0 then
begin
showmessage('储值完成');
kyc.Text:='';
khExit(nil);
end;}
end;
procedure Tnewjz.BitBtn2Click(Sender: TObject);
var
i:integer; str1,str2,str3,str4,str5,str6,StrDh:string;
j,k,top1,top2,top3,top4,top5,top6:integer;
begin
str1:='消费单号:';
str2:='消费单号:';
str3:='消费单号:';
str4:='消费单号:';
str5:='消费单号:';
str6:='消费单号:';
Query1.Active:=false;
Query1.sql.Clear;
Query1.SQL.Add('delete jzdtemp ');
Query1.sql.Add('insert into jzdtemp select cusname,(select isnull(sum(cusprice*cusnum),0) from custom where substring(cuscode,1,2)=custype.custype');
Query1.sql.Add(' and accno='''+trim(paccount)+''') as ymoney,');
Query1.sql.Add('(select isnull(sum(money),0) from custom where substring(cuscode,1,2)=custype.custype and isxj=0 and ismd=0 ');
Query1.sql.Add(' and accno='''+trim(paccount)+''') as smoney');
Query1.sql.Add(' from custype where parentcode=''0'' or parentcode=''00''');
if mcs.Text<>'0' then
Query1.sql.Add('union (select ''免超时'' as cusname,-'+mcs.Text+' as ymoney ,-'+mcs.Text+' as smoney)');
if jj.Text<>'0' then
Query1.sql.Add('union (select ''加收'' as cusname,'+jj.Text+' as ymoney,'+jj.Text+' as smoney)');
if mm.Text<>'0' then
Query1.sql.Add('union (select ''免收'' as cusname,-'+mm.Text+' as ymoney,-'+mm.Text+' as smoney)');
Query1.SQL.Add('delete jzdtemp where ymoney=0 and smoney=0');
if mxf.Checked then
Query1.SQL.Add('update jzdtemp set smoney=0');
Query1.ExecSQL;
Query1.Active:=false;
Query1.sql.Clear;
application.CreateForm(Tjyxfdprint,jyxfdprint);
jyxfdprint.fh.Caption:=fh;
jyxfdprint.djdh.Caption:=djdh.Caption;
jyxfdprint.syym.Caption:=curper.name;
jyxfdprint.hykh.Caption:=kh.Text;
jyxfdprint.ysff.Caption:=floattostr(room+san+strtofloat(rcsm.Text)+strtofloat(scsm.Text));
if mfj.Checked then
jyxfdprint.ssff.Caption:='0'
else
jyxfdprint.ssff.Caption:=floattostr(strtofloat(rm.Text)+strtofloat(sm.Text)+strtofloat(rcsm.Text)+strtofloat(scsm.Text));
jyxfdprint.yjmoney.Caption:=rmb(strtofloat(yjm.Text));
// jyxfdprint.ssmoney.Caption:=rmb(strtofloat(jym.Text));
jyxfdprint.jzfs.Caption:=jzfsname.Text;
jyxfdprint.ldsj.Caption:=formatdatetime('yyyy''年''MM''月''dd''日'' hh:mm',now);
jyxfdprint.rzsj.Caption:=rzsj;
jyxfdprint.rs.Caption:=inttostr(rs);
jyxfdprint.QRLabel1.Caption:=curper.sydw+'消费单';
jyxfdprint.ysh.Caption:=jyxfdprint.ysff.Caption;
jyxfdprint.ssh.Caption:=jyxfdprint.ssff.Caption;
Query1.Active:=false;
Query1.sql.Clear;
Query1.SQL.Add('select * from jzdtemp ');
Query1.Open;
while not Query1.Eof do
begin
jyxfdprint.ysh.Caption:=floattostr(strtofloat(jyxfdprint.ysh.Caption)+Query1.Fields[1].AsFloat);
// jyxfdprint.ssh.Caption:=floattostr(strtofloat(jyxfdprint.ssh.Caption)+Query1.Fields[2].AsFloat);
Query1.Next;
end;
jyxfdprint.xfdh1.Visible:=false;
jyxfdprint.xfdh2.Visible:=false;
jyxfdprint.xfdh3.Visible:=false;
jyxfdprint.xfdh4.Visible:=false;
jyxfdprint.xfdh5.Visible:=false;
jyxfdprint.xfdh6.Visible:=false;
jyxfdprint.ssh.Caption:=floattostr(int(strtofloat(jyxfdprint.ssh.Caption)+0.5));
Query1.Active:=false;
Query1.sql.Clear;
query1.SQL.Add('select distinct djcode from custom where accno='''+paccount+'''');
query1.Prepare;
query1.Open;
i:=1;
while not query1.Eof do
begin
strdh:=query1.Fields[0].AsString;
if i<=20 then
begin
jyxfdprint.xfdh1.Visible:=true;
if i=1 then
str1:=str1+query1.Fields[0].AsString+' '
else
Str1:=Str1+#10#13+'消费单号:'+query1.Fields[0].AsString+' ';
With Query6 do
begin
Active:=false;
sql.Clear;
SQL.Add('select Cusname,cusNum from custom,cusItem where CusItem.cusCode=custom.cusCode and djcode='+strdh);
Prepare;
Open;
j:=1;
While not eof do
begin
if (j mod 2 =0) then
begin
str1:=str1+fieldByName('cusName').AsString+':'+FieldByName('cusNum').AsString+' ';
end
else
begin
if j>1 then
begin
Str1:=str1+#13#10+' ';
jyxfdprint.xfdh1.Height:=jyxfdprint.xfdh1.Height+13;
top1:=jyxfdprint.xfdh1.top;
For k:=0 to jyxfdprint.ComponentCount-1 do
begin
if jyxfdprint.Components[k] is TWinControl then
begin
if TWinControl(jyxfdprint.Components[k]).top >top1 then
TWinControl(jyxfdprint.Components[k]).top := TWinControl(jyxfdprint.Components[k]).top +13;
end;
end;
jyxfdprint.QRBand1.Height:=jyxfdPrint.QRBand1.Height+13;
jyxfdprint.QRBand2.top:=jyxfdPrint.QRBand2.top+13;
jyxfdprint.QRSubDetail1.top:=jyxfdPrint.QRSubDetail1.top+13;
jyxfdprint.QRimage6.Height:=jyxfdPrint.QRimage6.Height+15;
jyxfdprint.QRimage7.Height:=jyxfdPrint.QRimage7.Height+15;
jyxfdprint.QRimage31.Height:=jyxfdPrint.QRimage31.Height+15;
jyxfdprint.QRimage32.Height:=jyxfdPrint.QRimage32.Height+15;
jyxfdprint.QRimage33.Height:=jyxfdPrint.QRimage33.Height+15;
jyxfdprint.QRimage19.Height:=jyxfdPrint.QRimage19.Height+15;
end;
str1:=str1+fieldByName('cusName').AsString+':'+FieldByName('cusNum').AsString+' ';
end;
inc(j);
next;
end;
close;
unprepare;
sql.Clear;
end;
end;
if (i>20)and(i<=40) then
begin
jyxfdprint.xfdh2.Visible:=true;
if i=21 then
str2:=str2+query1.Fields[0].AsString+' '
else
Str2:=Str2+#10#13+'消费单号:'+query1.Fields[0].AsString+' ';
With Query6 do
begin
Active:=false;
sql.Clear;
SQL.Add('select Cusname,cusNum from custom,cusItem where cusItem.cuscode=custom.cuscode and djcode='+strdh);
Prepare;
Open;
j:=1;
While not eof do
begin
if (j mod 2 =0) then
begin
str2:=str2+fieldByName('cusName').AsString+':'+FieldByName('cusNum').AsString+' ';
end
else
begin
if j>1 then
begin
Str2:=str2+#13#10+' ';
jyxfdprint.xfdh2.Height:=jyxfdprint.xfdh2.Height+13;
top1:=jyxfdprint.xfdh2.top;
For k:=0 to jyxfdprint.ComponentCount-1 do
begin
if jyxfdprint.Components[k] is TWinControl then
begin
if TWinControl(jyxfdprint.Components[k]).top >top1 then
TWinControl(jyxfdprint.Components[k]).top := TWinControl(jyxfdprint.Components[k]).top +13;
end;
end;
jyxfdprint.QRBand1.Height:=jyxfdPrint.QRBand1.Height+13;
jyxfdprint.QRBand2.top:=jyxfdPrint.QRBand2.top+13;
jyxfdprint.QRSubDetail1.top:=jyxfdPrint.QRSubDetail1.top+13;
jyxfdprint.QRimage6.Height:=jyxfdPrint.QRimage6.Height+15;
jyxfdprint.QRimage7.Height:=jyxfdPrint.QRimage7.Height+15;
jyxfdprint.QRimage31.Height:=jyxfdPrint.QRimage31.Height+15;
jyxfdprint.QRimage32.Height:=jyxfdPrint.QRimage32.Height+15;
jyxfdprint.QRimage33.Height:=jyxfdPrint.QRimage33.Height+15;
end;
str2:=str2+fieldByName('cusName').AsString+':'+FieldByName('cusNum').AsString+' ';
end;
inc(j);
next;
end;
close;
unprepare;
sql.Clear;
end;
end;
if (i>40)and(i<=60) then
begin
jyxfdprint.xfdh3.Visible:=true;
if i=41 then
str3:=str3+query1.Fields[0].AsString+' '
else
Str3:=Str3+#10#13+'消费单号:'+query1.Fields[0].AsString+' ';
With Query6 do
begin
Active:=false;
sql.Clear;
SQL.Add('select Cusname,cusNum from custom,cusItem where cusItem.cuscode=custom.cuscode and djcode='+strdh);
Prepare;
Open;
j:=1;
While not eof do
begin
if (j mod 2 =0) then
begin
str3:=str3+fieldByName('cusName').AsString+':'+FieldByName('cusNum').AsString;
end
else
begin
if j>1 then
begin
Str3:=str3+#13#10+' ';
jyxfdprint.xfdh3.Height:=jyxfdprint.xfdh3.Height+13;
top1:=jyxfdprint.xfdh3.top;
For k:=0 to jyxfdprint.ComponentCount-1 do
begin
if jyxfdprint.Components[k] is TWinControl then
begin
if TWinControl(jyxfdprint.Components[k]).top >top1 then
TWinControl(jyxfdprint.Components[k]).top := TWinControl(jyxfdprint.Components[k]).top +13;
end;
end;
jyxfdprint.QRBand1.Height:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -