I have to edit the quantity of some items programmatically in Magento.
Say a customer ordered for 5 kg of Apples and 10 qantity of pens. But then he rejects 1 kg of apple and 5 pens because of say poor quality or whatsoever the reason. So i need to update them in my credit memo and the price should also automatically update accordingly along with taxes and everything so that customer has to pay for 4 kg of apples and 5 pens only. How to apply this functionality to magento programmatically?
I am using magento 18.104.22.168 version.
Please help me. I am a novice in magento and I am stuck at this point. Thankyou in advance!!