Merge pull request #587 from batuhawk/1.3-dev
Some request values fixed
This commit is contained in:
commit
dfc6357154
@ -240,6 +240,7 @@ class Invoices extends Controller
|
|||||||
{
|
{
|
||||||
$taxes = [];
|
$taxes = [];
|
||||||
|
|
||||||
|
$tax = 0;
|
||||||
$tax_total = 0;
|
$tax_total = 0;
|
||||||
$sub_total = 0;
|
$sub_total = 0;
|
||||||
$discount_total = 0;
|
$discount_total = 0;
|
||||||
|
@ -87,7 +87,7 @@ class BillsTest extends FeatureTestCase
|
|||||||
{
|
{
|
||||||
$amount = $this->faker->randomFloat(2, 2);
|
$amount = $this->faker->randomFloat(2, 2);
|
||||||
|
|
||||||
$items = [['name' => 'urun', 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD', 'tax_id' => null]];
|
$items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD', 'tax_id' => null]];
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'vendor_id' => '0',
|
'vendor_id' => '0',
|
||||||
|
@ -58,6 +58,7 @@ class InvoicesTest extends FeatureTestCase
|
|||||||
->assertStatus(302);
|
->assertStatus(302);
|
||||||
|
|
||||||
$this->assertFlashLevel('success');
|
$this->assertFlashLevel('success');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testItShouldDeleteInvoice()
|
public function testItShouldDeleteInvoice()
|
||||||
@ -70,20 +71,24 @@ class InvoicesTest extends FeatureTestCase
|
|||||||
->assertRedirect(url('incomes/invoices'));
|
->assertRedirect(url('incomes/invoices'));
|
||||||
|
|
||||||
$this->assertFlashLevel('success');
|
$this->assertFlashLevel('success');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getInvoiceRequest($recurring = 0)
|
private function getInvoiceRequest($recurring = 0)
|
||||||
{
|
{
|
||||||
$amount = $this->faker->randomFloat(2, 2);
|
$amount = $this->faker->randomFloat(2, 2);
|
||||||
|
|
||||||
|
$items = [['name' => $this->faker->text(5), 'item_id' => null, 'quantity' => '1', 'price' => $amount, 'currency' => 'USD']];
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'company_id' => $this->company->id,
|
|
||||||
'customer_id' => '0',
|
'customer_id' => '0',
|
||||||
'currency_code' => setting('general.default_currency'),
|
|
||||||
'currency_rate' => '1',
|
|
||||||
'invoiced_at' => $this->faker->date(),
|
'invoiced_at' => $this->faker->date(),
|
||||||
'due_at' => $this->faker->date(),
|
'due_at' => $this->faker->date(),
|
||||||
'invoice_number' => $this->faker->lexify('INV ???'),
|
'invoice_number' => '1',
|
||||||
'order_number' => $this->faker->randomDigit,
|
'order_number' => '1',
|
||||||
|
'currency_code' => setting('general.default_currency'),
|
||||||
|
'currency_rate' => '1',
|
||||||
|
'item' => $items,
|
||||||
'discount' => '0',
|
'discount' => '0',
|
||||||
'notes' => $this->faker->text(5),
|
'notes' => $this->faker->text(5),
|
||||||
'category_id' => $this->company->categories()->type('income')->first()->id,
|
'category_id' => $this->company->categories()->type('income')->first()->id,
|
||||||
@ -95,6 +100,7 @@ class InvoicesTest extends FeatureTestCase
|
|||||||
'customer_address' => $this->faker->address,
|
'customer_address' => $this->faker->address,
|
||||||
'invoice_status_code' => 'draft',
|
'invoice_status_code' => 'draft',
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
|
'company_id' => $this->company->id,
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($recurring) {
|
if ($recurring) {
|
||||||
@ -103,6 +109,7 @@ class InvoicesTest extends FeatureTestCase
|
|||||||
$data['recurring_custom_frequency'] = $this->faker->randomElement(['monthly', 'weekly']);
|
$data['recurring_custom_frequency'] = $this->faker->randomElement(['monthly', 'weekly']);
|
||||||
$data['recurring_count'] = '1';
|
$data['recurring_count'] = '1';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user