1270 lines
41 KiB
ObjectPascal
1270 lines
41 KiB
ObjectPascal
|
|
unit U_YSCRPB_QTTJMgg;
|
|||
|
|
|
|||
|
|
interface
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|||
|
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|||
|
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|||
|
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|||
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|||
|
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|||
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|||
|
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|||
|
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|||
|
|
cxTextEdit, cxPC, cxDropDownEdit, cxLookAndFeels, cxLookAndFeelPainters,
|
|||
|
|
dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel,
|
|||
|
|
dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
|
|||
|
|
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
|
|||
|
|
dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
|
|||
|
|
dxSkinMcSkin, dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins,
|
|||
|
|
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green,
|
|||
|
|
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black,
|
|||
|
|
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
|
|||
|
|
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven,
|
|||
|
|
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
|
|||
|
|
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
|
|||
|
|
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
|
|||
|
|
dxSkinXmas2008Blue, dxSkinscxPCPainter, dxBarBuiltInMenu, cxNavigator;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmYSCRPB_QTTJMgg = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
YFName: TEdit;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
begdate: TDateTimePicker;
|
|||
|
|
Enddate: TDateTimePicker;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DS_HZ: TDataSource;
|
|||
|
|
CDS_HZ: TClientDataSet;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
ADOQuery1: TADOQuery;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
KPType: TEdit;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
FactoryName: TEdit;
|
|||
|
|
cxTabControl2: TcxTabControl;
|
|||
|
|
RadioGroup1: TRadioGroup;
|
|||
|
|
TPrint: TToolButton;
|
|||
|
|
Order_FYZC: TClientDataSet;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|||
|
|
v2Column6: TcxGridDBColumn;
|
|||
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|||
|
|
VMoney: TcxGridDBColumn;
|
|||
|
|
v2PayMent: TcxGridDBColumn;
|
|||
|
|
cxGridLevel1: TcxGridLevel;
|
|||
|
|
Tv2Column1: TcxGridDBColumn;
|
|||
|
|
procedure FormDestroy(Sender: TObject);
|
|||
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
procedure TBCloseClick(Sender: TObject);
|
|||
|
|
procedure FormShow(Sender: TObject);
|
|||
|
|
procedure TBRafreshClick(Sender: TObject);
|
|||
|
|
procedure ToolButton2Click(Sender: TObject);
|
|||
|
|
procedure KPTypeChange(Sender: TObject);
|
|||
|
|
procedure Button2Click(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn8PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn1PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure cxGridDBColumn6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure ToolButton1Click(Sender: TObject);
|
|||
|
|
procedure v2Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2PSPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2Column2PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure v2KPMoneyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
procedure Button1Click(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure FormCreate(Sender: TObject);
|
|||
|
|
procedure TchkClick(Sender: TObject);
|
|||
|
|
procedure TnochkClick(Sender: TObject);
|
|||
|
|
procedure v2ComTaitouPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure VBZPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2Column5PropertiesChange(Sender: TObject);
|
|||
|
|
procedure v2ConNoHZPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2GYSNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure v2Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
procedure Tv2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
procedure cxTabControl2Change(Sender: TObject);
|
|||
|
|
procedure RadioGroup1Click(Sender: TObject);
|
|||
|
|
procedure TPrintClick(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
|
|||
|
|
procedure InitGridHZ();
|
|||
|
|
procedure InitGrid();
|
|||
|
|
function SaveData(): Boolean;
|
|||
|
|
procedure SetStatus();
|
|||
|
|
public
|
|||
|
|
fflag: integer;
|
|||
|
|
{ Public declarations }
|
|||
|
|
RKFlag, FCYID, canshu1, canshu2, canshu3: string;
|
|||
|
|
fmanage: string;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmYSCRPB_QTTJMgg: TfrmYSCRPB_QTTJMgg;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_Fun, U_ZDYHelp, U_ProductOrderNewList, U_ProductOrderList,
|
|||
|
|
U_ZdyAttachment, U_SXCKNewList, U_SXCKNewList_SK, U_JYOrderCon_CX,
|
|||
|
|
U_ZdyAttachGYS, U_FKCR, U_FjList_RZ;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.SetStatus();
|
|||
|
|
var
|
|||
|
|
i: integer;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.InitGrid();
|
|||
|
|
var
|
|||
|
|
i: integer;
|
|||
|
|
begin
|
|||
|
|
// v2FKNo.Visible := false;
|
|||
|
|
if RadioGroup1.ItemIndex = 2 then
|
|||
|
|
begin
|
|||
|
|
cxGridDBColumn1.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
// v2FKNo.Visible := true;
|
|||
|
|
end;
|
|||
|
|
if RadioGroup1.ItemIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
cxGridDBColumn1.Caption := '<27>·<EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
if RadioGroup1.ItemIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
cxGridDBColumn1.Caption := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select A.FactoryName,A.YFName,A.KPType,A.PayMent');
|
|||
|
|
case RadioGroup1.ItemIndex of
|
|||
|
|
0:
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
sql.Add(',Sum(A.Money) Money,convert(varchar(4),A.CRTime,120) CRTime');
|
|||
|
|
sql.Add(' from YF_Money_CR A where A.CRFlag=''Ӧ<><D3A6><EFBFBD><EFBFBD>''');
|
|||
|
|
end;
|
|||
|
|
1:
|
|||
|
|
begin
|
|||
|
|
sql.Add(',Sum(A.Money) Money,convert(varchar(7),A.CRTime,120) CRTime');
|
|||
|
|
sql.Add(' from YF_Money_CR A where A.CRFlag=''Ӧ<><D3A6><EFBFBD><EFBFBD>''');
|
|||
|
|
end;
|
|||
|
|
2:
|
|||
|
|
begin
|
|||
|
|
sql.Add(',convert(varchar(10),A.CRTime,120) CRTime,A.Money,A.Note ');
|
|||
|
|
sql.Add(' from YF_Money_CR A where A.CRFlag=''Ӧ<><D3A6><EFBFBD><EFBFBD>''');
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
if cxTabControl2.TabIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and isnull(A.CRType,'''')<>''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(A.SQType,'''')<>''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' ');
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
if Trim(cxTabControl2.Tabs[cxTabControl2.TabIndex].Caption) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>úϼ<C3BA>' then
|
|||
|
|
sql.add(' and isnull(A.SQType,'''') in (''<27><><EFBFBD><EFBFBD>'',''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'',''<27><><EFBFBD><EFBFBD>'',''ˮ<><CBAE><EFBFBD><EFBFBD>'')')
|
|||
|
|
else
|
|||
|
|
sql.add(' and isnull(A.SQType,'''')=''' + cxTabControl2.Tabs[cxTabControl2.TabIndex].Caption + '''');
|
|||
|
|
end;
|
|||
|
|
case RadioGroup1.ItemIndex of
|
|||
|
|
0:
|
|||
|
|
begin
|
|||
|
|
sql.add(' and convert(varchar(4),A.CRTime,120)>=''' + trim(formatdatetime('yyyy', begdate.DateTime)) + '''');
|
|||
|
|
sql.add(' and convert(varchar(4),A.CRTime,120)<=''' + trim(formatdatetime('yyyy', enddate.DateTime)) + '''');
|
|||
|
|
sql.Add(' group by A.FactoryName,A.YFName,A.KPType,A.PayMent,convert(varchar(4),A.CRTime,120),A.Note');
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
1:
|
|||
|
|
begin
|
|||
|
|
sql.add(' and convert(varchar(7),A.CRTime,120)>=''' + trim(formatdatetime('yyyy-MM', begdate.DateTime)) + '''');
|
|||
|
|
sql.add(' and convert(varchar(7),A.CRTime,120)<=''' + trim(formatdatetime('yyyy-MM', enddate.DateTime)) + '''');
|
|||
|
|
sql.Add(' group by A.FactoryName,A.YFName,A.KPType,A.PayMent,convert(varchar(7),A.CRTime,120)');
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
2:
|
|||
|
|
begin
|
|||
|
|
sql.add(' and convert(varchar(10),A.CRTime,120)>=''' + trim(formatdatetime('yyyy-MM-dd', begdate.DateTime)) + '''');
|
|||
|
|
sql.add(' and convert(varchar(10),A.CRTime,120)<''' + trim(formatdatetime('yyyy-MM-dd', enddate.DateTime + 1)) + '''');
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
for i := 1 to 33 - CDS_HZ.RecordCount do
|
|||
|
|
begin
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
Label13.Caption := '0';
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
//ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.InitGridHZ();
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmYSCRPB_QTTJMgg := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>4', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>4', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Enddate.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
begdate.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
begdate.SetFocus;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.ToolButton2Click(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
i: Integer;
|
|||
|
|
begin
|
|||
|
|
label13.Caption := '0';
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
for i := 1 to 33 - CDS_HZ.RecordCount do
|
|||
|
|
begin
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.KPTypeChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if Radiogroup1.ItemIndex = 2 then
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.Button2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫɾ<D2AA><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
if Trim(CDS_HZ.fieldbyname('SubID').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('delete YCL_SG_HZ where SubID=''' + Trim(CDS_HZ.fieldbyname('SubID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
CDS_HZ.Delete;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
function TfrmYSCRPB_QTTJMgg.SaveData(): Boolean;
|
|||
|
|
var
|
|||
|
|
maxId, CRID: string;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
if GetLSNo(ADOQueryCmd, maxId, 'YC', 'YF_Money_CR', 4, 1) = False then
|
|||
|
|
begin
|
|||
|
|
Result := False;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_KC where FactoryName=''' + Trim(CDS_HZ.fieldbyname('FactoryName').AsString) + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.IsEmpty = False then
|
|||
|
|
begin
|
|||
|
|
CRID := ADOQueryCmd.fieldbyname('CRID').AsString;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('Update YF_Money_CRID set CRID=CRID+1');
|
|||
|
|
sql.Add('select * from YF_Money_CRID ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
CRID := ADOQueryCmd.fieldbyname('CRID').AsString;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_KC where 1<>1');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|||
|
|
FieldByName('FactoryNo').Value := Trim(CDS_HZ.fieldbyname('FactoryNo').AsString);
|
|||
|
|
FieldByName('FactoryName').Value := Trim(CDS_HZ.fieldbyname('FactoryName').AsString);
|
|||
|
|
FieldByName('ZdyStr1').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|||
|
|
// FieldByName('YFDefFlag1').Value:=fFlag;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_CR where 1=2');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
FieldByName('YFID').Value := Trim(maxId);
|
|||
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|||
|
|
//SSetSaveDataCDSNew(ADOQueryCmd,Tv2,CDS_HZ,'YF_Money_CR',3);
|
|||
|
|
FieldByName('Filler').Value := Trim(DName);
|
|||
|
|
FieldByName('CRType').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>';
|
|||
|
|
FieldByName('CRFlag').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('QtyFlag').Value := -1;
|
|||
|
|
FieldByName('FactoryName').Value := Trim(CDS_HZ.fieldbyname('FactoryName').AsString);
|
|||
|
|
FieldByName('YFName').Value := Trim(CDS_HZ.fieldbyname('YFName').AsString);
|
|||
|
|
FieldByName('FeeType').Value := Trim(CDS_HZ.fieldbyname('FeeType').AsString);
|
|||
|
|
FieldByName('CRTime').Value := CDS_HZ.fieldbyname('CRTime').AsDateTime;
|
|||
|
|
fieldbyname('chknote').Value := CDS_HZ.fieldbyname('chknote').AsString;
|
|||
|
|
FieldByName('YFDefFlag1').Value := fFlag;
|
|||
|
|
FieldByName('status').Value := '2';
|
|||
|
|
fieldbyname('HuiLv').Value := CDS_HZ.fieldbyname('HuiLv').AsFloat;
|
|||
|
|
fieldbyname('Money').Value := CDS_HZ.fieldbyname('Money').AsFloat;
|
|||
|
|
fieldbyname('SLV').Value := 1;
|
|||
|
|
fieldbyname('BZType').Value := '<27><>';
|
|||
|
|
fieldbyname('ComTaitou').Value := Trim(CDS_HZ.fieldbyname('ComTaitou').AsString);
|
|||
|
|
;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('YFId').Value := Trim(maxId);
|
|||
|
|
FieldByName('CRID').Value := StrToInt(CRID);
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
Result := True;
|
|||
|
|
except
|
|||
|
|
Result := True;
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.cxGridDBColumn8PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YCL_SG_HZ ');
|
|||
|
|
if Trim(mvalue) <> '' then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + '''');
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=NULL');
|
|||
|
|
end;
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where SubId=''' + Trim(CDS_HZ.fieldbyname('SubId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FQty, FPrice, FMoney, FHuiLv, FBBMoney, FKCBB, FFieldName, FSLV: string;
|
|||
|
|
begin
|
|||
|
|
{if Trim(CDS_HZ.fieldbyname('YFType').AsString)<>'' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2>ܸ<EFBFBD><DCB8><EFBFBD>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end; }
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := NULL;
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
if Trim(DParameters2) = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|||
|
|
begin
|
|||
|
|
FieldByName('HuiLv').Value := 1;
|
|||
|
|
end;
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select isnull(BBMoney,0) BBMoney from YF_Money_CR where YFID=''' + cds_hz.fieldbyname('YFID').AsString + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FKCBB := ADOQueryTemp.fieldbyname('BBMoney').AsString;
|
|||
|
|
|
|||
|
|
FQty := Trim(CDS_HZ.fieldbyname('Qty').AsString);
|
|||
|
|
if Trim(FQty) = '' then
|
|||
|
|
FQty := '0';
|
|||
|
|
|
|||
|
|
FPrice := Trim(CDS_HZ.fieldbyname('Price').AsString);
|
|||
|
|
if Trim(FPrice) = '' then
|
|||
|
|
FPrice := '0';
|
|||
|
|
FQty := Trim(CDS_HZ.fieldbyname('Qty').AsString);
|
|||
|
|
if Trim(FQty) = '' then
|
|||
|
|
FQty := '0';
|
|||
|
|
|
|||
|
|
FMoney := Trim(CDS_HZ.fieldbyname('Money').AsString);
|
|||
|
|
if Trim(FMoney) = '' then
|
|||
|
|
FMoney := '0';
|
|||
|
|
|
|||
|
|
FHuiLv := Trim(CDS_HZ.fieldbyname('HuiLv').AsString);
|
|||
|
|
if Trim(FHuiLv) = '' then
|
|||
|
|
FHuiLv := '1';
|
|||
|
|
|
|||
|
|
FSLV := Trim(CDS_HZ.fieldbyname('SLV').AsString);
|
|||
|
|
if Trim(FSLV) = '' then
|
|||
|
|
FSLV := '0';
|
|||
|
|
|
|||
|
|
{FBBMoney:=Trim(CDS_HZ.fieldbyname('BBMoney').AsString);
|
|||
|
|
if Trim(FBBMoney)='' then FBBMoney:='0'; }
|
|||
|
|
|
|||
|
|
if Trim(FFieldName) <> 'Money' then
|
|||
|
|
begin
|
|||
|
|
if Trim(FFieldName) <> 'HuiLv' then
|
|||
|
|
begin
|
|||
|
|
FBBMoney := FloatToStr(StrToFloat(FQty) * StrToFloat(FPrice) * StrToFloat(FHuiLv) * StrToFloat(FSLV));
|
|||
|
|
FMoney := FloatToStr(StrToFloat(FQty) * StrToFloat(FPrice));
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FBBMoney := FloatToStr(StrToFloat(FMoney) * StrToFloat(FHuiLv) * StrToFloat(FSLV));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
FBBMoney := FloatToStr(StrToFloat(FMoney) * StrToFloat(FHuiLv) * StrToFloat(FSLV));
|
|||
|
|
end;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('Money').Value := StrToFloat(FMoney);
|
|||
|
|
FieldByName('BBMoney').Value := StrToFloat(FBBMoney);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
if Trim(FFieldName) <> 'Money' then
|
|||
|
|
begin
|
|||
|
|
sql.Add(',Money=' + FMoney);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
sql.Add(',BBMoney=' + FBBMoney);
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
|
|||
|
|
SQL.Add('Update YF_Money_KC Set KCBBMoney=KCBBMoney-' + FKCBB + '+' + FBBMoney);
|
|||
|
|
sql.Add(' where CRID=''' + Trim(CDS_HZ.fieldbyname('CRID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.cxGridDBColumn1PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
if Trim(mvalue) <> '' then
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + '''');
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=NULL');
|
|||
|
|
end;
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.cxGridDBColumn3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
if Trim(CDS_HZ.fieldbyname('YFType').AsString) <> '' then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('<27>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݲ<EFBFBD><DDB2>ܸ<EFBFBD><DCB8><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'YFName';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>';
|
|||
|
|
MainType := trim(DName);
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('YFCode').Value := Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString);
|
|||
|
|
FieldByName('YFName').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set YFCode=''' + Trim(ClientDataSet1.fieldbyname('ZdyNo').AsString) + '''');
|
|||
|
|
sql.Add(' ,YFName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.cxGridDBColumn6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'OrderUnit';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_HZ.Edit;
|
|||
|
|
Self.CDS_HZ.FieldByName('QtyUnit').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set QtyUnit=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2Column3PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'MP_CodeName';
|
|||
|
|
flagname := 'Ʒ<><C6B7>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_HZ.Edit;
|
|||
|
|
Self.CDS_HZ.FieldByName('P_CodeName').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set P_CodeName=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
SelExportData(Tv2, ADOQueryMain, 'Ӧ<>տ<EFBFBD><D5BF>б<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2Column7PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmProductOrderNewList := TfrmProductOrderNewList.Create(Application);
|
|||
|
|
with frmProductOrderNewList do
|
|||
|
|
begin
|
|||
|
|
//frmProductOrderList.v1Column4.Visible:=True;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('MainId').Value := Trim(frmProductOrderNewList.Order_Main.fieldbyname('MainId').AsString);
|
|||
|
|
FieldByName('subID').Value := Trim(frmProductOrderNewList.Order_Main.fieldbyname('subID').AsString);
|
|||
|
|
FieldByName('OrderNo').Value := Trim(frmProductOrderNewList.Order_Main.fieldbyname('OrderNo').AsString);
|
|||
|
|
FieldByName('P_CodeName').Value := Trim(frmProductOrderNewList.Order_Main.fieldbyname('MPRTCodeName').AsString);
|
|||
|
|
FieldByName('P_Spec').Value := Trim(frmProductOrderNewList.Order_Main.fieldbyname('MPRTSpec').AsString);
|
|||
|
|
post;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set MainId=''' + Trim(SELF.CDS_HZ.fieldbyname('MainId').AsString) + '''');
|
|||
|
|
sql.Add(' ,SubId=''' + Trim(SELF.CDS_HZ.fieldbyname('SubId').AsString) + '''');
|
|||
|
|
sql.Add(' ,p_CodeName=''' + Trim(SELF.CDS_HZ.fieldbyname('P_CodeName').AsString) + '''');
|
|||
|
|
sql.Add(' ,P_Spec=''' + Trim(SELF.CDS_HZ.fieldbyname('P_Spec').AsString) + '''');
|
|||
|
|
sql.Add(' ,OrderNo=''' + Trim(SELF.CDS_HZ.fieldbyname('OrderNo').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmProductOrderNewList.Free;
|
|||
|
|
self.Tv2.Controller.EditingController.ShowEdit();
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2PSPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2Column2PropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=''' + Trim(mvalue) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2KPMoneyPropertiesEditValueChanged(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue, FBBMoney, FKCBB, FFieldName: string;
|
|||
|
|
begin
|
|||
|
|
mvalue := TcxTextEdit(Sender).EditingText;
|
|||
|
|
if Trim(mvalue) = '' then
|
|||
|
|
begin
|
|||
|
|
mvalue := '0';
|
|||
|
|
end;
|
|||
|
|
FFieldName := Trim(Tv2.Controller.FocusedColumn.DataBinding.FilterFieldName);
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName(FFieldName).Value := Trim(mvalue);
|
|||
|
|
Post;
|
|||
|
|
end;
|
|||
|
|
with ADOQueryTemp do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select isnull(KPMoney,0) KPMoney from YF_Money_CR where YFID=''' + cds_hz.fieldbyname('YFID').AsString + '''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
FKCBB := ADOQueryTemp.fieldbyname('KPMoney').AsString;
|
|||
|
|
FBBMoney := CDS_HZ.fieldbyname('KPMoney').AsString;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ' + FFieldName + '=' + Trim(mvalue));
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
SQL.Add('Update YF_Money_KC Set KCKPMoney=KCKPMoney-' + FKCBB + '+' + FBBMoney);
|
|||
|
|
sql.Add(' where CRID=''' + Trim(CDS_HZ.fieldbyname('CRID').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.Button1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
try
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if fieldbyname('ssel').AsBoolean then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from YF_Money_CR ');
|
|||
|
|
sql.Add('where YFID=' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
open;
|
|||
|
|
edit;
|
|||
|
|
Fieldbyname('Price').Value := strtofloatdef(edit1.Text, 0);
|
|||
|
|
Fieldbyname('Money').Value := format('%.2f', [Fieldbyname('Qty').AsFloat * strtofloatdef(edit1.Text, 0)]);
|
|||
|
|
Fieldbyname('BBMoney').Value := format('%.2f', [Fieldbyname('Qty').AsFloat * strtofloatdef(edit1.Text, 0)]);
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
InitGrid();
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
label13.Caption := '0';
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
first;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
fieldbyname('ssel').Value := checkbox1.Checked;
|
|||
|
|
Label13.Caption := floattostr(strtofloat(Label13.Caption) + fieldbyname('Money').AsCurrency);
|
|||
|
|
post;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SetStatus();
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxGrid2.Align := alclient;
|
|||
|
|
canshu2 := trim(DParameters2);
|
|||
|
|
canshu3 := trim(DParameters3);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.TchkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET status=''1'' ');
|
|||
|
|
sql.Add('where YFID =' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.TnochkClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
|
|||
|
|
if CDS_HZ.Locate('ssel', true, []) = false then
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox('û<><C3BB>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
DisableControls;
|
|||
|
|
First;
|
|||
|
|
while not eof do
|
|||
|
|
begin
|
|||
|
|
if Fieldbyname('ssel').AsBoolean = true then
|
|||
|
|
begin
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('update YF_Money_CR SET status=''0'' ');
|
|||
|
|
sql.Add('where YFID =' + quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ<EFBFBD><CABE>Ϣ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2ComTaitouPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'ComTaiTou';
|
|||
|
|
flagname := '<27><>˾̧ͷ';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Edit;
|
|||
|
|
FieldByName('ComTaiTou').Value := Trim(ClientDataSet1.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set ComTaiTou=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.VBZPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'BZType';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_HZ.Edit;
|
|||
|
|
Self.CDS_HZ.FieldByName('BZType').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set BZType=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2Column4PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZDYHelp := TfrmZDYHelp.Create(Application);
|
|||
|
|
with frmZDYHelp do
|
|||
|
|
begin
|
|||
|
|
flag := 'MP_Spec';
|
|||
|
|
flagname := '<27><><EFBFBD><EFBFBD>';
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_HZ.Edit;
|
|||
|
|
Self.CDS_HZ.FieldByName('P_Spec').Value := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set P_Spec=''' + Trim(ClientDataSet1.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZDYHelp.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2Column5PropertiesChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
HJ(CDS_HZ, Label13, CDS_HZ.fieldbyname('Money').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2ConNoHZPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
frmJYorderConCX := TfrmJYorderConCX.create(self);
|
|||
|
|
with frmJYorderConCX do
|
|||
|
|
begin
|
|||
|
|
formid := '1';
|
|||
|
|
if showmodal = 1 then
|
|||
|
|
begin
|
|||
|
|
Self.CDS_HZ.Edit;
|
|||
|
|
Self.CDS_HZ.FieldByName('ConNo').Value := Trim(Order_Main.fieldbyname('ConNo').AsString);
|
|||
|
|
Self.CDS_HZ.FieldByName('Conid').Value := Trim(Order_Main.fieldbyname('subid').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set Conid=''' + Trim(Order_Main.fieldbyname('subid').AsString) + '''');
|
|||
|
|
sql.add(',ConNO=''' + trim(Order_Main.fieldbyname('ConNO').AsString) + '''');
|
|||
|
|
SQL.Add(',Editer=''' + Trim(DName) + '''');
|
|||
|
|
SQL.Add(',Edittime=getdate() ');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2GYSNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
|||
|
|
with frmZdyAttachGYS do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('GYSname').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set GYSName=''' + trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(SELF.CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZdyAttachGYS.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.v2Column6PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmZdyAttachGYS := TfrmZdyAttachGYS.Create(Application);
|
|||
|
|
with frmZdyAttachGYS do
|
|||
|
|
begin
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
with Self.CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
edit;
|
|||
|
|
FieldByName('FactoryName').Value := Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString);
|
|||
|
|
end;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('UPdate YF_Money_CR ');
|
|||
|
|
sql.Add(' Set FactoryName=''' + Trim(frmZdyAttachGYS.CDS_HZ.fieldbyname('ZdyName').AsString) + '''');
|
|||
|
|
SQL.Add(' where YFId=''' + Trim(SELF.CDS_HZ.fieldbyname('YFId').AsString) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmZdyAttachGYS.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.Tv2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
var
|
|||
|
|
id, id10: Integer;
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.cxTabControl2Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
initgrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.RadioGroup1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
initgrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCRPB_QTTJMgg.TPrintClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fPrintFile: string;
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
exit;
|
|||
|
|
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB>ܱ<EFBFBD>.rmf';
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select year(A.CRTime) NFYear,A.ComTaitou FactoryName,A.YFName,Sum(Money) ZMoney');
|
|||
|
|
sql.add(',YIMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''01'')');
|
|||
|
|
sql.add(',ERMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''02'')');
|
|||
|
|
sql.add(',SANMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''03'')');
|
|||
|
|
sql.add(',SIMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''04'')');
|
|||
|
|
sql.add(',WUMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''05'')');
|
|||
|
|
sql.add(',LIUMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''06'')');
|
|||
|
|
sql.add(',QIMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''07'')');
|
|||
|
|
sql.add(',BAMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''08'')');
|
|||
|
|
sql.add(',JIUMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''09'')');
|
|||
|
|
sql.add(',SHIMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''10'')');
|
|||
|
|
sql.add(',SHIYIMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''11'')');
|
|||
|
|
sql.add(',SHIERMoney=(select Sum(B.Money) from YF_Money_CR B where year(B.CRTime)=year(A.CRTime) and B.ComTaitou=A.ComTaitou and B.YFName=A.YFName ');
|
|||
|
|
sql.add('and B.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' and isnull(B.FeeType,'''')=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'' and isnull(B.ConNo,'''')='''' and isnull(B.OrderNo,'''')='''' and Month(B.CRTime)=''12'')');
|
|||
|
|
sql.Add(' from YF_Money_CR A');
|
|||
|
|
sql.Add(' where year(A.CRTime)>=''' + trim(formatdatetime('yyyy', begdate.Date)) + ''' ');
|
|||
|
|
sql.Add(' and year(A.CRTime)<=''' + trim(formatdatetime('yyyy', enddate.Date)) + ''' ');
|
|||
|
|
if YFName.Text <> '' then
|
|||
|
|
sql.add(' and YFName like ''' + '%' + trim(YFName.Text) + '%' + '''');
|
|||
|
|
sql.Add(' and A.CRType=''Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>'' ');
|
|||
|
|
sql.add(' group by year(A.CRTime),A.ComTaitou,A.YFName ');
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryCmd, Order_FYZC);
|
|||
|
|
SInitCDSData20(ADOQueryCmd, Order_FYZC);
|
|||
|
|
if FileExists(fPrintFile) then
|
|||
|
|
begin
|
|||
|
|
//RMVariables['FSQMoney']:=FSQMoney;
|
|||
|
|
RM1.LoadFromFile(fPrintFile);
|
|||
|
|
RM1.ShowReport;
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Application.MessageBox(PChar('û<><C3BB><EFBFBD><EFBFBD>' + ExtractFilePath(Application.ExeName) + 'Report\<5C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><C8BB>ܱ<EFBFBD>.rmf'), '<27><>ʾ', 0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|