RTFormwork/项目代码/RTBasicsV1/A09财务通用管理/U_ReceivableEdit.pas
“ddf” 61630656e9 1
2024-07-07 09:35:27 +08:00

66 lines
1.5 KiB
ObjectPascal

unit U_ReceivableEdit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, DB, ADODB;
type
TfrmReceivableEdit = class(TForm)
Panel1: TPanel;
Button1: TButton;
Label1: TLabel;
Button2: TButton;
ADOQueryMain: TADOQuery;
ADOQueryTemp: TADOQuery;
ADOQueryCmd: TADOQuery;
Price: TEdit;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
FFFIDS: string;
{ Public declarations }
end;
var
frmReceivableEdit: TfrmReceivableEdit;
implementation
{$R *.dfm}
procedure TfrmReceivableEdit.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TfrmReceivableEdit.Button1Click(Sender: TObject);
begin
if StrToFloatDef(Price.Text, 0) = 0 then
Price.Text := '0';
try
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add(' update Finance_Flow ');
sql.Add(' set Price=' + Price.Text);
sql.Add(' ,Amount=Round((Qty * ' + Price.Text + ' + isnull(OtherFee,0) - isnull(Deduction,0)), 2)');
sql.Add(' where ISNULL(status, ''0'')=''0'' ');
sql.Add(' and EXISTS(select X.RTValue from [dbo].[F_Tool_SplitString](' + quotedstr(FFFIDS) + ','','') X where X.RTValue=Finance_Flow.FFID) ');
// showmessage(sql.text);
ExecSQL;
end;
ModalResult := 1;
except
application.MessageBox(PChar(Exception(ExceptObject).Message), 'ÌáʾÐÅÏ¢', 0);
end;
end;
end.