You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
225 lines
7.0 KiB
Plaintext
225 lines
7.0 KiB
Plaintext
unit u_code_fee_cargomainfest_add;
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
Dialogs, DB, ADODB, dxExEdtr, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl,
|
|
dxDBGrid, dxCntner, BusinessSkinForm, ExtCtrls, bsSkinCtrls, StdCtrls,
|
|
Mask, DBCtrls;
|
|
|
|
type
|
|
Tfrm_code_fee_cargomainfest_add = class(TForm)
|
|
t_ch_project: TADOQuery;
|
|
t_ch_project1: TDataSource;
|
|
t_ch_project_fee: TADOQuery;
|
|
t_ch_project_fee1: TDataSource;
|
|
dxDBGrid1: TdxDBGrid;
|
|
dxDBGrid1Column1: TdxDBGridMaskColumn;
|
|
dxDBGrid1Column2: TdxDBGridMaskColumn;
|
|
dxDBGrid1Column3: TdxDBGridDateColumn;
|
|
dxDBGrid1Column4: TdxDBGridMaskColumn;
|
|
bsBusinessSkinForm1: TbsBusinessSkinForm;
|
|
Panel1: TPanel;
|
|
dxDBGrid2: TdxDBGrid;
|
|
dxDBGrid2Column1: TdxDBGridMaskColumn;
|
|
dxDBGrid2Column2: TdxDBGridMaskColumn;
|
|
dxDBGrid2Column3: TdxDBGridMaskColumn;
|
|
bsSkinPanel1: TbsSkinPanel;
|
|
bsSkinButton3: TbsSkinButton;
|
|
bsSkinButton2: TbsSkinButton;
|
|
op_type: TEdit;
|
|
t_op_bill1: TDataSource;
|
|
t_ch_fee1: TDataSource;
|
|
dxDBGrid2Column7: TdxDBGridColumn;
|
|
dxDBGrid2Column5: TdxDBGridColumn;
|
|
t_op_fenzhang1: TDataSource;
|
|
procedure bsSkinButton2Click(Sender: TObject);
|
|
procedure FormShow(Sender: TObject);
|
|
procedure bsSkinButton3Click(Sender: TObject);
|
|
function fee_get_num:real;
|
|
private
|
|
{ Private declarations }
|
|
public
|
|
{ Public declarations }
|
|
end;
|
|
|
|
var
|
|
frm_code_fee_cargomainfest_add: Tfrm_code_fee_cargomainfest_add;
|
|
|
|
implementation
|
|
|
|
uses u_main, my_sys_function;
|
|
|
|
{$R *.dfm}
|
|
|
|
function Tfrm_code_fee_cargomainfest_add.fee_get_num:real;
|
|
begin
|
|
;
|
|
end;
|
|
|
|
procedure Tfrm_code_fee_cargomainfest_add.bsSkinButton2Click(Sender: TObject);
|
|
begin
|
|
close;
|
|
end;
|
|
|
|
procedure Tfrm_code_fee_cargomainfest_add.FormShow(Sender: TObject);
|
|
begin
|
|
t_ch_project.SQL.clear;
|
|
t_ch_project.sql.add('select * from t_ch_project_cargomainfest ');
|
|
t_ch_project.SQL.Add(' where 1=1');
|
|
if op_type.text='1'then
|
|
begin
|
|
t_ch_project.sql.add(' and ÒµÎñÖÖÀà='+''''+'º£Ô˳ö¿Ú'+'''');
|
|
end;
|
|
if op_type.text='2'then
|
|
begin
|
|
t_ch_project.sql.add(' and ÒµÎñÖÖÀà='+''''+'º£Ô˽ø¿Ú'+'''');
|
|
end;
|
|
if op_type.text='3'then
|
|
begin
|
|
t_ch_project.sql.add(' and ÒµÎñÖÖÀà='+''''+'¿ÕÔ˳ö¿Ú'+'''');
|
|
end;
|
|
if op_type.text='4'then
|
|
begin
|
|
t_ch_project.sql.add(' and ÒµÎñÖÖÀà='+''''+'¿ÕÔ˽ø¿Ú'+'''');
|
|
end;
|
|
t_ch_project.sql.add(' order by ·½°¸Ãû³Æ');
|
|
t_ch_project.open;
|
|
t_ch_project_fee.open;
|
|
end;
|
|
|
|
procedure Tfrm_code_fee_cargomainfest_add.bsSkinButton3Click(Sender: TObject);
|
|
var
|
|
i:real;
|
|
if_do:boolean;
|
|
aQuery:TADOQuery;
|
|
j:integer;
|
|
begin
|
|
if t_op_bill1.DataSet.IsEmpty then
|
|
exit;
|
|
|
|
if t_ch_project_fee.IsEmpty then
|
|
exit;
|
|
|
|
if t_ch_project.IsEmpty then
|
|
exit;
|
|
|
|
t_op_fenzhang1.DataSet.Edit;
|
|
t_op_fenzhang1.DataSet['½áËã´úÀí']:=t_ch_project['½áËã´úÀí'];
|
|
t_op_fenzhang1.DataSet['·ÑÓÃÃû³Æ']:=t_ch_project['·ÑÓÃÃû³Æ'];
|
|
t_op_fenzhang1.DataSet['±Ò±ð']:=t_ch_project['±Ò±ð'];
|
|
t_op_fenzhang1.DataSet['OT±Ò±ð']:=t_ch_project['OT±Ò±ð'];
|
|
t_op_fenzhang1.DataSet['·½°¸´úÂë']:=t_ch_project['·½°¸´úÂë'];
|
|
t_op_fenzhang1.DataSet.post;
|
|
|
|
aQuery:=CreateAdoQuery;
|
|
try
|
|
with aQuery do begin
|
|
Close;SQL.Clear;
|
|
if t_op_bill1.DataSet.FieldByName('×°ÔË·½Ê½').AsString='Æ´ÏäÖ÷Ʊ' then begin
|
|
sql.Add('select * from t_op_seae where Ö÷±àºÅ='''+t_op_bill1.DataSet.fieldByName('±àºÅ').AsString+''' and Ö÷±àºÅ<>±àºÅ and ±àºÅ not in (select ·ÖƱ±àºÅ from t_ch_fee_cargomainfast where ±àºÅ='''+t_op_bill1.DataSet.fieldByName('±àºÅ').AsString+''') order by ·ÖÌáµ¥ºÅ');
|
|
end else begin
|
|
sql.Add('select * from t_op_seae where Ö÷±àºÅ='''+t_op_bill1.DataSet.fieldByName('±àºÅ').AsString+''' and ±àºÅ not in (select ·ÖƱ±àºÅ from t_ch_fee_cargomainfast where ±àºÅ='''+t_op_bill1.DataSet.fieldByName('±àºÅ').AsString+''') order by ·ÖÌáµ¥ºÅ');
|
|
end;
|
|
Open;
|
|
end;
|
|
|
|
j:=1;
|
|
aQuery.first;
|
|
while not aQuery.eof do
|
|
begin
|
|
t_ch_fee1.DataSet.Append;
|
|
t_ch_fee1.DataSet['ÐòºÅ']:=j;
|
|
j:=j+1;
|
|
t_ch_fee1.DataSet['Ä£°åÃû³Æ']:=t_ch_project_fee.fieldbyname('·½°¸´úÂë').asstring;
|
|
t_ch_fee1.DataSet['񅧏']:=t_op_bill1.DataSet['񅧏'];
|
|
t_ch_fee1.DataSet['·ÖƱ±àºÅ']:=aQuery['±àºÅ'];
|
|
if aQuery.FieldByName('Ç©µ¥·½Ê½').AsString='µç·Å' then
|
|
t_ch_fee1.DataSet['ÊÇ·ñµç·Å']:=1
|
|
else
|
|
t_ch_fee1.DataSet['ÊÇ·ñµç·Å']:=0;
|
|
|
|
t_ch_fee1.DataSet['·¢»õÈË']:=aQuery['·¢»õÈË´úÂë'];
|
|
t_ch_fee1.DataSet['ÊÕ»õÈË']:=aQuery['ÊÕ»õÈË´úÂë'];
|
|
t_ch_fee1.DataSet['Ö÷Ìáµ¥ºÅ']:=aQuery['Ö÷Ìáµ¥ºÅ'];
|
|
t_ch_fee1.DataSet['·ÖÌáµ¥ºÅ']:=aQuery['·ÖÌáµ¥ºÅ'];
|
|
t_ch_fee1.DataSet['¸¶·Ñ·½Ê½']:=aQuery['¸¶·Ñ·½Ê½'];
|
|
t_ch_fee1.DataSet['¼þÊý']:=aQuery['¼þÊý'];
|
|
t_ch_fee1.DataSet['°ü×°']:=aQuery['°ü×°'];
|
|
t_ch_fee1.DataSet['ßéÍ·']:=aQuery['ßéÍ·'];
|
|
t_ch_fee1.DataSet['ÖØÁ¿']:=aQuery['ÖØÁ¿'];
|
|
t_ch_fee1.DataSet['³ßÂë']:=aQuery['³ßÂë'];
|
|
t_ch_fee1.DataSet['»õÎïÃèÊö']:=aQuery['»õÎïÃèÊö'];
|
|
t_ch_fee1.DataSet['ÊÇ·ñÉú³É']:=0;
|
|
|
|
|
|
if s_w(4,aQuery.fieldbyname('ÖØÁ¿').asfloat/1000)>aQuery.fieldbyname('³ßÂë').asfloat then
|
|
begin
|
|
if s_w(4,aQuery.fieldbyname('ÖØÁ¿').asfloat/1000)>1 then
|
|
t_ch_fee1.DataSet['¼Æ·Ñ¶Ö']:=s_w(4,aQuery.fieldbyname('ÖØÁ¿').asfloat/1000)
|
|
else
|
|
t_ch_fee1.DataSet['¼Æ·Ñ¶Ö']:=1;
|
|
end
|
|
else
|
|
begin
|
|
if aQuery.fieldbyname('³ßÂë').asfloat>1 then
|
|
t_ch_fee1.DataSet['¼Æ·Ñ¶Ö']:=aQuery.fieldbyname('³ßÂë').asfloat
|
|
else
|
|
t_ch_fee1.DataSet['¼Æ·Ñ¶Ö']:=1;
|
|
end;
|
|
|
|
|
|
t_ch_fee1.DataSet['CFSCHARGE']:=0;
|
|
t_ch_fee1.DataSet['CHC']:=0;
|
|
t_ch_fee1.DataSet['DOFEE']:=0;
|
|
t_ch_fee1.DataSet['YASEBS']:=0;
|
|
t_ch_fee1.DataSet['SYSTEMCHARGE']:=0;
|
|
t_ch_fee1.DataSet['OCEANHT']:=0;
|
|
t_ch_fee1.DataSet['RECFSCHARGE']:=0;
|
|
t_ch_fee1.DataSet['RECHC']:=0;
|
|
t_ch_fee1.DataSet['REDOFEE']:=0;
|
|
t_ch_fee1.DataSet['REYASEBS']:=0;
|
|
t_ch_fee1.DataSet['RESYSTEMCHARGE']:=0;
|
|
t_ch_fee1.DataSet['REOCEANHT']:=0;
|
|
|
|
t_ch_fee1.DataSet['REFUNDCBM']:=0;
|
|
|
|
t_ch_fee1.DataSet['REFUNDBL']:=0;
|
|
t_ch_fee1.DataSet['ºÏ¼Æ']:=0;
|
|
t_ch_fee1.DataSet['OTºÏ¼Æ']:=0;
|
|
t_ch_fee1.DataSet['OTFEE1']:=0;
|
|
t_ch_fee1.DataSet['OTFEE2']:=0;
|
|
t_ch_fee1.DataSet['OTFEE3']:=0;
|
|
t_ch_fee1.DataSet['OTFEE4']:=0;
|
|
t_ch_fee1.DataSet['OTFEE5']:=0;
|
|
t_ch_fee1.DataSet['OTFEE6']:=0;
|
|
t_ch_fee1.DataSet['OTFEE7']:=0;
|
|
t_ch_fee1.DataSet['OTFEE8']:=0;
|
|
|
|
|
|
t_ch_project_fee.first;
|
|
while not t_ch_project_fee.eof do
|
|
begin
|
|
if t_ch_project_fee.FieldByName('×Ö¶ÎÃû').AsString<>'' then begin
|
|
if t_ch_fee1.DataSet.FindField(trim(t_ch_project_fee.FieldByName('×Ö¶ÎÃû').AsString))<>nil then begin
|
|
if trim(t_ch_project_fee.FieldByName('×Ö¶ÎÀàÐÍ').AsString)='ĬÈÏ' then begin
|
|
t_ch_fee1.DataSet[t_ch_project_fee.FieldByName('×Ö¶ÎÃû').AsString]:=t_ch_project_fee['ĬÈÏÖµ'];
|
|
end;
|
|
end;
|
|
end;
|
|
t_ch_project_fee.Next;
|
|
end;
|
|
|
|
t_ch_fee1.DataSet.post;
|
|
aQuery.next;
|
|
end;
|
|
finally
|
|
FreeAndNil(aQuery);
|
|
end;
|
|
|
|
close;
|
|
end;
|
|
|
|
end.
|