System allows posting of more than one credit note against same invoice

Hi,

I face an issue where at times my system allows me to post a credit note more than once against the same invoice.

for eg. i have total 10 quantity of item A.

I deliver 5 with invoice number INV001

and later deliver remaining 5 with invoice number INV002.

Now I post a credit note of quantity 5 against INV002, thus i have only 5 quantity remaining of that item.

Now again when i post credit note of quantity of 5 against the same INV002(instead of INV001), the system allows me even if the quantity is invalid with INV002. But that quantity is available in INV001.

Why is this so ? I’m confused. O_o