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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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(replacedtextresource)//ThisscriptappliesUsersInput%DiscountfortheItemLinevalue.Ithasbeenenhancedtoincludeupdatingorrevertingpreviousdiscounts//Checksforexistingdiscounts.Ensuresthatmultiplediscountsdonottakeplace//-Ifnoinputsupplied;previousdiscountisreverted//-Ifinputissupplied;previousupdateisrevertedandthennewdiscountapplied//-Usesnewendofline[$#.##ea(-##%)] for method. Need end of line format retained to complete operations////Maintenance->Roles->User-><classname="button.linediscount"/>//Maintenance->Resources->Ticket.Buttons-><buttonkey="button.linediscount"image="img.linediscount"code="script.linediscount"/>//Maintenance->Resources->img.linediscount->UsecustombuttonimageforLineDiscountimportcom.openbravo.format.Formats;importcom.openbravo.pos.ticket.TicketLineInfo;importcom.openbravo.pos.ticket.TicketProductInfo;DiscountRate=1-(sales.getInputValue()/100.0);DiscountPercent=Formats.PERCENT.formatValue((1-DiscountRate));index=sales.getSelectedIndex();if(index>=0){for(intnumber=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);//Checkifdiscountalreadyexistsanddosomeinterestingstuff...ProductName=line.getProductName();LengthProductName=ProductName.length();if(ProductName.endsWith("%)]")&&ProductName.contains("[$")){intStartDiscTagIndex=ProductName.lastIndexOf("[");DiscTag=ProductName.substring(StartDiscTagIndex);//[$#.##ea(-##%)] (get that Discount Tag)intEndNormalPriceIndex=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;}//Ifadiscountexistsandnoinputfornewdiscount,reversethepreviousdiscount...if(DiscountExists==true&&sales.getInputValue()==0){ticket.setLine(index,newTicketLineInfo(line.getProductID(),ProductNameExDisc,line.getProductTaxCategoryID(),line.getMultiply(),NormalPriceB/(1+line.getTaxRate()),//Thislinesetspricebeforetax.Taxsubtractioncalculationneededas$NormalPriceBincludestaxline.getTaxInfo()));}else{}//Ifadiscountexistsandinputfornewdiscount,updatethepreviousdiscount...if(DiscountExists==true&&sales.getInputValue()>0.0){ticket.setLine(index,newTicketLineInfo(line.getProductID(),ProductNameExDisc+" [$"+NormalPrice+"ea"+"(-"+DiscountPercent+")]",line.getProductTaxCategoryID(),line.getMultiply(),(NormalPriceB/(1+line.getTaxRate()))*DiscountRate,line.getTaxInfo()));}else{}//Performthenormaloperationifpreviousdiscountdoesn't exist...if(line.getPrice()>0.0&&sales.getInputValue()>0.0&&DiscountExists==false){TagPriceTax=Formats.CURRENCY.formatValue(line.getPriceTax());//SetoriginalPriceTaxforTagticket.setLine(index,newTicketLineInfo(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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
Hi Andrew
I will try and look at this as soon as I get the chance.
John
Hi Andrew
Replace the file, recompile and try to see if this is what you want.
John
Last edit: John L 2015-06-06
Hi John,
Thank you. Unfortunately it doesn't work, throwing the following error message:
Unable to load report data
Andrew
Last edit: Andrew 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
Hi Andrew
Try this one, its should work with MySQL. these different version of sql cause a nightmare with reports sometimes.
Regards
John
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
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
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
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
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
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.
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...
Andrew
Last edit: 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
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.
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)...
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
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);"
And add to the IF statement in "// Perform the normal operation..."
.
Better yet, for both line and total discounts, just do this...
Add to the IF statement in "// Perform the normal operation..."
.
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
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
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.
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
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.
need help new sale button not working properly
not retrieving hold sale
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
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