Validation on Quantity field of the Purchase Invoice screen

By | October 27, 2023

In Sage X3, validating the quantity field in a Purchase Invoice screen is important to ensure data accuracy and prevent errors in your accounting or inventory management system.
Recently we had a requirement to add validation on the quantity field in the Purchase Invoice screen in such a way that, If the Purchase Order is created with some quantity, then the purchase invoice should not exceed the purchase order quantity it should be equal or less then the Purchase order qty. If the user tries to create more the Purchase Invoice with the quantity greater than the PO’s quantity, then the system should restrict the user to create the Purchase Invoice and Pop up message should be displayed on the Purchase Invoice screen.

So, to achieve this validation, Sage X3 has inbuild feature of 3 way PO matching by applying tolerance percentage to Supplier or products or Product-Supplier. Tolerance refers to the allowable variation or deviation between the quantities and prices on a purchase order, the actual goods received (receipts), and the corresponding supplier invoices. This feature is crucial for ensuring that your financial records accurately reflect your transactions, even when there are minor discrepancies or variations in the quantities or prices. But when users are trying to import bulk invoices using import template function this 3 way po matching tolerance feature seems to be not blocking the invoices which should block when quantities are more than purchase order quantities. So, to achieve this feature for import templates, we had to add additional validation to the invoice screen and customized the warning/blocking message as per user requirement.

New Stuff: Invoicing Elements Customization for Purchase

Navigate : Purchasing -> Orders -> Order

Fig 1 -Purchase Order
Fig 1 -Purchase Order

As shown in the above screenshot, we have created the purchase order with the Quantity “5” and Gross price “500”.

Navigate : Purchasing -> Invoices -> Invoice

Fig 2 - Purchase Invoice Modified qty
Fig 2 – Purchase Invoice Modified qty

As shown in the above screenshot, we have selected the purchase order from the left panel of the Purchase invoice screen and as per the standard process data is flowing.
To check whether our validation is working fine or not we have modified the Quantity in the Invoice screen.

Fig 3 - Pop-up 
App
Fig 3 – Pop-up

We have entered 7 quantity instead of 5 and as per our customization the, Pop is getting displayed by the system in the Purchase Invoice screen as we have exceeded the Purchase order quantity. So system will not allow the user to create Invoice.

In case of multiple lines the system will let us know in which line the quantity is exceeding the purchase order.

In this way we have added a validation on quantity field in the Purchase Invoice screen. And this validation will work only when the Purchase Invoice is getting created against the Purchase Order.