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; sql.Clear;
Filtered := False; Filtered := False;
sql.Add('select A.*,B.PRTCodeName,B.prtcode,B.PRTColor,B.SOrddefstr5,'); 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(' isnull((A.GxPrice ),0) as gxdj ,isnull(((A.GxPrice)*qty ),0) as gxmoney ');
SQL.Add('else isnull((A.GxPrice ),0) end, '); // 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('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 ),0) end, ');
SQL.Add(' else isnull(((A.GxPrice)*qty ),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('from JyOrder_Yield A ');
sql.Add('left join JYOrder_Sub B on A.mainid=B.mainid and A.subid=B.subid'); 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) + ''' '); sql.Add('where A.filltime>=''' + FormatDateTime('yyyy-MM-dd', begdate.DateTime) + ''' ');
@ -180,6 +181,7 @@ begin
if cxTabControl1.TabIndex < 2 then if cxTabControl1.TabIndex < 2 then
sql.Add(' and isnull(A.status,0)=''' + inttostr(cxTabControl1.TabIndex) + ''' '); 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'); // 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; Open;
end; end;
SCreateCDS20(ADOQueryMain, CDS_Main); SCreateCDS20(ADOQueryMain, CDS_Main);
@ -499,7 +501,7 @@ begin
sql.Add(',getdate() '); sql.Add(',getdate() ');
sql.Add(',' + quotedstr(trim(self.Caption))); sql.Add(',' + quotedstr(trim(self.Caption)));
sql.Add(',' + quotedstr(trim('Ô±¹¤¹¤¼Û'))); sql.Add(',' + quotedstr(trim('Ô±¹¤¹¤¼Û')));
sql.Add(',' + quotedstr(trim('修改前→条码:' + trim(CDS_Main.fieldbyname('CLID').AsString) + ',单价 ' + trim(CDS_Main.fieldbyname('GXPrice').AsString) + ',数量 '+ trim(CDS_Main.fieldbyname('QTY').AsString) + '修改后:' + ',单价 ' + trim(Edit_GXPrice.Text) + ',数量 ' + trim(Edit_QTY.text)))); sql.Add(',' + quotedstr(trim('修改前→条码:' + trim(CDS_Main.fieldbyname('CLID').AsString) + ',单价 ' + trim(CDS_Main.fieldbyname('GXPrice').AsString) + ',数量 ' + trim(CDS_Main.fieldbyname('QTY').AsString) + '修改后:' + ',单价 ' + trim(Edit_GXPrice.Text) + ',数量 ' + trim(Edit_QTY.text))));
sql.Add(',' + quotedstr(trim('³É¹¦'))); sql.Add(',' + quotedstr(trim('³É¹¦')));
sql.Add(')'); sql.Add(')');
if CheckBox4.Checked then if CheckBox4.Checked then
@ -533,8 +535,8 @@ begin
Panel2.Visible := false; Panel2.Visible := false;
Edit_GXPrice.Text := ''; Edit_GXPrice.Text := '';
Edit_QTY.Text := ''; Edit_QTY.Text := '';
CheckBox4.Checked:=false; CheckBox4.Checked := false;
CheckBox5.Checked:=false; CheckBox5.Checked := false;
Exit; Exit;
except except
ADOQueryCmd.Connection.RollbackTrans; ADOQueryCmd.Connection.RollbackTrans;