Need In Sales Invoice, Get Item from Delivery Note depends on "Proof Of Delivery Date(PoD) " field of Delivery Note

I have "Proof Of Delivery Date(PoD) " field in Delivery Note and PoD update after making delivery note. When I select get item from delivery note and if Proof of delivery date(PoD) is less than Invoice Date and not billed then it Should appear in sales invoice.

If PoD has not been received then it should not insert row in to Sales Invoice Item.

Delivery Note #: DN-00001
Delivery Note Date: 01-FEB-2016
PoD Date: 10-FEB-2016 (It has been updated after making Delivery Note)

Invoice Date : 23-FEB-2015

Thanks
Mithilesh

I am waiting. Please resolve this issue.

Thanks
Mithilesh

Add custom field using Customize Form and custom script (example: https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/date-validation.html)

Hi Anand,

I wrote the following script but it does not work.

cur_frm.add_fetch(“delivery_note”, “pod_date”, “pod_date”);

frappe.ui.form.on(“Sales Invoice”, “validate”, function(frm) {

if (frm.doc.pod_date > frm.doc.posting_date) {
msgprint(“PoD Date Can Not Be Greater Than Invoice Date”);
validated = false;
}
if (frm.doc.pod_date==""){
msgprint(“PoD To Be Received”);
validated = false;
}
});