public void fill (final @Nonnull Accounting accounting) { final CustomerRegistry customerRegistry = accounting.getCustomerRegistry(); final ProjectRegistry projectRegistry = accounting.getProjectRegistry(); final InvoiceRegistry invoiceRegistry = accounting.getInvoiceRegistry(); customersXml.forEach(customer -> customerRegistry.addCustomer().with(customer.toBuilder()).create()); projectsXml.forEach(project -> projectRegistry.addProject().with(project.toBuilder(accounting)).create()); invoicesxml.forEach(invoice -> invoiceRegistry.addInvoice().with(invoice.toBuilder(accounting)).create()); } }
public AccountingXml (final @Nonnull Accounting accounting) { customersXml = accounting.getCustomerRegistry().findCustomers().stream().map(customer -> new CustomerXml(customer)) .collect(toList()); projectsXml = accounting.getProjectRegistry().findProjects().stream().map(project -> new ProjectXml(project)) .collect(toList()); invoicesxml = accounting.getInvoiceRegistry().findInvoices().stream().map(invoice -> new InvoiceXml(invoice)) .collect(toList()); }
final Money earnings = configuration.getMoney("invoiceAmount"); invoiceRegistry.addInvoice().withId(configuration.getId("uniqueIdentifier")) .withNumber(configuration.getString("invoiceNumber")) .withDate(configuration.getDate("date"))
public void dumpAll() throws IOException { dumpCustomers(accounting.getCustomerRegistry().findCustomers()); dumpProjects(accounting.getProjectRegistry().findProjects()); dumpInvoices(accounting.getInvoiceRegistry().findInvoices()); }
final double taxRate = 0.20d; invoiceRegistry.addInvoice().withId(new Id("" + nextId++)) .withDate(lastDate) .withDueDate(lastDate.plusMonths(2))