This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-12-11 09:43:56 +08:00
parent 08850ca60a
commit 6369e4d72d

View File

@ -169,10 +169,11 @@ begin
sql.Clear;
Filtered := False;
sql.Add('select A.*,B.PRTCodeName,B.prtcode,B.PRTColor,B.SOrddefstr5,');
sql.Add('gxdj=case when A.qty<=30 then isnull((select (A.GxPrice)*2 from JyOrder_Yield B where A.CLID=B.clid ),0)');
SQL.Add('else isnull((A.GxPrice ),0) end, ');
sql.Add('gxmoney=case when A.qty<=30 then isnull((select ((A.GxPrice)*2)*B.qty from JyOrder_Yield B where A.CLID=B.clid ),0)');
SQL.Add(' else isnull(((A.GxPrice)*qty ),0) end ');
sql.Add(' isnull((A.GxPrice ),0) as gxdj ,isnull(((A.GxPrice)*qty ),0) as gxmoney ');
// sql.Add('gxdj=case when A.qty<=30 then isnull((select (A.GxPrice)*2 from JyOrder_Yield B where A.CLID=B.clid ),0)');
// SQL.Add('else isnull((A.GxPrice ),0) end, ');
// sql.Add('gxmoney=case when A.qty<=30 then isnull((select ((A.GxPrice)*2)*B.qty from JyOrder_Yield B where A.CLID=B.clid ),0)');
// SQL.Add(' else isnull(((A.GxPrice)*qty ),0) end ');
sql.Add('from JyOrder_Yield A ');
sql.Add('left join JYOrder_Sub B on A.mainid=B.mainid and A.subid=B.subid');
sql.Add('where A.filltime>=''' + FormatDateTime('yyyy-MM-dd', begdate.DateTime) + ''' ');
@ -180,6 +181,7 @@ begin
if cxTabControl1.TabIndex < 2 then
sql.Add(' and isnull(A.status,0)=''' + inttostr(cxTabControl1.TabIndex) + ''' ');
// Sql.add('group by convert(char(10),A.FillTime,120),A.Filler,A.mainID,A.MjTypeOther,C.OrderNo,D.PRTCodeName,C.conNo,C.CustomerNoName,D.PrtColor');
// ShowMessage(sql.text);
Open;
end;
SCreateCDS20(ADOQueryMain, CDS_Main);