Get Data From popup child table data customization

As we know in Delivery Note doctype we have a button name ‘Get Data From’. when we clicked this button then dropdown show ‘Sales Order’ button. After click on ‘Sales Order’ button then a popup window show with data. There is a checkbox ‘Select Sales Order Item’. If we click this then all the child table row will show below.

I need two customization here.

  1. if any item already delivered with required quantity then this specific item should not show in popupwindow data.
  2. If any item delivered partially, then I want to show remaining qty in there.