上传文件至「/」
2
This commit is contained in:
+39
-66
@@ -79,7 +79,6 @@ type
|
||||
function ConditionValid:Boolean;override;
|
||||
procedure Run; override;
|
||||
function CallBack(aID: TCallBackID; aParam: String=''): String; override;
|
||||
function GetSYSID:string;
|
||||
{ Public dEClarations }
|
||||
end;
|
||||
|
||||
@@ -119,25 +118,6 @@ begin
|
||||
Result:=Trim(cbxKJDW.Text);
|
||||
end;
|
||||
|
||||
function TfrmCX_YFZLFXB.GetSYSID:string;
|
||||
begin
|
||||
Result:='';
|
||||
with qryTool do
|
||||
begin
|
||||
Close;
|
||||
SQL.Clear;
|
||||
SQL.Add('select SYSID from system where 1=1 ');
|
||||
Open;
|
||||
First;
|
||||
if not IsEmpty then
|
||||
begin
|
||||
Result:=FieldByName('SYSID').AsString;
|
||||
end;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmCX_YFZLFXB.GetKM;
|
||||
var
|
||||
sKM,sSQL: string;
|
||||
@@ -457,16 +437,9 @@ var
|
||||
iLoop: Integer;
|
||||
iYear: Integer;
|
||||
fPriZLQ : Extended;
|
||||
SYSID:string;
|
||||
iflag:Extended; //锐洋系统
|
||||
begin
|
||||
inherited;
|
||||
//查询时判断列表是否已经创建,如果未创建,且未设置账龄期,则提示,否则根据设置的账龄期创建列表
|
||||
SYSID:=GetSYSID;
|
||||
iflag:=1;
|
||||
if SYSID='0413000101' then
|
||||
iflag:=-1;
|
||||
|
||||
|
||||
qryZLQ.Close;
|
||||
qryZLQ.Open;
|
||||
@@ -548,7 +521,7 @@ begin
|
||||
SQL.Add(' case when datediff(day,YFZK_YWRQ,:pCKRQ)>'+FloatToStr(fPriZLQ)+' and datediff(day,YFZK_YWRQ,:pCKRQ)<= '+FloatToStr(qryZLQSFZLQ_ZLQ.AsFloat)+' then ');
|
||||
end;
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -561,7 +534,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -587,7 +560,7 @@ begin
|
||||
SQL.Add(' case when datediff(day,YFZK_YWRQ,:pCKRQ)>'+FloatToStr(fPriZLQ)+' and datediff(day,YFZK_YWRQ,:pCKRQ)<= '+FloatToStr(qryZLQSFZLQ_ZLQ.AsFloat)+' then ');
|
||||
end;
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -599,7 +572,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -618,7 +591,7 @@ begin
|
||||
SQL.Add(' case ');
|
||||
SQL.Add(' when datediff(day,YFZK_DQRQ,:pCKRQ)>=0 then ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -634,7 +607,7 @@ begin
|
||||
SQL.Add(' case ');
|
||||
SQL.Add(' when datediff(day,YFZK_DQRQ,:pCKRQ)<0 then ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -647,7 +620,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -658,7 +631,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -674,7 +647,7 @@ begin
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
begin
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -749,7 +722,7 @@ begin
|
||||
begin
|
||||
//应付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -784,7 +757,7 @@ begin
|
||||
SQL.Add(' union all ');
|
||||
//预付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -914,7 +887,7 @@ begin
|
||||
SQL.Add(' case when datediff(day,YFZK_YWRQ,:pCKRQ)>'+FloatToStr(fPriZLQ)+' and datediff(day,YFZK_YWRQ,:pCKRQ)<='+FloatToStr(qryZLQSFZLQ_ZLQ.AsFloat)+' then ');
|
||||
end;
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -928,7 +901,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
// SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -953,7 +926,7 @@ begin
|
||||
SQL.Add(' case when datediff(day,YFZK_YWRQ,:pCKRQ)>'+FloatToStr(fPriZLQ)+' and datediff(day,YFZK_YWRQ,:pCKRQ)<= '+FloatToStr(qryZLQSFZLQ_ZLQ.AsFloat)+' then ');
|
||||
end;
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -965,7 +938,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
// SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -982,7 +955,7 @@ begin
|
||||
SQL.Add(' case ');
|
||||
SQL.Add(' when datediff(day,YFZK_DQRQ,:pCKRQ)>=0 then ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -997,7 +970,7 @@ begin
|
||||
SQL.Add(' case ');
|
||||
SQL.Add(' when datediff(day,YFZK_DQRQ,:pCKRQ)<0 then ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1009,7 +982,7 @@ begin
|
||||
//取出总的金额
|
||||
SQL.Add('round( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1026,7 +999,7 @@ begin
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
begin
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1063,7 +1036,7 @@ begin
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
begin
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1101,7 +1074,7 @@ begin
|
||||
begin
|
||||
//应付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1136,7 +1109,7 @@ begin
|
||||
SQL.Add(' union all ');
|
||||
//预付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1181,7 +1154,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1197,7 +1170,7 @@ begin
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
begin
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1234,7 +1207,7 @@ begin
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
begin
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1272,7 +1245,7 @@ begin
|
||||
begin
|
||||
//应付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1307,7 +1280,7 @@ begin
|
||||
SQL.Add(' union all ');
|
||||
//预付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1501,7 +1474,7 @@ begin
|
||||
SQL.Add(' case when datediff(day,YFZK_YWRQ,:pCKRQ)>'+FloatToStr(fPriZLQ)+' and datediff(day,YFZK_YWRQ,:pCKRQ)<='+FloatToStr(qryZLQSFZLQ_ZLQ.AsFloat)+' then ');
|
||||
end;
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1515,7 +1488,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1541,7 +1514,7 @@ begin
|
||||
SQL.Add(' case when datediff(day,YFZK_YWRQ,:pCKRQ)>'+FloatToStr(fPriZLQ)+' and datediff(day,YFZK_YWRQ,:pCKRQ)<= '+FloatToStr(qryZLQSFZLQ_ZLQ.AsFloat)+' then ');
|
||||
end;
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1553,7 +1526,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1571,7 +1544,7 @@ begin
|
||||
SQL.Add(' case ');
|
||||
SQL.Add(' when datediff(day,YFZK_DQRQ,:pCKRQ)>=0 then ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1587,7 +1560,7 @@ begin
|
||||
SQL.Add(' case ');
|
||||
SQL.Add(' when datediff(day,YFZK_DQRQ,:pCKRQ)<0 then ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1600,7 +1573,7 @@ begin
|
||||
SQL.Add('round( ');
|
||||
SQL.Add('sum( ');
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and LT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ')
|
||||
else
|
||||
@@ -1617,7 +1590,7 @@ begin
|
||||
if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'Y' then
|
||||
begin
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1654,7 +1627,7 @@ begin
|
||||
else if dmlCX_YFZLFXB_M.memTableFXDX.AsString = 'B' then
|
||||
begin
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1692,7 +1665,7 @@ begin
|
||||
begin
|
||||
//应付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1727,7 +1700,7 @@ begin
|
||||
SQL.Add(' union all ');
|
||||
//预付账款
|
||||
SQL.Add(' select YFZK_FLNBH as FLNBH, ');
|
||||
SQL.Add(' round(sum(isnull(:iflag*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' round(sum(isnull(-1*YFZKFP_FPJE,0)),2) as WJYSJE ');
|
||||
SQL.Add(' from YFZK ');
|
||||
SQL.Add(' left join GYS on GYS_GYSID=YFZK_GYSID ');
|
||||
SQL.Add(' ,YFZKFP ');
|
||||
@@ -1797,7 +1770,7 @@ begin
|
||||
begin
|
||||
SQL.Add ('having LT(');
|
||||
SQL.Add('round(sum( ');
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then :iflag*(YFZK_WFPJE-YFZK_YFPJE) ');
|
||||
SQL.Add(' case when isnull(YFZK_YFP,'' '')<>''Y'' and GT(YFZK_WFPJE,0) then -1*(YFZK_WFPJE-YFZK_YFPJE) ');
|
||||
SQL.Add(' else 0 end +isnull(a.WJYSJE,0)) ');
|
||||
SQL.Add(' ,2) ');
|
||||
SQL.Add(' ,0)');
|
||||
|
||||
Reference in New Issue
Block a user