📄 ukp.pas
字号:
//打印第二行
if pt_fp.DispJe2<>'' then
begin
if trim(pt_fp.CP2)<>'' then
begin
myrect.left:=190+p_left;
myrect.top:=450+p_top;
myrect.width:=370;
myrect.height:=60;
myrect.text:=trim(pt_fp.CP2);
if length(myrect.text)>30 then myrect.text:=copy(myrect.text,1,30);
myrect.fx:='<';
MMtextout(myrect);
end;
if trim(pt_fp.GG2)<>'' then
begin
myrect.left:=560+p_left;
myrect.top:=450+p_top;
myrect.width:=200;
myrect.height:=60;
myrect.text:=trim(pt_fp.GG2);
if length(myrect.text)>20 then myrect.text:=copy(myrect.text,1,20);
myrect.fx:='|';
MMtextout(myrect);
end;
if trim(pt_fp.DW2)<>'' then
begin
myrect.left:=760+p_left;
myrect.top:=450+p_top;
myrect.width:=100;
myrect.height:=60;
myrect.text:=trim(pt_fp.DW2);
if length(myrect.text)>8 then myrect.text:=copy(myrect.text,1,8);
myrect.fx:='|';
MMtextout(myrect);
end;
if pt_fp.DispSL2<>'' then
begin
myrect.left:=860+p_left;
myrect.top:=450+p_top;
myrect.width:=180;
myrect.height:=60;
myrect.text:=trim(pt_fp.DispSL2);
myrect.fx:='|';
MMtextout(myrect);
end;
if pt_fp.DispdJ2<>'' then
begin
myrect.left:=1040+p_left;
myrect.top:=450+p_top;
myrect.width:=140;
myrect.height:=70;
myrect.text:=trim(pt_fp.DispDJ2);
myrect.fx:='>';
MMtextout(myrect);
end;
if pt_fp.DispJE2<>'' then
begin
myrect.left:=1180+p_left;
myrect.top:=450+p_top;
myrect.width:=230;
myrect.height:=70;
myrect.text:=trim(pt_fp.DispJE2);
myrect.fx:='>';
MMtextout(myrect);
end;
end;
//打印第三行
if pt_fp.DispJe3<>'' then
begin
if trim(pt_fp.CP3)<>'' then
begin
myrect.left:=190+p_left;
myrect.top:=500+p_top;
myrect.width:=370;
myrect.height:=70;
myrect.text:=trim(pt_fp.CP3);
if length(myrect.text)>30 then myrect.text:=copy(myrect.text,1,30);
myrect.fx:='<';
MMtextout(myrect);
end;
if trim(pt_fp.GG3)<>'' then
begin
myrect.left:=560+p_left;
myrect.top:=500+p_top;
myrect.width:=200;
myrect.height:=70;
myrect.text:=trim(pt_fp.GG3);
if length(myrect.text)>20 then myrect.text:=copy(myrect.text,1,20);
myrect.fx:='|';
MMtextout(myrect);
end;
if trim(pt_fp.DW3)<>'' then
begin
myrect.left:=760+p_left;
myrect.top:=500+p_top;
myrect.width:=100;
myrect.height:=70;
myrect.text:=trim(pt_fp.DW3);
if length(myrect.text)>8 then myrect.text:=copy(myrect.text,1,8);
myrect.fx:='|';
MMtextout(myrect);
end;
if pt_fp.DispSL3<>'' then
begin
myrect.left:=860+p_left;
myrect.top:=500+p_top;
myrect.width:=180;
myrect.height:=70;
myrect.text:=trim(pt_fp.DispSL3);
myrect.fx:='|';
MMtextout(myrect);
end;
if pt_fp.DispdJ3<>'' then
begin
myrect.left:=1040+p_left;
myrect.top:=500+p_top;
myrect.width:=140;
myrect.height:=70;
myrect.text:=trim(pt_fp.DispDJ3);
myrect.fx:='>';
MMtextout(myrect);
end;
if pt_fp.DispJE3<>'' then
begin
myrect.left:=1180+p_left;
myrect.top:=500+p_top;
myrect.width:=230;
myrect.height:=70;
myrect.text:=trim(pt_fp.DispJE3);
myrect.fx:='>';
MMtextout(myrect);
end;
end;
//大写合计
myrect.left:=490+p_left;
myrect.top:=570+p_top;
myrect.width:=650;
myrect.height:=70;
myrect.text:=pt_fp.DispHJJEDX;
myrect.fx:='<';
MMtextout(myrect);
//小写合计
myrect.left:=1210+p_left;
myrect.top:=570+p_top;
myrect.width:=240;
myrect.height:=60;
myrect.text:=pt_fp.DispHJJe;
myrect.fx:='<';
MMtextout(myrect);
//税号
myrect.left:=600+p_left;
myrect.top:=640+p_top;
myrect.width:=700;
myrect.height:=70;
myrect.text:=pt_fp.TaxNo;
myrect.fx:='<';
MMtextout(myrect);
//开户行账号
myrect.left:=490+p_left;
myrect.top:=710+p_top;
myrect.width:=750;
myrect.height:=70;
myrect.text:=pt_fp.BankMN;
myrect.fx:='<';
MMtextout(myrect);
myrect.left:=350+p_left;
myrect.top:=780+p_top;
myrect.width:=180;
myrect.height:=50;
myrect.text:='铜陵车辆厂';
myrect.fx:='<';
MMtextout(myrect);
//打印电话
if pt_fp.TelNo<>'' then
begin
myrect.left:=630+p_left;
myrect.top:=780+p_top;
myrect.width:=180;
myrect.height:=50;
myrect.text:=pt_fp.TelNo;
myrect.fx:='<';
MMtextout(myrect);
end;
//打印收款人
if pt_fp.RenSK<>'' then
begin
myrect.left:=920+p_left;
myrect.top:=780+p_top;
myrect.width:=180;
myrect.height:=50;
myrect.text:=pt_fp.RenSK;
myrect.fx:='<';
MMtextout(myrect);
end;
//打印开票人
if pt_fp.RenKp<>'' then
begin
myrect.left:=1200+p_left;
myrect.top:=780+p_top;
myrect.width:=200;
myrect.height:=50;
myrect.text:=pt_fp.RenKp;
myrect.fx:='<';
MMtextout(myrect);
end;
//打印地址
if pt_fp.Address<>'' then
begin
myrect.left:=630+p_left;
myrect.top:=830+p_top;
myrect.width:=480;
myrect.height:=50;
myrect.text:=pt_fp.Address;
myrect.fx:='<';
MMtextout(myrect);
end;
//打印年月日
myrect.left:=1110+p_left;
myrect.top:=830+p_top;
myrect.width:=350;
myrect.height:=50;
myrect.text:=formatdatetime('yyyy mm dd',pt_fp.KPDate);
myrect.fx:='<';
MMtextout(myrect);
//打印作废
if pt_fp.Cancel then
begin
printer.Canvas.Font.Size:=16;
printer.Canvas.TextOut(getpix(150+p_left),getpiy(100+p_top),'作废');
end;
//打印红字
if pt_fp.HJJe<0 then
begin
printer.Canvas.Font.Size:=16;
printer.Canvas.TextOut(getpix(1300+p_left),getpiy(100+p_top),'负票');
end;
// printer.NewPage;
printer.EndDoc;
if kpxx.b07 then
begin
if Application.MessageBox(PChar('你是否需要打印发票附加联信息?' + #13#10
+ '如果需要,则请等发票打印完成后,换好打印纸并联机后,按下确定按钮!' +
#13#10 + '如不需要,则直接按取消按钮(可以不用等发票打印完成)即可!'),
PChar('提示'), MB_OKCANCEL + MB_ICONQUESTION + MB_TOPMOST) = IDOK then
begin
printer.Title:='打印发票附联'+pt_fp.FPNum;
printer.BeginDoc;
printer.Canvas.Font.Size:=18;
printer.Canvas.TextOut(getpix(500+p_left),getpiy(80+p_top),'安 徽 省 货 物 销 售 发 票 附 联');
printer.Canvas.Font.Size:=12;
printer.Canvas.TextOut(getpix(650+p_left),getpiy(150+p_top),'(仓库联 记账附联 出门联)');
myrect.left:=1550+p_left;
myrect.top:=210+p_top;
myrect.width:=500;
myrect.height:=70;
myrect.fx:='<';
myrect.text:='发票代码:'+pt_fp.FPCode;
MMTextout(myrect);
myrect.top:=280+p_top;
myrect.text:='发票号码:'+pt_fp.FPNum;
MMTextout(myrect);
myrect.left:=200+p_left;
myrect.width:=1100;
myrect.text:='客户名称:'+pt_fp.KHmc;
MMTextout(myrect);
myrect.left:=1100+p_left;
myrect.text:='开票日期:'+formatdatetime('yyyy年mm月dd日',pt_fp.KPDate);
MMTextout(myrect);
MMMoveto(200+p_left,350+p_Top); MMLineto(1900+p_left,350+p_top);
MMMoveto(200+p_left,420+p_Top); MMLineto(1900+p_left,420+p_top);
MMMoveto(200+p_left,630+p_Top); MMLineto(1900+p_left,630+p_top);
MMMoveto(200+p_left,700+p_Top); MMLineto(1900+p_left,700+p_top);
MMMoveto(520+p_left,350+p_Top); MMLineto(520+p_left,700+p_top);
MMMoveto(770+p_left,350+p_Top); MMLineto(770+p_left,630+p_top);
MMMoveto(890+p_left,350+p_Top); MMLineto(890+p_left,630+p_top);
MMMoveto(1070+p_left,350+p_Top); MMLineto(1070+p_left,630+p_top);
MMMoveto(1270+p_left,350+p_Top); MMLineto(1270+p_left,700+p_top);
MMMoveto(1520+p_left,350+p_Top); MMLineto(1520+p_left,700+p_top);
MMMoveto(1640+p_left,350+p_Top); MMLineto(1640+p_left,700+p_top);
myrect.top:=350+p_top;
myrect.fx:='|';
myrect.height:=70;
myrect.left:=200+p_left;
myrect.width:=320;
myrect.text:='品 名';
MMTextout(myrect);
myrect.left:=520+p_left;
myrect.width:=250;
myrect.text:='规 格';
MMTextout(myrect);
myrect.left:=770+p_left;
myrect.width:=120;
myrect.text:='单位';
MMTextout(myrect);
myrect.left:=890+p_left;
myrect.width:=180;
myrect.text:='数量';
MMTextout(myrect);
myrect.left:=1070+p_left;
myrect.width:=200;
myrect.text:='销售单价';
MMTextout(myrect);
myrect.left:=1270+p_left;
myrect.width:=250;
myrect.text:='销售金额';
MMTextout(myrect);
myrect.left:=1520+p_left;
myrect.width:=120;
myrect.text:='计划价';
MMTextout(myrect);
myrect.left:=1640+p_left;
myrect.width:=250;
myrect.text:='计划金额';
MMTextout(myrect);
if pt_fp.CP1<>'' then
begin
myrect.left:=200+p_left;
myrect.top:=420+p_top;
myrect.width:=320;
myrect.fx:='|';
myrect.text:=pt_fp.CP1;
MMTextout(myrect);
end;
if pt_fp.GG1<>'' then
begin
myrect.left:=520+p_left;
myrect.top:=420+p_top;
myrect.width:=250;
myrect.fx:='|';
myrect.text:=pt_fp.GG1;
MMTextout(myrect);
end;
if pt_fp.DW1<>'' then
begin
myrect.left:=770+p_left;
myrect.top:=420+p_top;
myrect.width:=120;
myrect.fx:='|';
myrect.text:=pt_fp.DW1;
MMTextout(myrect);
end;
if pt_fp.DispSL1<>'' then
begin
myrect.left:=890+p_left;
myrect.top:=420+p_top;
myrect.width:=180;
myrect.fx:='>';
myrect.text:=pt_fp.DispSL1;
MMTextout(myrect);
end;
if pt_fp.DispDJ1<>'' then
begin
myrect.left:=1070+p_left;
myrect.top:=420+p_top;
myrect.width:=200;
myrect.fx:='>';
myrect.text:=pt_fp.DispDJ1;
MMTextout(myrect);
end;
myrect.left:=1270+p_left;
myrect.top:=420+p_top;
myrect.width:=250;
if pt_fp.DispJe1<>'' then
begin
myrect.fx:='>';
myrect.text:=pt_fp.DispJe1;
end
else begin
myrect.fx:='|';
myrect.text:='********';
end;
MMTextout(myrect);
if pt_fp.CP2<>'' then
begin
myrect.left:=200+p_left;
myrect.top:=490+p_top;
myrect.width:=320;
myrect.fx:='|';
myrect.text:=pt_fp.CP2;
MMTextout(myrect);
end;
if pt_fp.GG2<>'' then
begin
myrect.left:=520+p_left;
myrect.top:=490+p_top;
myrect.width:=250;
myrect.fx:='|';
myrect.text:=pt_fp.GG2;
MMTextout(myrect);
end;
if pt_fp.DW2<>'' then
begin
myrect.left:=770+p_left;
myrect.top:=490+p_top;
myrect.width:=120;
myrect.fx:='|';
myrect.text:=pt_fp.DW2;
MMTextout(myrect);
end;
if pt_fp.DispSL2<>'' then
begin
myrect.left:=890+p_left;
myrect.top:=490+p_top;
myrect.width:=180;
myrect.fx:='>';
myrect.text:=pt_fp.DispSL2;
MMTextout(myrect);
end;
if pt_fp.DispDJ2<>'' then
begin
myrect.left:=1070+p_left;
myrect.top:=490+p_top;
myrect.width:=200;
myrect.fx:='>';
myrect.text:=pt_fp.DispDJ2;
MMTextout(myrect);
end;
myrect.left:=1270+p_left;
myrect.top:=490+p_top;
myrect.width:=250;
if pt_fp.DispJe2<>'' then
begin
myrect.fx:='>';
myrect.text:=pt_fp.DispJe2;
end
else begin
myrect.fx:='|';
myrect.text:='********';
end;
MMTextout(myrect);
if pt_fp.CP3<>'' then
begin
myrect.left:=200+p_left;
myrect.top:=560+p_top;
myrect.width:=320;
myrect.fx:='|';
myrect.text:=pt_fp.CP3;
MMTextout(myrect);
end;
if pt_fp.GG3<>'' then
begin
myrect.left:=520+p_left;
myrect.top:=560+p_top;
myrect.width:=250;
myrect.fx:='|';
myrect.text:=pt_fp.GG3;
MMTextout(myrect);
end;
if pt_fp.DW3<>'' then
begin
myrect.left:=770+p_left;
myrect.top:=560+p_top;
myrect.width:=120;
myrect.fx:='|';
myrect.text:=pt_fp.DW3;
MMTextout(myrect);
end;
if pt_fp.DispSL3<>'' then
begin
myrect.left:=890+p_left;
myrect.top:=560+p_top;
myrect.width:=180;
myrect.fx:='>';
myrect.text:=pt_fp.DispSL3;
MMTextout(myrect);
end;
if pt_fp.DispDJ3<>'' then
begin
myrect.left:=1070+p_left;
myrect.top:=560+p_top;
myrect.width:=200;
myrect.fx:='>';
myrect.text:=pt_fp.DispDJ3;
MMTextout(myrect);
end;
myrect.left:=1270+p_left;
myrect.top:=560+p_top;
myrect.width:=250;
if pt_fp.DispJe3<>'' then
begin
myrect.fx:='>';
myrect.text:=pt_fp.DispJe3;
end
else begin
myrect.fx:='|';
myrect.text:='********';
end;
MMTextout(myrect);
myrect.top:=630+p_top;
myrect.fx:='>';
myrect.height:=70;
myrect.left:=200+p_left;
myrect.width:=320;
myrect.text:='合计金额(大写)';
MMTextout(myrect);
myrect.left:=523+p_left;
myrect.width:=750;
myrect.text:=pt_fp.DispHJJEDX;;
myrect.fx:='<';
MMTextout(myrect);
myrect.left:=1270+p_left;
myrect.width:=250;
myrect.fx:='>';
myrect.text:='¥'+pt_fp.DispHJJe;
MMTextout(myrect);
myrect.height:=80;
myrect.left:=200+p_left;
myrect.top:=700+p_top;
myrect.fx:='<';
myrect.width:=1900;
myrect.text:='开票单位:(盖章) 收款: 开票:'+pt_fp.RenKp;
MMTextout(myrect);
// printer.NewPage;
printer.EndDoc;
end;
end;
printer.PrinterIndex:=prtIndex;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -