Billing profile implementation

This commit is contained in:
Peter Papp
2021-04-28 15:55:01 +02:00
parent 1e4bbd10f3
commit b37edd298a
18 changed files with 582 additions and 183 deletions

View File

@@ -14,6 +14,26 @@ class OasisInvoiceProfileTest extends TestCase
{
use DatabaseMigrations;
/**
* @test
*/
public function it_get_user_invoice_profile()
{
$user = User::factory(User::class)
->create(['role' => 'user']);
$profile = InvoiceProfile::factory(InvoiceProfile::class)
->create(['user_id' => $user->id]);
Sanctum::actingAs($user);
$this->getJson('/api/oasis/invoices/profile')
->assertStatus(200)
->assertJsonFragment([
'company' => $profile->company,
]);
}
/**
* @test
*/
@@ -30,24 +50,28 @@ class OasisInvoiceProfileTest extends TestCase
Sanctum::actingAs($user);
$this->postJson('/api/oasis/invoices/profile', [
'logo' => $image,
'stamp' => $image,
'company' => 'VueFileManager Inc.',
'email' => 'howdy@hi5ve.digital',
'registration_notes' => 'Some registration notes',
'logo' => $image,
'ico' => '11111111',
'dic' => '11111111',
'ic_dph' => 'SK20002313123',
'registration_notes' => 'Some registration notes',
'author' => 'John Doe',
'address' => 'Does 11',
'state' => 'Slovakia',
'city' => 'Bratislava',
'postal_code' => '04001',
'country' => 'SK',
'phone' => '+421950123456',
'bank' => 'Fio Banka',
'iban' => 'SK20000054236423624',
'swift' => 'FIOZXXX',
'phone' => '+421950123456',
'email' => 'howdy@hi5ve.digital',
'author' => 'John Doe',
'stamp' => $image,
])->assertStatus(201)
->assertJsonFragment([
'company' => 'VueFileManager Inc.',

View File

@@ -292,16 +292,15 @@ class OasisInvoiceTest extends TestCase
Sanctum::actingAs($user);
$this->postJson('/api/oasis/invoices', [
'invoice_type' => 'regular-invoice',
'invoice_number' => '2120001',
'variable_number' => '2120001',
'items' => $this->items,
'discount_type' => 'percent',
'discount_rate' => 10,
'delivery_at' => Carbon::now()->addWeek(),
'store_client' => true,
'send_invoice' => true,
'invoice_type' => 'regular-invoice',
'invoice_number' => '2120001',
'variable_number' => '2120001',
'items' => $this->items,
'discount_type' => 'percent',
'discount_rate' => 10,
'delivery_at' => Carbon::now()->addWeek(),
'store_client' => true,
'send_invoice' => true,
'client' => 'others',
'client_avatar' => null,
'client_name' => 'VueFileManager Inc.',
@@ -350,16 +349,15 @@ class OasisInvoiceTest extends TestCase
Sanctum::actingAs($user);
$this->postJson('/api/oasis/invoices', [
'invoice_type' => 'regular-invoice',
'invoice_number' => '2120001',
'variable_number' => '2120001',
'items' => $this->items,
'discount_type' => 'percent',
'discount_rate' => 10,
'delivery_at' => Carbon::now()->addWeek(),
'store_client' => false,
'send_invoice' => false,
'invoice_type' => 'regular-invoice',
'invoice_number' => '2120001',
'variable_number' => '2120001',
'items' => $this->items,
'discount_type' => 'percent',
'discount_rate' => 10,
'delivery_at' => Carbon::now()->addWeek(),
'store_client' => false,
'send_invoice' => false,
'client' => 'others',
'client_avatar' => null,
'client_name' => 'VueFileManager Inc.',
@@ -409,16 +407,15 @@ class OasisInvoiceTest extends TestCase
Sanctum::actingAs($user);
$this->postJson('/api/oasis/invoices', [
'invoice_type' => 'regular-invoice',
'invoice_number' => '2120001',
'variable_number' => '2120001',
'items' => $this->items,
'discount_type' => 'percent',
'discount_rate' => 10,
'delivery_at' => Carbon::now()->addWeek(),
'store_client' => false,
'send_invoice' => true,
'invoice_type' => 'regular-invoice',
'invoice_number' => '2120001',
'variable_number' => '2120001',
'items' => $this->items,
'discount_type' => 'percent',
'discount_rate' => 10,
'delivery_at' => Carbon::now()->addWeek(),
'store_client' => false,
'send_invoice' => true,
'client' => 'others',
'client_name' => 'VueFileManager Inc.',
'client_email' => 'howdy@hi5ve.digital',