Some costs that the entity incurs during a period may be debited to more than one expense or asset account. For example, if you separate the entity into "departments," some of the general and administrative costs may be attributable to several departments. In principle, some fraction of the costs that are incurred for various purposes should be charged to each of these purposes. The process for doing this is called cost allocation.
The basis of cost allocation is that each purpose should bear its fair share of the total cost. However, the allocation of costs may not be worth the bookkeeping effort involved in making the allocations. Charge each department only with the expenses that can be directly traced to that department. Record all other expenses as general expenses, and do not try to allocate them to departments. These other expenses are called overhead.
To allocate costs, consult a book on cost accounting.