Author: jleroux
Date: Wed Aug 2 14:27:49 2006 New Revision: 428156 URL: http://svn.apache.org/viewvc?rev=428156&view=rev Log: This implement the load part of OFBIZ-734 (POS Save and load sessions). Actually they are not sessions but sales. You can add a shopping list (saved sale) to the current cart (current sale) or replace it. The button to use is "LOAD SALE" (or "Charger une vente" in french) This work was partly funded by Ray Barlow, thanks to him. In the same time decided to commit the xpos.properties file in the state it is on machine to avoid futur svn conflicts for me. If someone thinks it's a problem let me know. I commit also additions in posmain.xml : new product button to test the new scrollable panel. Added: incubator/ofbiz/trunk/applications/pos/screens/default/includes/sales.xml (with props) incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/screen/Sales.java (with props) Modified: incubator/ofbiz/trunk/applications/pos/config/XuiLabels.properties incubator/ofbiz/trunk/applications/pos/config/XuiLabels_fr.properties incubator/ofbiz/trunk/applications/pos/config/buttonevents.xml incubator/ofbiz/trunk/applications/pos/config/pos.properties incubator/ofbiz/trunk/applications/pos/config/pos_fr.properties incubator/ofbiz/trunk/applications/pos/config/xpos.properties incubator/ofbiz/trunk/applications/pos/screens/default/includes/numeric.xml incubator/ofbiz/trunk/applications/pos/screens/default/menu/posmain.xml incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/PosTransaction.java incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/event/MenuEvents.java Modified: incubator/ofbiz/trunk/applications/pos/config/XuiLabels.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/config/XuiLabels.properties?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/config/XuiLabels.properties (original) +++ incubator/ofbiz/trunk/applications/pos/config/XuiLabels.properties Wed Aug 2 14:27:49 2006 @@ -15,65 +15,65 @@ # License for the specific language governing permissions and limitations # under the License. ##################################################################### - -SKU = SKU -MAIN = MAIN -MGR = MGR -PROMO = PROMO -LANG = LANG -PAY = PAY -TEST_ALERT = TEST ALERT -TEST_MSR = TEST MSR -CASH = CASH -CHECK = CHECK -CREDIT = CREDIT -GIFT_CERT = GIFT CERT -CLEAR_ONE = CLEAR ONE -CLEAR_ALL = CLEAR ALL -SET_REF# = SET REF# -FINISH = FINISH -CHANGE_PRICE = CHANGE PRICE -REPRINT = REPRINT -OPEN = OPEN -CLOSE = CLOSE -VOID_SALE = VOID SALE -CLEAR_CACHE = CLEAR CACHE -RESET_XUI = RESET XUI -OPEN_DRAWER = OPEN DRAWER -TOTALS = TOTAL -EXIT = EXIT -CLR = CLR -ENT = ENT -SIGN_OUT = SIGN OUT -LOCK = LOCK -QTY = QTY -MOD = MOD -ITEM_DISC = ITEM DISC -VOID_ITEM = VOID ITEM -VOID_SALE = VOID SALE -SALE_DISC = SALE DISC -TRANS_SAVE = TRANS SAVE -TRANS_RET = TRANS RET -CLR_DISC = CLR DISC -DEL = DEL - -promo_page = This will be the promo page! - -product_not_found = PRODUCT NOT FOUND -order_not_found = ORDER NOT FOUND -problems_reading_card = PROBLEMS READING SWIPED CARD -CASH_DRAWER_COMMUNICATION_ERROR= CASH DRAWER COMMUNICATION ERROR -CASH_DRAWER_IS_OPEN = CASH DRAWER IS OPEN -EXCEPTION = EXCEPTION -RECEIPT_PRINTER_COMMUNICATION_ERROR = RECEIPT PRINTER COMMUNICATION ERROR -INVALID_CARD_NUMBER = INVALID CARD NUMBER -MANAGER_NOT_LOGGED_IN = MANAGER NOT LOGGED IN -NO_ITEMS_SOLD = NO ITEMS SOLD -NOT_ENOUGH_FUNDS = CUSTOMER DID NOT PROVIDE ENOUGH FUNDS TO COMPLETE THIS SALE -FUNCTION_NOT_YET_SUPPORTED = FUNCTION NOT YET SUPPORTED -PRINTER_NOT_READY = PRINTER NOT READY -ITEM_MODIFICATION_ERROR = ITEM MODIFICATION ERROR -SALE_VOIDED = SALE VOIDED -TERMINAL_IS_CLOSED = TERMINAL IS CLOSED -TEST_ALERT_BOX = TEST ALERT BOX - TESTING THE DIALOG IMPLEMENTATION -UNKNOWN_CARD_TYPE = UNKNOWN CARD TYPE \ No newline at end of file +Add=Add +CASH=CASH +CASH_DRAWER_COMMUNICATION_ERROR=CASH DRAWER COMMUNICATION ERROR +CASH_DRAWER_IS_OPEN=CASH DRAWER IS OPEN +CHANGE_PRICE=CHANGE PRICE +CHECK=CHECK +CLEAR_ALL=CLEAR ALL +CLEAR_CACHE=CLEAR CACHE +CLEAR_ONE=CLEAR ONE +CLOSE=CLOSE +CLR=CLR +CLR_DISC=CLR DISC +CREDIT=CREDIT +Cancel=Cancel +DEL=DEL +ENT=ENT +EXCEPTION=EXCEPTION +EXIT=EXIT +FINISH=FINISH +FUNCTION_NOT_YET_SUPPORTED=FUNCTION NOT YET SUPPORTED +GIFT_CERT=GIFT CERT +INVALID_CARD_NUMBER=INVALID CARD NUMBER +ITEM_DISC=ITEM DISC +ITEM_MODIFICATION_ERROR=ITEM MODIFICATION ERROR +LANG=LANG +LOCK=LOCK +MAIN=MAIN +MANAGER_NOT_LOGGED_IN=MANAGER NOT LOGGED IN +MGR=MGR +MOD=MOD +NOT_ENOUGH_FUNDS=CUSTOMER DID NOT PROVIDE ENOUGH FUNDS TO COMPLETE THIS SALE +NO_ITEMS_SOLD=NO ITEMS SOLD +OK=OK +OPEN=OPEN +OPEN_DRAWER=OPEN DRAWER +PAY=PAY +PRINTER_NOT_READY=PRINTER NOT READY +PROMO=PROMO +QTY=QTY +RECEIPT_PRINTER_COMMUNICATION_ERROR=RECEIPT PRINTER COMMUNICATION ERROR +REPRINT=REPRINT +RESET_XUI=RESET XUI +Replace=Replace +SALE_DISC=SALE DISC +SALE_VOIDED=SALE VOIDED +SET_REF\#=SET REF# +SIGN_OUT=SIGN OUT +SKU=SKU +TERMINAL_IS_CLOSED=TERMINAL IS CLOSED +TEST_ALERT=TEST ALERT +TEST_ALERT_BOX=TEST ALERT BOX - TESTING THE DIALOG IMPLEMENTATION +TEST_MSR=TEST MSR +TOTALS=TOTAL +TRANS_RET=LOAD SALE +TRANS_SAVE=SAVE SALE +UNKNOWN_CARD_TYPE=UNKNOWN CARD TYPE +VOID_ITEM=VOID ITEM +VOID_SALE=VOID SALE +order_not_found=ORDER NOT FOUND +problems_reading_card=PROBLEMS READING SWIPED CARD +product_not_found=PRODUCT NOT FOUND +promo_page=This will be the promo page! Modified: incubator/ofbiz/trunk/applications/pos/config/XuiLabels_fr.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/config/XuiLabels_fr.properties?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/config/XuiLabels_fr.properties (original) +++ incubator/ofbiz/trunk/applications/pos/config/XuiLabels_fr.properties Wed Aug 2 14:27:49 2006 @@ -16,65 +16,65 @@ # License for the specific language governing permissions and limitations # under the License. ##################################################################### -SKU = Code -MAIN = Vente -MGR = Gestion -PROMO = Promos -LANG = Langage -PAY = Paiement -TEST_ALERT = Alerte (test) -TEST_MSR = Carte de crédit -CASH = Espèces -CHECK = Chèque -CREDIT = Crédit -GIFT_CERT = Bon d'achat -CLEAR_ONE = Annuler l'article -CLEAR_ALL = Tout annuler -SET_REF# = n° ? -FINISH = Fin -CHANGE_PRICE = Changer le prix -REPRINT = Réafficher -OPEN = Ouvrir -CLOSE = Fermer -VOID_SALE = Annuler une vente -CLEAR_CACHE = Annuler l'encours -RESET_XUI = Réinitialiser -OPEN_DRAWER = Ouvrir le tiroir -TOTALS = Totals -EXIT = Quitter -SIGN_OUT = Sortir -LOCK = Bloquer -QTY = Quantité -MOD = Changer la quantité -ITEM_DISC = Remise sur l'article -VOID_ITEM = Annuler l'article -CLR = Effacer -ENT = Valider -VOID_SALE = Annuler la vente -SALE_DISC = Remise sur la vente -TRANS_SAVE = -TRANS_RET = -CLR_DISC = Annuler la remise -DEL = Suppr. - -promo_page = Ce sera la page des promotions... - -product_not_found = Produit inconnu ! -order_not_found = N° de transaction inconnu ! -problems_reading_card = Problème lors de la lecture de la carte -CASH_DRAWER_COMMUNICATION_ERROR = Erreur lors de la communication avec le tiroir caisse -CASH_DRAWER_IS_OPEN = Le tiroir caisse est ouvert -EXCEPTION = Exception rencontrée -RECEIPT_PRINTER_COMMUNICATION_ERROR = Erreur lors de la communication avec l'imprimante de caisse -INVALID_CARD_NUMBER = N° de carte non valide -MANAGER_NOT_LOGGED_IN = Identifiant non gérant -NO_ITEMS_SOLD = Aucun article vendu -NOT_ENOUGH_FUNDS = Le client n'a pas fournit assez d'argent pour clôturer la vente -FUNCTION_NOT_YET_SUPPORTED = Fonction non encore supportée -PRINTER_NOT_READY = Imprimante de caisse non prête -ITEM_MODIFICATION_ERROR = Erreur lors de la modification de l'article -SALE_VOIDED = Vente annulée -TERMINAL_IS_CLOSED = Le terminal est fermé -TEST_ALERT_BOX = Test de l'implémentation des alertes -UNKNOWN_CARD_TYPE = Type de carte inconnu - +Add=Ajouter +CASH=Esp\u00E8ces +CASH_DRAWER_COMMUNICATION_ERROR=Erreur lors de la communication avec le tiroir caisse +CASH_DRAWER_IS_OPEN=Le tiroir caisse est ouvert +CHANGE_PRICE=Changer le prix +CHECK=Ch\u00E8que +CLEAR_ALL=Tout annuler +CLEAR_CACHE=Annuler l'encours +CLEAR_ONE=Annuler l'article +CLOSE=Fermer +CLR=Effacer +CLR_DISC=Annuler la remise +CREDIT=Cr\u00E9dit +Cancel=Annuler +DEL=Suppr. +ENT=Valider +EXCEPTION=Exception rencontr\u00E9e +EXIT=Quitter +FINISH=Fin +FUNCTION_NOT_YET_SUPPORTED=Fonction non encore support\u00E9e +GIFT_CERT=Bon d'achat +INVALID_CARD_NUMBER=N\u00B0 de carte non valide +ITEM_DISC=Remise sur l'article +ITEM_MODIFICATION_ERROR=Erreur lors de la modification de l'article +LANG=Langage +LOCK=Bloquer +MAIN=Vente +MANAGER_NOT_LOGGED_IN=Identifiant non g\u00E9rant +MGR=Gestion +MOD=Changer la quantit\u00E9 +NOT_ENOUGH_FUNDS=Le client n'a pas fournit assez d'argent pour cl\u00F4turer la vente +NO_ITEMS_SOLD=Aucun article vendu +OK=OK +OPEN=Ouvrir +OPEN_DRAWER=Ouvrir le tiroir +PAY=Paiement +PRINTER_NOT_READY=Imprimante de caisse non pr\u00EAte +PROMO=Promos +QTY=Quantit\u00E9 +RECEIPT_PRINTER_COMMUNICATION_ERROR=Erreur lors de la communication avec l'imprimante de caisse +REPRINT=R\u00E9afficher +RESET_XUI=R\u00E9initialiser +Replace=Remplacer +SALE_DISC=Remise sur la vente +SALE_VOIDED=Vente annul\u00E9e +SET_REF\#=n\u00B0 ? +SIGN_OUT=Sortir +SKU=Code +TERMINAL_IS_CLOSED=Le terminal est ferm\u00E9 +TEST_ALERT=Alerte (test) +TEST_ALERT_BOX=Test de l'impl\u00E9mentation des alertes +TEST_MSR=Carte de cr\u00E9dit +TOTALS=Totals +TRANS_RET=Recharger une vente +TRANS_SAVE=Sauver la vente +UNKNOWN_CARD_TYPE=Type de carte inconnu +VOID_ITEM=Annuler l'article +VOID_SALE=Annuler la vente +order_not_found=N\u00B0 de transaction inconnu ! +problems_reading_card=Probl\u00E8me lors de la lecture de la carte +product_not_found=Produit inconnu ! +promo_page=Ce sera la page des promotions... Modified: incubator/ofbiz/trunk/applications/pos/config/buttonevents.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/config/buttonevents.xml?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/config/buttonevents.xml (original) +++ incubator/ofbiz/trunk/applications/pos/config/buttonevents.xml Wed Aug 2 14:27:49 2006 @@ -75,6 +75,8 @@ <event button-name="menuItemDisc" class-name="org.ofbiz.pos.event.MenuEvents" method-name="itemDiscount" disable-lock="false"/> <event button-name="menuSaleDisc" class-name="org.ofbiz.pos.event.MenuEvents" method-name="saleDiscount" disable-lock="false"/> <event button-name="menuClrDisc" class-name="org.ofbiz.pos.event.MenuEvents" method-name="clearDiscounts" disable-lock="false"/> + <event button-name="menuSave" class-name="org.ofbiz.pos.event.MenuEvents" method-name="saveSale" disable-lock="false"/> + <event button-name="menuLoad" class-name="org.ofbiz.pos.event.MenuEvents" method-name="loadSale" disable-lock="false"/> <!-- payment events --> <event button-name="payCash" class-name="org.ofbiz.pos.event.PaymentEvents" method-name="payCash" disable-lock="false"/> Modified: incubator/ofbiz/trunk/applications/pos/config/pos.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/config/pos.properties?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/config/pos.properties (original) +++ incubator/ofbiz/trunk/applications/pos/config/pos.properties Wed Aug 2 14:27:49 2006 @@ -80,4 +80,6 @@ term = Term: draw = Dr: clerk = Clerk: -total_report = TOTALS REPORT \ No newline at end of file +total_report = TOTALS REPORT + +LoadASale = Load a sale \ No newline at end of file Modified: incubator/ofbiz/trunk/applications/pos/config/pos_fr.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/config/pos_fr.properties?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/config/pos_fr.properties (original) +++ incubator/ofbiz/trunk/applications/pos/config/pos_fr.properties Wed Aug 2 14:27:49 2006 @@ -80,4 +80,6 @@ term = Terminal : draw = Tiroir : clerk = Vendeur : -total_report = TOTAUX \ No newline at end of file +total_report = TOTAUX + +LoadASale = Charger une vente \ No newline at end of file Modified: incubator/ofbiz/trunk/applications/pos/config/xpos.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/config/xpos.properties?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/config/xpos.properties (original) +++ incubator/ofbiz/trunk/applications/pos/config/xpos.properties Wed Aug 2 14:27:49 2006 @@ -1,23 +1,8 @@ -#Dynamically modified by OFBiz Framework (org.ofbiz.base.util : UtilProperties.setPropertyValue) -# -# -# Copyright 2001-2006 The Apache Software Foundation -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may not -# use this file except in compliance with the License. You may obtain a copy of -# the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -#Sat May 13 22:01:46 CEST 2006 +#Dynamically modified by OFBiz Framework (org.ofbiz.base.util : UtilProperties.setPropertyValue) +#Wed Aug 02 23:21:33 CEST 2006 CenterWin=true ClientHeight=768 -Language=XuiLabels_fr +Language=XuiLabels ClientWidth=1024 StartClass=default/pospanel Title=OFBiz POS Modified: incubator/ofbiz/trunk/applications/pos/screens/default/includes/numeric.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/screens/default/includes/numeric.xml?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/screens/default/includes/numeric.xml (original) +++ incubator/ofbiz/trunk/applications/pos/screens/default/includes/numeric.xml Wed Aug 2 14:27:49 2006 @@ -53,8 +53,8 @@ <Button name="menuSaleDisc" x="268" y="138" w="95" h="68" style="posButton" content="SALE_DISC" alignment="Center"/> <!--<Button name="" x="0" y="207" w="75" h="68" style="posButton" content="" alignment="Center"/>--> - <Button name="" x="76" y="207" w="95" h="68" style="posButton" content="TRANS_SAVE" alignment="Center"/> - <Button name="" x="172" y="207" w="95" h="68" style="posButton" content="TRANS_RET" alignment="Center"/> + <Button name="menuSave" x="76" y="207" w="95" h="68" style="posButton" content="TRANS_SAVE" alignment="Center"/> + <Button name="menuLoad" x="172" y="207" w="95" h="68" style="posButton" content="TRANS_RET" alignment="Center"/> <Button name="menuClrDisc" x="268" y="207" w="95" h="68" style="posButton" content="CLR_DISC" alignment="Center"/> </Panel> </Components> Added: incubator/ofbiz/trunk/applications/pos/screens/default/includes/sales.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/screens/default/includes/sales.xml?rev=428156&view=auto ============================================================================== --- incubator/ofbiz/trunk/applications/pos/screens/default/includes/sales.xml (added) +++ incubator/ofbiz/trunk/applications/pos/screens/default/includes/sales.xml Wed Aug 2 14:27:49 2006 @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + + Copyright 2001-2006 The Apache Software Foundation + + Licensed under the Apache License, Version 2.0 (the "License"); you may not + use this file except in compliance with the License. You may obtain a copy of + the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + License for the specific language governing permissions and limitations + under the License. +--> +<XPage class="net.xoetrope.swing.XDialog"> + <Components> + <Panel name="salesPanel" x="0" y="0" w="320" h="420"> + <ScrollPane name="scroolList" x="10" y="10" w="200" h="400"> + <List name="salesList" x="0" y="0" w="200" h="400" /> + </ScrollPane> + <Button name="BtnCancel" x="230" y="10" w="65" h="22" content="Cancel"/> + <Button name="BtnAdd" x="230" y="50" w="65" h="22" content="Add"/> + <Button name="BtnReplace" x="230" y="80" w="65" h="22" content="Replace"/> + </Panel> + </Components> +</XPage> \ No newline at end of file Propchange: incubator/ofbiz/trunk/applications/pos/screens/default/includes/sales.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: incubator/ofbiz/trunk/applications/pos/screens/default/includes/sales.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: incubator/ofbiz/trunk/applications/pos/screens/default/menu/posmain.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/screens/default/menu/posmain.xml?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/screens/default/menu/posmain.xml (original) +++ incubator/ofbiz/trunk/applications/pos/screens/default/menu/posmain.xml Wed Aug 2 14:27:49 2006 @@ -33,27 +33,27 @@ <Button name="SKU.WG-5569" x="510" y="62" w="100" h="60" style="skuButton2" content="WIDGET 1" alignment="Center"/> <!-- col 3 --> - <Button name="" x="0" y="124" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="102" y="124" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="204" y="124" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="306" y="124" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="408" y="124" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="510" y="124" w="100" h="60" style="posButton" content="" alignment="Center"/> + <Button name="SKU.GC-001-C10" x="0" y="124" w="100" h="60" style="skuButton" content="GCC10" alignment="Center"/> + <Button name="SKU.GC-001-C100" x="102" y="124" w="100" h="60" style="skuButton" content="GCC100" alignment="Center"/> + <Button name="SKU.GC-001-C25" x="204" y="124" w="100" h="60" style="skuButton" content="GCC25" alignment="Center"/> + <Button name="SKU.GC-001-C50" x="306" y="124" w="100" h="60" style="skuButton" content="GCC50" alignment="Center"/> + <Button name="SKU.GC-001-CO" x="408" y="124" w="100" h="60" style="skuButton" content="GCCO" alignment="Center"/> + <Button name="SKU.GZ-1000" x="510" y="124" w="100" h="60" style="skuButton" content="GZ1000" alignment="Center"/> <!-- col 4 --> - <Button name="" x="0" y="186" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="102" y="186" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="204" y="186" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="306" y="186" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="408" y="186" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="510" y="186" w="100" h="60" style="posButton" content="" alignment="Center"/> + <Button name="SKU.GC-001-H10" x="0" y="186" w="100" h="60" style="skuButton" content="GCH10" alignment="Center"/> + <Button name="SKU.GC-001-H100" x="102" y="186" w="100" h="60" style="skuButton" content="GCH100" alignment="Center"/> + <Button name="SKU.GC-001-H25" x="204" y="186" w="100" h="60" style="skuButton" content="GCH125" alignment="Center"/> + <Button name="SKU.GC-001-H50" x="306" y="186" w="100" h="60" style="skuButton" content="GCH50" alignment="Center"/> + <Button name="SKU.GC-001-HO" x="408" y="186" w="100" h="60" style="skuButton" content="GCHO" alignment="Center"/> + <Button name="SKU.GZ-DIG" x="510" y="186" w="100" h="60" style="skuButton" content="GZDIG" alignment="Center"/> <!-- col 5 --> - <Button name="" x="0" y="248" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="102" y="248" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="204" y="248" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="306" y="248" w="100" h="60" style="posButton" content="" alignment="Center"/> - <Button name="" x="408" y="248" w="100" h="60" style="posButton" content="" alignment="Center"/> + <Button name="SKU.GZ-1004" x="0" y="248" w="100" h="60" style="skuButton" content="GZ1004" alignment="Center"/> + <Button name="SKU.GZ-1005" x="102" y="248" w="100" h="60" style="skuButton" content="GZ1005" alignment="Center"/> + <Button name="SKU.GZ-8544" x="204" y="248" w="100" h="60" style="skuButton" content="GZ8544" alignment="Center"/> + <Button name="SKU.GZ-9290" x="306" y="248" w="100" h="60" style="skuButton" content="GZ9290" alignment="Center"/> + <Button name="SKU.GZ-5005" x="408" y="248" w="100" h="60" style="skuButton" content="GZ5005" alignment="Center"/> <Button name="" x="510" y="248" w="100" h="60" style="posButton" content="" alignment="Center"/> <!-- col 6 --> Modified: incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/PosTransaction.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/PosTransaction.java?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/PosTransaction.java (original) +++ incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/PosTransaction.java Wed Aug 2 14:27:49 2006 @@ -17,42 +17,46 @@ import java.io.PrintWriter; import java.io.Serializable; +import java.util.HashMap; +import java.util.Hashtable; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.HashMap; import net.xoetrope.xui.data.XModel; import net.xoetrope.xui.helper.SwingWorker; +import org.ofbiz.accounting.payment.PaymentGatewayServices; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.Log4jLoggerWriter; +import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilFormatOut; -import org.ofbiz.base.util.UtilValidate; -import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.collections.LifoSet; -import org.ofbiz.guiapp.xui.XuiSession; +import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.guiapp.xui.XuiSession; import org.ofbiz.order.shoppingcart.CartItemModifyException; -import org.ofbiz.order.shoppingcart.ShoppingCart; -import org.ofbiz.order.shoppingcart.ShoppingCartItem; import org.ofbiz.order.shoppingcart.CheckOutHelper; import org.ofbiz.order.shoppingcart.ItemNotFoundException; +import org.ofbiz.order.shoppingcart.ShoppingCart; +import org.ofbiz.order.shoppingcart.ShoppingCartItem; +import org.ofbiz.order.shoppinglist.ShoppingListEvents; import org.ofbiz.pos.component.Journal; import org.ofbiz.pos.component.Output; import org.ofbiz.pos.device.DeviceLoader; -import org.ofbiz.entity.GenericValue; -import org.ofbiz.entity.GenericEntityException; -import org.ofbiz.entity.GenericDelegator; -import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.pos.screen.PosScreen; +import org.ofbiz.pos.screen.Sales; import org.ofbiz.product.store.ProductStoreWorker; -import org.ofbiz.service.ServiceUtil; -import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.GenericServiceException; -import org.ofbiz.accounting.payment.PaymentGatewayServices; -import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ServiceUtil; /** * @@ -873,4 +877,83 @@ } return currentTx; } + + public void loadSale(PosScreen pos) { + //ShoppingCart.CartPaymentInfo inf = cart.getPaymentInfo(paymentIndex); + + /*if (UtilValidate.isEmpty(shoppingListId)) { + // create a new shopping list + if (partyId == null) { + partyId = userLogin.getString("partyId"); + } + + Map serviceCtx = UtilMisc.toMap("userLogin", userLogin, "partyId", partyId, + "productStoreId", productStoreId, "listName", "List Created From Order #" + orderId); + + if (UtilValidate.isNotEmpty(shoppingListTypeId)) { + serviceCtx.put("shoppingListTypeId", shoppingListTypeId); + } + + Map newListResult = null; + try { + + newListResult = dispatcher.runSync("createShoppingList", serviceCtx); + } catch (GenericServiceException e) { + Debug.logError(e, "Problems creating new ShoppingList", module); + return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,"OrderUnableToCreateNewShoppingList",locale)); + } + + // check for errors + if (ServiceUtil.isError(newListResult)) { + return ServiceUtil.returnError(ServiceUtil.getErrorMessage(newListResult)); + } + + // get the new list id + if (newListResult != null) { + shoppingListId = (String) newListResult.get("shoppingListId"); + } + }*/ + + List shoppingList = null; + GenericDelegator delegator = this.session.getDelegator(); + try { + shoppingList = delegator.findAll("ShoppingList"); + } catch (GenericEntityException e) { + Debug.logError(e, module); + ServiceUtil.returnError("Error running initLowLevelCode: " + e.getMessage()); + } + + if (shoppingList == null) { + Debug.log(UtilProperties.getMessage("EcommerceUiLabels","EcommerceNoShoppingListsCreate",locale), module); + } + + Hashtable salesMap = new Hashtable(); + Iterator i = shoppingList.iterator(); + while (i.hasNext()){ + GenericValue v = (GenericValue) i.next(); + salesMap.put(v.getString("shoppingListId"), v.getString("listName")); + } + + Sales salesDlg = new Sales(salesMap, this, pos); + salesDlg.openDlg(); + + } + + public boolean addListToCart(String shoppingListId, PosScreen pos, boolean append) { + GenericDelegator delegator = session.getDelegator(); + LocalDispatcher dispatcher = session.getDispatcher(); + String includeChild = null; // Perhaps will be used later ... + String prodCatalogId = null; + + try { + //(GenericDelegator delegator, LocalDispatcher dispatcher, ShoppingCart cart, String prodCatalogId, String shoppingListId, boolean includeChild, boolean setAsListItem, boolean append) throws java.lang.IllegalArgumentException { + ShoppingListEvents.addListToCart(delegator, dispatcher, cart, prodCatalogId, shoppingListId, (includeChild != null), true, append); + } catch (IllegalArgumentException e) { + Debug.logError(e, module); + pos.showDialog("dialog/error/exception", e.getMessage()); + pos.refresh(); + return false; + } + return true; + } } Modified: incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/event/MenuEvents.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/event/MenuEvents.java?rev=428156&r1=428155&r2=428156&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/event/MenuEvents.java (original) +++ incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/event/MenuEvents.java Wed Aug 2 14:27:49 2006 @@ -354,6 +354,17 @@ pos.refresh(); } + public static void saveSale(PosScreen pos) { + PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); + pos.refresh(); + } + + public static void loadSale(PosScreen pos) { + PosTransaction trans = PosTransaction.getCurrentTx(pos.getSession()); + Input input = pos.getInput(); + trans.loadSale(pos); + } + public static String getSelectedItem(PosScreen pos) { Journal journal = pos.getJournal(); return journal.getSelectedSku(); Added: incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/screen/Sales.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/screen/Sales.java?rev=428156&view=auto ============================================================================== --- incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/screen/Sales.java (added) +++ incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/screen/Sales.java Wed Aug 2 14:27:49 2006 @@ -0,0 +1,161 @@ +/* + * Copyright 2001-2006 The Apache Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ +package org.ofbiz.pos.screen; + +import java.util.Hashtable; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +import javax.swing.ListSelectionModel; + +import net.xoetrope.swing.XButton; +import net.xoetrope.swing.XDialog; +import net.xoetrope.swing.XList; +import net.xoetrope.xui.XPage; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.pos.PosTransaction; + +/** + * + * @author <a href="mailto:[hidden email]">Jacques Le Roux</a> + * @version $Rev$ + * @since 3.2 + */ + +public class Sales extends XPage { + + /** + * To load a sale from a shopping list. 2 modes : add to or replace the current sale. + */ + public static final String module = Sales.class.getName(); + protected static PosScreen m_page = null; + protected XDialog m_dialog = null; + protected Hashtable m_saleMap = null; + protected XList m_salesList = null; + protected XButton m_add = null; + protected XButton m_replace = null; + protected XButton m_cancel = null; + protected static PosTransaction m_trans = null; + + //TODO : make getter and setter for members (ie m_*) if needed (extern calls) + + public Sales(Hashtable saleMap, PosTransaction trans, PosScreen page) { + m_saleMap = saleMap; + m_trans = trans; + m_page = page; + } + + public void openDlg() { + XDialog dlg = (XDialog) pageMgr.loadPage("default/includes/sales"); + m_dialog = dlg; + dlg.setCaption(UtilProperties.getMessage("pos", "LoadASale", Locale.getDefault())); + m_salesList = (XList) dlg.findComponent("salesList"); + + m_add = (XButton) dlg.findComponent("BtnAdd"); + m_replace = (XButton) dlg.findComponent("BtnReplace"); + m_cancel = (XButton) dlg.findComponent("BtnCancel"); + addMouseHandler(m_add, "add"); + addMouseHandler(m_replace, "replace"); + addMouseHandler(m_cancel, "cancel"); + + m_salesList.setListData(m_saleMap.values().toArray()); + m_salesList.setVisibleRowCount(-1); + m_salesList.ensureIndexIsVisible(m_salesList.getItemCount()); + m_salesList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + + dlg.pack(); + dlg.showDialog(this); + } + + public synchronized void cancel() + { + if (wasMouseClicked()) { + this.m_dialog.closeDlg(); + } + } + + public synchronized void add() { + if (wasMouseClicked()) { + String sale = selectedSale(); + if (null != sale) { + addListToCart(sale, true); + } + } + } + + public synchronized void replace() { + if (wasMouseClicked()) { + String sale = selectedSale(); + if (null != sale) { + addListToCart(sale, false); + } + } + } + + private String selectedSale() { + String saleSelected = null; + if (null != m_salesList.getSelectedValue()) { + String sale = (String) m_salesList.getSelectedValue(); + Set sales = m_saleMap.entrySet(); + Iterator i = sales.iterator(); + while(i.hasNext()) { + Object o = i.next(); + Map.Entry entry = (Map.Entry)o; + String val = entry.getValue().toString(); + if (val == sale) { + saleSelected = entry.getKey().toString(); + } + } + } + return saleSelected; + } + + private void addListToCart(String sale, boolean addToCart) { + final ClassLoader cl = this.getClassLoader(m_page); + Thread.currentThread().setContextClassLoader(cl); + if (!m_trans.addListToCart(sale, m_page, addToCart)) { + Debug.logError("Error while loading cart from shopping list : " + sale, module); + } + else { + m_trans.calcTax(); + m_page.refresh(); + this.m_dialog.closeDlg(); + } + } + + private ClassLoader getClassLoader(PosScreen pos) { + ClassLoader cl = pos.getClassLoader(); + if (cl == null) { + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (Throwable t) { + } + if (cl == null) { + Debug.log("No context classloader available; using class classloader", module); + try { + cl = this.getClass().getClassLoader(); + } catch (Throwable t) { + Debug.logError(t, module); + } + } + } + return cl; + } +} \ No newline at end of file Propchange: incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/screen/Sales.java ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: incubator/ofbiz/trunk/applications/pos/src/org/ofbiz/pos/screen/Sales.java ------------------------------------------------------------------------------ svn:mime-type = text/plain |
Free forum by Nabble | Edit this page |