/**
  * @param \Generated\Shared\Transfer\InvoiceTransfer $invoiceTransfer
  * @throws \Pav\Zed\Invoice\Business\Exception\InvoiceDoesNotExistException
  * @throws \Propel\Runtime\Exception\PropelException
  * @return void
  */
 public function writeInvoiceVersion(InvoiceTransfer $invoiceTransfer)
 {
     $invoiceEntity = $this->queryContainer->queryInvoiceById($invoiceTransfer->getIdInvoice())->findOne();
     if ($invoiceEntity === null) {
         throw new InvoiceDoesNotExistException(sprintf('Invoice: %s does not exist.', $invoiceTransfer->getIdInvoice()));
     }
     $invoiceEntity->setTemplateVersion($invoiceTransfer->getTemplateVersion());
     $invoiceEntity->setFileName($invoiceTransfer->getFileName());
     $invoiceEntity->save();
 }
 /**
  * @param \Generated\Shared\Transfer\InvoiceTransfer $invoiceTransfer
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return void
  */
 protected function writeInvoiceTaxItems(InvoiceTransfer $invoiceTransfer)
 {
     foreach ($invoiceTransfer->getTaxes() as $tax) {
         $invoiceTax = $this->queryContainer->createInvoiceTaxEntity();
         $invoiceTax->fromArray($tax->toArray());
         $invoiceTax->setFkInvoice($invoiceTransfer->getIdInvoice());
         $invoiceTax->save();
     }
 }