# 2008-04-21_195652_Microsoft_Word_-_ThuvienhamtrongVF

Document Sample

```					*Ham tinh bao hiem xa hoi FUNCTION BHXH PARAMETERS LCB, PCCV TINHBHXH=LCB+PCCV IF TINHBHXH>=9000000 TINHBHXH=9000000 ELSE TINHBHXH=TINHBHXH ENDIF TRAVE=TINHBHXH*0.05 RETURN TRAVE ENDFUNC *Ham tinh bao hiem y te FUNCTION BHYT PARAMETERS LCB, PCCV TINHBHYT=LCB+PCCV IF TINHBHYT>=9000000 TINHBHYT=9000000 ELSE TINHBHYT=TINHBHYT ENDIF TRAVE=TINHBHYT*0.01 RETURN TRAVE ENDFUNC *Ham tra ve thu tieng Viet FUNCTION THUTV PARAMETERS HOMNAY DO CASE CASE CDOW(HOMNAY) = "Sunday" TRAVE="Chuû Nhaät" CASE CDOW(HOMNAY) = "Monday" TRAVE="Thöù Hai" CASE CDOW(HOMNAY) = "Tuesday" TRAVE="Thöù Ba" CASE CDOW(HOMNAY) = "Wenesday" TRAVE="Thöù Tö" CASE CDOW(HOMNAY) = "Thusday" TRAVE="Thöù Naêm" CASE CDOW(HOMNAY) = "Friday" TRAVE="Thöù Saùu" OTHERWISE TRAVE="Thöù Baûy" ENDCASE RETURN TRAVE ENDFUNC *Ham tra ve tien lanh khi dao han FUNCTION TIETKIEM PARAMETERS TIENGUI, LAISUAT, KYHAN FOR i=1 TO KYHAN TIENLAI=TIENGUI*LAISUAT TIENLANH=TIENLAI+TIENGUI

ENDFOR RETURN TIENLANH ENDFUNC *Ham tinh tien lanh khi dao han FUNCTION TIENLANH PARAMETERS TIENGUI, KYHAN DO CASE CASE KYHAN=3 TIENLAI=TIENGUI*0.05 CASE KYHAN=6 TIENLAI=TIENGUI*0.06 CASE KYHAN=9 TIENLAI=TIENGUI*0.07 CASE KYHAN=12 TIENLAI=TIENGUI*0.075 CASE KYHAN=24 TIENLAI=TIENGUI*0.09 OTHERWISE TIENLAI=TIENGUI*1.0 ENDCASE TIEN=TIENGUI+TIENLAI RETURN TIEN ENDFUNC *Ham tinh tien dien FUNCTION TIENDIEN PARAMETERS DT,SOVUOT, CSD, CSC TIEUTHU=CSC-CSD DO CASE CASE DT="Sinh hoaït" DM=10 CASE DT="Haønh chính söï nghieäp" DM=30 CASE DT="Saûn xuaát" DM=10 OTHERWISE DM=15 ENDCASE DM=DM+SOVUOT*2 IF TIEUTHU<=DM THEN TRAVE=DM*5000 ELSE TRAVE=(DM*5000)+((TIEUTHU-DM)*8500) ENDIF RETURN TRAVE ENDFUNC *Ham tinh thue thu nhap theo luat thue moi FUNCTION THUETN PARAMETERS THUNHAP, GIAMTRU TINHTHUE=THUNHAP-(4000000+(1600000*GIAMTRU)) IF THUNHAP<=4000000 THEN TRAVE=0

ELSE IF TINHTHUE<=5000000 THEN TRAVE=THUNHAP*0.05 ELSE IF TINHTHUE<=10000000 THEN TRAVE=(5000000*0.05)+((THUNHAP-5000000)*0.07) ELSE IF TINHTHUE<=18000000 THEN TRAVE=(5000000*0.05)+(5000000*0.07)+((THUNHAP10000000)*0.1) ELSE IF TINHTHUE<=32000000 THEN TRAVE=(5000000*0.05)+(5000000*0.07) +(8000000*0.1)+((THUNHAP-18000000)*0.15) ELSE IF TINHTHUE<=52000000 THEN TRAVE=(5000000*0.05)+(5000000*0.07) +(8000000*0.1)+(14000000*0.15)+((THUNHAP-32000000)*0.25) ELSE IF TINHTHUE<=80000000 THEN TRAVE=(5000000*0.05)+ (5000000*0.07)+(8000000*0.1)+(14000000*0.15)+(20000000*0.25)+((THUNHAP-52000000)*0.3) ELSE TRAVE=(5000000*0.05)+ (5000000*0.07)+(8000000*0.1)+(14000000*0.15)+(20000000*0.25)+(28000000*0.3)+ ((THUNHAP-80000000)*0.35) ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF ENDIF RETURN TRAVE ENDFUNC *Ham tinh luong san pham FUNCTION LUONGSP PARAMETERS MASP, SOLUONGSP DO CASE CASE MASP="A" DM=100 DG=15000 CASE MASP="B" DM=200 DG=10000 OTHERWISE DM=400 DG=5000 ENDCASE IF SOLUONGSP<=DM THEN TRAVE=DG*SOLUONGSP ELSE IF SOLUONGSP<=(1.1*DM) THEN

TRAVE=(DG*SOLUONGSP)+((SOLUONGSP-DM)*DG*1.1) ELSE TRAVE=(DG*SOLUONGSP)+((SOLUONGSP1.1*DM)*DG*1.2)+((DM*0.1)*(DG*1.1)) ENDIF ENDIF RETURN TRAVE ENDFUNC

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 7 posted: 10/21/2009 language: Vietnamese pages: 4