All Accepted or All Rejected for Purchase Receipt Item?

Hello,

Is there a way to change Purchase Receipt Items so that all items are either accepted or rejected? Our process is to assign any rejected stock a different Lot number, to segregate the items until investigated, so have an accepted and rejected quantity for the same Lot number doesn’t work as an approach.

So what I’d like to do is to change the Purchase Receipt Item, so that:

  • if you put a number in the Accepted column it automatically zeroes the amount in the Rejected column
  • vice versa if a number is entered in the Rejected column the Accepted column is zeroed.

Can I achieve this via customisation or do I need a look at trying to make a client script?

Thanks,
Paul

Hi @pmjd,

Please try it. If comfortable with it then use it.

frappe.ui.form.on('Purchase Receipt Item', {
	qty: function(frm, cdt, cdn) {
		var d = locals[cdt][cdn];
		d.rejected_qty = 0;
		frm.refresh_field('items');
	},
	rejected_qty: function(frm, cdt, cdn) {
		var d = locals[cdt][cdn];
		d.qty = 0;
		frm.refresh_field('items');
	}
});

Then reload and check it.

Thank You!

1 Like

Thank you very much, it’s working perfectly!