add subtotal and payment date to invoices (#2450)

This commit is contained in:
Philipp
2021-03-29 00:51:34 +02:00
committed by GitHub
parent 7029bde555
commit d84beb957c
11 changed files with 222 additions and 5 deletions

View File

@@ -320,6 +320,29 @@ class InvoiceControllerTest extends ControllerBaseTest
$this->assertTrue($client->getResponse()->isSuccessful());
$this->request($client, '/invoice/change-status/' . $id . '/paid');
$this->assertTrue($client->getResponse()->isSuccessful());
$this->assertHasValidationError(
$client,
'/invoice/change-status/' . $id . '/paid',
'form[name=invoice_payment_date_form]',
[
'invoice_payment_date_form' => [
'paymentDate' => 'invalid'
]
],
['#invoice_payment_date_form_paymentDate']
);
$this->assertTrue($client->getResponse()->isSuccessful());
$form = $client->getCrawler()->filter('form[name=invoice_payment_date_form]')->form();
$client->submit($form, [
'invoice_payment_date_form' => [
'paymentDate' => (new \DateTime())->format('Y-m-d')
]
]);
$this->assertIsRedirect($client, '/invoice/show');
$client->followRedirect();
$this->assertTrue($client->getResponse()->isSuccessful());