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 |