pdf invoice generation scaffolding

This commit is contained in:
Peter Papp
2021-04-26 17:03:17 +02:00
parent 644fbaede4
commit 7cf193abb7
99 changed files with 390 additions and 325 deletions

View File

@@ -25,13 +25,13 @@ class OasisInvoiceTest extends TestCase
$this->items = [
[
'description' => 'Test 1',
'description' => "No, I've made up my mind about it; if I'm Mabel, I'll stay.",
'amount' => 1,
'tax_rate' => 20,
'price' => 200,
],
[
'description' => 'Test 2',
'description' => "I only knew the right words,' said poor Alice, who felt.",
'amount' => 3,
'tax_rate' => 20,
'price' => 500,
@@ -204,8 +204,8 @@ class OasisInvoiceTest extends TestCase
public function user_create_new_invoice_with_storing_new_client()
{
Notification::fake();
Storage::fake('local');
//Storage::fake('local');
//PDF::fake();
$avatar = UploadedFile::fake()
->image('fake-image.jpg');
@@ -213,6 +213,16 @@ class OasisInvoiceTest extends TestCase
$user = User::factory(User::class)
->create(['role' => 'user']);
$user->settings()->update([
'ic_dph' => 'SK2023489457',
'dic' => '2023489457',
'ico' => '46530045',
'bank_name' => 'Fio a.s.',
'iban' => 'SK7583300000002000476497',
'swift' => 'FIOZSKBAXXX',
'registration_notes' => 'Registrácia na OR SR Bratislava I. oddiel: Sro vl. č 91906',
]);
Sanctum::actingAs($user);
$this->postJson('/api/oasis/invoices', [
@@ -258,6 +268,11 @@ class OasisInvoiceTest extends TestCase
Client::first()->getRawOriginal('avatar')
);
Storage::disk('local')
->assertExists(
'files/' . $user->id . '/invoice-' . Invoice::first()->id . '.pdf'
);
Notification::assertTimesSent(1, InvoiceDeliveryNotification::class);
}