Menu

Promotion POS - ERP

2016-07-21
2022-03-24
  • Edwin Kurniawan

    Edwin Kurniawan - 2016-07-21

    In a previous post (at Business forums) I said that I'll share step by step deploying promotion module in smartPOS.
    The basic stuff I'd like to have before deployement are the following :
    * Discount in % during a certain period
    * Discount in Money during a certain period
    * Buy nX get nY
    * Buy X get Discount Y n%
    * Buy nX and nY cheaper (product package)
    * Buy nX get nY

    Here is what we did. Please note that to deploy this you need to get the source code of the 2.1 smartPOS version, also the 2.1 iDempiere version and the knowledge of compiling the project with a Java IDE (Netbeans & eclipse in my case) and playing with DB (Postgresql in my case)

    1.activate promotion module in iDempiere using promotion validator. please refer to https://idempiere.atlassian.net/browse/IDEMPIERE-2117

    2.define promotion in iDempiere. you can refer from adaxa documentation (attached)
    * try directly inside iDempiere, make an Order with promotion that already defined, you'll get behaviour of Sales Order it always create one new line to substract total amount of sales and it noted as charge with account that you defined in Promotion windows.

    3.SQL part

    First thing is to create 2 tables : the one that will contain the promotion type (called promo_type) and the one that will contain the definition of the promo itself (called promo_header).

    -- Table: promo_type
    
    CREATE TABLE promo_type
    (
      id bigint NOT NULL,
      description character(50),
      bonustype bigint,
      CONSTRAINT type_id PRIMARY KEY (id )
    )
    WITH (
      OIDS=FALSE
    );
    ALTER TABLE promo_type
      OWNER TO postgres;
    GRANT ALL ON TABLE promo_type TO postgres;
    GRANT ALL ON TABLE promo_type TO public;
    
    -- Table: promo_header
    
    CREATE TABLE promo_header
    (
      id character(255) NOT NULL,
      name character(255),
      startdate bigint,
      enddate bigint,
      starthour bigint,
      endhour bigint,
      article character varying(255),
      articlecategory character varying(255),
      type bigint,
      amount numeric(9,3),
      qtymin bigint,
      qtymax bigint,
      qtystep bigint,
      amountstep bigint,
      bonusarticle character varying(255),
      bonusarticledesc character varying(255),
      bonus_point_reward integer,
      customer_type integer NOT NULL DEFAULT 0,
      article2 character varying(255),
      qty2 bigint,
      ket character varying(255),
      promo_id numeric,
      c_charge_id numeric,
      bpgroup_id numeric,
      CONSTRAINT promo_header_pkey PRIMARY KEY (id )
    )
    WITH (
      OIDS=FALSE
    );
    ALTER TABLE promo_header
      OWNER TO postgres;
    

    Promo_type Rules:
    Type are predefined and the code is built based on that.
    This table is used while filling a new promotion in Promotion Code field in iDempiere promotion windows

    Promo_header Rules:
    ID : an autogenerated identifier field
    Name : the name of the discount/promo, the one that you named in iDempiere at Promotion windows header (adempiere.m_promotion)
    startdate/ enddate : Format is YYYYMMDD. you fill it in iDempiere on preCondition tab at startdate & enddate field
    starthour/endhour : Format is HH. You can only manage hour, not minute. Mandatory for having a discount working properly.
    Article : product_id which is defined as promo product in iDempiere on Promotion Group Windows at Group Line (adempiere.m_promotiongroup_line)
    Type : here you define the behaviour of your promotion.
    Qtymin / QtypMax / QtyStep : product qty scope of your promotion depending on the type. defined in iDempiere on Promotion Windows Qty Distribution
    Amountstep : denomination/ percentage discount that customer will get.
    * promo_id, c_charge_id, bpgroup_id : ID refer to ID that defined from iDempiere.

     

    Last edit: Edwin Kurniawan 2016-07-25
  • Edwin Kurniawan

    Edwin Kurniawan - 2016-07-22

    continue from part above

    4. Java Part
    a. create new package com.openbravo.pos.promotion (source code attached)
    b. next create class I named PromotionDao for pull data from ERP (source code attached)
    c. Add Method in TicketLineInfo.java

       private long promoId=0;
       private String promoName="";
       private long chargeId;
       private double diskon=0;
       private double diskonPrint=0;
    
     public void setDiskon(double diskon){
         this.diskon=diskon;
     }
    
       public double getDiskon() {
            return diskon;
        }
    
        public void setDiskonPrint(double diskonPrint){
            this.diskonPrint=diskonPrint;
        }
    
        public double getDiskonPrint() {
            return diskonPrint;
        }
    
        public String printDiskon() {
            return Formats.DOUBLE.formatValue(diskon);
        }
    
        public String printDiskonPrint() {
            return Formats.DOUBLE.formatValue(diskonPrint);
        }
    
        public long getPromoId() {
            return promoId;
        }
    
        public void setPromoId(long promoId) {
            this.promoId = promoId;
        }
    
        public String getPromoName() {
            return promoName;
        }
    
         public void setPromoName(String promoName) {
            this.promoName = promoName;
        }
    
         public long getChargeId() {
            return chargeId;
        }
    
        public void setChargeId(long chargeId) {
            this.chargeId = chargeId;
        }
    

    d. add some code/ script in JPanelTicket.java on refreshticket method

       private void refreshTicket() {
    
            VariableG.ticketLineInfos.clear();
            VariableG.totalDisc=0;        
            VariableG.voucher=null;
            discProduct=0;
            pricePromo1=0;
            pricePromo3=0;
            pricePromo6=0;
    
            CardLayout cl = (CardLayout)(getLayout());
    
            if (m_oTicket == null) {        
                m_jTicketId.setText(null); 
                m_jWaiter.setText(null);
                m_ticketlines.clearTicketLines();
    
                m_jSubtotalEuros.setText("0");
                m_jTaxesEuros.setText("0");
                m_jTotalEuros.setText("0"); 
    
                stateToZero();
    
                // Muestro el panel de nulos.
                cl.show(this, "null");  
                resetSouthComponent();
    
            } else {
                Main.logger.info("**********Cash "+m_oTicket.getId()+" "+m_oTicketExt+" "+m_oTicket.getCustomerId());
                Main.logger.info("**********Cash "+m_oTicket.getProperty("cash"));
                Main.logger.info("**********Cash "+m_oTicket.getProperty("floor"));
                if(m_oTicket.getProperty("cash") !=null){
                    VariableG.GIVEN=m_oTicket.getProperty("cash");
                }else{
                    VariableG.GIVEN="";
                }
    
                if(m_oTicket.getProperty("username") !=null){
                    VariableG.WAITER=m_oTicket.getProperty("username");
                }else{
                    VariableG.WAITER="";
                }
                Main.logger.info("**********username "+m_oTicket.getProperty("username"));
                if (m_oTicket.getTicketType() == TicketInfo.RECEIPT_REFUND) {
                    //Make disable Search and Edit Buttons
                    m_jEditLine.setVisible(false);
                    m_jList.setVisible(false);
                }
    
                // Refresh ticket taxes
                for (TicketLineInfo line : m_oTicket.getLines()) {
                    line.setTaxInfo(taxeslogic.getTaxInfo(line.getProductTaxCategoryID(), m_oTicket.getDate(), m_oTicket.getCustomer()));
                } 
    
                List<TicketLineInfo>  naa = new  ArrayList<TicketLineInfo>();
                int aa=0;
                for (TicketLineInfo line : m_oTicket.getLines()) {
                    if(line.getProperty("note")!=null){
                        if(line.getProperty("note").toString().equalsIgnoreCase("promo")){
                           naa.add(line);
                    }
                    }
                    aa++;
                } 
    
                for (TicketLineInfo a:naa){
                    //try{
                        m_oTicket.remove(a);
    //                }catch(IndexOutOfBoundsException e){
    //                }
                }
                // The ticket name
                m_jTicketId.setText(m_oTicket.getName(m_oTicketExt));
                if(VariableG.customer!=null){
                    m_jTicketId.setText(VariableG.customer.getName());
                }
                m_jWaiter.setText(VariableG.WAITER);//@win
    
                // Limpiamos todas las filas y anadimos las del ticket actual
                m_ticketlines.clearTicketLines();
    
    //            for (int i = 0; i < m_oTicket.getLinesCount(); i++) {
    //                try{
    //                    m_ticketlines.addTicketLine(m_oTicket.getLine(i),m_oTicketExt);
    //                }catch (Exception e){
    //                    continue;
    //                }
    //            }
    
                List<PromoInfo> promoInfos=PromotionDAO.getInstance().getCurrentPromotion();
    
                Double discons[]=VariableG.disc;
    
                double totalDisc=0;
                tls.clear();
    
                int defaultgroupid = Integer.parseInt(dlSystem.getResourceAsText("customer.default.groupid"));
    
                for (int i = 0; i < m_oTicket.getLinesCount(); i++) {
                    try{
                        TicketLineInfo pi=m_oTicket.getLine(i);
                        m_ticketlines.addTicketLine(m_oTicket.getLine(i),m_oTicketExt);
                        for(PromoInfo promoInfo: promoInfos)
                { if(pi.getProductID().trim().equalsIgnoreCase(promoInfo.getArticle().trim())){
                              System.out.println("AAsup....."+promoInfo.getType()+" "+promoInfo.getName()+ " "+pi.getProductID()+" "+promoInfo.getArticle());                                        
                              if(promoInfo.getType().intValue()==31){                          
                                                ProductInfoExt p = dlSales.getProductInfo(promoInfo.getArticleBonus());       
                                                TicketLineInfo t = new TicketLineInfo();
                                                t.setProductID(promoInfo.getArticleBonus());
                                                t.setPrice(p.getPriceSell());
                                                t.setProductAttSetInstDesc(promoInfo.getArticleBonusDescription());          
                                                t.setProperty("note", "promo");
                                                t.setMultiply(1);
                                                t.setProperty("product.name", p.getName());
                                                t.setTaxInfo(taxeslogic.getTaxInfo(p.getTaxCategoryID(), m_oTicket.getDate(), m_oTicket.getCustomer()));
                                                discons[i]=p.getPriceSell();
                                                totalDisc=totalDisc+discons[i];
                                                discProduct=discProduct+discons[i];
                                                VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                t.setDiskon(discons[i]);
                                                t.setPromoId(promoInfo.getPromoId());
                                                t.setPromoName(promoInfo.getName());
                                                t.setChargeId(promoInfo.getChargeId());
                                                t.setDiscountActual(p.getPriceSell());
                                                tls.add(t);
                                                m_ticketlines.addTicketLine(t,m_oTicketExt);
                                                VariableG.ticketLineInfos.add(t);
                                            }
                                            else if(promoInfo.getType().intValue()==1 && VariableG.customer==null){
                                               System.out.println("Diskon PROMO 1 >>> Customer NULL");
    
                                                if(promoInfo.getBPGroupId().longValue()==bpGroupIdDefault){
                                                if(pi.getMultiply()>=promoInfo.getMinQuantity()){
                                                ProductInfoExt p = dlSales.getProductInfo(promoInfo.getArticle());    
                                                discons[i]=p.getPriceSell()*pi.getMultiply()*(promoInfo.getStepAmount().doubleValue()/100);
                                                discProduct=discProduct+discons[i];
                                                totalDisc=totalDisc+discons[i];
                                                VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                pi.setDiskon(discons[i]);
                                                pi.setPromoId(promoInfo.getPromoId());
                                                pi.setPromoName(promoInfo.getName());
                                                pi.setChargeId(promoInfo.getChargeId());
                                                pi.setDiscountActual(discons[i]);
                                                tls.add(pi);
    
    System.out.println("Diskon PROMO 1 "+p.getPriceSell()+" "+pi.getPromoId()+" "+pi.getPromoName()+" Amount "+promoInfo.getAmount()+" step amount "+promoInfo.getStepAmount()+" Diskon "+discons[i]);
                                                break;
                                                }
                                               }
                                            }
                                            else if(promoInfo.getType().intValue()==1 && VariableG.customer!=null){
                                                System.out.println("Diskon PROMO 1 >>> customer NOT NULL"+ promoInfo.getBPGroupId()+" c "+VariableG.customer.getGroupId());
                                                if(VariableG.customer!=null && promoInfo.getBPGroupId().intValue()==VariableG.customer.getGroupId().intValue()){
                                                if(pi.getMultiply()>=promoInfo.getMinQuantity()){
                                                ProductInfoExt p = dlSales.getProductInfo(promoInfo.getArticle());    
                                                discons[i]=p.getPriceSell()*pi.getMultiply()*(promoInfo.getStepAmount().doubleValue()/100);
                                                discProduct=discProduct+discons[i];
                                                totalDisc=totalDisc+discons[i];
                                                VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                pi.setDiskon(discons[i]);
                                                pi.setPromoId(promoInfo.getPromoId());
                                                pi.setPromoName(promoInfo.getName());
                                                pi.setChargeId(promoInfo.getChargeId());
                                                pi.setDiscountActual(discons[i]);
                                                tls.add(pi);
    
                                                System.out.println("Diskon PROMO 1 "+p.getPriceSell()+" "+pi.getPromoId()+" "+pi.getPromoName()+" Amount "+promoInfo.getAmount()+" step amount "+promoInfo.getStepAmount()+" Diskon "+discons[i]);
                                                break;
                                                }
                                                }else if(VariableG.customer!=null && promoInfo.getBPGroupId().intValue()==VariableG.groupid){
                                                System.out.println("Diskon PROMO 1 >>> Customer VariableG.groupid");
                                                if(pi.getMultiply()>=promoInfo.getMinQuantity()){
                                                ProductInfoExt p = dlSales.getProductInfo(promoInfo.getArticle());    
                                                discons[i]=p.getPriceSell()*pi.getMultiply()*(promoInfo.getStepAmount().doubleValue()/100);
                                                discProduct=discProduct+discons[i];
                                                totalDisc=totalDisc+discons[i];
                                                VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                pi.setDiskon(discons[i]);
                                                pi.setPromoId(promoInfo.getPromoId());
                                                pi.setPromoName(promoInfo.getName());
                                                pi.setChargeId(promoInfo.getChargeId());
                                                pi.setDiscountActual(discons[i]);
                                                tls.add(pi);
    
                                                System.out.println("Diskon PROMO 1 "+p.getPriceSell()+" "+pi.getPromoId()+" "+pi.getPromoName()+" Amount "+promoInfo.getAmount()+" step amount "+promoInfo.getStepAmount()+" Diskon "+discons[i]);
                                                break;
                                                }
                                                }
                                            }   else if(promoInfo.getType().intValue()==3){
                                                //System.out.println("PROMO 3 "+promoInfo.getArticleBonusDescription());
                                                if(pi.getMultiply()>=promoInfo.getMinQuantity()){
    
                                                    int  jum= (int) pi.getMultiply()/promoInfo.getMinQuantity().intValue();
                                                    ProductInfoExt p = dlSales.getProductInfo(promoInfo.getArticle());                                            
                                                    TicketLineInfo t = new TicketLineInfo();
                                                    t.setProductID(promoInfo.getArticle());
                                                    t.setPrice(p.getPriceSell());
                                                    t.setMultiply(jum*promoInfo.getStepQuantity());                                                
                                                    System.out.println("Jum "+jum+"  multiply "+t.getMultiply());
    
                                                    t.setProperties(p.getProperties());
                                                    t.setProperty("note", "promo");
                                                    t.setProperty("notes", "");
    
                                                    t.setProperty("product.name", p.getName());
                                                    //Tambahan
                                                    t.setProperty("product.categoryid", p.getCategoryID());
                                                    t.setProperty("product.com", "false");
                                                    t.setProperty("product.unit", p.getUnit());
                                                    t.setProperty("product.taxcategoryid", p.getTaxCategoryID());
                                                    t.setProperty("unitid", p.getUnit());
                                                    t.setProperty("unitDtext", "Each");                                           
                                                    t.setTaxInfo(taxeslogic.getTaxInfo(p.getTaxCategoryID(), m_oTicket.getDate(), m_oTicket.getCustomer()));
                                                    pricePromo3 = pricePromo3 + p.getPriceSell() * t.getMultiply();
                                                    discons[i]=p.getPriceSell()*promoInfo.getStepQuantity()*jum;
                                                    totalDisc=totalDisc+ discons[i];
                                                    discProduct=discProduct+ discons[i];
                                                    VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                    t.setDiskon(discons[i]);
                                                    t.setPromoId(promoInfo.getPromoId());
                                                    t.setPromoName(promoInfo.getName());
    
                                                    tls.add(t);
                                                    m_ticketlines.addTicketLine(t,m_oTicketExt);
                                                    VariableG.ticketLineInfos.add(t);
    
                                                System.out.println("Diskon PROMO 3 "+p.getPriceSell()+" "+t.getPromoId()+" "+t.getPromoName()+" "+t.getDiskon());
    
                                                }
    
                                            }
                                            else if (promoInfo.getType().intValue() == 4) {
                                        System.out.println("PROMO 4 " + promoInfo.getArticle() + " " + promoInfo.getArticleBonus());
                                        if (pi.getMultiply() >= promoInfo.getMinQuantity()) {
                                            boolean ada = false;
    
                                            TicketLineInfo ppp = null;
                                            for (int a = 0; a < m_oTicket.getLinesCount(); a++) {
                                                TicketLineInfo pa = m_oTicket.getLine(a);
                                                //for(ProductInfo pi2:products){
                                                System.out.println(promoInfo.getArticle2() + " - " + pa.getProductID());
                                                if (promoInfo.getArticleBonus().equalsIgnoreCase(pa.getProductID())) {
                                                    if (pa.getMultiply() >= promoInfo.getQty2()) {
                                                        ada = true;
                                                        ppp = pa;
                                                    }
                                                    break;
                                                }
                                            }
                                        if (ada) {
                                            discons[i] = ppp.getPrice() * ppp.getMultiply() * promoInfo.getStepAmount().doubleValue() / 100;
                                            ppp.setDiskon(discons[i]);
                                            discProduct = discProduct + discons[i];
                                            totalDisc = totalDisc + discons[i];
                                            ppp.setPromoId(promoInfo.getPromoId());
                                            ppp.setPromoName(promoInfo.getName());
                                            VariableG.disc[m_ticketlines.getRowCount() - 1] = discons[i];
                                            System.out.println("Diskon PROMO 4 : Beli "+ pi.getProductName() + " bisa beli " + ppp.getProductName()+" diskon "+promoInfo.getStepAmount()+" minus "+discons[i]);
                                        }
                                    }
                                            }else if(promoInfo.getType().intValue()==2){
                                                //Cashback
    
                                                int jum= (int) pi.getMultiply()/promoInfo.getMinQuantity().intValue();
                                                discons[i]=promoInfo.getStepAmount().doubleValue()*jum;
                                                discProduct=discProduct+ discons[i];
                                                totalDisc=totalDisc+discons[i];
                                                VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                pi.setDiskon(discons[i]);
                                                pi.setPromoId(promoInfo.getPromoId());
                                                pi.setPromoName(promoInfo.getName());
                                                pi.setChargeId(promoInfo.getChargeId());
                                                pi.setDiscountActual(discons[i]);
                                                tls.add(pi);
                                            }else if(promoInfo.getType().intValue()==51){
    
                                                pi.setMultiply(pi.getMultiply()+1);
                                                discons[i]=pi.getPrice();
                                                discProduct=discProduct+ discons[i];
                                                totalDisc=totalDisc+discons[i];
                                                VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                pi.setDiskon(discons[i]);
                                                pi.setPromoId(promoInfo.getPromoId());
                                                pi.setPromoName(promoInfo.getName());
                                                pi.setChargeId(promoInfo.getChargeId());
                                                  tls.add(pi);
                                            }else if(promoInfo.getType().intValue()==5){
    
                                                System.out.println("PROMO 5 "+(pi.getMultiply()>=promoInfo.getMinQuantity()));
    
                                                if(pi.getMultiply()>=promoInfo.getMinQuantity()){
                                                boolean ada=false;
    
                                                TicketLineInfo ppp=null;
                                                for (int a = 0; a < m_oTicket.getLinesCount(); a++) {
                                                    TicketLineInfo pa=m_oTicket.getLine(a);
                                                    if(promoInfo.getArticle2().equalsIgnoreCase(pa.getProductID())){
                                                        if(pa.getMultiply()>=promoInfo.getQty2()){
                                                            ada=true;
                                                            ppp=pa;
                                                        }
    
                                                        break;
                                                    }                                                
                                                }
                                                if(ada){
                                                    double  t=pi.getPrice()*pi.getMultiply()+ppp.getPrice()*ppp.getMultiply();
                                                    double  tA=pi.getPrice()*pi.getMultiply()+ppp.getPrice()*ppp.getMultiply();
                                                    System.out.println("*********** hitungan : " + tA);
                                                    discons[i]=t-promoInfo.getStepAmount();
                                                    ppp.setDiskon(discons[i]);
                                                    ppp.setDiscountActual(tA-promoInfo.getStepAmount());
                                                    discProduct=discProduct+ discons[i];
                                                    totalDisc=totalDisc+discons[i];
                                                    pi.setPromoId(promoInfo.getPromoId());
                                                    pi.setPromoName(promoInfo.getName());
                                                    pi.setChargeId(promoInfo.getChargeId());
                                                    ppp.setPromoId(promoInfo.getPromoId());
                                                    ppp.setPromoName(promoInfo.getName());
                                                    ppp.setChargeId(promoInfo.getChargeId());
                                                    VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];  
                                                    System.out.println("Diskon PROMO 5 "+(t-promoInfo.getStepAmount())+" "+t);
                                                    break;
                                                    }
                                                }
                                            }else if(promoInfo.getType().intValue()==6){
                                                //System.out.println("PROMO 6 ");
                                                //System.out.println("Get nx free ny");
                                                if(pi.getMultiply()>=promoInfo.getMinQuantity().intValue()){
                                                    int jum= (int) pi.getMultiply()/promoInfo.getMinQuantity().intValue();
                                                    ProductInfoExt p = dlSales.getProductInfo(promoInfo.getArticleBonus());
                                                    TicketLineInfo t = new TicketLineInfo();
                                                    t.setProductID(promoInfo.getArticleBonus());
                                                    t.setPrice(p.getPriceSell());
                                                    t.setMultiply(jum*promoInfo.getStepQuantity());                                                
                                                    System.out.println("Jum "+jum+"  multiply "+t.getMultiply());        
                                                    t.setProperties(p.getProperties());
                                                    t.setProperty("note", "promo");
                                                    t.setProperty("notes", "");
                                                    t.setProperty("product.name", p.getName());
                                                    //Tambahan
                                                    t.setProperty("product.categoryid", p.getCategoryID());
                                                    t.setProperty("product.com", "false");
                                                    t.setProperty("product.unit", p.getUnit());
                                                    t.setProperty("product.taxcategoryid", p.getTaxCategoryID());
                                                    t.setProperty("unitid", p.getUnit());
                                                    t.setProperty("unitDtext", "Each");                                       
                                                    t.setTaxInfo(taxeslogic.getTaxInfo(p.getTaxCategoryID(), m_oTicket.getDate(), m_oTicket.getCustomer()));
                                                   // m_ticketlines.
                                                    pricePromo6= pricePromo6+p.getPriceSell()*t.getMultiply();
                                                    discons[i]=p.getPriceSell()*promoInfo.getStepQuantity()*jum;
                                                    totalDisc=totalDisc+ discons[i];
                                                    discProduct=discProduct+ discons[i];
                                                    VariableG.disc[m_ticketlines.getRowCount()-1]=discons[i];
                                                    t.setDiskon(discons[i]);
                                                    t.setPromoId(promoInfo.getPromoId());
                                                    t.setPromoName(promoInfo.getName());
                                                    t.setDiscountActual(discons[i]);
                                                    tls.add(t);
                                                    m_ticketlines.addTicketLine(t,m_oTicketExt);
                                                    VariableG.ticketLineInfos.add(t);
    System.out.println("Diskon PROMO 6 "+p.getPriceSell()*promoInfo.getStepQuantity()+" "+t.getPromoId()+" "+t.getPromoName()+" "+t.getDiskon());
                                                }
                                            }
                                            //break;
                                        }else{
                                            tls.add(pi);
                                        }
                                         }
                                        VariableG.totalDisc=totalDisc;
    
                    }catch (Exception e){
                        e.printStackTrace();
                        continue;
                    }
                }
    
                m_jWaiter.setText(m_jWaiter.getText());
    
                m_jLblDisc.setText(Formats.CURRENCY.formatValue(new Double(totalDisc)));//Win
                //System.out.println("-------------------Diskon : "+totalDisc);
                printPartialTotals();
                stateToZero();
    
                // Muestro el panel de tickets.
                cl.show(this, "ticket");
                resetSouthComponent();
    
                // activo el tecleador...
                m_jKeyFactory.setText(null);       
                java.awt.EventQueue.invokeLater(new Runnable() {
                    public void run() {
                        m_jKeyFactory.requestFocus();
                    }
                });
            }
        }
    

    e. Add Synch Promo Button along side with Synchonize data button in SynchPanel.java

       private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        String r=PromotionDAO.getInstance().syncronizePromo();
        JOptionPane.showMessageDialog(null, r);
    } 
    
     

    Last edit: Edwin Kurniawan 2016-07-25
  • pedrorozo

    pedrorozo - 2016-07-25

    Thanks for sharing Edwin

     
  • Esder

    Esder - 2022-05-10
    Post awaiting moderation.

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.