After creating(saving/submitting) Sales Order, delivery_date and total_qty


I need help to create server/client script for delivery_date field in Sales Order.

I want to deliver 10 items everyday.

So, If there are 10 Items in 3 different Sales Order and delivery date is same then for next Sales Order, that respective delivery date should be disabled.

There are two field in doctype Sales Order total_qty and delivery_date

If there are 9 items booked for delivery on 09/08/2023, and new sales orders has 2 items then 09/08/2023 will be disabled and all future dates will be available.