I have a situation where we want to generate a purchase receipt without bringing in the item from the PO.
We want to be able to scan in the items into the Purchase Receipt one by one. We however still want to be able to reference the PR to the PO to enable us know what quantities have been received and which ones are outstanding on the PO.
We created a custom field in the PR form and linked it to PO doctype
We then created a custom script on the PR page as below
frappe.ui.form.on(“Purchase Receipt”, “validate”, function(frm,cdt,cdn) {
$.each(frm.doc.items,
function(i,v) {
if (frm.doc.purchase_order_no) {
v.purchase_order = frm.doc.purchase_order_no;
}
})
frm.refresh_field(“items”);
});
While this appears to attach the PR to the PO (we see the PR in the PO’s dashboard) it does not update the quantity received column of the item in the PO, this defeats the purpose.
Any idea what else can be done ? Or is there any alternative?
The use case scenario is for a wholesaler who orders hundreds of items on one PO, it is very cumbersome to bring in all the items from the PO into the PR and then start scrolling up and down to key in the physical items received. It is more convenient to scan the items as seen into the PR and then link this to the PO.
Any solution will be very appreciated