Here are the various options available for defining account numbers in the historical data item.

A - Get the account number from account actually entered in the account mask field.  
D - Get the department portion of account number from the value of .H DEPT on the employee's record; get the remaining portion of account number from the account mask below.
G - Get the Gla portion of account number from the value of .H GLA on the employee's record; get remaining portion of account number from the account mask.
B - Get both the depart and Gla portions of account number for .H GLA and .H DEPT on the employee's record.
X - Prorate amounts and use the accounts from data items listed
H - Prorate on hours and use the accounts from data items listed
Note: There are several rules as to precedence between Account Mask, .H GLA, .H DEPT and .costcode.  For options A,B,D,G , the precedence is always the same

Precedence rules:
1.  If the account mask has a number in any position of the account structure, that number is always used.
2.  If .H DEPT has a number in any position of the account structure, it is used before .H GLA and .costcode but not before the number in the account mask.
3.  If .H GLA has a number in any position of the account structure, it is used before .costcode but not before the number in .H DEPT and/or the account mask.

Example:
Account Mask = 77 77-77 7777
.H DEPT = 88 88-88 8888
.H GLA = 66 66-66 6666
.costcode = 44 44-44 4444
Results = 77 77-77 7777
Example:
Account Mask = 77 77-77 XXXX
.H DEPT = 88 88-88 8888
.H GLA = 66 66-66 6666
.costcode = 44 44-44 4444
Results:  77 77-77 8888
Example:
Account Mask = 77 77-77 XXXX
.H DEPT = 88 88-88 XXXX
.H GLA = 66 66-66 6666
.costcode = 44 44-44 4444
Results:  77 77-77 6666
Example:
Account Mask = 77 77-77 XXXX
.H DEPT = 88 88-88 XXXX
.H GLA = 66 66-66 XXXX
.costcode = 44 44-44 4444
Results:  77 77-77 4444
Basically, it ignores what appears to be the rules from the description of the option and follows this precedence regardless of whether it's option A, B, D or G.  The proration options work differently as they do not look at any information on the employee's record or on the time card, but rather from resolved accounts on other data items.
 
The account number precedence rules are established in field 6 of the historical data item screen as below: