From bb2023a15f0462c66159714b4dca336b4449875f Mon Sep 17 00:00:00 2001 From: peillis Date: Fri, 3 Feb 2012 12:53:46 +0100 Subject: [PATCH] added paymenttype --- .../Controller/DefaultController.php | 2 +- src/Siwapp/InvoiceBundle/Form/PaymentType.php | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 src/Siwapp/InvoiceBundle/Form/PaymentType.php diff --git a/src/Siwapp/InvoiceBundle/Controller/DefaultController.php b/src/Siwapp/InvoiceBundle/Controller/DefaultController.php index 766f6df..ad79507 100644 --- a/src/Siwapp/InvoiceBundle/Controller/DefaultController.php +++ b/src/Siwapp/InvoiceBundle/Controller/DefaultController.php @@ -138,7 +138,7 @@ public function paymentsAction($invoiceId) // Return all payments $em = $this->getDoctrine()->getEntityManager(); $entities = $em->getRepository('SiwappInvoiceBundle:Payment')->findBy(array('invoice' => $invoiceId)); - + return array('entities' => $entities, 'invoiceId' => $invoiceId); } diff --git a/src/Siwapp/InvoiceBundle/Form/PaymentType.php b/src/Siwapp/InvoiceBundle/Form/PaymentType.php new file mode 100644 index 0000000..ad212b8 --- /dev/null +++ b/src/Siwapp/InvoiceBundle/Form/PaymentType.php @@ -0,0 +1,31 @@ +add('date') + ->add('amount') + ->add('notes') + ; + } + + public function getDefaultOptions(array $options) + { + return array( + 'data_class' => 'Siwapp\InvoiceBundle\Entity\Payment', + ); + } + + public function getName() + { + return 'siwapp_invoicebundle_paymenttype'; + } +}