Solved

Sales qty in fixed multiples

  • 28 September 2021
  • 3 replies
  • 295 views

Userlevel 5
Badge +11

Hi,

On the sales part it is possible to set a minimum sales qty, but is it also possible to set the sales qty as a fixed multiple. For example, you can only order multiples of 100 (100 - 200 - 300 -...) and not 250 for example?

I would think there would be a standard field for something like this but I can’t seem to find it.

 

Best Regards

Roel Timmermans

icon

Best answer by durette 28 September 2021, 18:16

View original

3 replies

Userlevel 7
Badge +18

Create a custom field on SalesPart called PACKAGE_QUANTITY, of type Number

 

Create a Custom Event called VALIDATE_PACKAGE_QUANTITY, on LU CustomerOrderLine and table CUSTOMER_ORDER_LINE_TAB. Fire on new or changed objects, when BUY_QTY_DUE is changed. Expose the new values of BUY_QTY_DUE, CONTRACT, and CATALOG_NO.

 

Create a new Event Action, of type “Execute Online SQL”.

DECLARE
package_quantity_ NUMBER;
BEGIN
BEGIN
SELECT sp.cf$_package_quantity
INTO package_quantity_
FROM sales_part_cfv sp
WHERE sp.contract = '&NEW:CONTRACT'
AND sp.catalog_no = '&NEW:CATALOG_NO';
EXCEPTION
WHEN NO_DATA_FOUND THEN NULL;
END;
IF package_quantity_ IS NULL THEN
RETURN;
END IF;
IF MOD(&NEW:BUY_QTY_DUE, package_quantity_) != 0 THEN
error_sys.record_general(
'CustomerOrderLine',
'BADPACKAGEQTY: Part number :P1 must be sold in lots of :P2 per Acme business rules.',
'&NEW:CATALOG_NO',
package_quantity_);
END IF;
END;

 

Userlevel 5
Badge +11

Hi @Manoj Balasooriya,

 

I’ve looked at the other topic. The topic question is indeed identical. I’m not so happy with the response though. It seems a complex workaround for something that seems pretty simple and should be standard functionality in my opinion.

 

Some other workarounds I thought about was using ‘Package Part’ with UoM in Pcs, and having my actual sales part as a component with a fixed qty. Or having another salespart, also with UoM = pcs and set into the description the standard qty like ‘Bottle of 25kg’.

 

is there no ‘cleaner’ alternative?

 

Best Regards

Roel Timmermans

Userlevel 6
Badge +14

Hi, please check whether you can get any help from the answer in below question.

 

Reply