From: Anneli <an...@us...> - 2005-02-24 13:52:48
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25817/src/org/redpos/client/ui/plugin/function Modified Files: RowDiscountAmount.java RowDiscountPercent.java Log Message: It is not possible to give rowdiscount on freetext- or discountrow Index: RowDiscountAmount.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/RowDiscountAmount.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RowDiscountAmount.java 19 Feb 2005 08:37:14 -0000 1.4 --- RowDiscountAmount.java 24 Feb 2005 13:52:22 -0000 1.5 *************** *** 31,34 **** --- 31,36 ---- import org.redpos.amount.Amount; import org.redpos.client.contract.POSEngineException; + import org.redpos.client.contract.receipt.DiscountReceiptRow; + import org.redpos.client.contract.receipt.FreetextReceiptRow; import org.redpos.client.contract.receipt.ReceiptRow; import org.redpos.client.lang.contract.Language; *************** *** 81,85 **** --- 83,102 ---- return false; } + + if ((receiptRow instanceof FreetextReceiptRow) || + (receiptRow instanceof DiscountReceiptRow)) + { + // send message to ui + String message = getLanguageString( + "ui.main.message.rowdiscountamount2.text", + "Discount is not allowed on the receipt row"); + sendUIMessage(message); + // function is finished, notify listeners + fireNotification( + PluginFunctionConstants.NOTIFICATION_FUNCTION_FINISHED, null); + return false; + } + // create user input listener // Index: RowDiscountPercent.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/RowDiscountPercent.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RowDiscountPercent.java 19 Feb 2005 08:37:14 -0000 1.4 --- RowDiscountPercent.java 24 Feb 2005 13:52:22 -0000 1.5 *************** *** 30,33 **** --- 30,35 ---- import org.eclipse.swt.SWT; import org.redpos.client.contract.POSEngineException; + import org.redpos.client.contract.receipt.DiscountReceiptRow; + import org.redpos.client.contract.receipt.FreetextReceiptRow; import org.redpos.client.contract.receipt.ReceiptRow; import org.redpos.client.lang.contract.Language; *************** *** 80,83 **** --- 82,99 ---- return false; } + if ((receiptRow instanceof FreetextReceiptRow) || + (receiptRow instanceof DiscountReceiptRow)) + { + // send message to ui + String message = getLanguageString( + "ui.main.message.rowdiscountamount2.text", + "Discount is not allowed on the receipt row"); + sendUIMessage(message); + // function is finished, notify listeners + fireNotification( + PluginFunctionConstants.NOTIFICATION_FUNCTION_FINISHED, null); + + return false; + } // create user input listener |