📄 pubmotion.~pas
字号:
aq2.Parameters.ParamByName('date').value:=FormatDateTime('yyyy-mm-dd ',now);
open;
aq2.Last;
if aq2.RecordCount>0 then
begin
s2:=copy(fieldbyname('djbh').AsString,11,3);
k:=strtoint(s2);
j:=k+1;
i:=length(inttostr(j));
case i of
1: s3:='00'+inttostr(j);
2: s3:='0'+inttostr(j);
3: s3:=inttostr(j);
end;
gxxzcreate:=copy(fieldbyname('djbh').AsString,1,10)+s3;
end
else
gxxzcreate:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
function spxxtzcreate:string;
var s1,s2,s3:string;
j, i,k:integer;
begin
s1:='GP';
with data do
begin
aq2.Connection:=adoc1;
with aq2 do
begin
close;
sql.Clear;
sql.add('select * from spxxtzd01 where convert(char(10),zdrq,120)=:zdrq order by zdrq');
aq2.Parameters.ParamByName('zdrq').value:=FormatDateTime('yyyy-mm-dd ',now);
open;
aq2.Last;
if aq2.RecordCount>0 then
begin
s2:=copy(fieldbyname('djbh').AsString,11,3);
k:=strtoint(s2);
j:=k+1;
i:=length(inttostr(j));
case i of
1: s3:='00'+inttostr(j);
2: s3:='0'+inttostr(j);
3: s3:=inttostr(j);
end;
spxxtzcreate:=copy(fieldbyname('djbh').AsString,1,10)+s3;
end
else
spxxtzcreate:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
//状态调整单
function csztcreate: string;
var s1,s2,s3:string;
j, i,k:integer;
begin
s1:='TC';
with data do
begin
aq2.Connection:=adoc1;
with aq2 do
begin
close;
sql.Clear;
sql.add('select * from cszttzd where convert(char(10),tzrq,120)=:zdrq');
aq2.Parameters.ParamByName('zdrq').value:=FormatDateTime('yyyy-mm-dd',now);
open;
aq2.Last;
if aq2.RecordCount>0 then
begin
s2:=copy(fieldbyname('djbh').AsString,11,3);
k:=strtoint(s2);
j:=k+1;
i:=length(inttostr(j));
case i of
1: s3:='00'+inttostr(j);
2: s3:='0'+inttostr(j);
3: s3:=inttostr(j);
end;
csztcreate:=copy(fieldbyname('djbh').AsString,1,10)+s3;
end
else
csztcreate:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
//商品入场单
function xprcdcreate:string;
var s1,s2,s3:string;
j, i,k:integer;
begin
s1:='GP';
with data do
begin
aq2.Connection:=adoc1;
with aq2 do
begin
close;
sql.Clear;
sql.add('select * from sprcd01 where zdrq=:zdrq');
aq2.Parameters.ParamByName('zdrq').value:=FormatDateTime('yyyy-mm-dd',now);
open;
aq2.Last;
if aq2.RecordCount>0 then
begin
s2:=copy(fieldbyname('djbh').AsString,11,3);
k:=strtoint(s2);
j:=k+1;
i:=length(inttostr(j));
case i of
1: s3:='00'+inttostr(j);
2: s3:='0'+inttostr(j);
3: s3:=inttostr(j);
end;
xprcdcreate:=copy(fieldbyname('djbh').AsString,1,10)+s3;
end
else
xprcdcreate:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
function csxxtzcreate: string;
var s1,s2,s3:string;
j, i,k:integer;
begin
s1:='GC';
with data do
begin
aq2.Connection:=adoc1;
with aq2 do
begin
close;
sql.Clear;
sql.add('select * from cstzd01 where zdrq=:zdrq');
aq2.Parameters.ParamByName('zdrq').value:=FormatDateTime('yyyy-mm-dd',now);
open;
aq2.Last;
if aq2.RecordCount>0 then
begin
s2:=copy(fieldbyname('djbh').AsString,11,3);
k:=strtoint(s2);
j:=k+1;
i:=length(inttostr(j));
case i of
1: s3:='00'+inttostr(j);
2: s3:='0'+inttostr(j);
3: s3:=inttostr(j);
end;
csxxtzcreate:=copy(fieldbyname('djbh').AsString,1,10)+s3;
end
else
csxxtzcreate:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
function ghscreate: string;
var s1,s2,s3:string;
j, i,k:integer;
begin
s1:='XC';
with data do
begin
aq2.Connection:=adoc1;
with aq2 do
begin
close;
sql.Clear;
sql.add('select * from csrcd01 where zdrq=:zdrq');
aq2.Parameters.ParamByName('zdrq').value:=FormatDateTime('yyyy-mm-dd',now);
open;
aq2.Last;
if aq2.RecordCount>0 then
begin
s2:=copy(fieldbyname('djbh').AsString,11,3);
k:=strtoint(s2);
j:=k+1;
i:=length(inttostr(j));
case i of
1: s3:='00'+inttostr(j);
2: s3:='0'+inttostr(j);
3: s3:=inttostr(j);
end;
ghscreate:=copy(fieldbyname('djbh').AsString,1,10)+s3;
end
else
ghscreate:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
function SmallTOBig(small:real):string;
var SmallMonth,BigMonth:string;
wei1,qianwei1:string[2];
qianwei,dianweizhi,qian:integer;
begin
{------- 修改参数令值更精确 -------}
{小数点后的位置,需要的话也可以改动-2值}
qianwei:=-2;
{转换成货币形式,需要的话小数点后加多几个零}
//Smallmonth:=formatfloat('0.00',small);
Smallmonth:=format('%.2f',[small]);
{---------------------------------}
dianweizhi :=pos('.',Smallmonth);{小数点的位置}
{循环小写货币的每一位,从小写的右边位置到左边}
for qian:=length(Smallmonth) downto 1 do
begin
{如果读到的不是小数点就继续}
if qian<>dianweizhi then
begin
{位置上的数转换成大写}
case strtoint(copy(Smallmonth,qian,1)) of
1:wei1:='壹'; 2:wei1:='贰';
3:wei1:='叁'; 4:wei1:='肆';
5:wei1:='伍'; 6:wei1:='陆';
7:wei1:='柒'; 8:wei1:='捌';
9:wei1:='玖'; 0:wei1:='零';
end;
{判断大写位置,可以继续增大到real类型的最大值}
case qianwei of
-3:qianwei1:='厘';
-2:qianwei1:='分';
-1:qianwei1:='角';
0 :qianwei1:='元';
1 :qianwei1:='拾';
2 :qianwei1:='佰';
3 :qianwei1:='千';
4 :qianwei1:='万';
5 :qianwei1:='拾';
6 :qianwei1:='佰';
7 :qianwei1:='千';
8 :qianwei1:='亿';
9 :qianwei1:='十';
10:qianwei1:='佰';
11:qianwei1:='千';
end;
inc(qianwei);
BigMonth :=wei1+qianwei1+BigMonth;{组合成大写金额}
end;
end;
SmallTOBig:=BigMonth;
end;
function getstringgridedit(vstringgrid:tstringgrid):tedit;
var
i:integer;
begin
result:=nil;
if not assigned(vstringgrid) then exit;
if not vstringgrid.EditorMode then
begin
vstringgrid.EditorMode:=true;
vstringgrid.EditorMode:=false;
end;
with vstringgrid do
for i:=0 to pred(ComponentCount) do
if components[i] is tcustomedit then
begin
result:=tedit(components[i]);
break;
end;
end;
function fkdh:string;
var s1,s2,s3:string;
j, k:integer;
begin
s1:='FK';
with data do
begin
aq1.Connection :=adoc1;
with aq1 do
begin
close;
sql.Clear;
sql.add('select * from fkd where zdrq=:zdrq order by fkdh');
aq1.Parameters.ParamByName('zdrq').Value:=FormatDateTime('yyyy-mm-dd ' ,now);
open;
last;
if aq1 .RecordCount>0 then
begin
s2:=copy(fieldbyname('fkdh').AsString,11,3);
k:=strtoint(s2);
//i:=length(inttostr(k));
j:=k+1;
if j<10 then s3:='00'+inttostr(j);
if (j>9) and (j<100)then s3:='0'+inttostr(j);
if (j>99) and (j<1000) then s3:=inttostr(j);
fkdh:=copy(fieldbyname('fkdh').AsString,1,10)+s3;
end
else
fkdh:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
function jhdh:string;
var s1,s2,s3:string;
j, k:integer;
begin
s1:='JH';
with data do
begin
aq1.Connection :=adoc1;
with aq1 do
begin
close;
sql.Clear;
sql.add('select * from HCRKD0 where zdrq=:zdrq order by JHdh');
aq1.Parameters.ParamByName('zdrq').Value:=FormatDateTime('yyyy-mm-dd ' ,now);
open;
last;
if aq1 .RecordCount>0 then
begin
s2:=copy(fieldbyname('JHdh').AsString,11,3);
k:=strtoint(s2);
//i:=length(inttostr(k));
j:=k+1;
if j<10 then s3:='00'+inttostr(j);
if (j>9) and (j<100)then s3:='0'+inttostr(j);
if (j>99) and (j<1000) then s3:=inttostr(j);
jhdh:=copy(fieldbyname('JHdh').AsString,1,10)+s3;
end
else
jhdh:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
function xsdh:string;
var s1,s2,s3:string;
j, k:integer;
begin
s1:='CK';
with data do
begin
aq1.Connection :=adoc1;
with aq1 do
begin
close;
sql.Clear;
sql.add('select * from HCCKD0 where zdrq=:zdrq order by LYdh');
aq1.Parameters.ParamByName('zdrq').Value:=FormatDateTime('yyyy-mm-dd ' ,now);
open;
last;
if aq1 .RecordCount>0 then
begin
s2:=copy(fieldbyname('LYdh').AsString,11,3);
k:=strtoint(s2);
//i:=length(inttostr(k));
j:=k+1;
if j<10 then s3:='00'+inttostr(j);
if (j>9) and (j<100)then s3:='0'+inttostr(j);
if (j>99) and (j<1000) then s3:=inttostr(j);
XSdh:=copy(fieldbyname('LYDh').AsString,1,10)+s3;
end
else
XSdh:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
function htdh:string;
var s1,s2,s3:string;
j, k:integer;
begin
s1:='HT';
with data do
begin
aq1.Connection :=adoc1;
with aq1 do
begin
close;
sql.Clear;
sql.add('select * from cght where zdrq=:zdrq order by htdh');
aq1.Parameters.ParamByName('zdrq').Value:=FormatDateTime('yyyy-mm-dd ' ,now);
open;
last;
if aq1 .RecordCount>0 then
begin
s2:=copy(fieldbyname('htdh').AsString,11,3);
k:=strtoint(s2);
//i:=length(inttostr(k));
j:=k+1;
if j<10 then s3:='00'+inttostr(j);
if (j>9) and (j<100)then s3:='0'+inttostr(j);
if (j>99) and (j<1000) then s3:=inttostr(j);
htdh:=copy(fieldbyname('htdh').AsString,1,10)+s3;
end
else
htdh:=s1+'01'+FormatDateTime('yy',now)+FormatDateTime('mm',now)+FormatDateTime('dd',now)+'001';
end;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -