diff --git a/src/Siwapp/InvoiceBundle/Controller/DefaultController.php b/src/Siwapp/InvoiceBundle/Controller/DefaultController.php index c12d654..766f6df 100644 --- a/src/Siwapp/InvoiceBundle/Controller/DefaultController.php +++ b/src/Siwapp/InvoiceBundle/Controller/DefaultController.php @@ -136,7 +136,10 @@ public function deleteAction($id) public function paymentsAction($invoiceId) { // Return all payments - return array('invoiceId' => $invoiceId); + $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/Resources/views/Partials/payments.html.twig b/src/Siwapp/InvoiceBundle/Resources/views/Partials/payments.html.twig index fd6ee8a..c2fe5b8 100644 --- a/src/Siwapp/InvoiceBundle/Resources/views/Partials/payments.html.twig +++ b/src/Siwapp/InvoiceBundle/Resources/views/Partials/payments.html.twig @@ -5,9 +5,55 @@

{% trans %}Payments{% endtrans %}

- {# AJAX zone #} - {% include "SiwappInvoiceBundle:Partials:payments_form.html.twig" %} - {# AJAX zone #} +
+ + + + + + + + + + + {% for entity in entities %} + + + + + + + {% endfor %} + + + + + + + +
+ + + {% trans %}Date{% endtrans %} + + {% trans %}Description{% endtrans %} + + {% trans %}Amount{% endtrans %} +
+ + {{ entity.date|date("Y/m/d") }}{{ entity.notes }}{{ entity.amount }}
+ + + + + +
+
+ {% trans %}Remove selected{% endtrans %} + + +
+
\ No newline at end of file diff --git a/src/Siwapp/InvoiceBundle/Resources/views/Partials/payments_form.html.twig b/src/Siwapp/InvoiceBundle/Resources/views/Partials/payments_form.html.twig deleted file mode 100644 index 9445d7c..0000000 --- a/src/Siwapp/InvoiceBundle/Resources/views/Partials/payments_form.html.twig +++ /dev/null @@ -1,67 +0,0 @@ -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - {% trans %}Date{% endtrans %} - - {% trans %}Description{% endtrans %} - - {% trans %}Amount{% endtrans %} -
- - - 5/29/11 - - First Payment - - 1000,00€ -
- - - 9/13/11 - - Second Payment - - 500,00€ -
- - - - - -
-
- {% trans %}Remove selected{% endtrans %} - - -
-
\ No newline at end of file