You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(155) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(50) |
Feb
(18) |
Mar
(18) |
Apr
|
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Anneli <an...@us...> - 2005-01-17 10:24:17
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/device In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client/device Modified Files: ReceiptPrinter.java ReceiptPrinterRowFactory.java Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: ReceiptPrinterRowFactory.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/device/ReceiptPrinterRowFactory.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReceiptPrinterRowFactory.java 11 Jan 2005 17:02:46 -0000 1.2 --- ReceiptPrinterRowFactory.java 17 Jan 2005 10:23:23 -0000 1.3 *************** *** 26,30 **** --- 26,34 ---- import java.text.DateFormat; + import javax.management.JMException; + import org.redpos.amount.Amount; + import org.redpos.client.contract.POSEngineUtility; + import org.redpos.client.contract.properties.PropertiesUtility; import org.redpos.client.contract.receipt.DiscountReceiptRow; import org.redpos.client.contract.receipt.ReceiptConstants; *************** *** 62,65 **** --- 66,74 ---- private Language lang = null; + + private double currencyRate; + private Amount toPay = new Amount(0); + private Amount entered = new Amount(0); + private Amount back = new Amount(0); /** *************** *** 379,383 **** discountAmount.toNumberString(), false)); printableRow.append(NEW_LINE); ! break; --- 388,392 ---- discountAmount.toNumberString(), false)); printableRow.append(NEW_LINE); ! break; *************** *** 390,394 **** discountRowAmount.toNumberString(), false)); printableRow.append(NEW_LINE); ! break; --- 399,403 ---- discountRowAmount.toNumberString(), false)); printableRow.append(NEW_LINE); ! break; *************** *** 401,412 **** totalDiscountPercentAmount.toNumberString(), false)); printableRow.append(NEW_LINE); ! break; case ReceiptConstants.TYPE_RECEIPTROW_PAYMENT: Amount paymentAmount = rr.getAmount(); ! printableRow.append(formatString(rr.getText(), rr.getAmount().absolute().toNumberString(), false)); ! printableRow.append(NEW_LINE); /* if (paymentAmount.doubleValue() < 0) --- 410,441 ---- totalDiscountPercentAmount.toNumberString(), false)); printableRow.append(NEW_LINE); ! break; case ReceiptConstants.TYPE_RECEIPTROW_PAYMENT: Amount paymentAmount = rr.getAmount(); ! ! // the amount to receive will be shown in a different currency ! if ((rr.getObject().equals("SICUEX")) && (rr.getText().equals(lang.getString( ! "client.receiptprinter.change.text", "Change")))) ! { ! toPay.multiply(currencyRate); ! back.add(toPay); ! back.subtract(entered); ! ! paymentAmount.multiply(currencyRate); ! String text = rr.getText() + lang.getString("ui.plugin.receiptprinter.change2.text", ! "Currency: "); ! printableRow.append(formatString(text, ! back.absolute().toNumberString(), false)); ! printableRow.append(NEW_LINE); ! } ! else ! { ! printableRow.append(formatString(rr.getText(), rr.getAmount().absolute().toNumberString(), false)); ! printableRow.append(NEW_LINE); ! entered.add(rr.getAmount()); ! } /* if (paymentAmount.doubleValue() < 0) *************** *** 431,435 **** break; } - return printableRow.toString(); } --- 460,463 ---- *************** *** 447,450 **** --- 475,479 ---- "client.receiptprinter.subtotal.text", "Total"), total.toNumberString(), false)); + toPay.add(total); printableTotalRow.append(NEW_LINE); return printableTotalRow.toString(); *************** *** 546,549 **** return row.toString(); } ! } \ No newline at end of file --- 575,598 ---- return row.toString(); } ! ! /** ! * Sets currency rate ! * ! */ ! public void setCurrencyRate(double rate) ! { ! currencyRate = rate; ! } ! ! /** ! * Resets a number of variables ! * ! */ ! public void reset() ! { ! toPay = new Amount(0.0); ! entered = new Amount(0.0); ! back = new Amount(0.0); ! } ! } \ No newline at end of file Index: ReceiptPrinter.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/device/ReceiptPrinter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReceiptPrinter.java 11 Jan 2005 17:02:46 -0000 1.2 --- ReceiptPrinter.java 17 Jan 2005 10:23:23 -0000 1.3 *************** *** 41,44 **** --- 41,45 ---- import org.redpos.amount.Amount; + import org.redpos.client.contract.POSEngineUtility; import org.redpos.client.contract.properties.PropertiesUtility; import org.redpos.client.contract.receipt.PaymentReceiptRow; *************** *** 70,73 **** --- 71,76 ---- private ReceiptSessionUtility receiptUtility; + + private POSEngineUtility posEngineUtility; private POSPrinter posPrinter; *************** *** 86,90 **** private int receiptType; ! /** Payments started flag */ private boolean paymentsStarted; --- 89,94 ---- private int receiptType; ! ! /** Payments started flag */ private boolean paymentsStarted; *************** *** 107,110 **** --- 111,116 ---- // load properties // + posEngineUtility = new POSEngineUtility(getServer()); + Boolean enabled = (Boolean)po.getProperty("receiptprinter", "enabled"); if(enabled != null && enabled.booleanValue() == false) *************** *** 511,514 **** --- 517,529 ---- // the receipt is finished ReceiptPrinterRowFactory rowFactory = ReceiptPrinterRowFactory.getInstance(); + + try + { + rowFactory.setCurrencyRate(posEngineUtility.getCurrencyRate()); + } + catch(JMException e1) + { + log.error(e1.getMessage(), e1); + } Vector rows = data.receiptRows; *************** *** 569,572 **** --- 584,588 ---- receipt = new StringBuffer(); + rowFactory.reset(); } else if(n.getType().equals( |
From: Anneli <an...@us...> - 2005-01-17 10:24:17
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/payment/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client/payment/META-INF Modified Files: jboss-service.xml Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: jboss-service.xml =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/payment/META-INF/jboss-service.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** jboss-service.xml 23 Dec 2004 10:20:36 -0000 1.2 --- jboss-service.xml 17 Jan 2005 10:23:22 -0000 1.3 *************** *** 84,87 **** --- 84,94 ---- <depends>RedPOS.client:service=Properties</depends> </mbean> + + <mbean code="org.redpos.client.payment.SimpleCurrencyExchangePayment" + name="RedPOS.client.payment:service=SimpleCurrencyExchangePayment" + > + <depends>RedPOS.client.payment:service=PaymentRegistry</depends> + <depends>RedPOS.client:service=Properties</depends> + </mbean> <!-- |
From: Anneli <an...@us...> - 2005-01-17 10:24:02
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client/ui/plugin/function Modified Files: Pay.java Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: Pay.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/Pay.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Pay.java 23 Dec 2004 10:14:27 -0000 1.3 --- Pay.java 17 Jan 2005 10:23:21 -0000 1.4 *************** *** 84,87 **** --- 84,90 ---- private ConfirmActionUI confirmCancelReceiptAction; + + private Amount toPayChange; + private Amount payChange; /** *************** *** 288,306 **** paymentSelection = null; parent.layout(); ! String inputHeader = payment.receiptText; ! String inputMessage = language.getString( ! "ui.plugin.receipt.pay.message3.text", "Amount to pay:"); ! Amount toPay = getAmountToPay(); ! if(toPay != null) ! inputMessage = inputMessage + " " + toPay.toString(); ! String inputLabelText = language.getString( ! "ui.plugin.receipt.pay.message1.text", "Enter amount:"); ! ! // create user input ui ! userInput = new UserInputUI(parent, SWT.NORMAL, inputHeader, ! inputMessage, inputLabelText, true, getLanguage(), this); ! userInput.setFocus(); ! } else --- 291,343 ---- paymentSelection = null; parent.layout(); + + // the amount to pay will be shown in a different currency + if (payment.code.equals("SICUEX")) + { + try + { + String inputHeader = payment.receiptText; + String inputMessage = language.getString( + "ui.plugin.receipt.pay.message3.text", "Amount to pay:"); + Amount toPay = getAmountToPay(); + if(toPay != null) + { + toPayChange = getAmountToPay(); + toPayChange.multiply(posEngineUtility.getCurrencyRate()); + inputMessage = language.getString("ui.plugin.receipt.pay.message6.text", + "Currency: ") +toPayChange.toString(); + } + + String inputLabelText = language.getString( + "ui.plugin.receipt.pay.message1.text", "Enter amount:"); + + // create user input ui + userInput = new UserInputUI(parent, SWT.NORMAL, inputHeader, + inputMessage, inputLabelText, true, getLanguage(), this); + userInput.setFocus(); + } + catch(JMException e) + { + log.error(e.getMessage(), e); + } + + } + else + { + String inputHeader = payment.receiptText; + String inputMessage = language.getString( + "ui.plugin.receipt.pay.message3.text", "Amount to pay:"); + Amount toPay = getAmountToPay(); + if(toPay != null) + inputMessage = inputMessage + " " + toPay.toString(); + + String inputLabelText = language.getString( + "ui.plugin.receipt.pay.message1.text", "Enter amount:"); ! // create user input ui ! userInput = new UserInputUI(parent, SWT.NORMAL, inputHeader, ! inputMessage, inputLabelText, true, getLanguage(), this); ! userInput.setFocus(); ! } } else *************** *** 332,335 **** --- 369,373 ---- { amount = getAmountToPay(); + payChange = new Amount(0); } else *************** *** 337,340 **** --- 375,379 ---- Double dAmount = Double.valueOf(input); amount = new Amount(dAmount.doubleValue()); + payChange = new Amount(dAmount.doubleValue()); } *************** *** 534,538 **** "Return to customer:"); } ! String messageString = displayText + " " + returnToCustomer.toString(); --- 573,577 ---- "Return to customer:"); } ! String messageString = displayText + " " + returnToCustomer.toString(); *************** *** 542,545 **** --- 581,593 ---- "ui.main.dashboard.message.ok.text", "OK"); String cancelText = ""; + + // the amount to receive will be shown in a different currency + if (payment.code.equals("SICUEX")) + { + toPayChange.subtract(payChange); + messageString = displayText +language.getString("ui.plugin.receipt.pay.message6.text", + "Currency: ") + toPayChange.absolute().toString(); + } + ConfirmActionUI.ConfirmListener listener = new ConfirmActionUI.ConfirmListener() { |
From: Anneli <an...@us...> - 2005-01-17 10:24:02
|
Update of /cvsroot/redpos/RedPOS/lang/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/lang/conf Modified Files: lang-en-EN.xml lang-sv-SE.xml Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: lang-sv-SE.xml =================================================================== RCS file: /cvsroot/redpos/RedPOS/lang/conf/lang-sv-SE.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lang-sv-SE.xml 11 Jan 2005 17:11:39 -0000 1.4 --- lang-sv-SE.xml 17 Jan 2005 10:23:21 -0000 1.5 *************** *** 37,41 **** <string desc="Client payment text" name="client.payment.pay5.name.text">Garantiersättning</string> <string desc="Client payment text" name="client.payment.pay5.receipt.text">Garantiersättning betalning</string> ! <string desc="Client receipt text" name="client.receipt.tax.text">Moms</string> --- 37,42 ---- <string desc="Client payment text" name="client.payment.pay5.name.text">Garantiersättning</string> <string desc="Client payment text" name="client.payment.pay5.receipt.text">Garantiersättning betalning</string> ! <string desc="Client payment text" name="client.payment.simplecurrencyexchange.name.text">Norska kronor</string> ! <string desc="Client payment text" name="client.payment.simplecurrencyexchange.receipt.text">Norska kronor betalning</string> <string desc="Client receipt text" name="client.receipt.tax.text">Moms</string> *************** *** 52,55 **** --- 53,57 ---- <string desc="Client receipt printer text" name="client.receiptprinter.gross.text">Brutto</string> <string desc="Client receipt printer text" name="client.receiptprinter.change.text">Åter till kund</string> + <string desc="Client receipt printer text" name="client.receiptprinter.change2.text"> Norska kronor</string> <string desc="Client receipt printer text" name="client.receiptprinter.complaint.text">*** REKLAMATION ***</string> <string desc="Client receipt printer text" name="client.receiptprinter.return.text">*** RETUR ***</string> *************** *** 90,99 **** <string desc="Client tally report text" name="client.tally.report.string29.text">Avrundning</string> <string desc="Client tally report text" name="client.tally.report.string30.text">Summa inbetalningar:</string> ! <string desc="Client tally report text" name="client.tally.report.string31.text">Amex/Diners inbetalningar:</string> ! <string desc="Client tally report text" name="client.tally.report.string32.text">Övriga presentkort inbetalningar:</string> ! <string desc="Client tally report text" name="client.tally.report.string33.text">Försäkringsrekvisition inbetalningar:</string> ! <string desc="Client tally report text" name="client.tally.report.string34.text">Resurs Räntefritt inbetalningar:</string> ! <string desc="Client tally report text" name="client.tally.report.string35.text">Garantiersättning inbetalningar:</string> ! <string desc="UI main window dashboard" name="ui.main.dashboard.welcome.text">Välkommen till RedPOS</string> --- 92,103 ---- <string desc="Client tally report text" name="client.tally.report.string29.text">Avrundning</string> <string desc="Client tally report text" name="client.tally.report.string30.text">Summa inbetalningar:</string> ! <string desc="Client tally report text" name="client.tally.report.string31.text">Amex/Diners inbetalningar</string> ! <string desc="Client tally report text" name="client.tally.report.string32.text">Övriga presentkort inbetalningar</string> ! <string desc="Client tally report text" name="client.tally.report.string33.text">Försäkringsrekvisition inbetalningar</string> ! <string desc="Client tally report text" name="client.tally.report.string34.text">Resurs Räntefritt inbetalningar</string> ! <string desc="Client tally report text" name="client.tally.report.string35.text">Garantiersättning inbetalningar</string> ! <string desc="Client tally report text" name="client.tally.report.string36.text">Norska kronor</string> ! <string desc="Client tally report text" name="client.tally.report.string37.text">kurs:</string> ! <string desc="UI main window dashboard" name="ui.main.dashboard.welcome.text">Välkommen till RedPOS</string> *************** *** 208,211 **** --- 212,216 ---- <string desc="UI plugin function text" name="ui.plugin.receipt.pay.message4.text">Det är inte tillåtet att avbryta betalningen nu. Vill du avbryta kvittot?</string> <string desc="UI plugin function text" name="ui.plugin.receipt.pay.message5.text">Felslag korrigerat:</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.pay.message6.text">Norska kronor </string> <string desc="UI plugin function text" name="ui.plugin.receipt.return.text" >Retur/Öppet köp</string> <string desc="UI plugin function text" name="ui.plugin.receipt.complaint.text" >Reklamation</string> *************** *** 258,266 **** <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.label.text">Datum:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.receiptid.text">Kvittonr:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.date.text">Datum:</string> ! <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt..subtotal.text">Total:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.cashier.text">Kassör:</string> ! <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string1.text">Avbryt</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string2.text">Fortsätt</string> <string desc="UI main window message" name="ui.main.message.findreceipt1.text">Det finns inget kvitto med angivet datum</string> --- 263,276 ---- <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.label.text">Datum:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.receiptid.text">Kvittonr:</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.receipttype.text">Kvittotyp:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.date.text">Datum:</string> ! <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.subtotal.text">Total:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.cashier.text">Kassör:</string> ! <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string1.text">Tillbaka</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string2.text">Fortsätt</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string3.text">Försäljning</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string4.text">Reklamation</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string5.text">Felslag</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string6.text">Retur</string> <string desc="UI main window message" name="ui.main.message.findreceipt1.text">Det finns inget kvitto med angivet datum</string> Index: lang-en-EN.xml =================================================================== RCS file: /cvsroot/redpos/RedPOS/lang/conf/lang-en-EN.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lang-en-EN.xml 11 Jan 2005 17:11:38 -0000 1.4 --- lang-en-EN.xml 17 Jan 2005 10:23:20 -0000 1.5 *************** *** 35,39 **** <string desc="Client payment text" name="client.payment.pay5.name.text">Payment 5</string> <string desc="Client payment text" name="client.payment.pay5.receipt.text">Payment 5 payment</string> ! <string desc="Client receipt text" name="client.receipt.tax.text">VAT</string> --- 35,40 ---- <string desc="Client payment text" name="client.payment.pay5.name.text">Payment 5</string> <string desc="Client payment text" name="client.payment.pay5.receipt.text">Payment 5 payment</string> ! <string desc="Client payment text" name="client.payment.simplecurrencyexchange.name.text">Norska kronor</string> ! <string desc="Client payment text" name="client.payment.simplecurrencyexchange.receipt.text">Norska kronor betalning</string> <string desc="Client receipt text" name="client.receipt.tax.text">VAT</string> *************** *** 50,53 **** --- 51,55 ---- <string desc="Client receipt printer text" name="client.receiptprinter.gross.text">Gross</string> <string desc="Client receipt printer text" name="client.receiptprinter.change.text">Change</string> + <string desc="Client receipt printer text" name="client.receiptprinter.change2.text"> Norska kronor</string> <string desc="Client receipt printer text" name="client.receiptprinter.complaint.text">*** COMPLAINT ***</string> <string desc="Client receipt printer text" name="client.receiptprinter.return.text">*** RETURN GOODS ***</string> *************** *** 93,96 **** --- 95,101 ---- <string desc="Client tally report text" name="client.tally.report.string34.text">Payment4 payments:</string> <string desc="Client tally report text" name="client.tally.report.string35.text">Payment5 payments:</string> + <string desc="Client tally report text" name="client.tally.report.string36.text">Norska kronor</string> + <string desc="Client tally report text" name="client.tally.report.string37.text">rate:</string> + <string desc="UI main window dashboard" name="ui.main.dashboard.welcome.text">Welcome to REDPOS</string> *************** *** 256,259 **** --- 261,265 ---- <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.label.text">Date:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.receiptid.text">Receipt No:</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.receipttype.text">Receipt type:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.date.text">Date:</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.subtotal.text">Total:</string> *************** *** 261,264 **** --- 267,274 ---- <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string1.text">Cancel</string> <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string2.text">Continue</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string3.text">Sale</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string4.text">Complaint</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string5.text">Correction</string> + <string desc="UI plugin function text" name="ui.plugin.receipt.findreceipt.string6.text">Retur</string> <string desc="UI main window message" name="ui.main.message.findreceipt1.text">There is no receipt with stated date</string> |
From: Anneli <an...@us...> - 2005-01-17 10:24:02
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/contract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client/contract Modified Files: POSEngineUtility.java Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: POSEngineUtility.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/contract/POSEngineUtility.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** POSEngineUtility.java 20 Dec 2004 07:56:13 -0000 1.2 --- POSEngineUtility.java 17 Jan 2005 10:23:22 -0000 1.3 *************** *** 184,187 **** --- 184,209 ---- return isLoginPerReciept.booleanValue(); } + + /** + * Returns currencyRate + * + * @return + * @throws JMException + */ + public double getCurrencyRate() throws JMException + { + return ((Double)this.getAttribute("CurrencyRate")).doubleValue(); + } + + /** + * Returns currencyRate + * + * @return + * @throws JMException + */ + public String getCurrencyRateString() throws JMException + { + return this.getAttribute("CurrencyRate").toString(); + } /** |
From: Anneli <an...@us...> - 2005-01-17 10:24:01
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client Modified Files: POSEngine.java Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: POSEngine.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/POSEngine.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** POSEngine.java 11 Jan 2005 17:11:35 -0000 1.6 --- POSEngine.java 17 Jan 2005 10:23:20 -0000 1.7 *************** *** 85,88 **** --- 85,90 ---- private boolean loginPerReceipt; + + private double currencyRate; /** *************** *** 125,128 **** --- 127,141 ---- return loginPerReceipt; } + + /** + * Returns loginPerReciept attribute + * + * @jmx.managed-attribute + * @return + */ + public double getCurrencyRate() + { + return currencyRate; + } /** *************** *** 148,151 **** --- 161,165 ---- defaultPricelistId = (String)po.getProperty("pos", "defaultpricelist"); loginPerReceipt = ((Boolean) po.getProperty("pos", "loginperreceipt")).booleanValue(); + currencyRate = (((Double)po.getProperty("exchange", "CurrencyRate")).doubleValue()); getLog().info("RegisterId = " + registerId); *************** *** 724,728 **** e3.printStackTrace(); } ! // if the receipt is of type COMPLAINT, RETURN OR CORRECTION // the changeRow will be of choosen paymenttype --- 738,742 ---- e3.printStackTrace(); } ! // if the receipt is of type COMPLAINT, RETURN OR CORRECTION // the changeRow will be of choosen paymenttype *************** *** 745,748 **** --- 759,773 ---- storeId, cashier, defaultPricelistId); } + else if (payment.code.equals("SICUEX")) + { + PaymentReceiptRow changeRow = new PaymentReceiptRow(payment); + changeRow.setText(text); + changeRow.setObject(payment.code); + changeRow.setQuantity(1); + changeRow.setAmount(totalPayable); + // add row to receipt + receiptSessionUtility.addReceiptRow(changeRow, registerId, + storeId, cashier, defaultPricelistId); + } else { |
From: Anneli <an...@us...> - 2005-01-17 10:23:38
|
Update of /cvsroot/redpos/RedPOS/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/conf Modified Files: properties.xml Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: properties.xml =================================================================== RCS file: /cvsroot/redpos/RedPOS/conf/properties.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** properties.xml 13 Jan 2005 14:51:22 -0000 1.8 --- properties.xml 17 Jan 2005 10:23:23 -0000 1.9 *************** *** 4,7 **** --- 4,12 ---- <redpos-properties> + <!-- Exchange properties --> + <property-category name="exchange"> + <property name="CurrencyRate" type="java.lang.Double">1.116</property> + </property-category> + <!-- General properties --> <property-category name="general"> *************** *** 170,173 **** --- 175,188 ---- <property name="Pay5LimitRepay" type="java.lang.Double">10000</property> + <property name="SimpleCurrencyExchangeIndex" type="java.lang.Integer">12</property> + <property name="SimpleCurrencyExchangeCode" type="java.lang.String">SICUEX</property> + <property name="SimpleCurrencyExchangeChangeAllowed" type="java.lang.Boolean">true</property> + <property name="SimpleCurrencyExchangeRepayAllowed" type="java.lang.Boolean">true</property> + <property name="SimpleCurrencyExchangeCancelAllowed" type="java.lang.Boolean">true</property> + <property name="SimpleCurrencyExchangeUpdateAllowed" type="java.lang.Boolean">true</property> + <property name="SimpleCurrencyExchangeLimit" type="java.lang.Double">10000</property> + <property name="SimpleCurrencyExchangeLimitChange" type="java.lang.Double">10000</property> + <property name="SimpleCurrencyExchangeLimitRepay" type="java.lang.Double">10000</property> + </property-category> |
From: Anneli <an...@us...> - 2005-01-17 10:23:38
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/tally/report In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client/tally/report Modified Files: BasicReport.java Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. Index: BasicReport.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/tally/report/BasicReport.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BasicReport.java 23 Dec 2004 10:20:37 -0000 1.4 --- BasicReport.java 17 Jan 2005 10:23:28 -0000 1.5 *************** *** 31,34 **** --- 31,35 ---- import java.util.Iterator; + import javax.management.JMException; import javax.management.ObjectName; import javax.print.Doc; *************** *** 46,49 **** --- 47,51 ---- import org.eclipse.swt.widgets.Shell; import org.redpos.amount.Amount; + import org.redpos.client.contract.POSEngineUtility; import org.redpos.client.contract.properties.PropertiesUtility; import org.redpos.client.lang.contract.Language; *************** *** 78,83 **** private Amount rounding = new Amount(0.0); private Amount total2 = new Amount(0.0); ! ! /** * The order in which the different types of tally row data should be --- 80,87 ---- private Amount rounding = new Amount(0.0); private Amount total2 = new Amount(0.0); ! ! private POSEngineUtility posEngineUtility; ! ! /** * The order in which the different types of tally row data should be *************** *** 98,101 **** --- 102,106 ---- new TallyRowOrderInfo("Payment", "PAY4"), new TallyRowOrderInfo("Payment", "PAY5"), + new TallyRowOrderInfo("Payment", "SICUEX"), new TallyRowOrderInfo("Payment", "ROUNDING"), new TallyRowOrderInfo("ReceiptAmount", "Total"), *************** *** 181,185 **** report.append(NEW_LINE); report.append(NEW_LINE); ! // add data rows, use array of order info to get the rows in the right // order --- 186,190 ---- report.append(NEW_LINE); report.append(NEW_LINE); ! // add data rows, use array of order info to get the rows in the right // order *************** *** 189,192 **** --- 194,198 ---- for(Iterator iter = tally.getTallyRows().iterator(); iter.hasNext();) { + TallyRowData row = (TallyRowData)iter.next(); if(dataTypeOrder[i].type.equalsIgnoreCase(row.getType()) *************** *** 197,202 **** && row.getId().equalsIgnoreCase("Total")) report.append(getSeparator()); ! report.append(createReportRow(row)); report.append(NEW_LINE); report.append(NEW_LINE); --- 203,209 ---- && row.getId().equalsIgnoreCase("Total")) report.append(getSeparator()); ! report.append(createReportRow(row)); + report.append(NEW_LINE); report.append(NEW_LINE); *************** *** 218,222 **** report.append(tally.getCashiers()); report.append(NEW_LINE); ! // get date time formatter DateFormat dtf = DateFormat.getDateTimeInstance(DateFormat.SHORT, --- 225,229 ---- report.append(tally.getCashiers()); report.append(NEW_LINE); ! // get date time formatter DateFormat dtf = DateFormat.getDateTimeInstance(DateFormat.SHORT, *************** *** 228,232 **** report.append(dtf.format(tally.getFromReceiptDate())); report.append(NEW_LINE); ! report.append(lang.getString("client.tally.report.string18.text", "Last sale registered at:")); --- 235,239 ---- report.append(dtf.format(tally.getFromReceiptDate())); report.append(NEW_LINE); ! report.append(lang.getString("client.tally.report.string18.text", "Last sale registered at:")); *************** *** 234,238 **** report.append(dtf.format(tally.getToReceiptDate())); report.append(NEW_LINE); ! String cancelledReceiptsCount = getCancelledReceiptCount(tally); if(cancelledReceiptsCount != null) --- 241,245 ---- report.append(dtf.format(tally.getToReceiptDate())); report.append(NEW_LINE); ! String cancelledReceiptsCount = getCancelledReceiptCount(tally); if(cancelledReceiptsCount != null) *************** *** 244,248 **** report.append(NEW_LINE); } ! String returnReceiptsCount = getReturnReceiptsCount(tally); if(returnReceiptsCount != null) --- 251,255 ---- report.append(NEW_LINE); } ! String returnReceiptsCount = getReturnReceiptsCount(tally); if(returnReceiptsCount != null) *************** *** 308,312 **** String reportDir = dataPath + File.separator + "redpos" + File.separator + "reports"; ! // make sure that the report dir really exists, if not create it File reportDirFile = new File(reportDir); --- 315,319 ---- String reportDir = dataPath + File.separator + "redpos" + File.separator + "reports"; ! // make sure that the report dir really exists, if not create it File reportDirFile = new File(reportDir); *************** *** 366,371 **** "The requested printer was not found or does not support the wanted printing format"); } ! ! /* * print through unix LPR command String printCommand = "lpr -P apoc " + * reportFilename; Runtime.getRuntime().exec(printCommand); --- 373,377 ---- "The requested printer was not found or does not support the wanted printing format"); } ! /* * print through unix LPR command String printCommand = "lpr -P apoc " + * reportFilename; Runtime.getRuntime().exec(printCommand); *************** *** 542,546 **** { StringBuffer newRow = new StringBuffer(); ! if(data.getType().equalsIgnoreCase("Payment")) { --- 548,552 ---- { StringBuffer newRow = new StringBuffer(); ! if(data.getType().equalsIgnoreCase("Payment")) { *************** *** 583,586 **** --- 589,607 ---- text = lang.getString("client.tally.report.string35.text", "Sale with pay5"); + else if(data.getId().equalsIgnoreCase("SICUEX")) + { + try + { + text = lang.getString("client.tally.report.string36.text", + "Sale with SimpleCurrencyExchange"); + text = text + " (" +lang.getString("client.tally.report.string37.text", + "rate"); + text = text + posEngineUtility.getCurrencyRateString() +")"; + } + catch(JMException e) + { + log.error(e.getMessage(), e); + } + } else if(data.getId().equalsIgnoreCase("Rounding")) text = lang.getString("client.tally.report.string29.text", *************** *** 752,755 **** --- 773,777 ---- { PropertiesUtility po = new PropertiesUtility(getServer()); + posEngineUtility = new POSEngineUtility(getServer()); // get report printer name |
From: Anneli <an...@us...> - 2005-01-17 10:23:31
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/payment In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17783/src/org/redpos/client/payment Added Files: SimpleCurrencyExchangePayment.java Log Message: New type of payment SimpleCurrencyExchange, enter rate on one currency in properties.xml, when using this payment type the amount will be shown in the currency entered, this is just for the gui part, no info about rate or will be saved in the database. --- NEW FILE: SimpleCurrencyExchangePayment.java --- /* * RedPOS, the OpenSource Point of Sale * * Copyright (C) 2004-2007 Redpill AB * * This application is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software * Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This application is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this application; if not, it can be downloaded * from http://www.gnu.org/licenses/lgpl.html. * * For more information and contacts, please visit http://www.redpos.org * */ package org.redpos.client.payment; import org.redpos.amount.Amount; import org.redpos.client.contract.properties.PropertiesUtility; import org.redpos.client.payment.contract.PaymentException; /** * Type of payment * * @version <tt>$Revision: 1.1 $</tt> * @author <a href="mailto:an...@us...">anba</a> * * @jmx.mbean name = "RedPOS.client.payment:service=SimpleCurrencyExchange" * description = "RedPOS client cash payment" * extends = "org.redpos.client.payment.PaymentMBean" */ public class SimpleCurrencyExchangePayment extends PaymentMBeanSupport implements SimpleCurrencyExchangePaymentMBean { /** * @see org.redpos.client.payment.PaymentMBeanSupport#validateAmount(org.redpos.amount.Amount, * org.redpos.amount.Amount) */ public void validateAmount(Amount amountToPay, Amount enteredPayAmount) throws PaymentException { super.validateAmount(amountToPay, enteredPayAmount); } /** * @see org.jboss.system.ServiceMBeanSupport#startService() */ protected void startService() throws Exception { super.startService(); setName(getLanguageString("client.payment.simplecurrencyexchange.name.text", "SimpleCurrencyExchange")); setReceiptText(getLanguageString("client.payment.simplecurrencyexchange.receipt.text", "SimpleCurrencyExchange")); getLog().info("Started SimpleCurrencyExchangePayment service: " + getName()); // get settings from properties // PropertiesUtility po = new PropertiesUtility(this.getServer()); setIndex((Integer)po.getProperty("payments", "simplecurrencyexchangeindex")); setCode((String)po.getProperty("payments", "simplecurrencyexchangecode")); setChangeAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangechangeallowed")).booleanValue()); setRepayAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangerepayallowed")).booleanValue()); setCancelAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangecancelallowed")).booleanValue()); setUpdateAllowed(((Boolean)po.getProperty("payments", "simplecurrencyexchangeupdateallowed")).booleanValue()); setLimit(((Double)po.getProperty("payments", "simplecurrencyexchangelimit")).doubleValue()); setLimitChange(((Double)po.getProperty("payments", "simplecurrencyexchangelimitchange")).doubleValue()); setLimitRepay(((Double)po.getProperty("payments", "simplecurrencyexchangelimitrepay")).doubleValue()); } } |
From: Lennart P. <le...@us...> - 2005-01-13 15:58:06
|
Update of /cvsroot/redpos/RedPOS_third_party/jboss/server/redpos/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25103/jboss/server/redpos/lib Modified Files: hsqldb.jar Log Message: Version 1.7.2 Index: hsqldb.jar =================================================================== RCS file: /cvsroot/redpos/RedPOS_third_party/jboss/server/redpos/lib/hsqldb.jar,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsAo0zZF and /tmp/cvspo65C3 differ |
From: Lennart P. <le...@us...> - 2005-01-13 15:57:49
|
Update of /cvsroot/redpos/RedPOS_third_party/jboss/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25060/jboss/bin Added Files: sqltool.sh Log Message: Added sqltool --- NEW FILE: sqltool.sh --- echo echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ echo Remember that you explicitly has to run COMMIT to store echo any changes that you might have done!!! echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++ echo java -jar ../server/redpos/lib/hsqldb.jar --noAutoFile --rcfile ../server/redpos/data/hypersonic/sqltool.rc RedPOS |
From: Lennart P. <le...@us...> - 2005-01-13 15:57:30
|
Update of /cvsroot/redpos/RedPOS_third_party/jboss/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25012/jboss/bin Modified Files: run.sh Log Message: -Xmx128m Index: run.sh =================================================================== RCS file: /cvsroot/redpos/RedPOS_third_party/jboss/bin/run.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** run.sh 13 Jan 2005 10:04:40 -0000 1.5 --- run.sh 13 Jan 2005 15:57:20 -0000 1.6 *************** *** 175,179 **** # Setup JBoss sepecific properties # RedPOS ! JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME -Djava.library.path=$JBOSS_HOME/swt/linux-gtk -Duser.language=sv -Duser.region=SE" # For Cygwin, switch paths to Windows format before running java --- 175,179 ---- # Setup JBoss sepecific properties # RedPOS ! JAVA_OPTS="$JAVA_OPTS -Xmx128m -Dprogram.name=$PROGNAME -Djava.library.path=$JBOSS_HOME/swt/linux-gtk -Duser.language=sv -Duser.region=SE" # For Cygwin, switch paths to Windows format before running java |
From: Lennart P. <le...@us...> - 2005-01-13 15:53:00
|
Update of /cvsroot/redpos/RedPOS In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24114 Modified Files: build.xml Log Message: Added sqltool Index: build.xml =================================================================== RCS file: /cvsroot/redpos/RedPOS/build.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** build.xml 27 Dec 2004 11:22:24 -0000 1.12 --- build.xml 13 Jan 2005 15:52:49 -0000 1.13 *************** *** 156,159 **** --- 156,162 ---- <include name="localDB.*"/> </fileset> + <fileset dir="${project.db}/scripts"> + <include name="sqltool.rc"/> + </fileset> </copy> |
From: Lennart P. <le...@us...> - 2005-01-13 15:53:00
|
Update of /cvsroot/redpos/RedPOS/db/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24114/db/scripts Added Files: sqltool.rc Log Message: Added sqltool --- NEW FILE: sqltool.rc --- # $Id: sqltool.rc,v 1.11 2004/07/18 21:34:35 unsaved Exp $ # Connect to RedPOS hsqldb database urlid RedPOS url jdbc:hsqldb:../server/redpos/data/hypersonic/localDB username sa password |
From: Anneli <an...@us...> - 2005-01-13 14:51:42
|
Update of /cvsroot/redpos/RedPOS/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12135/conf Modified Files: properties.xml Log Message: Changed from Calendar.roll() to Calendar.add(), bug 1101198 Index: properties.xml =================================================================== RCS file: /cvsroot/redpos/RedPOS/conf/properties.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** properties.xml 13 Jan 2005 09:48:23 -0000 1.7 --- properties.xml 13 Jan 2005 14:51:22 -0000 1.8 *************** *** 26,32 **** <property name="reportprintername" type="java.lang.String">apoc</property> <!-- The number of days to keep receipts in RedPOS client --> ! <property name="receiptsavetime" type="java.lang.Integer">7</property> <!-- The number of days to keep reports/tallies in RedPOS client --> ! <property name="reportsavetime" type="java.lang.Integer">7</property> </property-category> --- 26,32 ---- <property name="reportprintername" type="java.lang.String">apoc</property> <!-- The number of days to keep receipts in RedPOS client --> ! <property name="receiptsavetime" type="java.lang.Integer">365</property> <!-- The number of days to keep reports/tallies in RedPOS client --> ! <property name="reportsavetime" type="java.lang.Integer">365</property> </property-category> *************** *** 170,173 **** --- 170,174 ---- <property name="Pay5LimitRepay" type="java.lang.Double">10000</property> + </property-category> |
From: Anneli <an...@us...> - 2005-01-13 14:51:42
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/receipt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12135/src/org/redpos/client/receipt Modified Files: ReceiptSession.java Log Message: Changed from Calendar.roll() to Calendar.add(), bug 1101198 Index: ReceiptSession.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/receipt/ReceiptSession.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ReceiptSession.java 11 Jan 2005 17:11:37 -0000 1.3 --- ReceiptSession.java 13 Jan 2005 14:51:21 -0000 1.4 *************** *** 1720,1727 **** Calendar cal = Calendar.getInstance(); ! ! // cal.roll(Calendar.DATE, savetime.intValue() * -1); ! cal.roll(Calendar.MONTH, savetime.intValue() * -1); ! getLog().debug("Receipts prior to " + cal.getTime() + " will be deleted"); --- 1720,1725 ---- Calendar cal = Calendar.getInstance(); ! cal.add(Calendar.DATE, savetime.intValue() * -1); ! getLog().debug("Receipts prior to " + cal.getTime() + " will be deleted"); |
From: Anneli <an...@us...> - 2005-01-13 14:51:37
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/tally In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12135/src/org/redpos/client/tally Modified Files: Tally.java Log Message: Changed from Calendar.roll() to Calendar.add(), bug 1101198 Index: Tally.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/tally/Tally.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Tally.java 23 Nov 2004 16:02:59 -0000 1.1 --- Tally.java 13 Jan 2005 14:51:22 -0000 1.2 *************** *** 535,539 **** Integer savetime = (Integer)po.getProperty("pos", "reportsavetime"); Calendar cal = Calendar.getInstance(); ! cal.roll(Calendar.DATE, savetime.intValue() * -1); getLog().debug("Tallies prior to " + cal.getTime() + " will be deleted"); --- 535,539 ---- Integer savetime = (Integer)po.getProperty("pos", "reportsavetime"); Calendar cal = Calendar.getInstance(); ! cal.add(Calendar.DATE, savetime.intValue() * -1); getLog().debug("Tallies prior to " + cal.getTime() + " will be deleted"); |
From: Lennart P. <le...@us...> - 2005-01-13 10:04:51
|
Update of /cvsroot/redpos/RedPOS_third_party/jboss/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22724/jboss/bin Modified Files: run.sh Log Message: Index: run.sh =================================================================== RCS file: /cvsroot/redpos/RedPOS_third_party/jboss/bin/run.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** run.sh 11 Jan 2005 13:58:22 -0000 1.4 --- run.sh 13 Jan 2005 10:04:40 -0000 1.5 *************** *** 219,221 **** rm $JBOSS_HOME/bin/redpos.lck fi ! ffi --- 219,221 ---- rm $JBOSS_HOME/bin/redpos.lck fi ! fi |
From: Lennart P. <le...@us...> - 2005-01-13 09:48:34
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/txe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19388/src/org/redpos/txe Modified Files: TXELocator.java Log Message: Added property interval-seconds specifying interval between try to connect to TXE Index: TXELocator.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/txe/TXELocator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TXELocator.java 27 Dec 2004 22:13:34 -0000 1.2 --- TXELocator.java 13 Jan 2005 09:48:23 -0000 1.3 *************** *** 65,68 **** --- 65,73 ---- */ public String port = ""; + + /** + * Interval in seconds between trying to connect TXE + */ + public Integer intervalSeconds = new Integer(60); /** *************** *** 138,141 **** --- 143,147 ---- logger.info("---> TXE enabled and will use IP address " + getIpAddress() + ":" + getPort()); + setIntervalSeconds((Integer)po.getProperty("txe", "interval-seconds")); // Start a thread that will try to reach TXE to be authorized *************** *** 239,242 **** --- 245,258 ---- { log.debug("I'm running..."); + + try + { + // Initial sleep before trying first time to connect with TXE + Thread.sleep(5000); + } + catch(InterruptedException e1) + { + log.error(e1.getMessage(), e1); + } while(goOn) *************** *** 244,252 **** try { - Thread.sleep(5000); if(goOn) { log.trace("Time to ping TXE"); authorizeTXE(); } } --- 260,272 ---- try { if(goOn) { log.trace("Time to ping TXE"); authorizeTXE(); + + if(goOn) + { + Thread.sleep((getIntervalSeconds().intValue()*1000)); + } } } *************** *** 327,329 **** --- 347,365 ---- } + /** + * @return Returns the intervalSeconds. + * @jmx.managed-attribute + */ + public Integer getIntervalSeconds() + { + return intervalSeconds; + } + /** + * @param intervalSeconds The intervalSeconds to set. + * @jmx.managed-attribute + */ + public void setIntervalSeconds(Integer intervalSeconds) + { + this.intervalSeconds = intervalSeconds; + } } \ No newline at end of file |
From: Lennart P. <le...@us...> - 2005-01-13 09:48:33
|
Update of /cvsroot/redpos/RedPOS/conf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19388/conf Modified Files: properties.xml Log Message: Added property interval-seconds specifying interval between try to connect to TXE Index: properties.xml =================================================================== RCS file: /cvsroot/redpos/RedPOS/conf/properties.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** properties.xml 10 Jan 2005 15:23:57 -0000 1.6 --- properties.xml 13 Jan 2005 09:48:23 -0000 1.7 *************** *** 36,39 **** --- 36,40 ---- <property name="ipAddress" type="java.lang.String">xxx.xxx.xxx.xxx</property> <property name="port" type="java.lang.String">1099</property> + <property name="interval-seconds" type="java.lang.Integer">60</property> </property-category> |
From: Lennart P. <le...@us...> - 2005-01-13 09:47:58
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/receipt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19277/src/org/redpos/client/receipt Modified Files: ReceiptRowStorage.java Log Message: Added some trace logging Index: ReceiptRowStorage.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/receipt/ReceiptRowStorage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReceiptRowStorage.java 23 Nov 2004 16:02:31 -0000 1.1 --- ReceiptRowStorage.java 13 Jan 2005 09:47:49 -0000 1.2 *************** *** 188,191 **** --- 188,235 ---- } + /* (non-Javadoc) + * @see org.redpos.mbean.StorageMBeanSupport#startService() + */ + protected void startService() throws Exception + { + // TODO Auto-generated method stub + super.startService(); + + /* if(log.isTraceEnabled()) + { + // create column names for where clause + String where[] = {DB_COLUMN_NAME_RECEIPTID}; + // create values for where clause + Object values[] = {"%"}; + // create columns for order by clause + String orderBy[] = {DB_COLUMN_NAME_RECEIPTID, DB_COLUMN_NAME_ROWORDER}; + + // call select in table + Vector result = receiptRowTable.select(getConnection(), where, values, + orderBy, true, true); + log.info("Size:"+result.size()); + + Vector rows = new Vector(); + Map data; + StringBuffer buf = new StringBuffer(); + if(!result.isEmpty()) + { + for(Iterator iter = result.iterator(); iter.hasNext();) + { + RedPOSRow row = (RedPOSRow)iter.next(); + data = row.getValues(); + buf.append(data.get(DB_COLUMN_NAME_RECEIPTID)); + buf.append(","); + buf.append(data.get(DB_COLUMN_NAME_ROWORDER)); + buf.append(","); + buf.append(data.get(DB_COLUMN_NAME_ROWOBJECT)); + log.trace(buf.toString()); + buf.delete(0, buf.length()); + } + } + } + */ + } + /** * Returns all receipt rows that belong to given receipt id |
From: Anneli <an...@us...> - 2005-01-12 15:43:32
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22507/src/org/redpos/client/ui/plugin/function Modified Files: FindProductUI.java FindReceiptUI.java Log Message: Input field in search should not be editable when product/receipt has been choosen Index: FindProductUI.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/FindProductUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FindProductUI.java 10 Jan 2005 15:23:57 -0000 1.2 --- FindProductUI.java 12 Jan 2005 15:43:21 -0000 1.3 *************** *** 238,242 **** int index = productTable.getSelectionIndex(); if(index != -1) ! showProduct(index); } }; --- 238,245 ---- int index = productTable.getSelectionIndex(); if(index != -1) ! { ! inputField.setEditable(false); ! showProduct(index); ! } } }; *************** *** 314,317 **** --- 317,321 ---- public void handleEvent(Event arg0) { + inputField.setEditable(true); productInfoBackSelected(); } Index: FindReceiptUI.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/FindReceiptUI.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FindReceiptUI.java 11 Jan 2005 17:11:39 -0000 1.1 --- FindReceiptUI.java 12 Jan 2005 15:43:21 -0000 1.2 *************** *** 49,52 **** --- 49,53 ---- import org.eclipse.swt.widgets.Listener; import org.redpos.amount.Amount; + import org.redpos.client.contract.receipt.ReceiptConstants; import org.redpos.client.contract.receipt.ReceiptData; import org.redpos.client.lang.contract.Language; *************** *** 79,82 **** --- 80,85 ---- private Label receiptAmountText; private Label receiptAmount; + private Label receiptTypeText; + private Label receiptType; *************** *** 218,222 **** --- 221,228 ---- int index = receiptTable.getSelectionIndex(); if (index != -1) + { + inputField.setEditable(false); showReceipt(index); + } } }; *************** *** 237,241 **** GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; ! gridLayout.verticalSpacing = 10; receiptInfo.setLayout(gridLayout); --- 243,247 ---- GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 2; ! gridLayout.verticalSpacing = 8; receiptInfo.setLayout(gridLayout); *************** *** 251,255 **** "ui.plugin.receipt.findreceipt.receiptid.text", "Receipt:")); - receiptId = new Label(receiptInfo, SWT.LEFT); receiptId.setBackground(getBackground()); --- 257,260 ---- *************** *** 259,262 **** --- 264,284 ---- receiptId.setLayoutData(receiptIdData); + receiptTypeText = new Label(receiptInfo, SWT.LEFT); + receiptTypeText.setFont(fontManager.getDefaultBoldFont()); + receiptTypeText.setBackground(getBackground()); + GridData receiptTypeTextData = new GridData(); + receiptTypeTextData.horizontalAlignment = GridData.BEGINNING; + receiptTypeTextData.verticalAlignment = GridData.CENTER; + receiptTypeText.setLayoutData(receiptTypeTextData); + receiptTypeText.setText(language.getString( + "ui.plugin.receipt.findreceipt.receipttype.text", "Receipt type:")); + + receiptType = new Label(receiptInfo, SWT.LEFT); + receiptType.setBackground(getBackground()); + GridData receiptTypeData = new GridData(); + receiptTypeData.horizontalAlignment = GridData.BEGINNING; + receiptTypeData.verticalAlignment = GridData.CENTER; + receiptType.setLayoutData(receiptTypeData); + receiptDateText= new Label(receiptInfo, SWT.RIGHT); receiptDateText.setFont(fontManager.getDefaultBoldFont()); *************** *** 390,393 **** --- 412,416 ---- { stack.topControl = receiptTable; + inputField.setEditable(true); centerStack.layout(); } *************** *** 477,481 **** receiptCashier.setText(receipt.receiptData.getCashier()); receiptAmount.setText(receipt.amountTotal.toString()); ! receiptInfo.layout(); --- 500,517 ---- receiptCashier.setText(receipt.receiptData.getCashier()); receiptAmount.setText(receipt.amountTotal.toString()); ! String type = ""; ! if (receipt.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_NORMAL) ! type = language.getString( ! "ui.plugin.receipt.findreceipt.string3.text", "Sale"); ! if (receipt.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_COMPLAINT) ! type = language.getString( ! "ui.plugin.receipt.findreceipt.string4.text", "Complaint"); ! if (receipt.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_CORRECTION) ! type = language.getString( ! "ui.plugin.receipt.findreceipt.string5.text", "Correction"); ! if (receipt.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_RETURN) ! type = language.getString( ! "ui.plugin.receipt.findreceipt.string6.text", "Return"); ! receiptType.setText(type); receiptInfo.layout(); |
From: Anneli <an...@us...> - 2005-01-11 17:14:31
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12515/src/org/redpos/client/ui/plugin/function Added Files: CustomerService.java Log Message: New plugin for displaying information about support --- NEW FILE: CustomerService.java --- /* * RedPOS, the OpenSource Point of Sale * * Copyright (C) 2004-2007 Redpill AB * * This application is free software; you can redistribute * it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software * Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This application is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this application; if not, it can be downloaded * from http://www.gnu.org/licenses/lgpl.html. * * For more information and contacts, please visit http://www.redpos.org * */ package org.redpos.client.ui.plugin.function; import javax.management.JMException; import org.eclipse.swt.widgets.Composite; import org.redpos.client.contract.POSEngineUtility; import org.redpos.client.ui.plugin.PluginFunctionMBeanSupport; import org.redpos.client.ui.plugin.contract.PluginFunctionConstants; /** * Information to customer service for RedPOS * * @version <tt>$Revision: 1.1 $</tt> * @author <a href="mailto:an...@us...">anba</a> * @jmx.mbean name = "RedPOS.client.ui.plugin.function:service=CustomerService" * description = "RedPOS client plug-in function" * extends = "org.redpos.client.ui.plugin.PluginFunctionMBean" */ public class CustomerService extends PluginFunctionMBeanSupport implements CustomerServiceMBean { private POSEngineUtility posEngineUtility = null; /** * @see org.redpos.client.ui.plugin.PluginFunctionMBean#invoke(org.eclipse.swt.widgets.Composite) */ public boolean invokeFunction(Composite parent) { ConfirmActionUI.ConfirmListener listener = new ConfirmActionUI.ConfirmListener() { public void selectionMade(int selection) { // send notification fireNotification( PluginFunctionConstants.NOTIFICATION_FUNCTION_FINISHED, null); try { if (posEngineUtility.getLoginPerReceipt()) { fireNotification(PluginFunctionConstants.NOTIFICATION_LOGIN_PER_RECEIPT, null); } } catch(JMException e) { log.error(e.getMessage(), e); } } }; String yesText = ""; String noText = ""; String okText = getLanguageString("ui.main.dashboard.message.ok.text", "OK"); String cancelText = ""; String message = getLanguageString( "ui.plugin.support.customerservice.message.text", "Customer service su...@re..."); ConfirmActionUI confirm = new ConfirmActionUI(parent, message, ConfirmActionUI.OK_SELECTION, listener, yesText, noText, okText, cancelText); parent.layout(); return true; } /** * Invoked when service is started * * @see org.jboss.system.ServiceMBeanSupport#startService() */ protected void startService() throws Exception { super.startService(); setText(getLanguageString("ui.plugin.support.customerservice.text", "Customer Service")); posEngineUtility = new POSEngineUtility(getServer()); } } |
From: Anneli <an...@us...> - 2005-01-11 17:12:30
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/receipt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11881/src/org/redpos/client/receipt Modified Files: ReceiptStorage.java ReceiptSession.java Log Message: New function, save and find receipt Index: ReceiptStorage.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/receipt/ReceiptStorage.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReceiptStorage.java 23 Nov 2004 16:02:31 -0000 1.1 --- ReceiptStorage.java 11 Jan 2005 17:11:36 -0000 1.2 *************** *** 73,77 **** public static final String DB_COLUMN_NAME_TALLIED = "tallied"; ! public static final String allColumnNames[] = {DB_COLUMN_NAME_RECEIPTID, DB_COLUMN_NAME_REGISTERID, DB_COLUMN_NAME_STOREID, --- 73,77 ---- public static final String DB_COLUMN_NAME_TALLIED = "tallied"; ! public static final String allColumnNames[] = {DB_COLUMN_NAME_RECEIPTID, DB_COLUMN_NAME_REGISTERID, DB_COLUMN_NAME_STOREID, *************** *** 353,356 **** --- 353,458 ---- /** + * Finds all receipts that has a date that is greater than the given one + * + * @jmx.managed-operation + * @param addedDate + * @param status + * @return + * @throws SQLException + */ + public Vector findReceiptsByDateGreaterThan(final java.util.Date addedDate, final java.lang.Integer status) + throws SQLException + { + StringBuffer sql = new StringBuffer("SELECT "); + for(int i = 0; i < allColumnNames.length; i++) + { + if(i > 0) + sql.append(","); + + sql.append(allColumnNames[i]); + } + sql.append(" FROM "); + sql.append(DB_TABLE_NAME); + sql.append(" WHERE "); + sql.append(DB_COLUMN_NAME_ADDEDDATE); + sql.append(" > ?"); + sql.append(" AND "); + sql.append(DB_COLUMN_NAME_RECEIPTSTATUS); + sql.append(" = ?"); + sql.append(" ORDER BY "); + sql.append(DB_COLUMN_NAME_ADDEDDATE); + sql.append(" DESC "); + + // prepare statement + PreparedStatement ps = getConnection().prepareStatement(sql.toString()); + try + { + ps.setDate(1, new java.sql.Date(addedDate.getTime())); + ps.setInt(2, status.intValue()); + + // execute statement + ResultSet rs = ps.executeQuery(); + Vector redPosRows = new Vector(); + // parse result set + while(rs.next()) + { + RedPOSRow row = new RedPOSRow(); + // get value for every column + for(int i = 0; i < allColumnNames.length; i++) + { + Object value = rs.getObject(allColumnNames[i]); + row.addValue(allColumnNames[i], value); + } + // add row to result + redPosRows.add(row); + } + // convert rows to ReceiptData object + Vector receiptDatas = new Vector(); + for(Iterator iter = redPosRows.iterator(); iter.hasNext();) + { + RedPOSRow row = (RedPOSRow)iter.next(); + receiptDatas.add(this.createReceiptData(row)); + } + + return receiptDatas; + } + finally + { + ps.close(); + } + } + + /** + * Finds all receipts that has the given id + * + * @jmx.managed-operation + * @param receiptId + * @return + * @throws SQLException + */ + public Vector findReceiptsById(final String receiptId) throws SQLException + { + // create column names for where clause + String where[] = {DB_COLUMN_NAME_RECEIPTID}; + // create values for where clause + Object values[] = {receiptId}; + // create column names for order by + String orderBy[] = {DB_COLUMN_NAME_RECEIPTID}; + // call select in table + Vector result = receiptTable.select(getConnection(), where, values, + orderBy, false, true); + + Vector receipts = new Vector(); + for(Iterator iter = result.iterator(); iter.hasNext();) + { + RedPOSRow row = (RedPOSRow)iter.next(); + receipts.add(createReceiptData(row)); + } + + return receipts; + } + + + /** * Removes receipt with given id from the database * Index: ReceiptSession.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/receipt/ReceiptSession.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReceiptSession.java 11 Jan 2005 11:32:12 -0000 1.2 --- ReceiptSession.java 11 Jan 2005 17:11:37 -0000 1.3 *************** *** 30,33 **** --- 30,34 ---- import java.io.PrintStream; import java.util.Calendar; + import java.util.Collection; import java.util.Date; import java.util.HashMap; *************** *** 46,49 **** --- 47,51 ---- import org.redpos.client.contract.properties.PropertiesUtility; import org.redpos.client.contract.receipt.DiscountReceiptRow; + import org.redpos.client.contract.receipt.FreetextReceiptRow; import org.redpos.client.contract.receipt.PaymentReceiptRow; import org.redpos.client.contract.receipt.ProductReceiptRow; *************** *** 210,214 **** /** * Returns receipt rows ! * * @jmx.managed-attribute * @return --- 212,216 ---- /** * Returns receipt rows ! * * @jmx.managed-attribute * @return *************** *** 257,261 **** throws ReceiptException { ! return newOfType(register, storeId, cashier, pricelistId, ReceiptConstants.TYPE_RECEIPT_RETURN); } --- 259,263 ---- throws ReceiptException { ! return newOfType(register, storeId, cashier, pricelistId, ReceiptConstants.TYPE_RECEIPT_RETURN); } *************** *** 274,278 **** throws ReceiptException { ! return newOfType(register, storeId, cashier, pricelistId, ReceiptConstants.TYPE_RECEIPT_COMPLAINT); } --- 276,280 ---- throws ReceiptException { ! return newOfType(register, storeId, cashier, pricelistId, ReceiptConstants.TYPE_RECEIPT_COMPLAINT); } *************** *** 291,297 **** throws ReceiptException { ! return newOfType(register, storeId, cashier, pricelistId, ReceiptConstants.TYPE_RECEIPT_CORRECTION); } /** --- 293,346 ---- throws ReceiptException { ! return newOfType(register, storeId, cashier, pricelistId, ReceiptConstants.TYPE_RECEIPT_CORRECTION); } + + /** + * Starts a reopened receipt + * + * @jmx.managed-operation + * @param receipt + * @return + * @throws ReceiptException + */ + public String newReopening(final ReceiptData receipt) throws ReceiptException + { + return newOfTypeReopen(receipt); + } + + /** + * Starts an existing receipt + * + * @jmx.managed-operation + * @param receipt + * @return + * @throws ReceiptException + */ + public String newOfTypeReopen(final ReceiptData receipt) throws ReceiptException + { + // init fields + addedDate = new Date(); + receiptId = receipt.getReceiptId(); + registerId = receipt.getRegisterId(); + this.storeId = receipt.getStoreId(); + this.cashier = receipt.getCashier(); + this.pricelistId = receipt.getPriceListId(); + receiptType = receipt.getReceiptType(); + receiptStatus = receipt.getReceiptStatus(); + + // create notification data + ReceiptNotificationData data = new ReceiptNotificationData(); + data.receiptId = receipt.getReceiptId(); + data.receiptType = receipt.getReceiptType(); + data.registerId = receipt.getRegisterId(); + data.cashier = receipt.getCashier(); + data.receiptDate = receipt.getAddedDate(); + + // send notification + fireNotification(ReceiptConstants.NOTIFICATION_RECEIPT_STARTED, data); + + return receiptId; + } /** *************** *** 307,311 **** public String newOfType(final String register, final String storeId, final String cashier, final String pricelistId, ! int type) throws ReceiptException { if(isStarted()) --- 356,360 ---- public String newOfType(final String register, final String storeId, final String cashier, final String pricelistId, ! int type ) throws ReceiptException { if(isStarted()) *************** *** 463,466 **** --- 512,523 ---- // count total updateTotal(); + + // send notification + fireNotification(ReceiptConstants.NOTIFICATION_RECEIPT_CLOSED, data); + + // clear attributes + reset(); + + } catch(Exception e) *************** *** 876,880 **** if(rr instanceof ProductReceiptRow && (receiptType == ReceiptConstants.TYPE_RECEIPT_COMPLAINT ! || receiptType == ReceiptConstants.TYPE_RECEIPT_RETURN || receiptType == ReceiptConstants.TYPE_RECEIPT_CORRECTION)) { // negate receipt row quantity cause of receipt type --- 933,938 ---- if(rr instanceof ProductReceiptRow && (receiptType == ReceiptConstants.TYPE_RECEIPT_COMPLAINT ! || receiptType == ReceiptConstants.TYPE_RECEIPT_RETURN ! || receiptType == ReceiptConstants.TYPE_RECEIPT_CORRECTION)) { // negate receipt row quantity cause of receipt type *************** *** 932,935 **** --- 990,1092 ---- /** + * Adds saved rows to reopened receipt + * + * @jmx.managed-operation + * @param receiptRowData + * @return completed ReceiptRow object + * @throws ReceiptException + */ + public ReceiptRow addRowToReopenedReceipt(Collection receiptRowData) throws ReceiptException + { + + // go through all rows + for(Iterator iter = receiptRowData.iterator(); iter.hasNext();) + { + ReceiptRowData element = (ReceiptRowData)iter.next(); + + if (element.getType() == (ReceiptConstants.TYPE_RECEIPTROW_PRODUCT) + && element.getStatus() == (ReceiptConstants.STATUS_RECEIPT_ACTIVE)) + { + ProductReceiptRow rr = new ProductReceiptRow(); + + rr.setAmount(element.getAmount()); + rr.setObject(element.getObject()); + rr.setOrder(element.getOrder()); + rr.setQuantity(element.getQuantity()); + rr.setReceiptId(element.getReceiptId()); + rr.setReference(element.getReference()); + rr.setStatus(element.getStatus()); + rr.setTaxAmount(element.getTaxAmount()); + rr.setTaxPercentage(element.getTaxPercentage()); + rr.setText(element.getText()); + rr.setType(element.getType()); + + // save row + rowsInCurrentReceipt.add(rr); + + // create notification data + ReceiptNotificationData data = new ReceiptNotificationData(); + data.receiptId = element.getReceiptId(); + data.receiptRow = rr; + + // send notification + fireNotification(ReceiptConstants.NOTIFICATION_RECEIPTROW_ADDED, data); + + // increase order counter + nextRowOrder = element.getOrder(); + + // select row + selectRow(rr); + + } + if (element.getType() == (ReceiptConstants.TYPE_RECEIPTROW_FREETEXT) + && element.getStatus() == (ReceiptConstants.STATUS_RECEIPT_ACTIVE)) + { + FreetextReceiptRow rr = new FreetextReceiptRow(element.getText()); + + // save row + rowsInCurrentReceipt.add(rr); + + // create notification data + ReceiptNotificationData data = new ReceiptNotificationData(); + data.receiptId = element.getReceiptId(); + data.receiptRow = rr; + + // send notification + fireNotification(ReceiptConstants.NOTIFICATION_RECEIPTROW_ADDED, data); + + // increase order counter + nextRowOrder = element.getOrder(); + + // select row + selectRow(rr); + + } + if (element.getType() != (ReceiptConstants.TYPE_RECEIPTROW_PRODUCT) + && element.getType() != (ReceiptConstants.TYPE_RECEIPTROW_FREETEXT)) + { + // increase order counter + nextRowOrder = element.getOrder(); + } + + if (element.getType() == (ReceiptConstants.TYPE_RECEIPTROW_PRODUCT) + || element.getType() == (ReceiptConstants.TYPE_RECEIPTROW_FREETEXT) + && element.getStatus() != (ReceiptConstants.STATUS_RECEIPT_ACTIVE)) + { + // increase order counter + nextRowOrder = element.getOrder(); + } + + } + // count total + updateTotal(); + + nextRowOrder++; + + ReceiptRow rr= null;; + return rr; + } + + /** * Updates given receipt row in the receipt * *************** *** 1145,1149 **** double totalDiscountPercent = 0; boolean paymentAdded = false; - // go through all receipt rows // --- 1302,1305 ---- *************** *** 1161,1165 **** else if(element instanceof ProductReceiptRow) { ! // Product receipt row, add amount to total Amount temp = (Amount)element.getAmount().clone(); temp.multiply(element.getQuantity()); --- 1317,1321 ---- else if(element instanceof ProductReceiptRow) { ! // Product receipt row, add amount to total Amount temp = (Amount)element.getAmount().clone(); temp.multiply(element.getQuantity()); *************** *** 1391,1395 **** { selectedRow = receiptRow; ! // create notification data ReceiptNotificationData data = new ReceiptNotificationData(); --- 1547,1551 ---- { selectedRow = receiptRow; ! // create notification data ReceiptNotificationData data = new ReceiptNotificationData(); |
From: Anneli <an...@us...> - 2005-01-11 17:12:27
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/contract/receipt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11881/src/org/redpos/client/contract/receipt Modified Files: ReceiptSessionUtility.java Log Message: New function, save and find receipt Index: ReceiptSessionUtility.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/contract/receipt/ReceiptSessionUtility.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReceiptSessionUtility.java 23 Nov 2004 16:02:08 -0000 1.1 --- ReceiptSessionUtility.java 11 Jan 2005 17:11:35 -0000 1.2 *************** *** 24,27 **** --- 24,29 ---- package org.redpos.client.contract.receipt; + import java.util.Collection; + import javax.management.JMException; import javax.management.MBeanException; *************** *** 164,168 **** } } ! /** * Add a new row to receipt. Will start a new receipt if none is active. --- 166,199 ---- } } ! ! /** ! * Starts a reopened receipt ! * ! * @param receipt ! * @throws JMException ! * @throws ReceiptException ! */ ! public void newReopeningReceipt(final ReceiptData receipt) ! throws JMException, ! ReceiptException ! { ! try ! { ! Object[] params = {receipt}; ! String[] signature = {"org.redpos.client.contract.receipt.ReceiptData"}; ! getServer().invoke(getService(), "newReopening", params, signature); ! } ! catch(MBeanException e) ! { ! // exception thrown by mbean method ! Exception targetException = e.getTargetException(); ! throw (ReceiptException)targetException; ! } ! catch(JMException e) ! { ! throw e; ! } ! } ! /** * Add a new row to receipt. Will start a new receipt if none is active. *************** *** 200,203 **** --- 231,266 ---- } } + + /** + * Add a new row to receipt. Will start a new receipt if none is active. + * + * @param rr + * @param register + * @param store id + * @param cashier + * @param pricelistid + * @throws JMException + * @throws ReceiptException + */ + public void addReceiptRowToReopenedReceipt(Collection receiptRowData) throws JMException, + ReceiptException + { + try + { + Object[] params = {receiptRowData}; + String[] signature = {"java.util.Collection"}; + getServer().invoke(getService(), "addRowToReopenedReceipt", params, signature); + } + catch(MBeanException e) + { + // exception thrown by mbean method + Exception targetException = e.getTargetException(); + throw (ReceiptException)targetException; + } + catch(JMException e) + { + throw e; + } + } /** |