Hi Andrew Thanks for the feedback - seeing only full priced items in a report doesn't trouble us, so this method works quite well in our situation. I've come across an issue with my code though - discount is only ever applied to one unit in an item line. So if the quantity for the line is higher (say 2, 3, etc units) its only using the base price for calculating discount. I'm assuming there must be some sort of GetQuantity() function I can use to correct the discount, but I can't find any reference...
Hi Andrew Thanks for the feedback - seeing only full priced items in a report doesn't trouble us, so this method works quite well in our situation. I've come across an issue with my code though - discount is only ever applied to one unit in an item line. So if the quantity for the line is higher (say 2, 3, etc units) its only using the base price for calculating discount. I'm assuming there must be some sort of GetQuantity() function I can use to correct the discount, but I can't find any reference...
Hi Andrew Thanks for the feedback - for us seeing full priced items in a report doesn't trouble us, so for us this method works quite well. I've come across an issue with my code though - discount is only ever applied to one unit in an item line. So if the quantity for the line is higher (say 2, 3, etc units) its only using the base price for calculating discount. I'm assuming there must be some sort of GetQuantity() function I can use to correct the discount, but I can't find any reference to it...
Hi Andrew Thanks for the feedback - for us seeing full priced items in a report doesn't trouble us, so for us this method works quite well. I've come across an issue with my code though - discount is only ever applied to one unit in an item line. So if the quantity for the line is higher (say 2, 3, etc units) its only using the base price for calculating discount. I'm assuming there must be some sort of GetQuantity() function I can use to correct the discount, but I can't find any reference to it...
Hi Andrew Thanks for the feedback - for us seeing full priced items in a report doesn't trouble us, so for us this method works quite well. I've come across an issue with my code though - discount is only ever applied to one unit in an item line. So if the quantity for the line is higher (say 2, 3, etc units) its only using the base price for calculating discount. I'm assuming there must be some sort of GetQuantity() function I can use to correct the discount, but I can't find any reference to it...
I finally solved the problem by simply working around the ProductCategoryID issue. I added an additional attribute to the discount line which I check for first, this prevents the code from crashing out when ProductCategoryID is checked. This is my final piece of code - if anyone could give any feedback as to whether or not I'm doing something potentially damaging to elsewhere I'd appreciate it! // script.CategoryDiscount2 // This script applies UsersInput % Discount against the total value of all...
I've bashed away a bit more and unfortunately come back to the same fundamental issue. I decided that actually tampering with the existing ticket lines was not the best way to go about implementing a discount, so instead I worked on the premise of adding an additional ticketline that would have its own description with the required discount value (this is also more in line with how most receipts are formatted around my location). This is what I came up with: import com.openbravo.format.Formats; import...
I've implemented a script in the discussion archives for applying discount to a particular category and it works to an extent. However if the percentage applied is incorrect or you want to remove the discount it returns an undescribed error. I've tried a number of different revisions to the script, and I believe the problem lies here: ticket.setLine(number, new TicketLineInfo( line.getProductID(), line.getProductName() + sdiscount, line.getProductTaxCategoryID(), line.getMultiply(), (double)Math.rint(line.getPrice()...