public void writeCashOutFile(final Long customerGroup, final Long revision) {

		List<Receipt> receipts = ReceiptApiService.getUpdatesByRevision(revision);
		Long maxRevision = Long.valueOf(0);
		StringBuilder line = new StringBuilder();
		try {
			final Currency currency = CurrencyApiService.getByNumber(DbReader.getToken(), Long.valueOf(1));
			for (Receipt receipt : receipts) {
				if (receipt.getRevision() > maxRevision)
					maxRevision = receipt.getRevision();

				List<Sale> sales = SaleApiService.getAllFromReceipt(DbReader.getToken(), receipt.getUuid());
				for (Sale sale : sales) {
					Cashier cashier = CashierApiService.getByNumber(DbReader.getToken(),
							Long.valueOf(sale.getCashier()));
					line.append(receipt.getCustomer());// Customer number
					line.append(receipt.getNumber());// receipt number
					// $s->{date} = qq~$day.$month.$year~;
					// $s->{time} = $time;
					// $s->{tax} = sprintf "%.0f,00",
					final BigDecimal subtract = sale.getGrossItemPrice().subtract(sale.getNetItemPrice());
					final BigDecimal grossItemPrice = subtract.divide(
							(sale.getNetItemPrice().divide(BigDecimal.valueOf(100), 2, BigDecimal.ROUND_HALF_UP)), 2,
							BigDecimal.ROUND_HALF_UP);
					line.append(cashier.getFirstname());
					line.append(currency.getSymbol());
					line.append(grossItemPrice);
					line.append(sale.getNetItemPrice());
					line.append(sale.getQuantity());
				}

			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}