How r u proofing your cash account balance using your entries ? I think it should be as follows :

Mth 1
Dr Cash 500 (from A)
Dr Account receivable 500 (from B)
Cr Capital 1000

Mth 2
Dr Salary Expense 100 (from B)
Cr Account receivable (now rec'able left 400)

Same entry till receivable become nil. Subsequent entry back to normal expense entry.