|
|
|
|
unit u_ch_invoice_add_jk;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
Dialogs, BusinessSkinForm, StdCtrls, wwdblook, RxLookup, bsSkinCtrls, DB,
|
|
|
|
|
ADODB;
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
Tfrm_ch_invoice_add_jk = class(TForm)
|
|
|
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
|
|
|
Label48: TLabel;
|
|
|
|
|
wwDBLookupCombo6: TwwDBLookupCombo;
|
|
|
|
|
Label63: TLabel;
|
|
|
|
|
RxDBLookupCombo3: TRxDBLookupCombo;
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
Edit1: TEdit;
|
|
|
|
|
bsSkinCheckRadioBox7: TbsSkinCheckRadioBox;
|
|
|
|
|
bsSkinCheckRadioBox8: TbsSkinCheckRadioBox;
|
|
|
|
|
bsSkinCheckRadioBox1: TbsSkinCheckRadioBox;
|
|
|
|
|
bsSkinButton1: TbsSkinButton;
|
|
|
|
|
bsSkinButton2: TbsSkinButton;
|
|
|
|
|
p_invoice_no: TADOStoredProc;
|
|
|
|
|
Edit2: TEdit;
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
RxDBLookupCombo1: TRxDBLookupCombo;
|
|
|
|
|
bsSkinCheckRadioBox2: TbsSkinCheckRadioBox;
|
|
|
|
|
bsSkinCheckRadioBox3: TbsSkinCheckRadioBox;
|
|
|
|
|
edt1: TEdit;
|
|
|
|
|
procedure bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
|
|
|
|
|
private
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
public
|
|
|
|
|
BsNO:String;
|
|
|
|
|
{ Public declarations }
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
frm_ch_invoice_add_jk: Tfrm_ch_invoice_add_jk;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses u_data_share, u_ch_invoice_jk, u_main, my_sys_function;
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_ch_invoice_add_jk.bsSkinButton1Click(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
afield : variant;
|
|
|
|
|
i: Integer;
|
|
|
|
|
aQuery,aAdoQuery:TAdoQuery;
|
|
|
|
|
str_Bank,str_AccountNo,OldNo:string;
|
|
|
|
|
AmtRmb,UsdRmb:double;
|
|
|
|
|
begin
|
|
|
|
|
if trim(Edit1.Text)='' then
|
|
|
|
|
begin
|
|
|
|
|
//showmessage('<27><>Ʊ<EFBFBD><C6B1><EFBFBD>벻<EFBFBD><EBB2BB>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
|
|
//exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if bsSkinCheckRadioBox7.Checked or bsSkinCheckRadioBox8.Checked then
|
|
|
|
|
begin
|
|
|
|
|
if trim(wwDBLookupCombo6.Text)='' then
|
|
|
|
|
begin
|
|
|
|
|
showmessage('<27><>Ʊ<EFBFBD>ұ<EFBFBD><D2B1><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
{
|
|
|
|
|
if RxDBLookupCombo3.DisplayValue='' then
|
|
|
|
|
begin
|
|
|
|
|
showmessage('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD>Ʋ<EFBFBD><C6B2><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
end;
|
|
|
|
|
if bsSkinCheckRadioBox7.Checked then
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.Insert;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ɷ<EFBFBD>Ʊ';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=trim(Edit1.Text);
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>']:=wwDBLookupCombo6.Text;
|
|
|
|
|
if RxDBLookupCombo1.DisplayValues[0]<>'' then
|
|
|
|
|
begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo1.DisplayValues[0];
|
|
|
|
|
if frm_data_share.t_code_subcomp.locate('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo1.DisplayValues[0],[]) then
|
|
|
|
|
begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD>̵ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('<27><><EFBFBD>̵ǼǺ<C7BC>').AsString;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['˰<><CBB0><EFBFBD>ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString;
|
|
|
|
|
end;
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>;<3B>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',vararrayof([frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],subcomp]),[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end else begin
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>',frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>',frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo3.DisplayValues[1]<>'' then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo3.DisplayValues[1];
|
|
|
|
|
|
|
|
|
|
if not frm_data_share.t_crm_client_all.IsEmpty then
|
|
|
|
|
if RxDBLookupCombo3.DisplayValues[1]<>'' then
|
|
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo3.DisplayValues[1],[]) then
|
|
|
|
|
begin
|
|
|
|
|
if trim(frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring)<>''then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.RxDBLookupCombo2.Value:='';
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><>ֵ˰<D6B5><CBB0>Ʊ';
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.edt_from.text:=edt1.text;
|
|
|
|
|
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>']='USD' then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>';//get_parameters_value(7,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>')
|
|
|
|
|
frm_ch_invoice_jk.wwDBLookupCombo6.Text:='USD';
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=get_parameters_value(147,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>');
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.Post;
|
|
|
|
|
InsertUpdateInvoice_item(1,1,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('in_id').AsInteger,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modify_all:=false;
|
|
|
|
|
|
|
|
|
|
except
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.State=dsinsert then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.cancel;
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
showmessage('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.bsSkinTabSheet2.show;
|
|
|
|
|
close;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if bsSkinCheckRadioBox8.Checked then
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
afield := vararraycreate([0,frm_ch_invoice_jk.t_ch_invoice.fieldcount-1],varvariant);
|
|
|
|
|
for i := 0 to (frm_ch_invoice_jk.t_ch_invoice.fieldcount-1) do
|
|
|
|
|
begin
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
|
|
str_Bank:=frm_ch_invoice_jk.t_ch_invoice.fields[i].value;
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName='<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>' then
|
|
|
|
|
str_AccountNo:=frm_ch_invoice_jk.t_ch_invoice.fields[i].value;
|
|
|
|
|
afield[i] :=frm_ch_invoice_jk.t_ch_invoice.fields[i].value;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.append;
|
|
|
|
|
for i := 0 to (frm_ch_invoice_jk.t_ch_invoice.fieldcount-1) do
|
|
|
|
|
begin
|
|
|
|
|
if (frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName<>'IN_ID') and (Trim(frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName)<>'<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>б<EFBFBD>') then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.fields[i].value := afield[i] ;
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ɷ<EFBFBD>Ʊ';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=trim(Edit1.Text);
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>']:=wwDBLookupCombo6.Text;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring='' then
|
|
|
|
|
begin
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>',frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],[]) then
|
|
|
|
|
begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>շ<EFBFBD>']:=0;
|
|
|
|
|
if Application.MessageBox('<27>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD><CFB8>','<27><>ʾ',MB_YESNO+ MB_ICONINFORMATION)=IDYES then
|
|
|
|
|
begin
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>ע']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=0;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=0;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д']:='';
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo1.DisplayValues[0]<>'' then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo1.DisplayValues[0];
|
|
|
|
|
if frm_data_share.t_code_subcomp.locate('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo1.DisplayValues[0],[]) then
|
|
|
|
|
begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD>̵ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('<27><><EFBFBD>̵ǼǺ<C7BC>').AsString;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['˰<><CBB0><EFBFBD>ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString;
|
|
|
|
|
end;
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>;<3B>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',vararrayof([frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],subcomp]),[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end else begin
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>',frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo3.DisplayValues[1]<>'' then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo3.DisplayValues[1];
|
|
|
|
|
if not frm_data_share.t_crm_client_all.IsEmpty then
|
|
|
|
|
if RxDBLookupCombo3.DisplayValues[1]<>'' then
|
|
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo3.DisplayValues[1],[]) then
|
|
|
|
|
begin
|
|
|
|
|
if trim(frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring)<>''then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
// frm_ch_invoice.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=str_Bank;
|
|
|
|
|
// frm_ch_invoice.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=str_AccountNo;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.RxDBLookupCombo2.Value:='';
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƶ<EFBFBD><C6B5><EFBFBD>']:=employee;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=date;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=0;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>']:=0;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϳ<EFBFBD>ԭ<EFBFBD><D4AD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>']:=null;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=null;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.post;
|
|
|
|
|
InsertUpdateInvoice_item(1,1,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('in_id').AsInteger,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,0);
|
|
|
|
|
|
|
|
|
|
modify_all:=false;
|
|
|
|
|
|
|
|
|
|
except
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.State=dsinsert then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.cancel;
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
showmessage('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice_jk.bsSkinTabSheet2.show;
|
|
|
|
|
close;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if bsSkinCheckRadioBox3.Checked then
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
afield := vararraycreate([0,frm_ch_invoice_jk.t_ch_invoice.fieldcount-1],varvariant);
|
|
|
|
|
OldNo:=frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').AsString;
|
|
|
|
|
AmtRmb:=frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').AsFloat;
|
|
|
|
|
UsdRmb:=frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
for i := 0 to (frm_ch_invoice_jk.t_ch_invoice.fieldcount-1) do
|
|
|
|
|
begin
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then
|
|
|
|
|
str_Bank:=frm_ch_invoice_jk.t_ch_invoice.fields[i].value;
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName='<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>' then
|
|
|
|
|
str_AccountNo:=frm_ch_invoice_jk.t_ch_invoice.fields[i].value;
|
|
|
|
|
afield[i] :=frm_ch_invoice_jk.t_ch_invoice.fields[i].value;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.append;
|
|
|
|
|
for i := 0 to (frm_ch_invoice_jk.t_ch_invoice.fieldcount-1) do
|
|
|
|
|
begin
|
|
|
|
|
if (frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName<>'IN_ID') and (Trim(frm_ch_invoice_jk.t_ch_invoice.fields[i].FieldName)<>'<27><><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD>б<EFBFBD>') then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.fields[i].value := afield[i] ;
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><><EFBFBD>ɷ<EFBFBD>Ʊ';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=trim(Edit1.Text);
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>']:='USD';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˷<EFBFBD>';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsFloat;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>շ<EFBFBD>']:=0;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>']:=0;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.edt_from.text:=edt1.Text ;
|
|
|
|
|
frm_ch_invoice_jk.wwDBLookupCombo6.Text:='USD';
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>ע']:='USD'+frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>').AsString+'*'+floattostr(GetUsdExrate(frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString))+'<27><>Ʊ<EFBFBD><EFBFBD><DEB8><EFBFBD>Ԫ'+edt1.Text;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƶ<EFBFBD><C6B5><EFBFBD>']:=employee;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=date;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƿ<EFBFBD><C7B7><EFBFBD>ӡ']:=0;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>Ƿ<EFBFBD><C7B7>ϳ<EFBFBD>']:=0;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϳ<EFBFBD>ԭ<EFBFBD><D4AD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD>']:=null;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:='';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=null;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.post;
|
|
|
|
|
InsertUpdateInvoice_item(1,1,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('in_id').AsInteger,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,0);
|
|
|
|
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
|
|
with aAdoQuery do
|
|
|
|
|
try
|
|
|
|
|
Close;sql.Clear;
|
|
|
|
|
sql.Add('Update t_ch_fee_do set <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:bsno1');
|
|
|
|
|
sql.Add('From t_ch_fee_do');
|
|
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:bsno and <20>ұ<EFBFBD>=''USD''');
|
|
|
|
|
Parameters.ParamByName('bsno').Value:=OldNo;
|
|
|
|
|
Parameters.ParamByName('bsno1').Value:=frm_ch_invoice_jk.t_ch_invoice.FieldByName('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').Value;
|
|
|
|
|
ExecSQL;
|
|
|
|
|
finally
|
|
|
|
|
free;
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.Edit;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.post;
|
|
|
|
|
|
|
|
|
|
aAdoQuery:=CreateAdoQuery;
|
|
|
|
|
with aAdoQuery do
|
|
|
|
|
try
|
|
|
|
|
Close;sql.Clear;
|
|
|
|
|
sql.Add('Update t_ch_invoice');
|
|
|
|
|
sql.Add('set <20>ұ<EFBFBD>=''RMB'',<2C><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>=''<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӷ<EFBFBD>'',<2C><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>,<2C>ϼƽ<CFBC><C6BD><EFBFBD>=:<3A>ϼƽ<CFBC><C6BD><EFBFBD>,ʵ<>ʽ<EFBFBD><CABD><EFBFBD>=:ʵ<>ʽ<EFBFBD><CABD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>=:<3A><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>,<2C><>Ԫ<EFBFBD><D4AA><EFBFBD><EFBFBD>=0');
|
|
|
|
|
sql.Add('where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>=:bsno');
|
|
|
|
|
Parameters.ParamByName('bsno').Value:=OldNo;
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').Value:=AmtRmb;
|
|
|
|
|
Parameters.ParamByName('<27>ϼƽ<CFBC><C6BD><EFBFBD>').Value:=AmtRmb;
|
|
|
|
|
Parameters.ParamByName('ʵ<>ʽ<EFBFBD><CABD><EFBFBD>').Value:=AmtRmb;
|
|
|
|
|
Parameters.ParamByName('<27><><EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><D2BD><EFBFBD>').Value:=AmtRmb;
|
|
|
|
|
ExecSQL;
|
|
|
|
|
finally
|
|
|
|
|
free;
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.Refresh;
|
|
|
|
|
modify_all:=false;
|
|
|
|
|
|
|
|
|
|
except
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.State=dsinsert then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.cancel;
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
showmessage('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.bsSkinTabSheet2.show;
|
|
|
|
|
close;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
|
|
begin
|
|
|
|
|
try
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
frm_ch_invoice.t_ch_invoice.Insert;
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><>ϸ<EFBFBD><CFB8>Ʊ';
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=trim(Edit1.Text);
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27>ұ<EFBFBD>']:=wwDBLookupCombo6.Text;
|
|
|
|
|
if frm_ch_invoice.t_sys_bank.Locate('<27>ұ<EFBFBD>',frm_ch_invoice.t_ch_invoice['<27>ұ<EFBFBD>'],[]) then begin
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
if RxDBLookupCombo1.DisplayValues[0]<>'' then begin
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo1.DisplayValues[0];
|
|
|
|
|
if frm_data_share.t_code_subcomp.locate('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo1.DisplayValues[0],[]) then
|
|
|
|
|
begin
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27><><EFBFBD>̵ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('<27><><EFBFBD>̵ǼǺ<C7BC>').value;
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['˰<><CBB0><EFBFBD>ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').value;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo3.DisplayValues[1];
|
|
|
|
|
if not frm_data_share.t_crm_client_all.IsEmpty then
|
|
|
|
|
if frm_data_share.t_crm_client_all.locate('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo3.DisplayValues[1],[]) then
|
|
|
|
|
begin
|
|
|
|
|
if trim(frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring)<>''then
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27><>Ʊ̧ͷ']:=frm_data_share.t_crm_client_all.fieldbyname('<27><>Ʊ̧ͷ').asstring;
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice.t_ch_invoice['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>';
|
|
|
|
|
// frm_ch_invoice.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice.t_ch_invoice.post;
|
|
|
|
|
modify_all:=false;
|
|
|
|
|
|
|
|
|
|
except
|
|
|
|
|
if frm_ch_invoice.t_ch_invoice.State=dsinsert then
|
|
|
|
|
frm_ch_invoice.t_ch_invoice.cancel;
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊʧ<C6B1>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice.bsSkinTabSheet2.show;
|
|
|
|
|
Close;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
if bsSkinCheckRadioBox1.Checked then
|
|
|
|
|
begin
|
|
|
|
|
frm_main.db.BeginTrans;
|
|
|
|
|
try
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.Insert;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:='<27><><EFBFBD>뷢Ʊ';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=trim(Edit1.Text);
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>']:=wwDBLookupCombo6.Text;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>']:=edit2.text;
|
|
|
|
|
if RxDBLookupCombo1.DisplayValues[0]<>'' then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>']:=RxDBLookupCombo1.DisplayValues[0];
|
|
|
|
|
if frm_data_share.t_code_subcomp.locate('<27>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',RxDBLookupCombo1.DisplayValues[0],[]) then
|
|
|
|
|
begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD>̵ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('<27><><EFBFBD>̵ǼǺ<C7BC>').AsString;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['˰<><CBB0><EFBFBD>ǼǺ<C7BC>']:=frm_data_share.t_code_subcomp.fieldbyname('˰<><CBB0><EFBFBD>ǼǺ<C7BC>').AsString;
|
|
|
|
|
end;
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>;<3B>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>',vararrayof([frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],subcomp]),[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end else begin
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>',frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end else begin
|
|
|
|
|
if frm_ch_invoice_jk.t_sys_bank.Locate('<27>ұ<EFBFBD>',frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>'],[]) then begin
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>']:=frm_ch_invoice_jk.t_sys_bank.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD>').asstring;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>Ʊ̧ͷ']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><>Ʊ̧ͷ'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ᵥ<EFBFBD><E1B5A5>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27>ᵥ<EFBFBD><E1B5A5>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['ί<>б<EFBFBD><D0B1><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['ί<>б<EFBFBD><D0B1><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD>˸<EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD>˸<EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['ж<><D0B6><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['ж<><D0B6><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['Ŀ<>ĸ<EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['Ŀ<>ĸ<EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><>ע']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><>ע'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ϼƽ<CFBC><C6BD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['ʵ<>ʽ<EFBFBD><CABD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27>鿪<EFBFBD><E9BFAA><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27>ұ<EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27>ұ<EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'];
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.post;
|
|
|
|
|
InsertUpdateInvoice_item(1,1,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('in_id').AsInteger,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,frm_ch_invoice_jk.t_ch_invoice.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>').asstring,0);
|
|
|
|
|
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
close;sql.clear;
|
|
|
|
|
sql.Add('select * from t_ch_fee_do where <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='''+frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']+'''');
|
|
|
|
|
open;
|
|
|
|
|
if not IsEmpty then begin
|
|
|
|
|
first;
|
|
|
|
|
while not eof do begin
|
|
|
|
|
edit;
|
|
|
|
|
fieldbyname('<27><><EFBFBD><EFBFBD>').Asstring:='1';
|
|
|
|
|
post;
|
|
|
|
|
next;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice_shen.Edit;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD>״̬']:='<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ';
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=employee;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice_shen['<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>']:=now;
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice_shen['<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>']:=trim(Edit1.Text);
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice_shen.post;
|
|
|
|
|
modify_all:=false;
|
|
|
|
|
frm_main.db.CommitTrans;
|
|
|
|
|
finally
|
|
|
|
|
if frm_main.db.InTransaction then
|
|
|
|
|
begin
|
|
|
|
|
if frm_ch_invoice_jk.t_ch_invoice.State=dsinsert then
|
|
|
|
|
frm_ch_invoice_jk.t_ch_invoice.cancel;
|
|
|
|
|
modify_all:=true;
|
|
|
|
|
showmessage('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊʧ<C6B1>ܣ<EFBFBD><DCA3><EFBFBD>');
|
|
|
|
|
end;
|
|
|
|
|
{
|
|
|
|
|
if modify_all then
|
|
|
|
|
Send_invocie_check_check('<27><><EFBFBD>뷢Ʊ<EBB7A2><C6B1><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:'+frm_ch_invoice.t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring
|
|
|
|
|
+',<2C>ͻ<EFBFBD>:'+frm_ch_invoice.t_ch_invoice_shen.fieldbyname('<27>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD>').asstring,frm_ch_invoice.t_ch_invoice_shen.fieldbyname('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>').asstring,'25');
|
|
|
|
|
}
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frm_ch_invoice_jk.bsSkinTabSheet2.show;
|
|
|
|
|
if bsSkinCheckRadioBox2.Checked then
|
|
|
|
|
frm_ch_invoice_jk.bsSkinButton35.OnClick(nil);
|
|
|
|
|
close;
|
|
|
|
|
exit;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_ch_invoice_add_jk.bsSkinButton2Click(Sender: TObject);
|
|
|
|
|
begin
|
|
|
|
|
close;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_ch_invoice_add_jk.FormShow(Sender: TObject);
|
|
|
|
|
var
|
|
|
|
|
i:integer;
|
|
|
|
|
aQuery:TAdoQuery;
|
|
|
|
|
begin
|
|
|
|
|
if not if_reg(417) then bsSkinCheckRadioBox2.Visible:=false;
|
|
|
|
|
{
|
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
|
|
|
try
|
|
|
|
|
with aQuery do begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('select <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> from t_ch_invoice where IN_ID=(select max(IN_ID) from t_ch_invoice where <20>ֲ<EFBFBD><D6B2><EFBFBD><EFBFBD><EFBFBD>='''+subComp+''')');
|
|
|
|
|
Open;
|
|
|
|
|
if IsEmpty then begin
|
|
|
|
|
Close;SQL.Clear;
|
|
|
|
|
SQL.Add('select <20><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD> from t_ch_invoice where IN_ID=(select max(IN_ID) from t_ch_invoice)');
|
|
|
|
|
Open;
|
|
|
|
|
end;
|
|
|
|
|
try
|
|
|
|
|
i:=strtoint(aQuery.fieldbyname('<27><>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>').AsString);
|
|
|
|
|
Edit1.Text:=inttostr(i+1);
|
|
|
|
|
except
|
|
|
|
|
;
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
finally
|
|
|
|
|
FreeAndNil(aQuery);
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
RxDBLookupCombo1.DisplayValue:=subComp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
'select @inv_no=()'
|
|
|
|
|
p_invoice_no.ExecProc;
|
|
|
|
|
try
|
|
|
|
|
i:=strtoint(p_invoice_no.Parameters[1].value);
|
|
|
|
|
Edit1.Text:=inttostr(i+1);
|
|
|
|
|
except
|
|
|
|
|
;
|
|
|
|
|
end;
|
|
|
|
|
}
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
procedure Tfrm_ch_invoice_add_jk.Edit1KeyPress(Sender: TObject;
|
|
|
|
|
var Key: Char);
|
|
|
|
|
begin
|
|
|
|
|
if key=#13 then
|
|
|
|
|
begin
|
|
|
|
|
key:=#0;
|
|
|
|
|
frm_ch_invoice_jk.bsSkinButton1Click(Sender);
|
|
|
|
|
end;
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|