699 lines
19 KiB
ObjectPascal
699 lines
19 KiB
ObjectPascal
unit U_CWLLInput;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
Dialogs, ComCtrls, ToolWin, DB, ADODB, cxControls, cxContainer, cxEdit,
|
||
cxTextEdit, cxCurrencyEdit, BtnEdit, StdCtrls, ExtCtrls, cxGraphics,
|
||
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinsDefaultPainters;
|
||
|
||
type
|
||
TfrmCWLLInput = class(TForm)
|
||
ToolBar1: TToolBar;
|
||
TSAVE: TToolButton;
|
||
Tclose: TToolButton;
|
||
Panel1: TPanel;
|
||
Label11: TLabel;
|
||
Label9: TLabel;
|
||
Label8: TLabel;
|
||
Label5: TLabel;
|
||
Label2: TLabel;
|
||
note: TMemo;
|
||
CRTime: TDateTimePicker;
|
||
OutMoney: TcxCurrencyEdit;
|
||
ADOQueryTMP: TADOQuery;
|
||
ADOQueryCMD: TADOQuery;
|
||
Label1: TLabel;
|
||
InMoney: TcxCurrencyEdit;
|
||
CRZY: TEdit;
|
||
Label3: TLabel;
|
||
Label4: TLabel;
|
||
CRType: TComboBox;
|
||
Label7: TLabel;
|
||
ToolButton1: TToolButton;
|
||
BKName: TBtnEditC;
|
||
TOFactoryName: TBtnEditC;
|
||
ToBKName: TBtnEditC;
|
||
JHMoney: TcxCurrencyEdit;
|
||
Label6: TLabel;
|
||
JHHulLv: TcxCurrencyEdit;
|
||
Label10: TLabel;
|
||
procedure TcloseClick(Sender: TObject);
|
||
procedure TSAVEClick(Sender: TObject);
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure FormCreate(Sender: TObject);
|
||
function SaveFKData(): Boolean;
|
||
function SaveFYData(): Boolean;
|
||
function SaveSKData(): Boolean;
|
||
procedure TOFactoryNameBtnClick(Sender: TObject);
|
||
procedure ToolButton1Click(Sender: TObject);
|
||
procedure CRTypeChange(Sender: TObject);
|
||
procedure BKNameBtnUpClick(Sender: TObject);
|
||
procedure BKNameBtnDnClick(Sender: TObject);
|
||
procedure TOFactoryNameBtnUpClick(Sender: TObject);
|
||
procedure ToBKNameBtnUpClick(Sender: TObject);
|
||
procedure OutMoneyExit(Sender: TObject);
|
||
procedure JHMoneyExit(Sender: TObject);
|
||
private
|
||
procedure savedata();
|
||
procedure initdata();
|
||
procedure JSJH();
|
||
{ Private declarations }
|
||
public
|
||
fkeyNo, FStatus: string;
|
||
{ Public declarations }
|
||
end;
|
||
|
||
var
|
||
frmCWLLInput: TfrmCWLLInput;
|
||
|
||
implementation
|
||
|
||
uses
|
||
U_ZDYHelpSel, U_ZDYHelp, U_RTFun, U_DataLink, U_ZdyAttachment, U_ZdyAttachGYS,
|
||
U_BankListSel, U_GYSSel, U_KHSel;
|
||
|
||
{$R *.dfm}
|
||
procedure TfrmCWLLInput.JHMoneyExit(Sender: TObject);
|
||
begin
|
||
JSJH();
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.JSJH();
|
||
var
|
||
MOutMoney, MJHHulLv: Double;
|
||
begin
|
||
MOutMoney := StrToFloatDef(OutMoney.Text, 0);
|
||
MJHHulLv := StrToFloatDef(JHHulLv.Text, 0);
|
||
if MOutMoney <> 0 then
|
||
JHHulLv.Text := FloatToStr(RoundFloat(MJHHulLv / MOutMoney, 4));
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.OutMoneyExit(Sender: TObject);
|
||
begin
|
||
JSJH();
|
||
end;
|
||
|
||
function TfrmCWLLInput.SaveFYData(): Boolean;
|
||
var
|
||
maxId, CRID: string;
|
||
isCWID: Boolean;
|
||
begin
|
||
try
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add('select * from CW_Money_CR where FromDataID1=' + quotedstr(Trim(fkeyNo)));
|
||
Open;
|
||
end;
|
||
if ADOQueryCmd.IsEmpty then
|
||
begin
|
||
if GetLSNo(ADOQueryCmd, maxId, 'FY', 'CW_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;
|
||
isCWID := False;
|
||
end
|
||
else
|
||
begin
|
||
maxId := ADOQueryCMD.FieldByName('CWID').AsString;
|
||
isCWID := True;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add('select * from CW_Money_CR where CWID=' + quotedstr(maxId));
|
||
Open;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
if isCWID then
|
||
Edit
|
||
else
|
||
Append;
|
||
FieldByName('CWID').Value := Trim(maxId);
|
||
FieldByName('Filler').Value := Trim(DName);
|
||
FieldByName('CRType').Value := '<27><><EFBFBD>õǼ<C3B5>';
|
||
FieldByName('CRFlag').Value := '<27><><EFBFBD><EFBFBD>';
|
||
FieldByName('QtyFlag').Value := 1;
|
||
FieldByName('Money').Value := StrToFloat(OutMoney.Text);
|
||
FieldByName('CWType').Value := Trim(CRZY.Text);
|
||
FieldByName('FromDataID1').Value := Trim(fkeyNo);
|
||
fieldbyname('filler').Value := trim(Dname);
|
||
FieldByName('FactoryNo').Value := Trim(ToFactoryName.TxtCode);
|
||
FieldByName('FactoryName').Value := Trim(ToFactoryName.Text);
|
||
FieldByName('CRTime').Value := formatdateTIme('yyyy-MM-dd', CRTime.DateTime);
|
||
FieldByName('BankName').Value := Trim(BKName.Text);
|
||
FieldByName('note').Value := Trim(note.Text);
|
||
FieldByName('status').Value := '1';
|
||
FieldByName('BZType').Value := '<27><>';
|
||
Post;
|
||
end;
|
||
Result := True;
|
||
except
|
||
Result := True;
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
Application.MessageBox('<27><><EFBFBD>ɷ<EFBFBD><C9B7><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
|
||
function TfrmCWLLInput.SaveSKData(): Boolean;
|
||
var
|
||
maxId, FFactoryName: string;
|
||
isCWID: Boolean;
|
||
begin
|
||
try
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add('select * from CW_Money_CR where FromDataID1=' + quotedstr(Trim(fkeyNo)));
|
||
Open;
|
||
end;
|
||
if ADOQueryCmd.IsEmpty then
|
||
begin
|
||
if GetLSNo(ADOQueryCmd, maxId, 'SK', 'CW_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;
|
||
isCWID := False;
|
||
end
|
||
else
|
||
begin
|
||
maxId := ADOQueryCMD.FieldByName('CWID').AsString;
|
||
isCWID := True;
|
||
end;
|
||
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add('select * from CW_Money_CR where CWID=' + quotedstr(maxId));
|
||
Open;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
if isCWID then
|
||
Edit
|
||
else
|
||
Append;
|
||
FieldByName('CWID').Value := Trim(maxId);
|
||
FieldByName('Filler').Value := Trim(DName);
|
||
FieldByName('CRType').Value := '<27>տ<EFBFBD><D5BF>Ǽ<EFBFBD>';
|
||
FieldByName('CRFlag').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
||
FieldByName('QtyFlag').Value := -1;
|
||
FieldByName('BZType').Value := '$';
|
||
FieldByName('Money').Value := StrToFloat(InMoney.Text);
|
||
FieldByName('CWType').Value := Trim(CRZY.Text);
|
||
fieldbyname('filler').Value := trim(Dname);
|
||
FieldByName('CRTime').Value := formatdateTIme('yyyy-MM-dd', CRTime.DateTime);
|
||
FieldByName('BankName').Value := Trim(BKName.Text);
|
||
FieldByName('FromDataID1').Value := Trim(fkeyNo);
|
||
FieldByName('note').Value := Trim(note.Text);
|
||
FieldByName('FactoryNo').Value := Trim(TOFactoryName.TxtCode);
|
||
FieldByName('FactoryName').Value := Trim(TOFactoryName.Text);
|
||
FieldByName('status').Value := '1';
|
||
Post;
|
||
end;
|
||
Result := True;
|
||
except
|
||
Result := True;
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>տ<EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
|
||
function TfrmCWLLInput.SaveFKData(): Boolean;
|
||
var
|
||
maxId, CRID: string;
|
||
isCWID: Boolean;
|
||
begin
|
||
try
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add('select * from CW_Money_CR where FromDataID1=' + quotedstr(Trim(fkeyNo)));
|
||
Open;
|
||
end;
|
||
if ADOQueryCmd.IsEmpty then
|
||
begin
|
||
if GetLSNo(ADOQueryCmd, maxId, 'FK', 'CW_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;
|
||
isCWID := False;
|
||
end
|
||
else
|
||
begin
|
||
maxId := ADOQueryCMD.FieldByName('CWID').AsString;
|
||
isCWID := True;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
SQL.Clear;
|
||
sql.Add('select * from CW_Money_CR where CWID=' + quotedstr(maxId));
|
||
Open;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
if isCWID then
|
||
Edit
|
||
else
|
||
Append;
|
||
FieldByName('CWID').Value := Trim(maxId);
|
||
FieldByName('Filler').Value := Trim(DName);
|
||
FieldByName('CRType').Value := '<27><><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>';
|
||
FieldByName('CRFlag').Value := 'Ӧ<><D3A6><EFBFBD><EFBFBD>';
|
||
FieldByName('QtyFlag').Value := -1;
|
||
FieldByName('Money').Value := StrToFloat(OutMoney.Text);
|
||
FieldByName('CWType').Value := Trim(CRZY.Text);
|
||
FieldByName('FromDataID1').Value := Trim(fkeyNo);
|
||
fieldbyname('filler').Value := trim(Dname);
|
||
FieldByName('FactoryNo').Value := Trim(ToFactoryName.TxtCode);
|
||
FieldByName('FactoryName').Value := Trim(ToFactoryName.Text);
|
||
FieldByName('CRTime').Value := formatdateTIme('yyyy-MM-dd', CRTime.DateTime);
|
||
FieldByName('BankName').Value := Trim(ToBKName.Text);
|
||
FieldByName('note').Value := Trim(note.Text);
|
||
FieldByName('BZType').Value := '<27><>';
|
||
FieldByName('status').Value := '1';
|
||
Post;
|
||
end;
|
||
Result := True;
|
||
except
|
||
Result := True;
|
||
ADOQueryCmd.Connection.RollbackTrans;
|
||
Application.MessageBox('<27><><EFBFBD>ɸ<EFBFBD><C9B8><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.initdata();
|
||
begin
|
||
with ADOQueryTMP do
|
||
begin
|
||
close;
|
||
sql.clear;
|
||
sql.Add('select * from CW_Bank_LS ');
|
||
sql.Add('where BLID=' + quotedstr(trim(fkeyNo)));
|
||
open;
|
||
|
||
end;
|
||
if not ADOQueryTMP.isempty then
|
||
begin
|
||
SCSHData(ADOQueryTMP, Panel1, 0);
|
||
BKName.TxtCode := ADOQueryTMP.FieldByName('BKID').AsString;
|
||
ToBKName.TxtCode := ADOQueryTMP.FieldByName('ToBKID').AsString;
|
||
TOFactoryName.TxtCode := ADOQueryTMP.FieldByName('TOFactoryNO').AsString;
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.savedata();
|
||
var
|
||
fid: string;
|
||
begin
|
||
try
|
||
ADOQueryCMD.Connection.BeginTrans;
|
||
if Trim(fkeyNo) = '' then
|
||
begin
|
||
if GetLSNo(ADOQueryCMD, fkeyNo, 'YL', 'CW_Bank_LS', 4, 1) = False then
|
||
begin
|
||
ADOQueryCMD.Connection.RollbackTrans;
|
||
Application.MessageBox('ȡ<><C8A1>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!', '<27><>ʾ');
|
||
Exit;
|
||
end;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
SQL.Add('delete from CW_Bank_LS where fromBLID=''' + Trim(fkeyNo) + ''' ');
|
||
execsql;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
SQL.Add('select * from CW_Bank_LS where BLID=''' + Trim(fkeyNo) + ''' ');
|
||
Open;
|
||
if isempty then
|
||
begin
|
||
append;
|
||
fieldbyname('filler').Value := trim(Dname);
|
||
end
|
||
else
|
||
begin
|
||
edit;
|
||
fieldbyname('chker').Value := trim(Dname);
|
||
fieldbyname('chkTime').Value := SGetServerDate(adoqueryTmp);
|
||
end;
|
||
RTSetsavedata(ADOQueryCmd, 'CW_Bank_LS', Panel1, 0);
|
||
FieldByName('BLID').Value := Trim(fkeyNo);
|
||
fieldbyname('inMoney').Value := strtofloatdef(trim(inMoney.Text), 0);
|
||
fieldbyname('OutMoney').Value := strtofloatdef(trim(OutMoney.Text), 0);
|
||
fieldbyname('JHMoney').Value := strtofloatdef(trim(JHMoney.Text), 0);
|
||
fieldbyname('JHHulLv').Value := strtofloatdef(trim(JHHulLv.Text), 0);
|
||
fieldbyname('status').Value := '0';
|
||
fieldbyname('BKID').Value := BKName.TxtCode;
|
||
fieldbyname('ToBKID').Value := ToBKName.TxtCode;
|
||
fieldbyname('TOFactoryNo').Value := TOFactoryName.TxtCode;
|
||
Post;
|
||
end;
|
||
// if trim(CRType.Text) = '<27>տ<EFBFBD>' then
|
||
// begin
|
||
// SaveSKData();
|
||
// end;
|
||
// if trim(CRType.Text) = '<27><><EFBFBD><EFBFBD>' then
|
||
// begin
|
||
// SaveFKData();
|
||
// end;
|
||
// if trim(CRType.Text) = '<27><><EFBFBD><EFBFBD>' then
|
||
// begin
|
||
// SaveFYData();
|
||
// end;
|
||
|
||
if trim(CRType.Text) = '<27>˻<EFBFBD><CBBB><EFBFBD>ת' then
|
||
begin
|
||
if GetLSNo(ADOQueryCMD, fid, 'YL', 'CW_Bank_LS', 4, 1) = False then
|
||
begin
|
||
ADOQueryCMD.Connection.RollbackTrans;
|
||
Application.MessageBox('ȡ<><C8A1>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!', '<27><>ʾ');
|
||
Exit;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
SQL.Add('select * from CW_Bank_LS where BLID=''' + Trim(fid) + ''' ');
|
||
Open;
|
||
|
||
append;
|
||
fieldbyname('filler').Value := trim(Dname);
|
||
RTSetsavedata(ADOQueryCmd, 'CW_Bank_LS', Panel1, 0);
|
||
FieldByName('BLID').Value := Trim(fid);
|
||
fieldbyname('Bkid').Value := trim(ToBkName.TxtCode);
|
||
fieldbyname('BkName').Value := trim(ToBkName.Text);
|
||
fieldbyname('ToBkid').Value := trim(BkName.TxtCode);
|
||
fieldbyname('ToBkName').Value := trim(BkName.Text);
|
||
fieldbyname('inMoney').Value := strtofloatdef(trim(OutMoney.Text), 0);
|
||
fieldbyname('OutMoney').Value := strtofloatdef(trim(InMoney.Text), 0);
|
||
fieldbyname('status').Value := '0';
|
||
fieldbyname('fromBLID').Value := trim(fkeyNo);
|
||
Post;
|
||
end;
|
||
end;
|
||
if trim(CRType.Text) = '<27><><EFBFBD><EFBFBD>' then
|
||
begin
|
||
if GetLSNo(ADOQueryCMD, fid, 'YL', 'CW_Bank_LS', 4, 1) = False then
|
||
begin
|
||
ADOQueryCMD.Connection.RollbackTrans;
|
||
Application.MessageBox('ȡ<><C8A1>ˮ<EFBFBD><CBAE>ʧ<EFBFBD><CAA7>!', '<27><>ʾ');
|
||
Exit;
|
||
end;
|
||
with ADOQueryCmd do
|
||
begin
|
||
Close;
|
||
sql.Clear;
|
||
SQL.Add('select * from CW_Bank_LS where BLID=''' + Trim(fid) + ''' ');
|
||
Open;
|
||
|
||
append;
|
||
fieldbyname('filler').Value := trim(Dname);
|
||
RTSetsavedata(ADOQueryCmd, 'CW_Bank_LS', Panel1, 0);
|
||
FieldByName('BLID').Value := Trim(fid);
|
||
fieldbyname('Bkid').Value := trim(ToBkName.TxtCode);
|
||
fieldbyname('BkName').Value := trim(ToBkName.Text);
|
||
fieldbyname('ToBkid').Value := trim(BkName.TxtCode);
|
||
fieldbyname('ToBkName').Value := trim(BkName.Text);
|
||
fieldbyname('inMoney').Value := strtofloatdef(trim(JHMoney.Text), 0);
|
||
fieldbyname('OutMoney').Value := strtofloatdef(trim(InMoney.Text), 0);
|
||
fieldbyname('JHMoney').Value := strtofloatdef(trim(JHMoney.Text), 0);
|
||
fieldbyname('JHHulLv').Value := strtofloatdef(trim(JHHulLv.Text), 0);
|
||
fieldbyname('status').Value := '0';
|
||
fieldbyname('fromBLID').Value := trim(fkeyNo);
|
||
Post;
|
||
end;
|
||
end;
|
||
ADOquerycmd.Connection.CommitTrans;
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>', '<27><>ʾ', 0);
|
||
ToolButton1.Click;
|
||
except
|
||
ADOquerycmd.Connection.RollbackTrans;
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>', '<27><>ʾ', 0);
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.TcloseClick(Sender: TObject);
|
||
begin
|
||
ModalResult := 1;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.ToBKNameBtnUpClick(Sender: TObject);
|
||
begin
|
||
try
|
||
frmBankListSel := TfrmBankListSel.Create(self);
|
||
with frmBankListSel do
|
||
begin
|
||
if showmodal = 1 then
|
||
begin
|
||
SELF.ToBKName.TxtCode := Trim(CDS_HZ.fieldbyname('BKID').AsString);
|
||
SELF.ToBKName.Text := Trim(CDS_HZ.fieldbyname('BKName').AsString);
|
||
end;
|
||
end;
|
||
finally
|
||
frmBankListSel.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.TSAVEClick(Sender: TObject);
|
||
begin
|
||
JSJH();
|
||
if CRType.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27><><EFBFBD>Ͳ<EFBFBD><CDB2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
if BKName.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27>ҷ<EFBFBD><D2B7>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
if Trim(CRType.Text) = '<27>˻<EFBFBD><CBBB><EFBFBD>ת' then
|
||
begin
|
||
|
||
if TOBKName.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27>Է<EFBFBD><D4B7>˻<EFBFBD><CBBB><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
if Trim(CRType.Text) = '<27>տ<EFBFBD>' then
|
||
begin
|
||
if InMoney.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27>跽<EFBFBD><E8B7BD><EFBFBD><EFBFBD><EEB2BB>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
if TOFactoryName.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27>Է<EFBFBD><D4B7><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
if Trim(CRType.Text) = '<27><><EFBFBD><EFBFBD>' then
|
||
begin
|
||
if OutMoney.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB2BB>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
if TOFactoryName.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27>Է<EFBFBD><D4B7><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
if Trim(CRType.Text) = '<27><><EFBFBD><EFBFBD>' then
|
||
begin
|
||
if OutMoney.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EEB2BB>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
if TOFactoryName.Text = '' then
|
||
begin
|
||
Application.MessageBox('<27>Է<EFBFBD><D4B7><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD>', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
savedata();
|
||
with AdoQueryTmp do
|
||
begin
|
||
close;
|
||
sql.Clear;
|
||
sql.Add('select A.BLID from CW_Bank_LS A');
|
||
sql.Add('where ISNULL(fromBLID,'''')<>'''' ');
|
||
sql.Add('and not exists(select X.BLID from CW_Bank_LS X WHERE X.BLID=A.fromBLID)');
|
||
open;
|
||
end;
|
||
if AdoQueryTmp.IsEmpty = False then
|
||
begin
|
||
Application.MessageBox('<27><>ˮ<EFBFBD><CBAE><EFBFBD><EFBFBD><EFBFBD>쳣!', '<27><>ʾ', 0);
|
||
Exit;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.FormClose(Sender: TObject; var Action: TCloseAction);
|
||
begin
|
||
Action := cafree;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.FormDestroy(Sender: TObject);
|
||
begin
|
||
frmCWLLInput := nil;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.FormShow(Sender: TObject);
|
||
begin
|
||
CRTime.DateTime := SGetServerDate(adoqueryTmp);
|
||
|
||
initData();
|
||
if FStatus = '<27><EFBFBD>' then
|
||
begin
|
||
CRType.Enabled := False;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.FormCreate(Sender: TObject);
|
||
begin
|
||
Panel1.Align := alclient;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.TOFactoryNameBtnClick(Sender: TObject);
|
||
begin
|
||
try
|
||
frmZDYHelp := TfrmZDYHelp.Create(self);
|
||
with frmZDYHelp do
|
||
begin
|
||
flag := 'XJLLFLAG';
|
||
flagname := '<27>˻<EFBFBD><CBBB><EFBFBD><EFBFBD>Ͷ<EFBFBD><CDB6><EFBFBD>';
|
||
if showmodal = 1 then
|
||
begin
|
||
TOFactoryName.Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString);
|
||
end;
|
||
end;
|
||
finally
|
||
frmZDYHelp.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.TOFactoryNameBtnUpClick(Sender: TObject);
|
||
begin
|
||
if CRType.Text = '<27><><EFBFBD><EFBFBD>' then
|
||
begin
|
||
try
|
||
frmGYSSel := TfrmGYSSel.Create(Application);
|
||
with frmGYSSel do
|
||
begin
|
||
if ShowModal = 1 then
|
||
begin
|
||
SELF.TOFactoryName.Text := Trim(Order_Main.fieldbyname('CoName').AsString);
|
||
SELF.TOFactoryName.TxtCode := Trim(Order_Main.fieldbyname('CoCode').AsString);
|
||
end;
|
||
end;
|
||
finally
|
||
frmGYSSel.Free;
|
||
end;
|
||
end;
|
||
|
||
if CRType.Text = '<27>տ<EFBFBD>' then
|
||
begin
|
||
try
|
||
frmKHSel := TfrmKHSel.Create(Application);
|
||
with frmKHSel do
|
||
begin
|
||
if ShowModal = 1 then
|
||
begin
|
||
SELF.TOFactoryName.Text := Trim(Order_Main.fieldbyname('CoName').AsString);
|
||
SELF.TOFactoryName.TxtCode := Trim(Order_Main.fieldbyname('CoCode').AsString);
|
||
end;
|
||
end;
|
||
finally
|
||
frmKHSel.Free;
|
||
end;
|
||
end;
|
||
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.ToolButton1Click(Sender: TObject);
|
||
begin
|
||
Fkeyno := '';
|
||
CRType.ItemIndex := -1;
|
||
TOFactoryName.Text := '';
|
||
ToBKName.Text := '';
|
||
CRZY.Text := '';
|
||
|
||
InMoney.Text := '';
|
||
OutMoney.Text := '';
|
||
note.Text := '';
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.BKNameBtnDnClick(Sender: TObject);
|
||
begin
|
||
TBtnEditC(Sender).Text := '';
|
||
TBtnEditC(Sender).TxtCode := '';
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.BKNameBtnUpClick(Sender: TObject);
|
||
begin
|
||
try
|
||
frmBankListSel := TfrmBankListSel.Create(self);
|
||
with frmBankListSel do
|
||
begin
|
||
fFlag := 10;
|
||
if showmodal = 1 then
|
||
begin
|
||
SELF.BKName.TxtCode := Trim(CDS_HZ.fieldbyname('BKID').AsString);
|
||
SELF.BKName.Text := Trim(CDS_HZ.fieldbyname('BKName').AsString);
|
||
end;
|
||
end;
|
||
finally
|
||
frmBankListSel.Free;
|
||
end;
|
||
end;
|
||
|
||
procedure TfrmCWLLInput.CRTypeChange(Sender: TObject);
|
||
begin
|
||
if ((trim(CRType.Text) = '<27>˻<EFBFBD><CBBB><EFBFBD>ת') or (trim(CRType.Text) = '<27><><EFBFBD><EFBFBD>')) then
|
||
begin
|
||
TOFactoryName.ReadOnly := false;
|
||
end
|
||
else
|
||
begin
|
||
TOFactoryName.text := '';
|
||
TOFactoryName.ReadOnly := true;
|
||
end;
|
||
|
||
end;
|
||
|
||
end.
|
||
|