Package com.openbravo.pos.customers

Examples of com.openbravo.pos.customers.CustomerSync


                        String phone = externalsales.encodeStringISO(remoteUser.getPhone());
                        String mobile = externalsales.encodeStringISO(remoteUser.getMobile());
                String zipcode = externalsales.encodeStringISO(remoteUser.getZipcode());
                        CharsetEncoder encoder = externalsales.getEncoder();
               
                CustomerSync copyCustomer = new CustomerSync(remoteUser.getId());

                        if (firstname==null || firstname.equals(""))
                            firstname =" ";
                        copyCustomer.setFirstname(firstname.toUpperCase());

                if (lastname==null || lastname.equals(""))
                            lastname =" ";
                        copyCustomer.setLastname(lastname.toUpperCase());

                        copyCustomer.setTaxid(remoteUser.getLogin());

                  copyCustomer.setSearchkey(remoteUser.getLogin()+name.toUpperCase());
                
                if (name==null || name.equals(""))
                            name =" ";
                        copyCustomer.setName(name.toUpperCase());

                        if (description==null || description.equals(""))
                            description =" ";
                  copyCustomer.setNotes(description);
                 
                  copyCustomer.setEmail(remoteUser.getEmail());
                 
                        if (address==null || address.equals(""))
                            address =" ";
                  copyCustomer.setAddress(address);
                 
                        if (address2==null || address2.equals(""))
                            address2 =" ";
                        copyCustomer.setAddress2(address2);

                        if (city==null || city.equals(""))
                            city ="Brussels";
                  copyCustomer.setCity(city);

                        if (country==null || country.equals(""))
                            country ="Belgium";
                  copyCustomer.setCountry(country);

                  copyCustomer.setMaxdebt(1000.0);

                        if (phone==null || phone.equals(""))
                            phone=" ";
                  copyCustomer.setPhone(phone);

                        if (mobile==null || mobile.equals(""))
                            mobile =" ";
                  copyCustomer.setPhone2(mobile);

                        if (zipcode==null || zipcode.equals(""))
                            zipcode =" ";
                  copyCustomer.setPostal(zipcode);


                        // SYNC ONLY EMAIL USER FOR OGONE (ZAV)
                  if (TicketInfo.isWS()
                            && TicketInfo.getPayID()==2
                            && remoteUser.getEmail().contains("@DONOTSENDME")) {

                            notToSync.add(copyCustomer.getTaxid());
                            continue;
                        }

                  //Updates local user
                  dlintegration.syncCustomer(copyCustomer);
                  notToSync.add(copyCustomer.getTaxid());
              }
          }


        } while (remoteUsers.length > 0 );
View Full Code Here


                String country = externalsales.encodeString(remoteUser.getCountry());
                        String phone = externalsales.encodeString(remoteUser.getPhone());
                        String mobile = externalsales.encodeString(remoteUser.getMobile());
                String zipcode = externalsales.encodeString(remoteUser.getZipcode());
                      
                CustomerSync copyCustomer = new CustomerSync(remoteUser.getId());

                        if (firstname==null || firstname.equals(""))
                            firstname =" ";
                        copyCustomer.setFirstname(firstname.toUpperCase());

                if (lastname==null || lastname.equals(""))
                            lastname =" ";
                        copyCustomer.setLastname(lastname.toUpperCase());

                        copyCustomer.setTaxid(remoteUser.getLogin());

                  copyCustomer.setSearchkey(remoteUser.getLogin()+name.toUpperCase());
                
                if (name==null || name.equals(""))
                            name =" ";
                        copyCustomer.setName(name.toUpperCase());

                        if (description==null || description.equals(""))
                            description =" ";
                  copyCustomer.setNotes(description);
                 
                  copyCustomer.setEmail(remoteUser.getEmail());
                 
                        if (address==null || address.equals(""))
                            address =" ";
                  copyCustomer.setAddress(address);
                 
                        if (address2==null || address2.equals(""))
                            address2 =" ";
                        copyCustomer.setAddress2(address2);

                        if (city==null || city.equals(""))
                            city ="Brussels";
                  copyCustomer.setCity(city);

                        if (country==null || country.equals(""))
                            country ="Belgium";
                  copyCustomer.setCountry(country);

                  copyCustomer.setMaxdebt(10000.0);

                        if (phone==null || phone.equals(""))
                            phone=" ";
                  copyCustomer.setPhone(phone);

                        if (mobile==null || mobile.equals(""))
                            mobile =" ";
                  copyCustomer.setPhone2(mobile);

                        if (zipcode==null || zipcode.equals(""))
                            zipcode =" ";
                  copyCustomer.setPostal(zipcode);

                        // SYNC ONLY EMAIL USER FOR OGONE (ZAV)
                  if (TicketInfo.isWS()
                            && TicketInfo.getPayID()==2
                            && remoteUser.getEmail().contains("@DONOTSENDME")) {

                            notToSync.add(copyCustomer.getTaxid());
                            continue;
                        }

                  //Updates local user
                  dlintegration.syncCustomer(copyCustomer);
                  notToSync.add(copyCustomer.getTaxid());
              }
          }


        } while (remoteUsers.length > 0 );
View Full Code Here

TOP

Related Classes of com.openbravo.pos.customers.CustomerSync

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.