FANDOM


THIS MY EDITED VERSION OF ANOTHER SCRIPT POSTED HERE

It is available under the Creative Commons Share and Share Alike Licence

This code snippet is intented to implement a way to enter the price manually when selecting any product.

Add this code to the properties tab to each product that you want to have a manually price set.Edit

<?xml version="1.0" encoding="UTF-8" standalone="no"?>  
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">

<properties>
    <entry key="isVarPrice">Yes</entry>
</properties>


Add this to your Addline scriptEdit

// Enter product price all times begin

newPrice = line.getPrice();

// javax.swing.JOptionPane.showMessageDialog(null, "price all times " + line.getProperty("isVarPrice"), "Send Check", JOptionPane.WARNING_MESSAGE);

if (line.getProperty("isVarPrice")!= null){
 if (line.getProperty("isVarPrice").equals("Yes")){
  do{
   value = javax.swing.JOptionPane.showInputDialog("Price", newPrice);
   if (value != null) {

try {
      Double newPrice = new Double(value);
      line.setPrice(newPrice);
//      line.setPriceTax(newPrice);

     } catch (NumberFormatException e) {
      JOptionPane.showMessageDialog(null, "Not valid number: " + value, "Error", JOptionPane.PLAIN_MESSAGE);

     }

} else {
    return "Cancel";
   }
  } while (value.equals("0.0"));
 }
}

// Enter product price all times einde

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.