From: Anneli <an...@us...> - 2005-01-17 10:28:31
|
Update of /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18475/src/org/redpos/client/ui/plugin/function Modified Files: FindReceiptUI.java FindProductUI.java Log Message: The choosen product/receipt can now be added to receipt even if the user has moved focus to the input field, and then presses add. Index: FindProductUI.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/FindProductUI.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FindProductUI.java 12 Jan 2005 15:43:21 -0000 1.3 --- FindProductUI.java 17 Jan 2005 10:28:15 -0000 1.4 *************** *** 88,91 **** --- 88,93 ---- private Integer productSearch; + + private ProductTableItemData productTableItemData; /** *************** *** 390,396 **** private void productInfoToRegisterSelected() { ! ProductTableItemData product = getSelectedProduct(); ! listener.addProductToReceiptSelected(product.productData, ! product.priceData); } --- 392,398 ---- private void productInfoToRegisterSelected() { ! listener.addProductToReceiptSelected(productTableItemData.productData, ! productTableItemData.priceData); ! } *************** *** 506,517 **** { // get product data ! ProductTableItemData product = (ProductTableItemData)item.getData(); // set product info String priceText; ! if(product.priceData != null) { ! Amount amount = new Amount(product.priceData.getGrossPrice(), ! product.priceData.getCurrency()); priceText = amount.toString(); } --- 508,519 ---- { // get product data ! productTableItemData = (ProductTableItemData)item.getData(); // set product info String priceText; ! if(productTableItemData.priceData != null) { ! Amount amount = new Amount(productTableItemData.priceData.getGrossPrice(), ! productTableItemData.priceData.getCurrency()); priceText = amount.toString(); } *************** *** 519,532 **** priceText = noPriceText; ! productInfoName.setText(product.productData.getProductText()); productInfoPrice.setText(priceText); ! if(product.productData.getProductId() != null) ! productInfoId.setText(product.productData.getBarcode1()); else productInfoId.setText(""); ! if(product.productData.getSalesupport() != null) ! productInfoSalesupport.setText(product.productData.getSalesupport()); else productInfoSalesupport.setText(""); --- 521,534 ---- priceText = noPriceText; ! productInfoName.setText(productTableItemData.productData.getProductText()); productInfoPrice.setText(priceText); ! if(productTableItemData.productData.getProductId() != null) ! productInfoId.setText(productTableItemData.productData.getBarcode1()); else productInfoId.setText(""); ! if(productTableItemData.productData.getSalesupport() != null) ! productInfoSalesupport.setText(productTableItemData.productData.getSalesupport()); else productInfoSalesupport.setText(""); Index: FindReceiptUI.java =================================================================== RCS file: /cvsroot/redpos/RedPOS/src/org/redpos/client/ui/plugin/function/FindReceiptUI.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FindReceiptUI.java 12 Jan 2005 15:43:21 -0000 1.2 --- FindReceiptUI.java 17 Jan 2005 10:28:15 -0000 1.3 *************** *** 82,85 **** --- 82,86 ---- private Label receiptTypeText; private Label receiptType; + private ReceiptTableItemData receiptTableItemData; *************** *** 422,427 **** private void receiptInfoToRegisterSelected() { ! ReceiptTableItemData receipt = getSelectedReceipt(); ! listener.addReceiptSelected(receipt); } --- 423,427 ---- private void receiptInfoToRegisterSelected() { ! listener.addReceiptSelected(receiptTableItemData); } *************** *** 492,514 **** { // get receipt data ! ReceiptTableItemData receipt = (ReceiptTableItemData)item.getData(); // set receipt info ! receiptId.setText(receipt.receiptData.getReceiptId()); SimpleDateFormat sdf = new SimpleDateFormat("yyMMd hh:mm:ss"); ! String date = sdf.format(receipt.receiptData.getAddedDate()); receiptDate.setText(date); ! 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"); --- 492,514 ---- { // get receipt data ! receiptTableItemData = (ReceiptTableItemData)item.getData(); // set receipt info ! receiptId.setText(receiptTableItemData.receiptData.getReceiptId()); SimpleDateFormat sdf = new SimpleDateFormat("yyMMd hh:mm:ss"); ! String date = sdf.format(receiptTableItemData.receiptData.getAddedDate()); receiptDate.setText(date); ! receiptCashier.setText(receiptTableItemData.receiptData.getCashier()); ! receiptAmount.setText(receiptTableItemData.amountTotal.toString()); String type = ""; ! if (receiptTableItemData.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_NORMAL) type = language.getString( "ui.plugin.receipt.findreceipt.string3.text", "Sale"); ! if (receiptTableItemData.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_COMPLAINT) type = language.getString( "ui.plugin.receipt.findreceipt.string4.text", "Complaint"); ! if (receiptTableItemData.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_CORRECTION) type = language.getString( "ui.plugin.receipt.findreceipt.string5.text", "Correction"); ! if (receiptTableItemData.receiptData.getReceiptType() == ReceiptConstants.TYPE_RECEIPT_RETURN) type = language.getString( "ui.plugin.receipt.findreceipt.string6.text", "Return"); |