        AD71 = DSum(VNDCKNO ; KTTK; Left(Matk,3) = '111') - DSum(VNDCKNO ; KTTK; Left(Matk,3) = '112') 
        AD72 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '112')
        AD73 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '113')

        AR71 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '111')
        AR72 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '112')
        AR73 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '113')

        AD78 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '121')
        AD79 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '128')
        AD80 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '129')

        AR78 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '121')
        AR79 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '128')
        AR80 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '129')


        AD85 = 0
        AD86 = 0
        AD87 = 0
        AD89 = 0

        AR85 = 0
        AR86 = 0
        AR87 = 0
        AR89 = 0

        'Hàng tồn kho
        AD93 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '151')
        AD94 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '152')
        AD95 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '153')
        AD96 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '154')
        AD97 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '155')
        AD98 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '156')
        AD99 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '157')
        AD100 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '158')
        AD101 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '159')


        AR93 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '151')
        AR94 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '152')
        AR95 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '153')
        AR96 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '154')
        AR97 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '155')
        AR98 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '156')
        AR99 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '157')
        AR100 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '158')
        AR101 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '159')

        'Thuế và các khoản phải thu nhà nước
        AD109 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '133')
        AD110 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3332')
        AD111 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3333')
        AD112 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3334')
        AD113 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3335')
        AD114 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3336')
        AD115 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3337')
        AD116 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3338')
        AD117 = DSum(VNDDUNO ; KTTK ; Left(Matk,4) = '3339')


        'Thuế và các khoản phải thu nhà nước
        AR109 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '133')
        AR110 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3332')
        AR111 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3333')
        AR112 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3334')
        AR113 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3335')
        AR114 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3336')
        AR115 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3337')
        AR116 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3338')
        AR117 = DSum(VNDCKNO ; KTTK ; Left(Matk,4) = '3339')

        'Phải thu dài hạn khác
        AD134 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '244')
        AD135 = 0
        AD136 = 0
        AD137 = 0


        AR134 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '244')
        AR135 = 0
        AR136 = 0
        AR137 = 0

        'Số dư đầu năm
	
        	U143 = DSum(VNDDUNO ; KTTK ; Matk = '2111')
        	AA143 = DSum(VNDDUNO ; KTTK ; Matk = '2112')
        	AG143 = DSum(VNDDUNO ; KTTK ; Matk = '2113')
        	AM143 = DSum(VNDDUNO ; KTTK ; Matk = '2114')
        	AS143 = DSum(VNDDUNO ; KTTK ; Matk = '2118')
        	AY143 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '211')

        'Mua trong năm
        U144 = DSum(TTVND ; KTSC ; TKNO= '2111' AND LEFT(TKCO,3) <> '241')
        AA144 = DSum(TTVND ; KTSC ; TKNO = '2112' AND LEFT(TKCO,3) <> '241')
        AG144 = DSum(TTVND ; KTSC ; TKNO = '2113' AND LEFT(TKCO,3) <> '241')
        AM144 = DSum(TTVND ; KTSC ; TKNO = '2114' AND LEFT(TKCO,3) <> '241')
        AS144 = DSum(TTVND ; KTSC ; TKNO = '2118' AND LEFT(TKCO,3) <> '241')
        AY144 = DSum(TTVND ; KTSC ; LEFT(TKNO,3) = '211' AND LEFT(TKCO,3) <> '241')

        'Đầu tư xây dựng cơ bản hoàn thành
        U145 = DSum(TTVND ; KTSC ; TkNo = '2111' And Left(Tkco,3)='241')
        AA145 = DSum(TTVND ; KTSC ; TkNo = '2112' And Left(Tkco,3)='241')
        AG145 = DSum(TTVND ; KTSC ; TkNo = '2113' And Left(Tkco,3)='241')
        AM145 = DSum(TTVND ; KTSC ; TkNo = '2114' And Left(Tkco,3)='241')
        AS145 = DSum(TTVND ; KTSC ; TkNo = '2118' And Left(Tkco,3)='241')
        AY145 = DSum(TTVND ; KTSC ; Left(TkNo,3) = '211' And Left(Tkco,3)='241')

        'Tăng khác
        U146 = 0
        AA146 = 0
        AG146 = 0
        AM146 = 0
        AS146 = 0
        AY146 = 0

        'Chuyển sang bất động sản đầu tư
        U147 = 0
        AA147 = 0
        AG147 = 0
        AM147 = 0
        AS147 = 0
        AY147 = 0

        'Thanh lý nhượng bán
        U148 = DSum(TTVND ; KTSC ; TkCo = '2111' And Left(TkNo,3)='811')
        AA148 = DSum(TTVND ; KTSC ; TkCo = '2112' And Left(TkNo,3)='811')
        AG148 = DSum(TTVND ; KTSC ; TkCo = '2113' And Left(TkNo,3)='811')
        AM148 = DSum(TTVND ; KTSC ; TkCo = '2114' And Left(TkNo,3)='811')
        AS148 = DSum(TTVND ; KTSC ; TkCo = '2118' And Left(TkNo,3)='811')
        AY148 = DSum(TTVND ; KTSC ; Left(TkCo,3) = '211' And Left(TkNo,3)='811')

        'Giảm khác
        U149 = 0
        AA149 = 0
        AG149 = 0
        AM149 = 0
        AS149 = 0
        AY149 = 0

        'Số dư cuối năm
        U150 = DSum(VNDCKNO ; KTTK; Matk = '2111')
        AA150 = DSum(VNDCKNO ; KTTK ; Matk = '2112')
        AG150 = DSum(VNDCKNO ; KTTK ; Matk = '2113')
        AM150 = DSum(VNDCKNO ; KTTK ; Matk = '2114')
        AS150 = DSum(VNDCKNO ; KTTK ; Matk = '2118')
        AY150 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '211')

        'Giá trị hao mòn lũy kế
        'Số dư đầu năm
        AY152 = DSum(VNDDUCO ; KTTK ; Matk = '2141')
        AY157 = DSum(VNDCKCO ; KTTK ; Matk = '2141')
        AY159 = DSum(VNDDUNO ; KTTK ; Left(Matk,3) = '211') - DSum(VNDDUCO ; KTTK; Left(Matk,3) = '214')
        AY160 = DSum(VNDCKNO ; KTTK ; Left(Matk,3) = '211') - DSum(VNDCKCO ; KTTK; Left(Matk,3) = '214')
        

        'Thuế và các khoản phải nộp cho nhà nước
        AD291 = DSum(VNDCKCO ; KTTK; Matk = '33311') - DSum(VNDCKNO ; KTTK ; Matk = '33311')
        AD292 = DSum(VNDCKCO ; KTTK ; Matk = '3332') - DSum(VNDCKNO ; KTTK ; Matk = '3332')
        AD293 = DSum(VNDCKCO ; KTTK ; Matk = '3333') - DSum(VNDCKNO ; KTTK ; Matk = '3333')
        AD294 = DSum(VNDCKCO ; KTTK ; Matk = '3334') - DSum(VNDCKNO ; KTTK ; Matk = '3334')
        AD296 = DSum(VNDCKCO ; KTTK ; Matk = '3336') - DSum(VNDCKNO ; KTTK ; Matk = '3336')
        AD297 = DSum(VNDCKCO ; KTTK ; Matk = '3337') - DSum(VNDCKNO ; KTTK ; Matk = '3337')
        AD298 = DSum(VNDCKCO ; KTTK ; Matk = '3338') - DSum(VNDCKNO ; KTTK ; Matk = '3338')
        AD299 = DSum(VNDCKCO ; KTTK ; Matk = '3339') - DSum(VNDCKNO ; KTTK ; Matk = '3339')
        

        AR291 = DSum(VNDDUCO ; KTTK ; Matk = '33311') - DSum(VNDDUNO ; KTTK ; Matk = '33311')
        AR292 = DSum(VNDDUCO ; KTTK ; Matk = '3332') - DSum(VNDDUNO ; KTTK ; Matk = '3332')
        AR293 = DSum(VNDDUCO ; KTTK ; Matk = '3333') - DSum(VNDDUNO ; KTTK ; Matk = '3333')
        AR294 = DSum(VNDDUCO ; KTTK ; Matk = '3334') - DSum(VNDDUNO ; KTTK ; Matk = '3334')
        AR296 = DSum(VNDDUCO ; KTTK ; Matk = '3336') - DSum(VNDDUNO ; KTTK ; Matk = '3336')
        AR297 = DSum(VNDDUCO ; KTTK ; Matk = '3337') - DSum(VNDDUNO ; KTTK ; Matk = '3337')
        AR298 = DSum(VNDDUCO ; KTTK ; Matk = '3338') - DSum(VNDDUNO ; KTTK ; Matk = '3338')
        AR299 = DSum(VNDDUCO ; KTTK ; Matk = '3339') - DSum(VNDDUNO ; KTTK ; Matk = '3339')
        

        'Phải trả phải nộp khác
        AD312 = DSum(VNDCKCO ; KTTK ; Matk = '3381') - DSum(VNDCKNO ; KTTK ; Matk = '3381')
        AD313 = DSum(VNDCKCO ; KTTK ; Matk = '3382') - DSum(VNDCKNO ; KTTK ; Matk = '3382')
        AD314 = DSum(VNDCKCO ; KTTK ; Matk = '3383') - DSum(VNDCKNO ; KTTK ; Matk = '3383')
        AD315 = DSum(VNDCKCO ; KTTK ; Matk = '3384') - DSum(VNDCKNO ; KTTK ; Matk = '3384')
        AD316 = DSum(VNDCKCO ; KTTK ; Matk = '3385') - DSum(VNDCKNO ; KTTK ; Matk = '3385')
        AD317 = DSum(VNDCKCO ; KTTK ; Matk = '3386') - DSum(VNDCKNO ; KTTK ; Matk = '3386')
        AD318 = DSum(VNDCKCO ; KTTK ; Matk = '3387') - DSum(VNDCKNO ; KTTK ; Matk = '3387')
        AD319 = DSum(VNDCKCO ; KTTK ; Matk = '3387') - DSum(VNDCKNO ; KTTK ; Matk = '3387')
        


        AR312 = DSum(VNDDUCO ; KTTK ; Matk = '3381') - DSum(VNDDUNO ; KTTK ; Matk = '3381')
        AR313 = DSum(VNDDUCO ; KTTK ; Matk = '3382') - DSum(VNDDUNO ; KTTK ; Matk = '3332')
        AR314 = DSum(VNDDUCO ; KTTK ; Matk = '3383') - DSum(VNDDUNO ; KTTK ; Matk = '3333')
        AR315 = DSum(VNDDUCO ; KTTK ; Matk = '3384') - DSum(VNDDUNO ; KTTK ; Matk = '3334')
        AR316 = DSum(VNDDUCO ; KTTK ; Matk = '3385') - DSum(VNDDUNO ; KTTK ; Matk = '3335')
        AR317 = DSum(VNDDUCO ; KTTK ; Matk = '3386') - DSum(VNDDUNO ; KTTK ; Matk = '3336')
        AR318 = DSum(VNDDUCO ; KTTK ; Matk = '3387') - DSum(VNDDUNO ; KTTK ; Matk = '3337')
        AR319 = DSum(VNDDUCO ; KTTK ; Matk = '3388') - DSum(VNDDUNO ; KTTK ; Matk = '3338')
        

        'Tổng doanh thu bán hàng và cung cấp dịch vụ
        AD449 = DSum(TTVND; KTSC ;LEFT(TKCO,3) = '511')
        AD450 = 0
        AD451 = 0

        'Các khoản giảm trừ doanh thu
        AD455 = DSum(TTVND; KTSC ; LEFT(TKNO,3) = '521')
        AD456 = DSum(TTVND; KTSC ; LEFT(TKNO,3) = '531')
        AD457 = DSum(TTVND; KTSC ; LEFT(TKNO,3) = '532')
        AD458 = 0
        AD459 = 0
        AD460 = 0


        'Giá vốn hàng bán
        AD469 = DSum(TTVND ; KTSC ; TKNO = '632' AND LEFT(TKCO,3) IN ('152','156'))
        AD470 = DSum(TTVND ; KTSC ; TKNO = '632' AND LEFT(TKCO,3)='155')
        AD471 = 0
        AD472 = 0
        AD473 = 0
        AD474 = 0
        AD475 = 0
        AD476 = 0
        AD477 = 0


        'Chi phí sản xuất kinh doanh theo yếu tố
        AD520 = DSum(TTVND; KTSC ; LEFT(TKNO,3) = '152')
        AD521 = DSum(TTVND; KTSC ; LEFT(TKNO,3) = '622')
        AD522 = DSum(TTVND; KTSC ; LEFT(TKCO,3) = '214' And LEFT(TkNO,1)='6')
        AD523 = DSum(TTVND; KTSC ; TKNO = '6417' Or TKNO = '6427')
        AD524 = DSum(TTVND; KTSC ; TKNO = '6418' Or TKNO = '6428')
      