Account Strings Trial Balance Import

These steps are used when importing a trial balance and the Account Strings have already been parsed in the Account Strings table.

1.  Truncate table “aa_mi_bsa_import”.

2.  Import trial blance into the “aa_mi_bsa_import” table.

3.  Update the Local Unit Name, Year and AndID if they are not already: UPDATE aa_mi_bsa_import SET ImpAndID = 54331, FiscalYear = 2016, LocalUnitName = 'Grosse Pointe Woods';

4.  Update the Local Unit Fund Code first: UPDATE aa_mi_bsa_import JOIN c_luaccountstrings ON ImpAccountString = LasAccountString SET ImpLfcID = LasLfcID , ImpSection = LasSection, ImpMunID = 176 WHERE LasMunID = 176;

5.  Check to see if any are missing: SELECT * FROM aa_mi_bsa_import WHERE ImpLfcID IS NULL;

6.  Update the State Fund Code: UPDATE aa_mi_bsa_import JOIN c_lufundcodes ON LfcID = ImpLfcID SET ImpFtsID = LfcFtsID WHERE LfcMunID = 176;

7.  Check to see if any State Fund Codes are missing: SELECT * FROM aa_mi_bsa_import WHERE ImpFtsID IS NULL;

8.  Update the National Fund Code ID: UPDATE aa_mi_bsa_import JOIN c_fundtypestatecodes ON FtsID = ImpFtsID JOIN m_fundtype ON FutID = FtsFutID SET ImpFutID = FutID;

9.  Check to see if any National Fund Codes are missing: SELECT * FROM aa_mi_bsa_import WHERE ImpFutID IS NULL;

10. Update the State Function Codes SscID: UPDATE aa_mi_bsa_import JOIN c_luaccountstrings ON LasAccountString = ImpAccountString JOIN c_lucostcenters ON LccID = LasLccID SET ImpSscID = LccSscID, ImpFddLccID = LccID;

11. Check to see if any State Function Codes SscIDs are missing: SELECT * FROM aa_mi_bsa_import WHERE ImpSscID IS NULL;

12. Insert the new records: INSERT INTO m_financialdatadetail (FddAndID, FddFutID, FddFtsID, FddLfcID, FddSscID, FddLccID, FddAccountString, FddAmount, FddComment, FddDateAdded, FddDateModified) SELECT ImpAndID, ImpFutID, ImpFtsID, ImpLfcID, ImpSscID, ImpFddLccID, ImpAccountString, ImpAmount, ImpDescription, NOW(), NOW() FROM aa_mi_bsa_import WHERE ImpAmount <> 0;