1128 lines
31 KiB
ObjectPascal
1128 lines
31 KiB
ObjectPascal
|
|
unit U_YSCR_PBSH;
|
|||
|
|
|
|||
|
|
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, Menus;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmYSCR_PBSH = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
ToolButton1: TToolButton;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
FactoryName: TEdit;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
Label6: TLabel;
|
|||
|
|
begdate: TDateTimePicker;
|
|||
|
|
Enddate: TDateTimePicker;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DS_HZ: TDataSource;
|
|||
|
|
CDS_HZ: TClientDataSet;
|
|||
|
|
Label7: TLabel;
|
|||
|
|
Edit1: TEdit;
|
|||
|
|
Button1: TButton;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
Tchk: TToolButton;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
Tnochk: TToolButton;
|
|||
|
|
Label12: TLabel;
|
|||
|
|
Label13: TLabel;
|
|||
|
|
Label14: TLabel;
|
|||
|
|
Label16: TLabel;
|
|||
|
|
ChkNote: TEdit;
|
|||
|
|
Label17: TLabel;
|
|||
|
|
YFName: TEdit;
|
|||
|
|
PopupMenu1: TPopupMenu;
|
|||
|
|
N1: TMenuItem;
|
|||
|
|
N2: TMenuItem;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
OrderNO: TEdit;
|
|||
|
|
Label15: TLabel;
|
|||
|
|
SGFangshi: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
Label8: TLabel;
|
|||
|
|
Label9: TLabel;
|
|||
|
|
P_CodeName: TEdit;
|
|||
|
|
ConNo: TEdit;
|
|||
|
|
GCName: TEdit;
|
|||
|
|
Label10: TLabel;
|
|||
|
|
TeXing: TEdit;
|
|||
|
|
cxGrid2: TcxGrid;
|
|||
|
|
Tv2: TcxGridDBTableView;
|
|||
|
|
v1Ssel: TcxGridDBColumn;
|
|||
|
|
v1CRTime: TcxGridDBColumn;
|
|||
|
|
v1FactoryName: TcxGridDBColumn;
|
|||
|
|
v1YFName: TcxGridDBColumn;
|
|||
|
|
v1ConNO: TcxGridDBColumn;
|
|||
|
|
V1orderNo: TcxGridDBColumn;
|
|||
|
|
v1GCName: TcxGridDBColumn;
|
|||
|
|
v1ComTaiTou: TcxGridDBColumn;
|
|||
|
|
v1P_CodeName: TcxGridDBColumn;
|
|||
|
|
v1TeXing: TcxGridDBColumn;
|
|||
|
|
v1SGFangshi: TcxGridDBColumn;
|
|||
|
|
v2CPFLQty: TcxGridDBColumn;
|
|||
|
|
v1Qty: TcxGridDBColumn;
|
|||
|
|
v1Price: TcxGridDBColumn;
|
|||
|
|
v1BBMoney: TcxGridDBColumn;
|
|||
|
|
v1XFBFB: TcxGridDBColumn;
|
|||
|
|
v1KSFee: TcxGridDBColumn;
|
|||
|
|
v1KSFeeP8: TcxGridDBColumn;
|
|||
|
|
v1WPZFee: TcxGridDBColumn;
|
|||
|
|
v1XSFee: TcxGridDBColumn;
|
|||
|
|
v1Note: TcxGridDBColumn;
|
|||
|
|
cxGrid2Level1: TcxGridLevel;
|
|||
|
|
v2XXPrice: TcxGridDBColumn;
|
|||
|
|
v2JSTypeM: TcxGridDBColumn;
|
|||
|
|
Label11: TLabel;
|
|||
|
|
JSTypeM: TEdit;
|
|||
|
|
v2Column1: TcxGridDBColumn;
|
|||
|
|
v2Money: 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 FactoryNameChange(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 nochkClick(Sender: TObject);
|
|||
|
|
procedure v2Column5PropertiesChange(Sender: TObject);
|
|||
|
|
procedure cxTabControl2Change(Sender: TObject);
|
|||
|
|
procedure TZZSHClick(Sender: TObject);
|
|||
|
|
procedure TEJCXClick(Sender: TObject);
|
|||
|
|
procedure N1Click(Sender: TObject);
|
|||
|
|
procedure N2Click(Sender: TObject);
|
|||
|
|
procedure v1SselPropertiesChange(Sender: TObject);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
|
|||
|
|
procedure InitGridHZ();
|
|||
|
|
procedure InitGrid();
|
|||
|
|
function SaveData():Boolean;
|
|||
|
|
procedure SetStatus();
|
|||
|
|
|
|||
|
|
public
|
|||
|
|
canshu1,canshu2:string;
|
|||
|
|
fflag:integer;
|
|||
|
|
{ Public declarations }
|
|||
|
|
RKFlag,FCYID:String;
|
|||
|
|
fmanage:string;
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmYSCR_PBSH: TfrmYSCR_PBSH;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
uses
|
|||
|
|
U_DataLink,U_Fun,U_ZDYHelp, U_ProductOrderNewList, U_ProductOrderList,
|
|||
|
|
U_ZdyAttachment, U_SXCKNewList;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
procedure TfrmYSCR_PBSH.SetStatus();
|
|||
|
|
var i:integer;
|
|||
|
|
begin
|
|||
|
|
Tchk.Enabled:=false;
|
|||
|
|
if cxTabControl1.TabIndex=0 then
|
|||
|
|
begin
|
|||
|
|
Tchk.Enabled:=true;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.InitGrid();
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered:=False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add('select WHXMoney=A.Money-isnull(A.HxNum,0),JSTypeM=(case when isnull(JSType,'''')='''' then TeXing else JSType end)');
|
|||
|
|
sql.Add(',A.*');
|
|||
|
|
sql.Add(' from YF_Money_CR A');
|
|||
|
|
sql.Add(' where A.CRType=''Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>'' ');
|
|||
|
|
if cxTabControl1.TabIndex<>0 then
|
|||
|
|
begin
|
|||
|
|
sql.add(' and A.CRTime>='''+FormatDateTime('yyyy-MM-dd',begdate.Date)+''' ');
|
|||
|
|
sql.Add(' and A.CRTime<'''+FormatDateTime('yyyy-MM-dd',Enddate.Date+1)+''' ');
|
|||
|
|
end;
|
|||
|
|
IF cxTabControl1.TabIndex=0 then
|
|||
|
|
sql.Add(' and isnull(A.status,''0'')=''1'' ');
|
|||
|
|
IF cxTabControl1.TabIndex=1 then
|
|||
|
|
sql.Add(' and isnull(A.status,''0'')=''2''');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
|||
|
|
Label14.Caption:='0';
|
|||
|
|
Label16.Caption:='0';
|
|||
|
|
finally
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
//ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.InitGridHZ();
|
|||
|
|
begin
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmYSCR_PBSH:=nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action:=caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>3',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
procedure TfrmYSCR_PBSH.FormShow(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>3',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Enddate.DateTime:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
begdate.DateTime:=SGetServerDate(ADOQueryTemp)-7;
|
|||
|
|
SetStatus();
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
begdate.SetFocus;
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Label14.Caption:='0';
|
|||
|
|
Label16.Caption:='0';
|
|||
|
|
if ADOQueryMain.Active then
|
|||
|
|
begin
|
|||
|
|
SDofilter(ADOQueryMain,SGetFilters(Panel1,1,2));
|
|||
|
|
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.FactoryNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.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 TfrmYSCR_PBSH.SaveData():Boolean;
|
|||
|
|
var
|
|||
|
|
maxId,CRID:String;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
if GetLSNo(ADOQueryCmd,maxId,'YS','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<>1');
|
|||
|
|
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:='Ӧ<>տ<EFBFBD><D5BF>Ǽ<EFBFBD>';
|
|||
|
|
FieldByName('CRFlag').Value:='Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
|||
|
|
FieldByName('QtyFlag').Value:=1;
|
|||
|
|
FieldByName('FactoryNo').Value:=Trim(CDS_HZ.fieldbyname('FactoryNo').AsString);
|
|||
|
|
FieldByName('FactoryName').Value:=Trim(CDS_HZ.fieldbyname('FactoryName').AsString);
|
|||
|
|
FieldByName('CRTime').Value:=SGetServerDate(ADOQueryTemp);
|
|||
|
|
FieldByName('YFDefFlag1').Value:=fFlag;
|
|||
|
|
FieldByName('status').Value:='0';
|
|||
|
|
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 TfrmYSCR_PBSH.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 TfrmYSCR_PBSH.cxGridDBColumn5PropertiesEditValueChanged(
|
|||
|
|
Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue,FQty,FPrice,FMoney,FHuiLv,FBBMoney,FKCBB,FFieldName: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:='0';
|
|||
|
|
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:='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));
|
|||
|
|
FMoney:=FloatToStr(StrToFloat(FQty)*StrToFloat(FPrice));
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
FBBMoney:=FloatToStr(StrToFloat(FMoney)*StrToFloat(FHuiLv));
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end else
|
|||
|
|
begin
|
|||
|
|
FBBMoney:=FloatToStr(StrToFloat(FMoney)*StrToFloat(FHuiLv));
|
|||
|
|
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 TfrmYSCR_PBSH.cxGridDBColumn1PropertiesEditValueChanged(
|
|||
|
|
Sender: TObject);
|
|||
|
|
var
|
|||
|
|
mvalue,FFieldName: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;
|
|||
|
|
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 TfrmYSCR_PBSH.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><C4BF>ժҪ';
|
|||
|
|
if Trim(DParameters3)='<27><>Ŀ<EFBFBD>ֿ<EFBFBD>' then
|
|||
|
|
MainType:='<27>տ<EFBFBD>';
|
|||
|
|
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 TfrmYSCR_PBSH.cxGridDBColumn6PropertiesButtonClick(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:='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 TfrmYSCR_PBSH.v2Column3PropertiesButtonClick(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:='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 TfrmYSCR_PBSH.ToolButton1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then Exit;
|
|||
|
|
SelExportData(Tv2,ADOQueryMain,'Ӧ<>տ<EFBFBD><D5BF>б<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.v2Column7PropertiesButtonClick(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>ɾ<EFBFBD><C9BE>!','<27><>ʾ',0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
frmProductOrderNewList:=TfrmProductOrderNewList.Create(Application);
|
|||
|
|
with frmProductOrderNewList do
|
|||
|
|
begin
|
|||
|
|
DParameters1:='<27><>Ȩ<EFBFBD><C8A8>';
|
|||
|
|
if fflag=2 then
|
|||
|
|
fsyrName:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD>';
|
|||
|
|
//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('PRTCodeName').Value:=Trim(frmProductOrderNewList.Order_Main.fieldbyname('PRTCodeName').AsString);
|
|||
|
|
FieldByName('PRTColor').Value:=Trim(frmProductOrderNewList.Order_Main.fieldbyname('PRTColor').AsString);
|
|||
|
|
// FieldByName('Filler').Value:=Trim(frmProductOrderNewList.Order_Main.fieldbyname('Filler').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('PRTCodeName').AsString)+'''');
|
|||
|
|
sql.Add(' ,p_Color='''+Trim(SELF.CDS_HZ.fieldbyname('PRTColor').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 TfrmYSCR_PBSH.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 TfrmYSCR_PBSH.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 TfrmYSCR_PBSH.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 TfrmYSCR_PBSH.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 TfrmYSCR_PBSH.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Label14.Caption:='0';
|
|||
|
|
Label16.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;
|
|||
|
|
if checkbox1.Checked=true then
|
|||
|
|
begin
|
|||
|
|
Label14.Caption:=floattostr(strtofloat(Label14.Caption)+fieldbyname('Qty').AsCurrency);
|
|||
|
|
Label16.Caption:=floattostr(strtofloat(Label16.Caption)+fieldbyname('Money').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
post;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SetStatus();
|
|||
|
|
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.FormCreate(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
cxGrid2.Align:=alclient;
|
|||
|
|
canshu1:=trim(DParameters1);
|
|||
|
|
canshu2:=trim(DParameters2);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.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=''2'',Chker='''+trim(DName)+''',ChkNote='''+trim(ChkNote.Text)+''' ');
|
|||
|
|
sql.Add('where YFID ='+quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.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=''1'' ');
|
|||
|
|
sql.Add('where YFID ='+quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.nochkClick(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;
|
|||
|
|
if chknote.Text='' then
|
|||
|
|
begin
|
|||
|
|
if application.MessageBox('ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD>˱<EFBFBD>עΪ<D7A2><CEAA><EFBFBD><EFBFBD>','<27><>ʾ',1)=2 then 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'',chkstatus=''<27><>ͨ<EFBFBD><CDA8>'',Chker='''',');
|
|||
|
|
SQL.Add('chknote='''+trim(chknote.Text)+''' ');
|
|||
|
|
sql.Add('where YFID ='+quotedstr(trim(CDS_HZ.fieldbyname('YFID').AsString)));
|
|||
|
|
execsql;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
next;
|
|||
|
|
end;
|
|||
|
|
First;
|
|||
|
|
EnableControls;
|
|||
|
|
end;
|
|||
|
|
InitGrid();
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>','<27><>ʾ<EFBFBD><CABE>Ϣ',0);
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.v2Column5PropertiesChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
toolbar1.SetFocus;
|
|||
|
|
HJ(CDS_HZ,Label14,CDS_HZ.fieldbyname('Qty').AsCurrency);
|
|||
|
|
HJ(CDS_HZ,Label16,CDS_HZ.fieldbyname('Money').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.cxTabControl2Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
setstatus();
|
|||
|
|
initgrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.TZZSHClick(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=''2'' ');
|
|||
|
|
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 TfrmYSCR_PBSH.TEJCXClick(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=''һ<><D2BB>'' ');
|
|||
|
|
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 TfrmYSCR_PBSH.N1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ,True);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.N2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
SelOKNo(CDS_HZ,false);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmYSCR_PBSH.v1SselPropertiesChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
Toolbar1.SetFocus;
|
|||
|
|
HJ(CDS_HZ,Label14,CDS_HZ.fieldbyname('Qty').AsCurrency);
|
|||
|
|
HJ(CDS_HZ,Label16,CDS_HZ.fieldbyname('Money').AsCurrency);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|