?? fcase.pas
字號(hào):
unit FCase;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, ImgList, ActnList, ComCtrls, ToolWin, StdCtrls,
DBCtrlsEh, Mask, ExtCtrls, DBGridEh, DBCtrls, DBLookupEh, Menus,Ime,
cxPC, cxControls;
type
TCaseFrm = class(TForm)
pnlClient: TPanel;
StateLab: TStaticText;
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton5: TToolButton;
ToolButton4: TToolButton;
ToolButton2: TToolButton;
TBCheck: TToolButton;
TBFinish: TToolButton;
ToolButton9: TToolButton;
ToolButton7: TToolButton;
ToolButton8: TToolButton;
ActList: TActionList;
BNew: TAction;
BCal: TAction;
BSave: TAction;
BCheck: TAction;
BCheckData: TAction;
BQuit: TAction;
BJudges: TAction;
BFinish: TAction;
ImageList: TImageList;
BillHead: TADOQuery;
_BillHead: TDataSource;
_People: TDataSource;
People: TADOQuery;
Status: TADOQuery;
_Status: TDataSource;
GetBrandList: TADOQuery;
GetRate: TADOQuery;
Judge: TADOQuery;
_Judge: TDataSource;
BSecrotory: TAction;
ToolButton3: TToolButton;
GetTaxRate: TADOQuery;
BFirst: TAction;
BPre: TAction;
BNext: TAction;
BLast: TAction;
BtnList: TToolBar;
ToolButton6: TToolButton;
ToolButton10: TToolButton;
ToolButton11: TToolButton;
ToolButton12: TToolButton;
ToolButton13: TToolButton;
CharacterPages: TcxPageControl;
Page_0: TcxTabSheet;
BillForm: TPanel;
Label2: TLabel;
Label4: TLabel;
Label5: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label3: TLabel;
Label14: TLabel;
Label17: TLabel;
Label15: TLabel;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape7: TShape;
Shape8: TShape;
Shape9: TShape;
Shape10: TShape;
Shape11: TShape;
Shape12: TShape;
Shape13: TShape;
Shape17: TShape;
Label18: TLabel;
Label13: TLabel;
EBillDate: TDBDateTimeEditEh;
EPeopleB: TDBEditEh;
EAmountD: TDBNumberEditEh;
EPeopleA: TDBEditEh;
EAmountA: TDBNumberEditEh;
EAmountC: TDBNumberEditEh;
EAmountB: TDBNumberEditEh;
EJudgeA: TDBLookupComboboxEh;
EJudgeB: TDBLookupComboboxEh;
ECaled: TDBCheckBox;
ESecretory: TDBLookupComboboxEh;
EStatus: TDBLookupComboboxEh;
ESecretoryAmount: TDBNumberEditEh;
EBillNo: TDBEditEh;
EJudgeC: TDBLookupComboboxEh;
EMethod: TDBComboBox;
Page_1: TcxTabSheet;
Shape14: TShape;
EJudgeAAmount: TDBNumberEditEh;
Label1: TLabel;
EJudgeBAmount: TDBNumberEditEh;
Shape15: TShape;
Label6: TLabel;
Label16: TLabel;
EJudgeCAmount: TDBNumberEditEh;
Shape16: TShape;
Shape18: TShape;
EAmountAllA: TDBNumberEditEh;
Label19: TLabel;
Label20: TLabel;
EAmountAllB: TDBNumberEditEh;
Shape19: TShape;
Label21: TLabel;
EAmountAllC: TDBNumberEditEh;
Shape20: TShape;
Shape21: TShape;
ETaxA: TDBNumberEditEh;
Label22: TLabel;
ETaxB: TDBNumberEditEh;
Shape24: TShape;
Label25: TLabel;
Label23: TLabel;
ETaxC: TDBNumberEditEh;
Shape22: TShape;
Shape23: TShape;
ETaxD: TDBNumberEditEh;
Label24: TLabel;
Shape25: TShape;
EReceiveA: TDBNumberEditEh;
Label26: TLabel;
Shape26: TShape;
EReceiveB: TDBNumberEditEh;
Label27: TLabel;
Shape27: TShape;
EReceiveC: TDBNumberEditEh;
Label28: TLabel;
Shape28: TShape;
EReceiveD: TDBNumberEditEh;
Label29: TLabel;
Shape29: TShape;
Shape30: TShape;
Shape31: TShape;
DBLookupComboboxEh1: TDBLookupComboboxEh;
Label30: TLabel;
Label31: TLabel;
DBLookupComboboxEh2: TDBLookupComboboxEh;
Label32: TLabel;
DBLookupComboboxEh3: TDBLookupComboboxEh;
GetPayRate: TADOQuery;
DBNumberEditEh1: TDBNumberEditEh;
DBNumberEditEh2: TDBNumberEditEh;
DBNumberEditEh3: TDBNumberEditEh;
DBNumberEditEh4: TDBNumberEditEh;
DBNumberEditEh5: TDBNumberEditEh;
DBNumberEditEh6: TDBNumberEditEh;
procedure BQuitExecute(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
procedure BNewExecute(Sender: TObject);
procedure EJudgeAEnter(Sender: TObject);
procedure EJudgeAExit(Sender: TObject);
procedure EBillDateExit(Sender: TObject);
procedure EStatusEnter(Sender: TObject);
procedure EStatusExit(Sender: TObject);
procedure EBillDateEnter(Sender: TObject);
procedure BSaveExecute(Sender: TObject);
procedure BJudgesExecute(Sender: TObject);
procedure BCalExecute(Sender: TObject);
procedure BSecrotoryExecute(Sender: TObject);
procedure EAmountCChange(Sender: TObject);
procedure EBillNoKeyPress(Sender: TObject; var Key: Char);
procedure EPeopleAEnter(Sender: TObject);
procedure EPeopleBEnter(Sender: TObject);
procedure BNextExecute(Sender: TObject);
procedure BPreExecute(Sender: TObject);
procedure BFirstExecute(Sender: TObject);
procedure BLastExecute(Sender: TObject);
private
FInterID:Integer;
Function CheckCurrentData: Boolean;
Function SaveBill:Boolean;
Procedure CalAmount;
Procedure GetBill(FInterID:Integer);
{ Private declarations }
public
Constructor Create(AOwner:TComponent;BillID:Integer);Reintroduce;
{ Public declarations }
end;
var
CaseFrm: TCaseFrm;
implementation
{$R *.dfm}
Uses Link,Judge,EMP,CaseList;
//檢驗(yàn)當(dāng)前行數(shù)據(jù)是否完整
Type
TReturnValue=record
FromAmount:Double;
EndAmount:Double;
FEntryID:Integer;
end;
Function TCaseFrm.CheckCurrentData: Boolean;
begin
with BillHead do
Result :=
(Not VarisNull(FieldByName('案號(hào)').Value))
and (Not VarisNull(FieldByName('申請(qǐng)人').Value))
and (Not VarisNull(FieldByName('被申請(qǐng)人').Value))
and (Not VarisNull(FieldByName('標(biāo)的').Value))
and (Not VarisNull(FieldByName('反請(qǐng)求標(biāo)的').Value))
and (Not VarisNull(FieldByName('仲裁受理費(fèi)').Value))
and (Not VarisNull(FieldByName('反請(qǐng)求受理費(fèi)').Value))
and
(
(
(Not VarisNull(FieldByName('首席仲裁員').Value)) And
(VarisNull(FieldByName('仲裁員一').Value)) And (VarisNull(FieldByName('仲裁員二').Value))
)
OR
(
(Not VarisNull(FieldByName('首席仲裁員').Value)) And
(Not VarisNull(FieldByName('仲裁員一').Value)) And (Not VarisNull(FieldByName('仲裁員二').Value))
)
)
end;
Procedure TCaseFrm.CalAmount;
Var Amount:Double; //受理費(fèi)總額:受理費(fèi)+反請(qǐng)求受理費(fèi)
LowAmount:Double;//當(dāng)前擋的起始金額
CalType:Integer; //計(jì)算類型
JudgeCounts:Integer;//仲裁員人數(shù)
Rate:Double;//比例
Limits:Double;//速加數(shù)
Amount0,Amount1,Amount2,Amount3:Double ; //總報(bào)酬,首席,第二,秘書(shū)處
Rate1,Rate2,Rate3:Double;
TaxRate1,TaxRate2,TaxRate3:Double;
PayRate1,PayRate2:Double;// 支付比例
AllAmount1,AllAmount2,AllAmount3:Double ; //首席,第二計(jì)稅總額
Tax1,Tax2,Tax3,Tax4,Tax11,Tax22,Tax33:Double;//應(yīng)繳稅額
ActAmount1,ActAmount2,ActAmount3,ActAmount4:Double ;//稅后所得
ActAmount11,ActAmount22,ActAmount33:Double; //仲裁員上繳秘書(shū)處
Begin
//獲得仲裁員人數(shù)
JudgeCounts:=0;
If (EJudgeB.Text='') AND (EJudgeC.Text='') Then
JudgeCounts:=1;
If (EJudgeB.Text<>'') AND (EJudgeC.Text<>'') Then
JudgeCounts:=3;
//獲得計(jì)算類型
If BillHead.FieldByName('計(jì)算類型').AsString='按高限計(jì)算' Then
CalType:=1
Else if BillHead.FieldByName('計(jì)算類型').AsString='按中限計(jì)算' Then
CalType:=2
Else If BillHead.FieldByName('計(jì)算類型').AsString='按低限計(jì)算' Then
CalType:=3
Else CalType:=0;
If CalType=0 Then
Begin
Application.MessageBox('仲裁員報(bào)酬計(jì)算方式不明確,請(qǐng)檢查!','提示',MB_ICONInformation);
Exit;
End;
If JudgeCounts=0 Then
Begin
Application.MessageBox('仲裁員登記有問(wèn)題,請(qǐng)檢查!','提示',MB_ICONInformation);
Exit;
End;
Amount:=BillHead.FieldByName('仲裁受理費(fèi)').Value+BillHead.FieldByName('反請(qǐng)求受理費(fèi)').Value;
//得到分配比例
GetRate.Active:=False;
GetRate.Parameters.ParamByName('@PeopleCount').Value:=JudgeCounts;
GetRate.Prepared;
GetRate.Open;
Rate1:=GetRate.FieldByName('首席仲裁員比例').Value;
Rate2:=GetRate.FieldByName('第二仲裁員比例').Value;
Rate3:=GetRate.FieldByName('秘書(shū)處比例').Value;
//得到計(jì)稅比例
GetTaxRate.Active:=False;
GetTaxRate.Parameters.ParamByName('@PeopleCount').Value:=JudgeCounts;
GetTaxRate.Prepared;
GetTaxRate.Open;
TaxRate1:=GetTaxRate.FieldByName('首席仲裁員比例').Value;
TaxRate2:=GetTaxRate.FieldByName('第一仲裁員比例').Value;
TaxRate3:=GetTaxRate.FieldByName('第二仲裁員比例').Value;
//得到支付比例
GetPayRate.Active:=False;
GetPayRate.Parameters.ParamByName('@PeopleCount').Value:=JudgeCounts;
GetPayRate.Prepared;
GetPayRate.Open;
PayRate1:=GetPayRate.FieldByName('仲裁員支付比例').Value;
PayRate2:=GetPayRate.FieldByName('秘書(shū)處支付比例').Value;
Try
GetBrandList.Active:=False;
GetBrandList.Active:=True;
While Not GetBrandList.Eof Do
Begin
If (Amount<=GetBrandList.FieldByName('截至金額').Value)And(Amount>GetBrandList.FieldByName('起始金額').Value) Then
Begin
//得到擋數(shù)
case CalType of
1: Begin
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -