use of eu.ggnet.lucidcalc.CFormat.Representation.CURRENCY_EURO in project dwoss by gg-net.
the class ContractorPricePartNoExporterOperation method toManufacturerMissingXls.
@Override
public FileJacket toManufacturerMissingXls(TradeName contractorManufacturer) {
if (!contractorManufacturer.isManufacturer())
throw new RuntimeException(contractorManufacturer + " is not a Manufacturer, wrong exporter");
SubMonitor m = monitorFactory.newSubMonitor("Lieferanten und Hersteller Exporter");
m.message("Loading Units").start();
List<Object[]> rows = productEao.findByTradeNames(contractorManufacturer.getBrands()).stream().filter(p -> p.getPrice(MANUFACTURER_COST) <= 0.01).sorted().map(p -> new Object[] { p.getPartNo(), 0.0, ProductFormater.toName(p) }).collect(Collectors.toList());
m.setWorkRemaining(rows.size() + 10).message("Filtering");
m.message("Generating Document");
STable table = new STable();
table.setTableFormat(new CFormat(BLACK, WHITE));
table.setHeadlineFormat(new CFormat(BOLD_ITALIC));
table.add(new STableColumn("Artikelnummer", 18)).add(new STableColumn("Kostpreis", 12, new CFormat(CURRENCY_EURO))).add(new STableColumn("Name", 45));
table.setModel(new STableModelList(rows));
CCalcDocument cdoc = new TempCalcDocument();
cdoc.add(new CSheet("Kostpreise", table));
FileJacket result = new FileJacket("Fehlende " + contractorManufacturer.getName() + " Kostpreise vom " + ISO.format(new Date()), ".xls", new JExcelLucidCalcWriter().write(cdoc));
m.finish();
return result;
}
use of eu.ggnet.lucidcalc.CFormat.Representation.CURRENCY_EURO in project dwoss by gg-net.
the class ContractorPricePartNoExporterOperation method toContractorXls.
// Manufacturer PartNo | GTIN | Name | Contractor Reference Price | ContractorPartNo
private FileJacket toContractorXls(TradeName contractor, final boolean missing) {
SubMonitor m = monitorFactory.newSubMonitor("Lieferanten Exporter", 100);
m.message("Loading Units").start();
List<Object[]> rows = productEao.findByContractor(contractor).stream().filter(p -> missing ? !p.hasPrice(CONTRACTOR_REFERENCE) : true).sorted().map(p -> new Object[] { p.getPartNo(), p.getGtin(), p.getTradeName() + " " + p.getName(), p.getPrice(CONTRACTOR_REFERENCE), p.getAdditionalPartNo(contractor) }).collect(Collectors.toList());
m.worked(5, "Generating File");
STable table = new STable();
table.setTableFormat(new CFormat(BLACK, WHITE));
table.setHeadlineFormat(new CFormat(BOLD_ITALIC));
table.add(new STableColumn("Herstellerartikelnummer", 18)).add(new STableColumn("Gtin/Ean", 15));
table.add(new STableColumn("Bezeichnung", 25)).add(new STableColumn("Reference Preis", 12, new CFormat(CURRENCY_EURO))).add(new STableColumn("Lieferantenartikelnummer", 14));
table.setModel(new STableModelList(rows));
CCalcDocument cdoc = new TempCalcDocument();
cdoc.add(new CSheet(contractor.getName(), table));
FileJacket result = new FileJacket((missing ? "Fehlende " : "Alle ") + contractor.getName() + " Preise und Artikelnummern vom " + ISO.format(new Date()), ".xls", new JExcelLucidCalcWriter().write(cdoc));
m.finish();
return result;
}
Aggregations