Nad023:
1- I got 0 from the customer
2- I got 500 from the neighbor
3- I paid 400 to customer
4- I gave material of 100
5- I paid 500 to neighbor
so total received is (2) = 500
total paid is (3, 4 & 5) = 1000
therefore loss is received - paid = 500