Fixing “Not enough stock” error when billing products

Table of Contents

Normally this error occurs because of some error in the scripts updated in “event.setline” under “Resources”

Follow the below steps #

  1. Administration Menu > Maintenance > Resources
  2. Under resources click “event.setline” from the left side list
  3. Copy paste the below script on the scripts page under “event.setline” (If already a similar script is present, check if its mentioned <=0 at the end of the second line, if yes remove the = from the equation to make it <0)
if(sales.getStock(line.getProductID())==0 || sales.getStock(line.getProductID())-line.getMultiply()<0)
{
 javax.swing.JOptionPane.showMessageDialog(null, "There is no stock of this item.");
     return "Cancel";
}

4. Save the script by clicking the save button on top right

5. Restart the system

0 Comments

Leave a Reply

Arrow-up