Feature request from ytorbyk, posted on GitHub Oct 03, 2016
P.S. As improvement it would be nice to have an ability to show Invoice ID in credit memo grid additionally to Order ID.
Comment from ytorbyk, posted on GitHub Oct 06, 2016
Here is pull request for the issue https://github.com/magento/magento2/pull/6902
Comment from SerhiyShkolyarenko, posted on GitHub Oct 20, 2016
@YTorbyk Thank you for your contribution to Magento!
I performed all the steps you described, after step 5 i settled both transactions and continued step 6.
I checked sales_creditmemo table and found that invoice_id field contains correct invoice id.
Here is a data dump of my sales_creditmemo table:
INSERT INTO `sales_creditmemo` VALUES (1,1,0.0000,0.0000,0.0000,0.0000,1.0000,18.2000,0.0000,3.2000,15.0000,3.2000,0.0000,15.0000,0.0000,1.0000,0.0000,3.2000,0.0000,3.2000,0.0000,18.2000,0.0000,0.0000,0.0000,0.0000,1,NULL,NULL,NULL,2,1,2,1,'USD','USD','USD','USD','p068fdg0-refund','000000001','2016-10-20 15:00:53','2016-10-20 15:00:53',0.0000,0.0000,NULL,NULL,15.0000,15.0000,NULL,NULL,NULL),(2,1,0.0000,0.0000,0.0000,0.0000,1.0000,6.4000,0.0000,6.4000,0.0000,6.4000,0.0000,0.0000,0.0000,1.0000,0.0000,6.4000,0.0000,6.4000,0.0000,6.4000,0.0000,0.0000,0.0000,0.0000,1,NULL,NULL,NULL,2,1,2,2,'USD','USD','USD','USD','qqxfge0p-refund','000000002','2016-10-20 15:01:58','2016-10-20 15:01:58',0.0000,0.0000,NULL,NULL,0.0000,0.0000,NULL,NULL,NULL);
Am I doing anything wrong?
Comment from ytorbyk, posted on GitHub Oct 30, 2016
@SerhiyShkolyarenko This is very weird. I retested it on the develop branch again and I have another result.
Comment from SerhiyShkolyarenko, posted on GitHub Oct 31, 2016
@YTorbyk have you settled transaction after placing order?
Could you please put your credentials to this script and settle transaction with it?
Transaction id should be a parameter of the script.
Offline refunds(credit memos) are not associated with invoices 1:1
It's possible to refund several invoices with one offline refund transaction, so in this case invoice_id will be NULL in sales_credit_memo record.
Comment from SerhiyShkolyarenko, posted on GitHub Nov 01, 2016
@YTorbyk we analyzed our offline refunding again and concluded it needs improvement. After implementing story MAGETWO-60332 our credit memos will be bound strictly to invoices.
Thank you for taking part.