Menu

johnl 3.81 changes

John L
2015-01-17
2021-10-15
<< < 1 .. 4 5 6 7 8 > >> (Page 6 of 8)
  • Andrew

    Andrew - 2015-06-06

    I'm sorry, perhaps I need to ask again.

    Is it possible to have the 'Product Sales' report ignore variable price discount. The discount on variable price is understandable due to the way it works.
    I would like to have the Grand Total ignore the variable price products. Is it possible to edit either the bs or jasper report to do so?
    If it is possible, would you be able to supply an example.

    Thank you,
    Andrew

     
    • uniCenta

      uniCenta - 2015-06-19

      Andrew

      You need to be aware that the correct calculations apply - this discussion depends on where you're based and which Tax authority you have to report to - as to whether you report Gross or Net values as different tax calculations apply.

      uniCenta oPOS calculations are based on the www.oecd.org expected POS standards.

      Jack
      Founder uniCenta

       
  • John L

    John L - 2015-06-06

    Hi Andrew

    I will try and look at this as soon as I get the chance.

    John

     
  • John L

    John L - 2015-06-06

    Hi Andrew

    Replace the file, recompile and try to see if this is what you want.

    John

     

    Last edit: John L 2015-06-06
    • Andrew

      Andrew - 2015-06-12

      Hi John,

      Thank you. Unfortunately it doesn't work, throwing the following error message:

      Unable to load report data

      com.openbravo.basic.BasicException: 
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INT) =  1) THEN 0 ELSE 1 END)-((TICKETLINES.PRICE+(TICKETLINES.PRICE*TAXES.RATE)' at line 1
      
      com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 
      You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INT) =  1) THEN 0 ELSE 1 END)-((TICKETLINES.PRICE+(TICKETLINES.PRICE*TAXES.RATE)' at line 1
      

      Andrew

       

      Last edit: Andrew 2015-06-12
  • John L

    John L - 2015-06-12

    Hi ANdrew

    No error, this is another one of those problems with different versions of SQL, works with derby. I will have to try with MySQL.

    John

     
  • John L

    John L - 2015-06-12

    Hi Andrew

    Try this one, its should work with MySQL. these different version of sql cause a nightmare with reports sometimes.

    Regards
    John

     
    • Andrew

      Andrew - 2015-06-12

      Hi John

      That one is exactly what I needed for MySQL. Doesn't show variable products as discounts and does show regular products as discounted if applied. Perfect!

      Thank you.

      Andrew

       
  • Willie

    Willie - 2015-06-15

    Hi,

    I'm testing JohnL's latest unicentaopos.jar. I dsid a fresh install of 3.81. I ran configure.sh and I was able to configure JohnL-Unicenta with out issues. But when I run start.sh I get the following error:
    $ ./start.sh
    Jun 14, 2015 6:01:23 PM com.openbravo.pos.forms.AppConfig init
    INFO: Reading configuration file: /root/unicentaopos.properties
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: liquibase/exception/DatabaseException
    at com.openbravo.pos.forms.JRootFrame.initFrame(JRootFrame.java:62)
    at com.openbravo.pos.forms.StartPOS$1.run(StartPOS.java:129)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
    Caused by: java.lang.ClassNotFoundException: liquibase.exception.DatabaseException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 16 more

    I can copy back the org 3.81 unicentaopos.jar and the program opens fine.

    OS: Fedora22
    DB: Apache Derby Embedded

    Thanks,

    Willie

     
  • Giorgos Efstathiou

    Hi John

    On ReprintLastTicket the amount Tendered is wrong. Is giving me the Total amount
    Is something im doing wrong?

    On customer receipt is correct

    Thanks

    Giorgos

     
  • Giorgos Efstathiou

    Hi John

    On ReprintLastTicket the amount Tendered is wrong. Is giving me the Total amount
    Is something im doing wrong?

    On customer receipt is correct

    Thanks

    Giorgos

     
  • Raymond

    Raymond - 2015-06-17
    Try changing =
    <text align ="right" length="20">${paymentline.printPaid()}</text>
    To
    <text align ="right" length="16">${paymentline.printTendered()}</text>
    
     
  • Giorgos Efstathiou

    Hi Raymond

    Manage to fix it
    Sorry for late post
    for a fast solution i was add total+change for a quick fix
    Thanks again

     
  • Andrew

    Andrew - 2015-06-18

    Hi John,

    Is it just me or isn't the canDiscount function not working currently?
    I've edited my own scripts and failed to get it working.
    Replaced the script with default and it fails to work.
    The product was switched between being tagged as a discountable product in Stock and either way it doesn't discount using your script posted at http://sourceforge.net/p/unicentaopos/discussion/1126901/thread/87929aed
    If got all Role privileges enabled and using MySQL database.

    Could you check it out please. Thanks.

    • UPDATE:
      Sorry! It is working now. Very strange. Just trying to get my scripts working with it.

    It is doing my head in. Trying to implement it with this...

    // script.linediscount (replaced text resource)
    // This script applies UsersInput% Discount for the Item Line value. It has been enhanced to include updating or reverting previous discounts
    // Checks for existing discounts. Ensures that multiple discounts do not take place
    // - If no input supplied; previous discount is reverted
    // - If input is supplied; previous update is reverted and then new discount applied
    // - Uses new end of line [$#.##ea(-##%)] for method. Need end of line format retained to complete operations
    //
    // Maintenance -> Roles -> User -> <class name="button.linediscount"/>
    // Maintenance -> Resources -> Ticket.Buttons -> <button key="button.linediscount" image="img.linediscount" code="script.linediscount"/>
    // Maintenance -> Resources -> img.linediscount -> Use custom button image for Line Discount
    
    import com.openbravo.format.Formats;
    import com.openbravo.pos.ticket.TicketLineInfo;
    import com.openbravo.pos.ticket.TicketProductInfo;
    
    DiscountRate = 1 - (sales.getInputValue() / 100.0);
    DiscountPercent = Formats.PERCENT.formatValue((1-DiscountRate));
    
    index = sales.getSelectedIndex();
    if (index >= 0) {
    
      for (int number= 0; number < ticket.getLinesCount(); number++) {
        line = ticket.getLine(number);
    
        if (line.getProductName().contains("~ Rounding 5c ~") || line.getProductName().contains("~ Layby") || line.getProductName().contains("~~ Deposit ~~")) {
          return;
        } else {}
      }
    
      line = ticket.getLine(index);
    
      // Check if discount already exists and do some interesting stuff...
      ProductName = line.getProductName();
      LengthProductName = ProductName.length();
      if (ProductName.endsWith("%)]") && ProductName.contains("[$")) {
        int StartDiscTagIndex = ProductName.lastIndexOf("[");
        DiscTag = ProductName.substring(StartDiscTagIndex);    // [$#.##ea(-##%)] (get that Discount Tag)
        int EndNormalPriceIndex = DiscTag.indexOf("e");
        NormalPrice = DiscTag.substring(2, EndNormalPriceIndex);    // $#.## (get Normal PriceTax(TagPriceTax) from DiscTag)
    
        NormalPriceA = NormalPrice.replaceAll(",", "");    // #.## ($)
        NormalPriceB = Double.valueOf(NormalPriceA);    // #.## ($ useable in methods)
    
        LengthDiscTag = DiscTag.length();
        ProductNameExDisc = ProductName.substring(0, LengthProductName - (LengthDiscTag + 1));
    
        DiscountExists = true;
      } else {DiscountExists = false;}
    
      // If a discount exists and no input for new discount, reverse the previous discount...
      if (DiscountExists == true && sales.getInputValue() == 0) {
        ticket.setLine(index,
        new TicketLineInfo(
        line.getProductID(),
        ProductNameExDisc,
        line.getProductTaxCategoryID(),
        line.getMultiply(),
        NormalPriceB / (1 + line.getTaxRate()),    // This line sets price before tax. Tax subtraction calculation needed as $ NormalPriceB includes tax
        line.getTaxInfo()));
      } else {}
    
      // If a discount exists and input for new discount, update the previous discount...
      if (DiscountExists == true && sales.getInputValue() > 0.0) {
        ticket.setLine(index,
        new TicketLineInfo(
        line.getProductID(),
        ProductNameExDisc + " [$" + NormalPrice + "ea" + "(-" + DiscountPercent + ")]",
        line.getProductTaxCategoryID(),
        line.getMultiply(),
        (NormalPriceB / (1 + line.getTaxRate())) * DiscountRate,
        line.getTaxInfo()));
      } else {}
    
      // Perform the normal operation if previous discount doesn't exist...
      if (line.getPrice() > 0.0 && sales.getInputValue() > 0.0 && DiscountExists == false) {
        TagPriceTax = Formats.CURRENCY.formatValue(line.getPriceTax());    // Set original PriceTax for Tag
        ticket.setLine(index,
        new TicketLineInfo(
        line.getProductID(),
        line.getProductName() + " [" + TagPriceTax + "ea" + "(-" + DiscountPercent + ")]",
        line.getProductTaxCategoryID(),
        line.getMultiply(),
        line.getPrice() * DiscountRate,
        line.getTaxInfo()));
      } else {}
    } else {java.awt.Toolkit.getDefaultToolkit().beep();}
    

    Andrew

     

    Last edit: Andrew 2015-06-18
  • Andrew

    Andrew - 2015-06-18

    Guessing it must be my alteration of product name to achieve reversing discount. The canDiscount function must call on the product name. Correct?

    Damn. Just trying to work it out. Might have to restart from scratch.

     

    Last edit: Andrew 2015-06-18
  • Peter

    Peter - 2015-06-20

    Hello Krulleke and all of you
    Please guide me how to login with magnetic card or barcode scanner.
    You mentioned about "the magic wand button will not create a password.
    It will give the user a ID for quick login via magnetic card or via barcodescanner.
    But you can make the user not visible in the gui so a normal user can't select that account. but still there is no password set."
    Please step by step guide for doing it. When i click on the magic wand it display a string of number but i don't know how to use it. On the welcome screen how to choose the way using normal login or magnetic card login.
    Thank you very much.

     
  • Andrew

    Andrew - 2015-06-20

    Hi,

    I've still been trying all sorts to get the option for enabling and disabling discounts for individual products working in my scripts.

    Understand that it is a function you've implemented to prevent multiple discounts.

    I added the following to help me with what was going on (slightly)...

    // TESTING AREA - Leave the following line commented out, unless testing
    javax.swing.JOptionPane.showMessageDialog(null, "What is canDiscount?: " + line.canDiscount(), "TESTING ZONE", JOptionPane.WARNING_MESSAGE);
    

    canDiscount is returning true for the first discount and false every other attempt.
    My script restores original price or updates based on original price.
    Once a discount has been applied and reversed, a subsequent discount isn't allowed because of the false flag that I can't seem to change at any stage.

    BTW, line.setDiscounted("yes"); isn't updating my MySQL product tables Discount... if it's supposed to?

    Thanks,
    Andrew

     

    Last edit: Andrew 2015-06-20
  • Andrew

    Andrew - 2015-06-21

    Finally solved it!

    Before Discount (if product is set to allow discounts):
    canDiscount = true
    Discounted = no

    During Discount (if product is set to allow discounts):
    canDiscount = true
    Discounted = yes

    After Discount (if product is set to allow discounts):
    canDicount = false
    Discounted = null

    Able to use a check of Discounted... I'm not going to paste the whole script again.
    Just after "line = ticket.getLine(index);"

    if (line.canDiscount() || (line.canDiscount() == false && line.getDiscounted() == null)) {
      allowDiscount = true;
    } else {}
    

    And add to the IF statement in "// Perform the normal operation..."

    && allowDiscount == true
    

    .
    Better yet, for both line and total discounts, just do this...
    Add to the IF statement in "// Perform the normal operation..."

    && (line.canDiscount() || (line.canDiscount() == false && line.getDiscounted() == null))
    

    .
    Now I can:
    1. Prevent a product from being discounted.
    2. Apply a discount if product is enabled.
    3. Update with a new discount by using original price.
    4. Revert the discount to original price.
    5. Reapply another discount.

    Andrew

     

    Last edit: Andrew 2015-06-22
    • Andrew

      Andrew - 2015-06-22

      A minor problem I've now realized... with my testing

      (please don't be deterred from trying John's changes, it's just me trying different things)

      Total discounts do not function correctly. If you are to apply a total 10% discount to a ticket with two $10 dollar products you would expect a $2 discount with the sale being $18. But If one of those products has the discount disabled, the total sale is $19 with only one of the products receiving a 10% discount.
      This is messy. A customer that was told "I'll give you a 10% discount, if you buy all that" for example, may very well end up unhappy with your failed promise.

      Is there a way to overcome this? Yeah, we can make some changes. But really, perhaps we are just taking this too far?

      Also, sorry Peter has a question about magnetic login which I've sort of flooded with my dribble. Find his valid question above here at
      https://sourceforge.net/p/unicentaopos/discussion/1126900/thread/841f23c8/?limit=25&page=5#4d01

      Andrew

       

      Last edit: Andrew 2015-07-11
  • Reiner

    Reiner - 2015-06-22

    Andrew, as you said, we are just taking this too far. If you tell the system "NO DISCOUNT", do you expect the system to make this product discountable just by magic???
    I would not call this a problem. I call this, it works perfect as the box says.

     
    • Andrew

      Andrew - 2015-06-22

      Yes Reiner,

      I understand that it works correctly. Yes, it is user choice to prevent the discount of any given product. The outcome of having one of those products in a total discount with a script altering the general operation is completely end-user.
      I only just realised the implication. Rather stupidly blinded by my endeavor to make a single line discount preventable with the option.
      Doesn't make sense spreading the discount of a total discount on other products... for me.
      I'm just sorry to carry on about it. I'm sure others will find what is best for them.
      For me, I'm just sticking with not having the canDiscount() in any of my scripts.

      Andrew

       
  • Peter

    Peter - 2015-06-22

    Thank you Andrew for repeating my question about user magnetic card login that
    Krulleke talking about magic wand but i don't know how to use it. Any guide will be higly appreciated.

     
  • shyam

    shyam - 2015-06-24

    need help new sale button not working properly
    not retrieving hold sale

     
  • Genya Kaplun

    Genya Kaplun - 2015-06-25

    Hi John,
    thanks for all your work on this. I just upgraded from regular 3.81 to your version. Everything is working except for couple strange issues.
    Whenever I go back to the sales screen and after every sale is completed i get a few absolutely random products added to the sale. If I delete that sale, then new random products are added. I have no idea where to start looking for the solution for this.
    Any chance you could help with this? I really like your modification and really hope to use this version.

    Any help would be appreciated!
    thanks

     
    • Andrew

      Andrew - 2015-06-26

      Hi Genya,

      I've yet to see that happen during my testing.

      Could you fill in these:
      1. What Database are you using (Derby, MySQL or PostgreSQL)?
      2. What version of Java are you using (Java 7x or Java8x)?
      3. What OS are you running (Windows, Linux or Mac)?
      4. Was your uniCenta v3.81 database populated before the upgrade and if so, how many products roughly?
      5. Do you have other terminals altering your uniCenta database?
      6. Is there any link between what products occur at the sale screen after the sale, and those that were sold in the prior sale?

      Very interested.

      Regards,
      Andrew

       
<< < 1 .. 4 5 6 7 8 > >> (Page 6 of 8)

Log in to post a comment.