All Accepted or All Rejected for Purchase Receipt Item?


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?


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;
	rejected_qty: function(frm, cdt, cdn) {
		var d = locals[cdt][cdn];
		d.qty = 0;

Then reload and check it.

Thank You!

1 Like

Thank you very much, it’s working perfectly!