Date now = new Date();
for (Product product : products) {
// Synchonization of taxcategories
TaxCategoryInfo tc = new TaxCategoryInfo(product.getTax().getId(), product.getTax().getName());
dlintegration.syncTaxCategory(tc);
// Synchonization of taxes
TaxInfo t = new TaxInfo(
product.getTax().getId(),
product.getTax().getName(),
tc.getID(),
new Date(Long.MIN_VALUE),
null,
null,
product.getTax().getPercentage() / 100,
false,
0);
dlintegration.syncTax(t);
// Synchonization of categories
CategoryInfo c = new CategoryInfo(product.getCategory().getId(), product.getCategory().getName(), null);
dlintegration.syncCategory(c);
// Synchonization of products
ProductInfoExt p = new ProductInfoExt();
p.setID(product.getId());
p.setReference(product.getId());
p.setCode(product.getEan() == null || product.getEan().equals("") ? product.getId() : product.getEan());
p.setName(product.getName());
p.setCom(false);
p.setScale(false);
p.setPriceBuy(product.getPurchasePrice());
p.setPriceSell(product.getListPrice());
p.setCategoryID(c.getID());
p.setTaxCategoryID(tc.getID());
p.setImage(ImageUtils.readImage(product.getImageUrl()));
dlintegration.syncProduct(p);
// Synchronization of stock
if (product instanceof ProductPlus) {